ensure that NaNs are handled correctly #40
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #39
This pull request includes changes to handle NaN values in the
data
property of thescatter
object and its associated tests. The most important changes include updating the margin calculations to usenp.nanmax
andnp.nanmin
and adding a test case to handle NaN values.Handling NaN values:
src/biaplotter/artists.py
: Updated margin calculations in thedata
property to usenp.nanmax
andnp.nanmin
instead ofnp.max
andnp.min
. This ensures that NaN values are properly handled when setting the limits of the axes.Testing NaN values:
src/biaplotter/_tests/test_artists.py
: Added a test case to handle NaN values in theon_color_indices_changed
function. This test ensures that thescatter
object can handle data containing NaN values without errors.