Skip to content
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

Figure.grdimage: Remove the unsupported 'img_out'/'A' parameter #2907

Merged
merged 3 commits into from
Dec 25, 2023

Conversation

seisman
Copy link
Member

@seisman seisman commented Dec 21, 2023

As proposed in #2765 (comment), we will NOT support the img_out/A parameter in the Figure.grdimage method. The related feature will be added to a new function/method if requested.

Supersede #2765.

@seisman seisman added the deprecation Deprecating a feature label Dec 21, 2023
@seisman seisman added this to the 0.11.0 milestone Dec 21, 2023
@seisman seisman added the needs review This PR has higher priority and needs review. label Dec 21, 2023
@seisman seisman requested a review from a team December 22, 2023 14:23
Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of minor suggestions, otherwise ok.

pygmt/tests/test_grdimage.py Outdated Show resolved Hide resolved
@@ -172,6 +157,13 @@ def grdimage(self, grid, **kwargs):
"""
kwargs = self._preprocess(**kwargs)

# Do not support -A option
if any(kwargs.get(arg) is not None for arg in ["A", "img_out"]):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if any(kwargs.get(arg) is not None for arg in ["A", "img_out"]):
if any(kwargs.get(arg) for arg in ["A", "img_out"]):

Should be ok to remove is not None, e.g.:

kwargs = {"img_out": "temp.nc"}
if any(kwargs.get(arg) for arg in ["A", "img_out"]):
    raise Exception

should raise an Exception.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't raise an exception if an empty string is given:

kwargs = {"img_out": ""}
if any(kwargs.get(arg) for arg in ["A", "img_out"]):
    raise Exception

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, keep it as is then.

@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Dec 25, 2023
Copy link

codspeed-hq bot commented Dec 25, 2023

CodSpeed Performance Report

Merging #2907 will not alter performance

Comparing grdimage/remove-imgout (aa85ac6) with main (013014b)

Summary

✅ 1 untouched benchmarks

@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Dec 25, 2023
@seisman seisman merged commit ff3dbb4 into main Dec 25, 2023
19 checks passed
@seisman seisman deleted the grdimage/remove-imgout branch December 25, 2023 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation Deprecating a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants