-
Notifications
You must be signed in to change notification settings - Fork 228
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
ruff: Fix Python 3.10 violations #3040
Conversation
Do we want to ignore UP038, or change to |
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.
Wanted to double-check the flame graphs, so I manually triggered the benchmarks workflow on the main branch to get the baseline (following steps at #2910 (comment)). Will merge this after I've had a look at the timing comparison. |
Hmm, still not seeing the flame graph, but the performance benchmark didn't report the run as noticeably slower https://github.com/GenericMappingTools/pygmt/pull/3040/checks?check_run_id=21254596529, so should be ok. |
Description of proposed changes
Fixes the following ruff violations with Python 3.10+
X | Y
inisinstance
call instead of(X, Y)
- https://docs.astral.sh/ruff/rules/non-pep604-isinstance (should we ignore this, because the docs saysX | Y
might be slower than(X, Y)
?)Addresses #3039 (comment)
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 command is:
/format
: automatically format and lint the code