-
Notifications
You must be signed in to change notification settings - Fork 228
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
pygmt.grdclip: Deprecate parameter 'new' to 'replace' (remove in v0.19.0) #3884
Conversation
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.
Should we add tests for this parameter and the usage of the old parmeter name?
Similar to the mode
parameter of grdfill
:
pygmt/pygmt/tests/test_grdfill.py
Lines 143 to 150 in a11fc15
# TODO(PyGMT>=0.19.0): Remove this test. | |
def test_grdfill_deprecated_mode(grid, expected_grid): | |
""" | |
Test that grdfill fails with deprecated `mode` argument. | |
""" | |
with pytest.warns(FutureWarning): | |
result = grdfill(grid=grid, mode="c20") | |
xr.testing.assert_allclose(a=result, b=expected_grid) |
Currently, it looks like only above
, below
and between
are included in the tests (https://github.com/GenericMappingTools/pygmt/blob/main/pygmt/tests/test_grdclip.py).
Thanks. Added. |
pygmt/tests/test_grdclip.py
Outdated
npt.assert_array_equal(np.unique(grid), [1, 2]) | ||
|
||
# Test for the deprecated 'new' parameter | ||
# TODO(PyGMT>=0.19.0): Remove this test for the 'new' parameter |
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.
Clarify that only the test below is to be removed, not the entire unit test.
# TODO(PyGMT>=0.19.0): Remove this test for the 'new' parameter | |
# TODO(PyGMT>=0.19.0): Remove this test below for the 'new' parameter |
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Addressing #3882 (comment).
Hopefully it can be approved and merged into v0.15.0