-
Notifications
You must be signed in to change notification settings - Fork 224
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
Add a decorator to raise a FutureWarning when positional arguments are passed for functions that changed parameter orders #1541
Conversation
…e passed for functions that changed parameter orders
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.
Looks good to me!
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 realize that this is a temporary decorator, which might not have much use after PyGMT v0.7.0, but should we:
- Add a usage note for
@check_data_input_order
at https://github.com/GenericMappingTools/pygmt/blob/main/doc/maintenance.md#backwards-compatibility-and-deprecation-policy - Add a note in the docstring of this decorator function to say that this function can be removed after PyGMT v0.7.0?
I prefer not to add the usage, because it's likely that no one will use this decorator again after we finish issue #1479 (definitely before v0.5.0 release).
Yes, it sounds good. |
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
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.
Ok to merge once you fix the lint issue. Some whitespace I think.
…e passed for functions that changed parameter orders (GenericMappingTools#1541) Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Description of proposed changes
See #1479 (comment) for discussions.
This PR adds a decorator to raise a warning when the order of parameters are changed and users are passing positional arguments.
Usage:
Address #1479.
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version