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

Recommend Figure.timestamp and remove timestamp (U) alias from all plotting methods #2135

Merged
merged 14 commits into from
Mar 5, 2023

Conversation

seisman
Copy link
Member

@seisman seisman commented Sep 24, 2022

Description of proposed changes

Similar to #2071.

The purpose of this PR is to remove timestamp (U) alias and recommend use Figure.timestamp instead.

NOTE: Figure.timestamp is not implemented yet.

Fixes #

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.

Slash Commands

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

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@seisman
Copy link
Member Author

seisman commented Sep 24, 2022

The warning message looks like this:

>>> import pygmt
>>> fig = pygmt.Figure()
>>> fig.basemap(region=[0, 10, 0, 10], projection="X10c/10c", frame=True, U=True)
<ipython-input-3-47b2c09a10fd>:1: SyntaxWarning: Parameter 'U' and 'timestamp' is deprecated since v0.8.0. Use Figure.timestamp() instead.
  fig.basemap(region=[0, 10, 0, 10], projection="X10c/10c", frame=True, U=True)

>>> fig.show()

>>> import pygmt
>>> fig = pygmt.Figure()
>>> fig.basemap(region=[0, 10, 0, 10], projection="X10c/10c", frame=True, timestamp=True)
<ipython-input-7-eff609310ed5>:1: SyntaxWarning: Parameter 'U' and 'timestamp' is deprecated since v0.8.0. Use Figure.timestamp() instead.
  fig.basemap(region=[0, 10, 0, 10], projection="X10c/10c", frame=True, timestamp=True)
>>> fig.show()

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.

NOTE: Figure.timestamp is not implemented yet.

Will definitely need to implement this before this PR can be approved 🙂

pygmt/helpers/decorators.py Outdated Show resolved Hide resolved
pygmt/helpers/decorators.py Outdated Show resolved Hide resolved
@seisman seisman modified the milestones: 0.8.0, 0.9.0 Dec 11, 2022
@seisman seisman changed the title WIP: Remove timestamp (U) alias from all plotting methods Remove timestamp (U) alias from all plotting methods Mar 3, 2023
@seisman seisman changed the title Remove timestamp (U) alias from all plotting methods Recommend Figure.timestamp and remove timestamp (U) alias from all plotting methods Mar 3, 2023
pygmt/tests/test_timestamp.py Outdated Show resolved Hide resolved
@seisman seisman marked this pull request as ready for review March 3, 2023 06:03
@seisman seisman added the needs review This PR has higher priority and needs review. label Mar 3, 2023
Copy link
Member

@michaelgrund michaelgrund left a comment

Choose a reason for hiding this comment

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

Looks good!

pygmt/tests/test_timestamp.py Show resolved Hide resolved
pygmt/tests/test_timestamp.py Show resolved Hide resolved
@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 Mar 3, 2023
@seisman seisman merged commit fd50ec2 into main Mar 5, 2023
@seisman seisman deleted the remove-timestamp branch March 5, 2023 08:28
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Mar 5, 2023
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.

3 participants