-
Notifications
You must be signed in to change notification settings - Fork 229
Remove the xshift (X) and yshift (Y) aliases from all plotting modules? #924
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
Comments
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 We can discuss xshift and yshift first. If we all agree, I'll open another issue to better track and discuss the |
Ping @GenericMappingTools/python and @GenericMappingTools/python-maintainers for comments and thoughts. |
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. |
Now that we have a deprecation policy, I support deprecating xshift and yshift in favor of Figure.shift_origin(). |
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. |
This is already done in #2071.
This is not done yet but will be tracked in issue #2401.
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. |
In the Zen of Python:
Now we have two different methods to shift origins:
xshift="2c", yshift="1c"
to any plotting modulesFigure.shift_origin(xshift="2c", yshift="1c")
GMT users are familiar with method 1, but IMHO method 2 is more pythonic. As I can see, these two methods are equivalent.
Should we remove xshift and yshift from all plotting modules, so that we can better follow the zen of python, and also make the docstrings shorter.
If yes, we need to do more things:
Figure.shift_origin()
.The text was updated successfully, but these errors were encountered: