-
Notifications
You must be signed in to change notification settings - Fork 224
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
Document limitations of GMT xarray accessors #2375
Conversation
7437520
to
9104524
Compare
9104524
to
628648a
Compare
Ping @GenericMappingTools/pygmt-maintainers for reviews. |
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.
Just one very minor suggestion, but otherwise I think it's documented really well!
Inplace assignment operators like ``*=`` don't create new instances, so the | ||
properties are still kept: | ||
|
||
>>> grid *= 2.0 | ||
>>> grid.gmt.registration, grid.gmt.gtype | ||
(0, 1) |
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.
Interesting, good to know that in-place assignment preserves the registration and gtype information!
The accessor extends :class:`xarray.DataArray` to store GMT-specific | ||
properties about grids, which are important for PyGMT to correctly process |
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.
Technically xarray accessors are not just about setting properties/attributes. You may need to change this sentence if the .gmt.imshow()
function at #2372 is added to this accessor class.
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.
Will rephrase this sentence in PR #2372.
Co-authored-by: Yvonne Fröhlich <[email protected]> Co-authored-by: Wei Ji <[email protected]>
Description of proposed changes
See #499 for context.
Preview: https://pygmt-dev--2375.org.readthedocs.build/en/2375/api/generated/pygmt.GMTDataArrayAccessor.html
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version