-
Notifications
You must be signed in to change notification settings - Fork 228
Allow passing xr.DataArray as shading to grdimage #750
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
bb99fa1
Pass xr.DataArray shading to grdimage
seisman 5a689ea
Merge branch 'master' into grdimage-xarray-shading
seisman 00036ee
Merge branch 'master' into grdimage-xarray-shading
seisman addc673
Merge branch 'master' into grdimage-xarray-shading
seisman b14140a
Merge branch 'master' into grdimage-xarray-shading
seisman 7c88639
Merge branch 'master' into grdimage-xarray-shading
seisman c7d8a4d
Merge branch 'master' into grdimage-xarray-shading
seisman 5387549
Merge branch 'master' into grdimage-xarray-shading
seisman f8184cb
Merge branch 'master' into grdimage-xarray-shading
seisman 31c80b9
Merge branch 'master' into grdimage-xarray-shading
seisman 12116ff
Merge branch 'master' into grdimage-xarray-shading
weiji14 5c74e0a
Test grdimage with xarray.DataArray input to both grid and shading
weiji14 38585fc
Update grdimage shading docstring to mention xarray.DataArray input
weiji14 db94b0c
Merge master branch
seisman b2fb5f7
Merge branch 'master' into grdimage-xarray-shading
seisman 15d1ebc
Merge branch 'master' into grdimage-xarray-shading
weiji14 a2590e7
Merge branch 'master' into grdimage-xarray-shading
weiji14 d2c2b45
Temporarily add verbosity and colorbar to debug failing test
weiji14 80dfb50
Mark the grdimage shading test as xfail [skip ci]
seisman f6da340
Merge branch 'master' into grdimage-xarray-shading
seisman caf1f2d
Update docstrings
seisman d09c20d
Fix docstring styles
seisman 2e9fba8
Fix docstrings
seisman 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 hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -117,6 +117,26 @@ def test_grdimage_shading_xarray(grid, shading): | |||||||||||||||||||||||||||||||||
return fig_ref, fig_test | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
@pytest.mark.xfail( | ||||||||||||||||||||||||||||||||||
reason="Incorrect scaling of geo CPT on xarray.DataArray grdimage plot." | ||||||||||||||||||||||||||||||||||
"See https://github.com/GenericMappingTools/gmt/issues/5294", | ||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||
@check_figures_equal() | ||||||||||||||||||||||||||||||||||
def test_grdimage_grid_and_shading_with_xarray(grid, xrgrid): | ||||||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||||||
Test that shading works well when xarray.DataArray is input to both the | ||||||||||||||||||||||||||||||||||
``grid`` and ``shading`` arguments. | ||||||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||||||
fig_ref, fig_test = Figure(), Figure() | ||||||||||||||||||||||||||||||||||
fig_ref.grdimage( | ||||||||||||||||||||||||||||||||||
grid="@earth_relief_01d_g", region="GL", cmap="geo", shading=xrgrid, verbose="i" | ||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||
fig_ref.colorbar() | ||||||||||||||||||||||||||||||||||
fig_test.grdimage(grid=grid, region="GL", cmap="geo", shading=xrgrid, verbose="i") | ||||||||||||||||||||||||||||||||||
fig_test.colorbar() | ||||||||||||||||||||||||||||||||||
Comment on lines
+131
to
+136
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Btw, I tried using
Suggested change
|
||||||||||||||||||||||||||||||||||
return fig_ref, fig_test | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
def test_grdimage_fails(): | ||||||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||||||
Should fail for unrecognized input. | ||||||||||||||||||||||||||||||||||
|
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.
Uh oh!
There was an error while loading. Please reload this page.