-
Notifications
You must be signed in to change notification settings - Fork 6
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
Enhancements and refactoring: Ruff checks resolved #443
Enhancements and refactoring: Ruff checks resolved #443
Conversation
…Centre/gl-issue-418 Allow reading pose model metadata from local folder
…o datajoint_pipeline
why? corrupted data in harp files? not sure
Co-authored-by: Chang Huan Lo <[email protected]>
Co-authored-by: Chang Huan Lo <[email protected]>
Co-authored-by: Chang Huan Lo <[email protected]>
Co-authored-by: Chang Huan Lo <[email protected]>
Co-authored-by: Chang Huan Lo <[email protected]>
Co-authored-by: Chang Huan Lo <[email protected]>
Co-authored-by: Chang Huan Lo <[email protected]>
Fix docstring indent
Dev ruff443
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.
Thanks @MilagrosMarin for addressing all comments. I made another PR here with some final suggestions. And just one last comment about noqa B023 here:
Line 164 in 6279bda
df[column] = df[self.root_key].apply(lambda x: x[column]) # noqa B023 |
If it's too much trouble to test this we can also keep the current change.
df = pd.read_json(f, lines=True) | ||
df.set_index("seconds", inplace=True) | ||
for column in self.columns: | ||
df[column] = df[self.root_key].apply(lambda x: x[column]) | ||
df[column] = df[self.root_key].apply(lambda x: x[column]) # noqa B023 |
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.
@MilagrosMarin has this been tested?
I have tested this, good to go here |
All comments/suggestions have been addressed/resolved |
This PR closes #441 and #417 by removing the exclusion of ruff checks for
dj_pipeline
frompyproject.toml
.streams.py
tests
This is a summary of the relevant changes that have been implemented, with all checks passing:
Resolved issues for
aeon/dj_pipeline
:plotting.py
.DeviceDataStream.key_source
, ensuring it remains informative.strict=False
to the zip function to prevent the function from raising aValueError
if the iterables passed to it do not have the same length.hashlib.md5
withhashlib.sha256
due to known vulnerabilities in the MD5 hashing algorithm -> Reverted: Change was reverted, and an ignore rule was added due to potential breakage introduced by the update.as err
and raising exceptions withraise ... from err
to differentiate errors.X | Y
syntax forisinstance
calls, as introduced in Python 3.10.visit_analysis
to use the ternary operator.pyproject.toml
list: No issues found for B006, B021, S110, UP038, E999, E722, F821, S324, S605, S607, E999, PLR2004.read
method in theJsonList
class withinaeon/io/reader.py
.gen_hex_grad
inaeon/analysis/block_plotting.py
.aeon/analysis/block_plotting.py
.# noqa
comments for specific cases, e.g., inreader
for F821 and# noqa PLW0127
forvisit_analysis.py
.Additional fixes to the rest of the reporitory:
In addition to the above changes, I have also resolved most of the ruff lint issues from the ignored list in
pyproject.toml
, ensuring all checks passed:logger=dj.logger
where appropriate. -> Reverted assertions replacement intests
and added rule inpyproject
since it is acceptable to use for small, simple tests.pytest
intests
.pyproject.toml
updated accordinglyDeprecation Fix:
datetime.utcnow()
todatetime.now(timezone.utc)
to address deprecation issues.