Skip to content

Fix the test for the default registration of earth_mag4km_02m dataset (#2341 #2341

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 4 commits into from
Feb 3, 2023

Conversation

seisman
Copy link
Member

@seisman seisman commented Jan 31, 2023

Description of proposed changes

The test test_earth_mag_02m_default_registration should test the "02m" dataset, but it actually tests the "05m" earth_mag4km dataset. This PR fixes the issue and also caches the tile.

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels Jan 31, 2023
@seisman seisman added this to the 0.9.0 milestone Jan 31, 2023
@seisman seisman changed the title Improve a test for load_earth_magnetic_anomaly WIP: Improve a test for load_earth_magnetic_anomaly Feb 1, 2023
@willschlitzer
Copy link
Contributor

It looks like this happened in #2241, but should the test test_earth_mag_02m_default_registration beginning has a second test on line 132. Should that be under a separate test function?

Additionally, I'm getting this error: AssertionError: assert <xarray.DataArray 'lat' ()>\narray(4.01666667) == 4.01666667 for that same test; assuming the final test should only use npt.assert_allclose?

@seisman seisman changed the title WIP: Improve a test for load_earth_magnetic_anomaly Improve a test for load_earth_magnetic_anomaly Feb 2, 2023
@seisman seisman changed the title Improve a test for load_earth_magnetic_anomaly Fix the test for test_earth_mag4km_02m_default_registrationImprove a test for load_earth_magnetic_anomaly Feb 2, 2023
@seisman seisman changed the title Fix the test for test_earth_mag4km_02m_default_registrationImprove a test for load_earth_magnetic_anomaly Fix the test for the default registration of earth_mag4km_02m dataset Feb 2, 2023
@seisman seisman requested a review from willschlitzer February 2, 2023 00:56
Copy link
Contributor

@willschlitzer willschlitzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Any idea what is causing the style check failures for this and other PRs?

@yvonnefroehlich
Copy link
Member

Looks good to me. Any idea what is causing the style check failures for this and other PRs?

These style check failures are related to the new / latest release of Pylint 2.16.0 on Feb, 01, 2023. @seisman already opened an issue regarding these new warnings, please see PR #2346.

@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label Feb 2, 2023
@seisman seisman changed the title Fix the test for the default registration of earth_mag4km_02m dataset Fix the test for the default registration of earth_mag4km_02m dataset (#2341 Feb 3, 2023
@seisman seisman merged commit ad91b05 into main Feb 3, 2023
@seisman seisman deleted the fix-load-earth-mag-test branch February 3, 2023 00:17
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants