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 — POC: Implement the new alias system, general parameter classes and some refactors by seisman · Pull Request #3238 · GenericMappingTools/pygmt

Conversation

@seisman

@seisman seisman commented May 9, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

See #3239 for the detailed context.

This PR implements the new alias system proposed in #3239. It also add some new features and refactor some wrappers to show how the new alias system will affect the current codes.

Here is a summary of changes in this PR:

  • pygmt/alias.py: Implement the new alias system
  • pygmt/params/base.py: Implement the BaseParam class as a base class for other parameter classes
  • pygmt/params/box.py: Implement the Box class, showing how to define new classes in a simple way
  • pygmt/params/frame.py: Impement the Frame class, showing that the current design works work for the most complicated GMT option
  • pygmt/src/basemap.py: Refactor so that you can try the new Frame parameter in Figure.basemap
  • pygmt/src/dimfilter.py: How the new alias system can affect grid-related modules
  • pygmt/src/image.py: How the new alias system can replace the old alias system
  • pygmt/src/logo.py: Refactor so that you can try the Box class
  • pygmt/src/scalebar.py: Initial implementation of the high-level wrapper for adding a scale bar.
  • pygmt/src/timestamp.py: Figure.timestamp is one of the wrappers that don't use the alias system. Using the new alias system can simplify the code.
  • pygmt/src/coast.py/pygmt/src/binstats.py: How to support long-form arguments

This is just the initial implementation. So, some doctests and tests are still missing. We will break this PR into multiple smaller PRs and make the implementation more robust after people generally agree with the design of the new alias system.

Preview:

  • https://pygmt-dev--3238.org.readthedocs.build/en/3238/api/index.html#common-parameters
  • https://pygmt-dev--3238.org.readthedocs.build/en/3238/api/generated/pygmt.params.Box.html#pygmt.params.Box
  • https://pygmt-dev--3238.org.readthedocs.build/en/3238/api/generated/pygmt.params.Frame.html#pygmt.params.Frame
  • https://pygmt-dev--3238.org.readthedocs.build/en/3238/api/generated/pygmt.Figure.logo.html#pygmt.Figure.logo
  • https://pygmt-dev--3238.org.readthedocs.build/en/3238/api/generated/pygmt.Figure.coast.html#pygmt.Figure.coast

Sorry, something went wrong.

Uh oh!

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

All reactions
@seisman seisman mentioned this pull request May 9, 2024
New alias system towards a more Pythonic interface #3239
Closed
4 tasks done
@seisman seisman added the discussions Need more discussion before taking further actions label May 9, 2024
@seisman
seisman force-pushed the alias-system branch 2 times, most recently from 05dd80e to 87736a0 Compare May 10, 2024 04:06
seisman added 12 commits May 14, 2024 10:01
@seisman
Implement the new alias system
cd1ffcd
@seisman
Implement the BaseParam class as a base class for PyGMT class-like pa…
492f2c2
…rameters
@seisman
Add the Box class for specifying the box parameter
ae9006d
@seisman
Add the Frame/Axes/Axis class for the frame parameter
34c3dd7
@seisman
Add Figure.scalebar for plotting a scale bar
85edc00
@seisman
Figure.basemap: Refactor to use the new alias system
b712840
@seisman
pygmt.dimfilter: Refactor to use the new alias system
1b480a0
@seisman
Figure.image: Refactor to use the new alias system
075d759
@seisman
Figure.logo: Refactor to use the new alias system
0b0d5b9
@seisman
Figure.timestamp: Refactor to use the new alias system
c25ef4a
@seisman
Figure.coast: Make the 'resolution' parameter more Pythonic
ce74b85
@seisman
pygmt.binstats: Make the 'statistic' parameter more Pythonic
c6ea4b8
@seisman
seisman force-pushed the alias-system branch from 87736a0 to c6ea4b8 Compare May 14, 2024 02:01
@seisman
Merge branch 'main' into alias-system
ecb5201
@seisman seisman added the needs review This PR has higher priority and needs review. label Jul 11, 2024
seisman added 2 commits July 12, 2024 18:55
@seisman
Merge branch 'main' into alias-system
1c08e31
@seisman
Merge branch 'main' into alias-system
8fd16d2
@seisman seisman mentioned this pull request Jul 19, 2024
pygmt.grd2cpt & pygmt.makecpt: Simplify the logic for dealing with CPT output #3334
Merged
@seisman
Merge branch 'main' into alias-system
478213d
@seisman seisman removed the needs review This PR has higher priority and needs review. label Aug 1, 2024
seisman added 2 commits August 25, 2024 16:31
@seisman
Merge branch 'main' into alias-system
07c4b4b
@seisman
Merge branch 'main' into alias-system
88a216c
This was referenced Sep 25, 2024
POC: Implement the general BaseParams class for any class-like parameters #2895
Closed
POC: WIP: New alias system #2949
Closed
Breaking change in how text strings are treated #3457
Closed
@seisman
Merge branch 'main' into alias-system
b9a3267
seisman added 2 commits April 8, 2025 13:25
@seisman
Fix static typing
b2c12c8
@seisman
Merge branch 'main' into alias-system
9da950c
@seisman seisman added run/benchmark Trigger the benchmark workflow in PRs needs review This PR has higher priority and needs review. labels Apr 8, 2025
@seisman seisman added this to Pythonic GMT arguments Apr 8, 2025
@github-project-automation github-project-automation Bot moved this to In Progress in Pythonic GMT arguments Apr 8, 2025
seisman added 7 commits April 19, 2025 21:04
@seisman
Merge branch 'main' into alias-system
b8fe689
@seisman
Merge branch 'main' into alias-system
17d1ce8
@seisman
Merge branch 'main' into alias-system
9b4d88e
@seisman
Merge branch 'main' into alias-system
2e7db46
@seisman
Merge branch 'main' into alias-system
78dce35
@seisman
Merge branch 'main' into alias-system
3ceea79
@seisman
Merge branch 'main' into alias-system
9af5ba1
@seisman seisman added this to PyGMT paper Jun 4, 2025
@seisman seisman added this to the 0.17.0 milestone Jun 8, 2025
seisman added 2 commits June 20, 2025 11:44
@seisman
Merge branch 'main' into alias-system
2db06b2
@seisman
Use the sequence_join function
a074ddb
@seisman
seisman force-pushed the alias-system branch from 16f2ef5 to a074ddb Compare June 20, 2025 06:30
@seisman
Rename to_string to _to_string
a869d24
@seisman seisman removed the needs review This PR has higher priority and needs review. label Jun 26, 2025
This was referenced Jul 10, 2025
New Alias System: Add the private _to_string function #3986
Merged
New Alias System: Add the Alias class #3993
Merged
@seisman

seisman commented Jul 26, 2025

Copy link
Copy Markdown
Member Author

This PR will be superseded by several smaller PRs and can be closed:

  • New Alias System: Add the private _to_string function #3986
  • New Alias System: Add the Alias class #3993
  • New Alias System: Add the AliasSystem class #4000
  • Add the Box class for specifying the box of GMT embellishments #3995
  • pygmt.binstats: Let the parameter 'statistic' support descriptive arguments #3012
  • Figure.timestamp: Refactor to use the new alias system #4012
  • Figure.coast/pygmt.grdlandmask/pygmt.select: Refactor to use the new alias system for parameter 'resolution' #4013
  • Figure.logo: Add parameters position/width/height to specify logo position and dimensions #4014
  • Add Figure.scalebar to plot a scale bar on maps #4015
  • WIP: Add the Axis and Frame classes for the frame parameter #4016
All reactions

Sorry, something went wrong.

Uh oh!

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

@seisman seisman closed this Jul 26, 2025
@github-project-automation github-project-automation Bot moved this to Done in PyGMT paper Jul 26, 2025
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Pythonic GMT arguments Jul 26, 2025
@seisman
seisman deleted the alias-system branch July 26, 2025 07:35
@seisman seisman added enhancement Improving an existing feature and removed discussions Need more discussion before taking further actions run/benchmark Trigger the benchmark workflow in PRs labels Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

@seisman seisman

Labels

enhancement Improving an existing feature

Projects

Pythonic GMT arguments
Status: Done
PyGMT paper
Status: Done

Milestone

0.17.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

2 participants

@seisman @yvonnefroehlich
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 01402792 — 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.