Add earth_relief_holes to load_sample_data()#1921
Conversation
weiji14
left a comment
There was a problem hiding this comment.
Thanks @willschlitzer! Do you also want to add @earth_relief_20m_holes to the cache list at
pygmt/pygmt/helpers/testing.py
Lines 153 to 155 in 951d30a
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
pygmt/datasets/samples.py
Outdated
| return data | ||
|
|
||
|
|
||
| def _load_earth_relief_holes(**kwargs): |
There was a problem hiding this comment.
Pylint reports the following warning.
pygmt/datasets/samples.py:351:0: W0613: Unused argument 'kwargs' (unused-argument)
I think we don't need kwagrs for new datasets.
| def _load_earth_relief_holes(**kwargs): | |
| def _load_earth_relief_holes(): |
There was a problem hiding this comment.
I'll check again to confirm after I rewrite the tests, but I think it needs **kwargs because of data = load_func[name](suppress_warning=True). It was getting passed a value for suppress_warning but wasn't expecting any arguments.
There was a problem hiding this comment.
I received TypeError: _load_earth_relief_holes() got an unexpected keyword argument 'suppress_warning' when I tried running it without **kwargs.
There was a problem hiding this comment.
The suppress_warning parameter (or **kwargs) was added so that users who call the deprecated, old load_xxx functions can silent the deprecation warnings by passing suppress_warning=True. Thus, **kwargs is NOT required for new private _load_xxx functions.
Do you think we should rewrite the code to call the old and new load_xxx functions in different ways:
# old public load functions for backward compatibility
load_func_old = {
"bathymetry": load_sample_bathymetry,
"fractures": load_fractures_compilation,
"hotspots": load_hotspots,
"japan_quakes": load_japan_quakes,
"mars_shape": load_mars_shape,
"ocean_ridge_points": load_ocean_ridge_points,
"usgs_quakes": load_usgs_quakes,
}
# new private load functions
load_func = {
"earth_relief_holes": _load_earth_relief_holes,
}
if name in load_func_old:
data = load_func[name](suppress_warning=True)
else:
data = load_func[name]
return data
There was a problem hiding this comment.
I think that's a good idea. I think this should be a separate PR; does that work? I'm happy to do it (admittedly copying the code above) but won't be able to get to it until tomorrow.
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
|
@GenericMappingTools/pygmt-admin It looks like this is failing some tests because of the change to gridline registration for |
xref: the grid file registration was changed in GenericMappingTools/gmtserver-admin#156 |
Yes, it's now stable so the baseline images can be updated. |
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
This adds a function to load the remote dataset
@earth_relief_20m_holes.grdfor use with the in-line example forgrdfill.Reminders
make formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.Slash Commands
You can write slash commands (
/command) in the first line of a comment to performspecific operations. Supported slash commands are:
/format: automatically format and lint the code/test-gmt-dev: run full tests on the latest GMT development version