-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Plots get labels from pint arrays #5561
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
ec3040e
test labels come from pint units
TomNicholas 6bb4298
values demotes pint arrays before returning
TomNicholas 04d78c5
plot labels look for pint units first
TomNicholas 6fee339
pre-commit
TomNicholas 17c5755
added to_numpy() and as_numpy() methods
TomNicholas 48ba107
remove special-casing of cupy arrays in .values in favour of using .t…
TomNicholas 531385b
merged to_numpy() method in
TomNicholas 9cb2f9b
.values -> .to_numpy()
TomNicholas ae6e931
lint
max-sixty dc24d3f
Fix mypy (I think?)
max-sixty 6ce6b05
Merge branch 'main' of https://github.com/pydata/xarray into to_numpy
TomNicholas 04d7b02
Merge branch 'to_numpy' of https://github.com/TomNicholas/xarray into…
TomNicholas ee34649
added Dataset.as_numpy()
TomNicholas 552b322
improved docstrings
TomNicholas 1215e69
add what's new
TomNicholas af8a1ee
add to API docs
TomNicholas e095bf0
linting
TomNicholas eb7d84d
fix failures by only importing pint when needed
TomNicholas 4d43f17
merge fix for pint import errors
TomNicholas 74c05e3
refactor pycompat into class
TomNicholas 7e5e928
Merge pyompat refactor from branch 'to_numpy' into unit-free-values
TomNicholas 3f85e21
pycompat import changes applied to plotting code
TomNicholas e397168
what's new
TomNicholas 45245d0
compute instead of load
TomNicholas 27fc4e5
added tests
TomNicholas 3e8cb24
fixed sparse test
TomNicholas f9d6370
tests and fixes for ds.as_numpy()
TomNicholas 50fdf4c
fix sparse tests
TomNicholas 1c94a97
fix linting
TomNicholas 2d07c0f
tests for Variable
TomNicholas 9673cea
test IndexVariable too
TomNicholas 0d624cc
use numpy.asarray to avoid a copy
TomNicholas 2f1ff46
also convert coords
TomNicholas afd35e2
Merge branch 'main' into to_numpy
TomNicholas 6d33b35
Force tests again after #5600
TomNicholas eae95f5
Merge branch 'main' into to_numpy
TomNicholas 36f3bd9
Merge branch 'to_numpy' into unit-free-values
TomNicholas 4c53790
merged main
TomNicholas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be possible to specify a non-dimensional coordinate with
x="x_coord"
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point was that I want this test to eventually test labels on both the x and y axes, but at the moment pint is only involved with the y axis, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's right. I meant to implement this by converting the dimension coordinate to a non-dimension coordinate:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I try that I still get a
UnitStrippedWarning
in.to_index_variable()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems like a bug. open an issue for it so we don't forget?