Uh oh!
There was an error while loading. Please reload this page.
Update failing doctests with upstream dataset changes - #2988
Conversation
Uh oh!
There was an error while loading. Please reload this page.
seisman
commented
Jan 11, 2024
There are still two failures: ===================================FAILURES===================================_______________ [doctest] pygmt.datasets.tile_map.load_tile_map________________105Raises106------107ImportError108If``contextily``isnotinstalledorcan'tbeimported. Follow109 :doc:`install instructions for contextily <contextily:index>`, (e.g.
110via``python-mpipinstallcontextily``) beforeusingthisfunction.
111112Examples113--------114>>>importcontextilyUNEXPECTEDEXCEPTION: ModuleNotFoundError("No module named 'contextily'")
Traceback (mostrecentcalllast):
File"/home/runner/micromamba/envs/pygmt/lib/python3.9/doctest.py", line1334, in__runexec(compile(example.source, filename, "single",
File"<doctest pygmt.datasets.tile_map.load_tile_map[0]>", line1, in<module>ModuleNotFoundError: Nomodulenamed'contextily'/home/runner/work/pygmt/pygmt/pygmt/datasets/tile_map.py:114: UnexpectedException__________________ [doctest] pygmt.src.grdproject.grdproject___________________179>>>importpygmt180>>># Load a grid of @earth_relief_30m data, with a longitude range of181>>># 10° E to 30° E, and a latitude range of 15° N to 25° N182>>>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 to186>>># 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: TEDEXCEPTION: 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 (mostrecentcalllast):
File"/home/runner/micromamba/envs/pygmt/lib/python3.9/doctest.py", line1334, in__runexec(compile(example.source, filename, "single",
File"<doctest pygmt.src.grdproject.grdproject[2]>", line1, in<module>File"/home/runner/work/pygmt/pygmt/pygmt/helpers/decorators.py", line603, innew_modulereturnmodule_func(*args, **kwargs)
File"/home/runner/work/pygmt/pygmt/pygmt/helpers/decorators.py", line776, innew_modulereturnmodule_func(*bound.args, **bound.kwargs)
File"/home/runner/work/pygmt/pygmt/pygmt/src/grdproject.py", line122, ingrdprojectlib.call_module(
File"/home/runner/work/pygmt/pygmt/pygmt/clib/session.py", line624, incall_moduleraiseGMTCLibError(
pygmt.exceptions.GMTCLibError: Module'grdproject'failedwithstatuscode72:
Error: ect [ERROR]: Option-J: Ifmapwidthisgivenyoumustalsospecifyaregionwith-R/home/runner/work/pygmt/pygmt/pygmt/src/grdproject.py:188: UnexpectedException-----------------------------Capturedstderrcall-----------------------------Error: ect [ERROR]: Option-J: Ifmapwidthisgivenyoumustalsospecifyaregionwith-R |
The The |
weiji14
commented
Jan 15, 2024
This doctest should be skipped with the pygmt/.github/workflows/ci_doctests.yaml Line 68 in 2d61b54 Is that doctest still being run somehow? |
seisman
commented
Jan 15, 2024
The doctest will be skipped only if the Line 45 in 621d6da |
weiji14
commented
Jan 15, 2024
Hmm, you mentioned at #1790 (comment) that we were using
Do we need to run the full tests on GMT Legacy/Dev? The |
seisman
commented
Jan 15, 2024
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 |
| >>> 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.
Oh wow, did we write the wrong description before. Default (when inverse=False) should have been "geographic" to "rectangular" 😅
Uh oh!
There was an error while loading. Please reload this page.
Description of proposed changes
Address #2961 (comment).