Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve cvt_archive_heatmap flexibility #354

Merged
merged 5 commits into from
Sep 7, 2023
Merged

Improve cvt_archive_heatmap flexibility #354

merged 5 commits into from
Sep 7, 2023

Conversation

btjanaka
Copy link
Member

@btjanaka btjanaka commented Sep 6, 2023

Description

This PR makes cvt_archive_heatmap more flexible by adding an ec parameter to control the edge color of the polygons.

We also rearrange several existing arguments to more closely mirror grid_archive_heatmap — specifically, we move plot_samples, plot_centroids, and ms to the end of the argument list. This reordering should not break anyone since we require keyword arguments for this method by putting a * in the signature.

Regarding style arguments for samples and centroids: I have decided to leave the sample and centroid style arguments (i.e., the arguments to ax.plot) as is for now, as it seems pretty rare to plot centroids/samples, so the added complexity of making them configurable may not be worth it. We can always add this later if there is a need for it.

This PR also fixes several bugs encountered while making these API changes.

TODO

  • Add ec parameter for controlling color of Voronoi cell boundaries
  • Test style for Voronoi cells (ec and lw)
  • Rearrange parameters to line up more closely with grid_archive_heatmap
  • Make background color of empty cells be transparent — this is important when someone wants to save a transparent image — in this case, we don’t want the background to be white
  • Throw an error if attempting to pass plot_samples when the archive has no samples
  • Fix bug with division by zero error when min_obj and max_obj are identical — since we normalize by max_obj - min_obj , we were getting such errors if min_obj equaled max_obj

Questions

Status

  • I have read the guidelines in
    CONTRIBUTING.md
  • I have formatted my code using yapf
  • I have tested my code by running pytest
  • I have linted my code with pylint
  • I have added a one-line description of my change to the changelog in
    HISTORY.md
  • This PR is ready to go

@btjanaka btjanaka merged commit d4b6ea4 into master Sep 7, 2023
17 checks passed
@btjanaka btjanaka deleted the cvt-flexibility branch September 7, 2023 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant