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.grdcontour: Deprecate parameter "interval" to "levels" (FutureWarning since v0.12.0, will be removed in v0.16.0) #3209

Merged
merged 5 commits into from
Apr 29, 2024

Conversation

yvonnefroehlich
Copy link
Member

@yvonnefroehlich yvonnefroehlich commented Apr 29, 2024

Description of proposed changes

This PR deprecate the parameter interval to levels (C) for Figur.grdcontour.
Then this alias is consistent with Figure.contour, the GMT documentation, and matplolib (details on the discussion at #1042 (comment)).

Fixes #1042 (partly)

Preview: https://pygmt-dev--3209.org.readthedocs.build/en/3209/api/generated/pygmt.Figure.grdcontour.html

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash command is:

  • /format: automatically format and lint the code

@yvonnefroehlich yvonnefroehlich added the deprecation Deprecating a feature label Apr 29, 2024
@yvonnefroehlich yvonnefroehlich added this to the 0.12.0 milestone Apr 29, 2024
@yvonnefroehlich yvonnefroehlich self-assigned this Apr 29, 2024
interval=250,
grid=grid,
)
fig.grdcontour(annotation=1000, levels=250, grid=grid)
Copy link
Member

Choose a reason for hiding this comment

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

Can you please update this example to always put grid as the first parameter?

Suggested change
fig.grdcontour(annotation=1000, levels=250, grid=grid)
fig.grdcontour(grid=grid, annotation=1000, levels=250)

Comment on lines 54 to 59
fig.grdcontour(
annotation=1000,
interval=250,
levels=250,
grid=grid,
limit=[-4000, -2000],
)
Copy link
Member

Choose a reason for hiding this comment

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

This code block and many others can be rewritten into a single line after we set the line length limit to 88 characters.

Copy link
Member Author

@yvonnefroehlich yvonnefroehlich Apr 29, 2024

Choose a reason for hiding this comment

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

Yes, I should find the time to make both updates. Should these be included in this PR, or better in separate PR and have this PR for the deprecation?

Copy link
Member

Choose a reason for hiding this comment

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

OK. Let's keep this PR small.

Copy link
Member Author

Choose a reason for hiding this comment

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

Just submitted PR #3212 for working on this.

@seisman seisman merged commit b1f5cc7 into main Apr 29, 2024
18 of 19 checks passed
@seisman seisman deleted the deprecate-interval2levels-grdcontour branch April 29, 2024 09:44
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.

Consistent (non-common) aliases between modules
2 participants