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 |
seisman
left a comment
There was a problem hiding this comment.
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 <seisman.info@gmail.com>
weiji14
left a comment
There was a problem hiding this comment.
Just a few minor comments, getting close!
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
weiji14
left a comment
There was a problem hiding this comment.
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 <23487320+weiji14@users.noreply.github.com> Co-authored-by: Dongdong Tian <seisman.info@gmail.com>

Wraps the GMT function
grd2cpt. Code and documentation borrowed heavily fromgrdcutandmakecpt.