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
[x] Add ec parameter for controlling color of Voronoi cell boundaries
[x] Test style for Voronoi cells (ec and lw)
[x] Rearrange parameters to line up more closely with grid_archive_heatmap
[x] 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
[x] Throw an error if attempting to pass plot_samples when the archive has no samples
[x] 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
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 moveplot_samples
,plot_centroids
, andms
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
ec
andlw
)grid_archive_heatmap
plot_samples
when the archive has no samplesmin_obj
andmax_obj
are identical — since we normalize bymax_obj - min_obj
, we were getting such errors ifmin_obj
equaledmax_obj
Questions
Status
yapf
pytest
pylint
HISTORY.md