Skip to content

CI: Run dev tests on Scientific Python nightly wheels #2612

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 5 commits into from
Jul 20, 2023

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Jul 19, 2023

Description of proposed changes

Check that PyGMT will work on future versions of numpy>=2.0.0, pandas>=2.1.0, xarray>=2023.7.1 and so on.

References:

Extends #1105 when pip install --pre started being used. The nightly wheels from https://pypi.anaconda.org/scientific-python-nightly-wheels/simple are a lot more up to date than those on the default PyPI index.

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

weiji14 added 2 commits July 19, 2023 15:00
Check that PyGMT will work on future versions of numpy>=2.0.0, pandas>=2.1.0, xarray>=2023.7.1 and so on. Uses pre-built wheels available via the extra index at https://anaconda.org/scientific-python-nightly-wheels, see also https://scientific-python.org/specs/spec-0004.
@weiji14 weiji14 added the maintenance Boring but important stuff for the core devs label Jul 19, 2023
@weiji14 weiji14 self-assigned this Jul 19, 2023
@weiji14
Copy link
Member Author

weiji14 commented Jul 19, 2023

Nice, no visible deprecation warnings or errors with using the nightly versions of NumPy, Pandas, Xarray, etc 🎉. See https://github.com/GenericMappingTools/pygmt/actions/runs/5594537134/jobs/10229490969?pr=2612#step:16:723

=================================== FAILURES ===================================
__________________ test_earth_relief_03s_default_registration __________________

    def test_earth_relief_03s_default_registration():
        """
        Test that the grid returned by default for the 3 arc-second resolution has
        a "gridline" registration.
        """
        data = load_earth_relief(resolution="03s", region=[-10, -9.8, 4.9, 5])
        assert data.shape == (121, 241)
        assert data.gmt.registration == 0
        npt.assert_allclose(data.coords["lat"].data.min(), 4.9)
        npt.assert_allclose(data.coords["lat"].data.max(), 5)
        npt.assert_allclose(data.coords["lon"].data.min(), -10)
        npt.assert_allclose(data.coords["lon"].data.max(), -9.8)
>       npt.assert_allclose(data.min(), -2069.996)

../pygmt/tests/test_datasets_earth_relief.py:263: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<function assert_allclose.<locals>.compare at 0x7f7acb461a80>, array(-2131.9707, dtype=float32), array(-2069.996))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-07, atol=0', 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Not equal to tolerance rtol=1e-07, atol=0
E           
E           Mismatched elements: 1 / 1 (100%)
E           Max absolute difference: 61.97470312
E           Max relative difference: 0.02993953
E            x: array(-2131.9707, dtype=float32)
E            y: array(-2069.996)

../../../../micromamba/envs/pygmt/lib/python3.11/contextlib.py:81: AssertionError
=============================== warnings summary ===============================
pygmt/helpers/decorators.py::pygmt.helpers.decorators.use_alias
  <doctest pygmt.helpers.decorators.use_alias[1]>:1: SyntaxWarning: Short-form parameter (R) is not recommended. Use long-form parameter 'region' instead.

pygmt/helpers/decorators.py::pygmt.helpers.decorators.use_alias
  <doctest pygmt.helpers.decorators.use_alias[1]>:1: SyntaxWarning: Short-form parameter (J) is not recommended. Use long-form parameter 'projection' instead.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
==================================== PASSES ====================================
...

Only error is on test_earth_relief_03s_default_registration which is failing on the main branch too and reported at #2511 (comment)

@weiji14 weiji14 marked this pull request as ready for review July 19, 2023 03:37
@weiji14 weiji14 added this to the 0.10.0 milestone Jul 19, 2023
@weiji14 weiji14 added the final review call This PR requires final review and approval from a second reviewer label Jul 19, 2023
@weiji14 weiji14 enabled auto-merge (squash) July 20, 2023 01:32
@weiji14 weiji14 merged commit a07f9df into main Jul 20, 2023
@weiji14 weiji14 deleted the scientific-python-nightly-wheels branch July 20, 2023 01:42
@weiji14 weiji14 removed the final review call This PR requires final review and approval from a second reviewer label Jul 20, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants