-
Notifications
You must be signed in to change notification settings - Fork 218
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
Update failing doctests with upstream dataset changes #2988
Conversation
There are still two failures: =================================== FAILURES ===================================
_______________ [doctest] pygmt.datasets.tile_map.load_tile_map ________________
105 Raises
106 ------
107 ImportError
108 If ``contextily`` is not installed or can't be imported. Follow
109 :doc:`install instructions for contextily <contextily:index>`, (e.g.
110 via ``python -m pip install contextily``) before using this function.
111
112 Examples
113 --------
114 >>> import contextily
UNEXPECTED EXCEPTION: ModuleNotFoundError("No module named 'contextily'")
Traceback (most recent call last):
File "/home/runner/micromamba/envs/pygmt/lib/python3.9/doctest.py", line 1334, in __run
exec(compile(example.source, filename, "single",
File "<doctest pygmt.datasets.tile_map.load_tile_map[0]>", line 1, in <module>
ModuleNotFoundError: No module named 'contextily'
/home/runner/work/pygmt/pygmt/pygmt/datasets/tile_map.py:114: UnexpectedException
__________________ [doctest] pygmt.src.grdproject.grdproject ___________________
179 >>> import pygmt
180 >>> # Load a grid of @earth_relief_30m data, with a longitude range of
181 >>> # 10° E to 30° E, and a latitude range of 15° N to 25° N
182 >>> grid = pygmt.datasets.load_earth_relief(
183 ... resolution="30m", region=[10, 30, 15, 25]
184 ... )
185 >>> # Create a new grid from the input grid, set the projection to
186 >>> # Mercator, and set inverse to "True" to change from "geographic"
187 >>> # to "rectangular"
188 >>> new_grid = pygmt.grdproject(grid=grid, projection="M10c", inverse=True)
Error: TED EXCEPTION: GMTCLibError("Module 'grdproject' failed with status code 72:\ngrdproject [ERROR]: Option -J: If map width is given you must also specify a region with -R")
Traceback (most recent call last):
File "/home/runner/micromamba/envs/pygmt/lib/python3.9/doctest.py", line 1334, in __run
exec(compile(example.source, filename, "single",
File "<doctest pygmt.src.grdproject.grdproject[2]>", line 1, in <module>
File "/home/runner/work/pygmt/pygmt/pygmt/helpers/decorators.py", line 603, in new_module
return module_func(*args, **kwargs)
File "/home/runner/work/pygmt/pygmt/pygmt/helpers/decorators.py", line 776, in new_module
return module_func(*bound.args, **bound.kwargs)
File "/home/runner/work/pygmt/pygmt/pygmt/src/grdproject.py", line 122, in grdproject
lib.call_module(
File "/home/runner/work/pygmt/pygmt/pygmt/clib/session.py", line 624, in call_module
raise GMTCLibError(
pygmt.exceptions.GMTCLibError: Module 'grdproject' failed with status code 72:
Error: ect [ERROR]: Option -J: If map width is given you must also specify a region with -R
/home/runner/work/pygmt/pygmt/pygmt/src/grdproject.py:188: UnexpectedException
----------------------------- Captured stderr call -----------------------------
Error: ect [ERROR]: Option -J: If map width is given you must also specify a region with -R |
The The |
This doctest should be skipped with the pygmt/.github/workflows/ci_doctests.yaml Line 68 in 2d61b54
Is that doctest still being run somehow? |
The doctest will be skipped only if the Line 45 in 621d6da
|
Hmm, you mentioned at #1790 (comment) that we were using
Do we need to run the full tests on GMT Legacy/Dev? The |
Hmm, I think the description in #1790 (comment) is incorrect.
You're right, I almost forgot this workflow. I was looking at the checklist at #2843, which only mentions "GMT Legacy" and "GMT Tests" but not "Doctests". I think we should mention the "DocTests" workflow in both checklists (#2843 and #2961). |
Yeah, could you trigger the "Doctests" workflow in this PR? I did try it locally and it seems to work fine without Lines 52 to 54 in 621d6da
Sounds good. |
Owh, but using |
>>> # Create a new grid from the input grid, set the projection to | ||
>>> # Mercator, and set inverse to "True" to change from "geographic" | ||
>>> # to "rectangular" | ||
>>> new_grid = pygmt.grdproject(grid=grid, projection="M10c", inverse=True) | ||
>>> region = [10, 30, 15, 25] | ||
>>> grid = pygmt.datasets.load_earth_relief(resolution="30m", region=region) | ||
>>> # Project the geographic gridded data onto a rectangular grid | ||
>>> new_grid = pygmt.grdproject(grid=grid, projection="M10c", region=region) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, did we write the wrong description before. Default (when inverse=False
) should have been "geographic" to "rectangular" 😅
Description of proposed changes
Address #2961 (comment).