-
Notifications
You must be signed in to change notification settings - Fork 229
Migrate the 'panel' parameter to the new alias system #4030
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
base: main
Are you sure you want to change the base?
Conversation
49af570
to
7046f57
Compare
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.
Pull Request Overview
This PR migrates the 'panel' parameter from the old GMT parameter alias system to the new PyGMT alias system. The migration involves removing c="panel"
from the use_alias
decorator, removing c="sequence_comma"
from kwargs_to_strings
, adding panel=None
as an explicit parameter, adding c=panel
to the aliases documentation, and implementing the new AliasSystem
with c=Alias(panel, name="panel", separator=",", size=2)
.
Key changes:
- Removes old-style panel parameter handling from 23 plotting functions
- Adds explicit panel parameters and new alias system implementation
- Updates one subplot utility function to use direct parameter processing
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
pygmt/src/wiggle.py | Migrates panel parameter to new alias system for wiggle plots |
pygmt/src/velo.py | Migrates panel parameter to new alias system for velocity vector plots |
pygmt/src/tilemap.py | Migrates panel parameter to new alias system for tilemap plots |
pygmt/src/text.py | Migrates panel parameter to new alias system for text plotting |
pygmt/src/ternary.py | Migrates panel parameter to new alias system for ternary plots |
pygmt/src/subplot.py | Updates set_panel function to use direct parameter processing |
pygmt/src/solar.py | Migrates panel parameter to new alias system for solar plots |
pygmt/src/rose.py | Migrates panel parameter to new alias system for rose diagrams |
pygmt/src/plot3d.py | Migrates panel parameter to new alias system for 3D plots |
pygmt/src/plot.py | Migrates panel parameter to new alias system for 2D plots |
pygmt/src/meca.py | Migrates panel parameter to new alias system for focal mechanism plots |
pygmt/src/logo.py | Migrates panel parameter to new alias system for GMT logo |
pygmt/src/legend.py | Migrates panel parameter to new alias system for legend plotting |
pygmt/src/image.py | Migrates panel parameter to new alias system for image plotting |
pygmt/src/histogram.py | Migrates panel parameter to new alias system for histograms |
pygmt/src/grdview.py | Migrates panel parameter to new alias system for grid view plots |
pygmt/src/grdimage.py | Migrates panel parameter to new alias system for grid image plots |
pygmt/src/grdcontour.py | Migrates panel parameter to new alias system for grid contour plots |
pygmt/src/contour.py | Migrates panel parameter to new alias system for contour plots |
pygmt/src/colorbar.py | Migrates panel parameter to new alias system for colorbar plots |
pygmt/src/coast.py | Migrates panel parameter to new alias system for coastline plots |
pygmt/src/basemap.py | Migrates panel parameter to new alias system for basemap plots |
7046f57
to
ee00133
Compare
@@ -86,6 +86,7 @@ def basemap(self, projection=None, **kwargs): | |||
self._activate_figure() | |||
aliasdict = AliasSystem( | |||
J=Alias(projection, name="projection"), | |||
c=Alias(panel, name="panel", sep=",", size=2), |
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.
I'm considering if we should define a function like:
def common_alias(value, name):
match name:
case "projection":
return Alias(value, name="projection")
case "panel":
return Alias(value, name="panel", sep=",", size=2)
then in wrappers, we can use it like:
from pygmt.alias import common_alias
aliasdict = AliasSystem(
J=common_alias(projection, name="projection"),
c=common_alias(panel, name="panel"),
)
so that we don't have to repeat alias(panel, name="panel", sep=",", size=2),
in all wrappers.
As the PR title says.