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

POC: Implement the new alias system, general parameter classes and some refactors #3238

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

seisman
Copy link
Member

@seisman seisman commented May 9, 2024

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.

@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 seisman added the needs review This PR has higher priority and needs review. label Jul 11, 2024
@seisman seisman removed the needs review This PR has higher priority and needs review. label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussions Need more discussion before taking further actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant