-
Notifications
You must be signed in to change notification settings - Fork 27
ruff fixes #196
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 fixes #196
Conversation
for more information, see https://pre-commit.ci
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, thank you! 👍 just a few nitpicks
examples/dataset_exploration/ricci_carrier_transport/convert_dtype+add_strucs.py
Outdated
Show resolved
Hide resolved
from unittest.mock import patch | ||
from xml.etree import ElementTree # noqa: ICN001 | ||
from xml.etree import ElementTree as ET |
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.
not a fan of this convention, i prefer to import ElementTree
as is without renaming but not a strong preference either way
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.
ET
is indeed less readable than ElementTree
, but the official Python API doc seems to prefer ET
:
This is a short tutorial for using xml.etree.ElementTree (ET in short).
And in code demo as well:
import xml.etree.ElementTree as ET
tree = ET.parse('country_data.xml')
root = tree.getroot()
Perhaps just follow the convention? Would let you decide :)
Thanks! |
* ruff fixes * fix s101 use of assert * globally ignore SLF001, access private class member * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add todo tag * put docstring and global ignore on top * fix py017, properly capture exception * Fix PT011, exception capture without match * add TODO tag for #195 (comment) * fix NPY201, np trapz * use warn over print to fix T201 * add comments for globally ignored ruff rules * guard type check only import when possible * remove ISC001 from ignore * add todo tag * reduce duration items shown to 20 * import Self from typing extension * remove global ignore of S311 as there're only 2 violation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * replace random with numpy, which also fixes S311 * fix "PT006", # pytest-parametrize-names-wrong-type * guard type check only import * fix "COM812", # trailing comma missing * remove no type check mark * Revert "fix "COM812", # trailing comma missing" This reverts commit 5ab3390. * fix unit test of io * NEED confirm: change width from 457 to 458 * clean up branch condition * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * use native array size arg * revert accidental elem -> element rename * fix random array generation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix random array generate in asset maker * revert test_io value to 457, reason unknown * skip eslint for now #197 * format pre-commit config * remove eslint skip mark in CI * fix indentation in pyproject.toml * drop quotes in test.yml string * fix typo in filename * fix shaded_ys type * remove overwriting pytest duration * pyproject whitespace --------- Co-authored-by: Janosh Riebesell <[email protected]>
ruff fixes
print
with others if possibleTODOs:
test_io
uncertainty
(this might be bug, if user use NumPy 2)match
no_type_check
slowest durations
to 20