Skip to content

Improve surface tests by checking values and using pre-processed data #1460

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

Closed
maxrjones opened this issue Aug 22, 2021 · 0 comments · Fixed by #1568
Closed

Improve surface tests by checking values and using pre-processed data #1460

maxrjones opened this issue Aug 22, 2021 · 0 comments · Fixed by #1568
Labels
enhancement Improving an existing feature maintenance Boring but important stuff for the core devs

Comments

@maxrjones
Copy link
Member

Description of the desired feature

The tests for surface currently use the raw data provided by pygmt.datasets.load_bathymetry_data and check the type and registration for the returned object. I think we should make two enhancements to these tests:

  1. Supply pre-processed data to pygmt.surface, by either using blockmedian or adding pre-processed data to the cache. This is for a more realistic test to surface, since the raw bathymetric data should not be provided directly to surface, as demonstrated by the warnings:
    surface [WARNING]: 77120 unusable points were supplied; these will be ignored.
    surface [WARNING]: You should have pre-processed the data with block-mean, -median, or -mode.
    surface [WARNING]: Check that previous processing steps write results with enough decimals.
    surface [WARNING]: Possibly some data were half-way between nodes and subject to IEEE 754 rounding.
    
  2. Use numpy.testing.assert_allclose to test values of the returned grid in addition to the type/registration.

Are you willing to help implement and maintain this feature? Yes

@maxrjones maxrjones added maintenance Boring but important stuff for the core devs enhancement Improving an existing feature labels Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing feature maintenance Boring but important stuff for the core devs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant