Skip to content

Wrap grd2cpt#803

Merged
willschlitzer merged 76 commits intoGenericMappingTools:masterfrom
willschlitzer:wrap-grd2cpt
Feb 12, 2021
Merged

Wrap grd2cpt#803
willschlitzer merged 76 commits intoGenericMappingTools:masterfrom
willschlitzer:wrap-grd2cpt

Conversation

@willschlitzer
Copy link
Copy Markdown
Contributor

Wraps the GMT function grd2cpt. Code and documentation borrowed heavily from grdcut and makecpt.

@willschlitzer willschlitzer added the feature Brand new feature label Jan 23, 2021
@willschlitzer willschlitzer added this to the 0.3.0 milestone Jan 23, 2021
@willschlitzer
Copy link
Copy Markdown
Contributor Author

Screenshot from 2021-01-23 16-17-57
For reasons I'm not sure, I'm getting a GMTImageComparisonFailure: images not close error when I run test_grd2cpt_grdimage. I'm confused because the code for both fig_ref and fig_test are identical (as I copy and pasted to make sure I didn't have a typo). When I ran the same code in a Jupyter notebook, I also had images that looked very different. Any idea what is causing this inconsistency?

@seisman
Copy link
Copy Markdown
Member

seisman commented Jan 23, 2021

I haven't checked it carefully, but it may be related to #372

@willschlitzer
Copy link
Copy Markdown
Contributor Author

I'm fine with deleting tests. I was mostly copying the format of test_makecpt.py, since that seems like the most similar module.

@seisman
Copy link
Copy Markdown
Member

seisman commented Feb 10, 2021

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 makecpt tests make sense because they're using @pytest.mark.mpl_image_compare. I think we need to think more about these tests.

@weiji14 As you wrote the makecpt wrapper, I'll let you decide what to do.

Comment thread pygmt/tests/test_grd2cpt.py Outdated
Comment thread pygmt/tests/test_grd2cpt.py Outdated
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Copy link
Copy Markdown
Member

@weiji14 weiji14 left a 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!

Comment thread pygmt/src/grd2cpt.py Outdated
Comment thread pygmt/src/grd2cpt.py Outdated
Comment thread pygmt/src/grd2cpt.py Outdated
willschlitzer and others added 2 commits February 12, 2021 08:30
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Copy link
Copy Markdown
Member

@weiji14 weiji14 left a 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!

@willschlitzer willschlitzer merged commit 2efcbba into GenericMappingTools:master Feb 12, 2021
@willschlitzer willschlitzer deleted the wrap-grd2cpt branch February 12, 2021 10:43
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
*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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Brand new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants