GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Figure.grdcontour: Deprecate parameter "interval" to "levels" (FutureWarning since v0.12.0, will be removed in v0.16.0) by yvonnefroehlich · Pull Request #3209 · GenericMappingTools/pygmt

Conversation

@yvonnefroehlich

@yvonnefroehlich yvonnefroehlich commented Apr 29, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
yvonnefroehlich added 5 commits April 28, 2024 23:39
@yvonnefroehlich
Depracate 'interval' by 'levels'
8f57a6f
@yvonnefroehlich
Update tests
5acadbb
@yvonnefroehlich
Update examples
0fa437c
@yvonnefroehlich
Adjust coding style
6b84090
@yvonnefroehlich
Improve formulation
bcda23a
@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
This was referenced Apr 29, 2024
Release PyGMT v0.12.0 #3180
Closed
Consistent (non-common) aliases between modules #1042
Closed
seisman
seisman reviewed Apr 29, 2024
View reviewed changes
Comment thread examples/tutorials/advanced/contour_map.py
interval=250,
grid=grid,
)
fig.grdcontour(annotation=1000, levels=250, grid=grid)

@seisman seisman Apr 29, 2024

Copy link
Copy Markdown
Member

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.

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)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread examples/tutorials/advanced/contour_map.py
Comment on lines 54 to 59
fig.grdcontour(
annotation=1000,
interval=250,
levels=250,
grid=grid,
limit=[-4000, -2000],
)

@seisman seisman Apr 29, 2024

Copy link
Copy Markdown
Member

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@yvonnefroehlich yvonnefroehlich Apr 29, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

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.

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@seisman seisman Apr 29, 2024

Copy link
Copy Markdown
Member

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.

OK. Let's keep this PR small.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@yvonnefroehlich yvonnefroehlich Apr 29, 2024

Copy link
Copy Markdown
Member Author

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.

Just submitted PR #3212 for working on this.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
seisman
seisman approved these changes Apr 29, 2024
View reviewed changes
@seisman
seisman merged commit b1f5cc7 into main Apr 29, 2024
@seisman
seisman deleted the deprecate-interval2levels-grdcontour branch April 29, 2024 09:44
@yvonnefroehlich yvonnefroehlich mentioned this pull request Apr 29, 2024
Tutorial and Intro for Figure.grdcontour: Adjust line length and parameter order #3212
Merged
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@seisman seisman seisman approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@yvonnefroehlich yvonnefroehlich

Labels

deprecation Deprecating a feature

Projects

None yet

Milestone

0.12.0

Development

Successfully merging this pull request may close these issues.

Consistent (non-common) aliases between modules

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@yvonnefroehlich @seisman
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.