-
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
Wrap grd2cpt #803
Wrap grd2cpt #803
Conversation
…le; changing units from US to SI
# Conflicts: # examples/projections/cyl/cyl_transverse_mercator.py # examples/projections/cyl/cyl_universal_transverse_mercator.py
I haven't checked it carefully, but it may be related to #372 |
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.
I'm OK with the wrapper and the aliases, but most of the tests don't make sense to me.
For example, in the following test, if cmap="rainbow"
doesn't work as expected (although unlikely as the wrapper is very simple), it would affect both the reference and test images, thus the tests always pass.
@check_figures_equal()
def test_grd2cpt_set_cpt(grid):
"""
Test function grd2cpt to create a CPT based off a grid input and a set CPT.
"""
fig_ref, fig_test = Figure(), Figure()
# Use single-character arguments for the reference image
fig_ref.basemap(B="a", J="W0/15c", R="d")
grd2cpt(grid=grid, cmap="rainbow")
fig_ref.colorbar(B="a2000")
fig_test.basemap(frame="a", projection="W0/15c", region="d")
grd2cpt(grid=grid, cmap="rainbow")
fig_test.colorbar(frame="a2000")
return fig_ref, fig_test
I'm fine with deleting tests. I was mostly copying the format of test_makecpt.py, since that seems like the most similar module. |
Some of the @weiji14 As you wrote the |
Co-authored-by: Dongdong Tian <[email protected]>
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 a few minor comments, getting close!
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.
Great! Thanks for your patience @willschlitzer, and also thank you @seisman for the comprehensive review!
*Wrap grd2cpt function *Add tests for grd2cpt function *Modify docstring in makecpt function Co-authored-by: Wei Ji <[email protected]> Co-authored-by: Dongdong Tian <[email protected]>
Wraps the GMT function
grd2cpt
. Code and documentation borrowed heavily fromgrdcut
andmakecpt
.