You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove the xshift (X) and yshift (Y) aliases from all plotting modules? #924
For context, the xshift/yshift aliases were added in #624. While I agree with that line in the Zen of Python "There should be one-- and preferably only one --obvious way to do it.", what comes higher up before that line is "Readability counts.", and that is what the xshift/yshift aliases (and other PyGMT aliases) was originally intended for.
Improve the docstrings of Figure.shift_origin().
Agree that this should be done, regardless of whether we decide to deprecate xshift (X) and yshift (Y).
Remove xshift and yshift alias from docstrings of all plotting functions
Raise a warning/error if xshift, yshift, X or Y is passed.
To be honest, this would be a good opportunity to practice Deprecation Warning cycles in PyGMT. But I'm not keen on handling this work, so my vote would be to keep the existing behaviour (xshift/yshift still works), but I'll respect people's opinions if deprecating xshift/yshift is a more popular opinion.
That's a +1 from me as well. A good first step is to not use them in docs even if they are still available. This cuts down on the docstring repetition as well.
Activity
seisman commentedon Feb 18, 2021
Similar to this issue, I also don't like the timestamp (-U) alias. I'm in favor of removing timestamp too, and add a new method
Figure.timestamp().We can discuss xshift and yshift first. If we all agree, I'll open another issue to better track and discuss the
Figure.timestamp()method.seisman commentedon Feb 20, 2021
Ping @GenericMappingTools/python and @GenericMappingTools/python-maintainers for comments and thoughts.
weiji14 commentedon Feb 20, 2021
For context, the xshift/yshift aliases were added in #624. While I agree with that line in the Zen of Python "There should be one-- and preferably only one --obvious way to do it.", what comes higher up before that line is "Readability counts.", and that is what the xshift/yshift aliases (and other PyGMT aliases) was originally intended for.
Agree that this should be done, regardless of whether we decide to deprecate xshift (X) and yshift (Y).
To be honest, this would be a good opportunity to practice Deprecation Warning cycles in PyGMT. But I'm not keen on handling this work, so my vote would be to keep the existing behaviour (xshift/yshift still works), but I'll respect people's opinions if deprecating xshift/yshift is a more popular opinion.
maxrjones commentedon Aug 12, 2021
Now that we have a deprecation policy, I support deprecating xshift and yshift in favor of Figure.shift_origin().
leouieda commentedon Aug 26, 2021
That's a +1 from me as well. A good first step is to not use them in docs even if they are still available. This cuts down on the docstring repetition as well.
seisman commentedon Mar 7, 2023
This is already done in #2071.
This is not done yet but will be tracked in issue #2401.
Done in #2208 and #2135.
This is not exactly true. See #2401 for explanations and solutions.
I'm closing the issue now and we can have more discussions in #2401.