Skip to content
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

STY: Apply ruff/flake8-simplify rules (SIM) #3676

Merged
merged 8 commits into from
Oct 6, 2024

Conversation

DimitriPapadopoulos
Copy link
Contributor

Summary

Apply assorted flake8-simplify (SIM) rules.

Copy link

codecov bot commented Sep 22, 2024

Codecov Report

Attention: Patch coverage is 30.00000% with 63 lines in your changes missing coverage. Please review.

Project coverage is 70.89%. Comparing base (6ac81ca) to head (d040d84).
Report is 144 commits behind head on master.

Files with missing lines Patch % Lines
nipype/interfaces/slicer/generate_classes.py 0.00% 12 Missing and 1 partial ⚠️
nipype/interfaces/fsl/model.py 21.42% 10 Missing and 1 partial ⚠️
nipype/interfaces/cmtk/convert.py 0.00% 7 Missing ⚠️
nipype/interfaces/cmtk/cmtk.py 0.00% 6 Missing ⚠️
nipype/interfaces/cmtk/nx.py 0.00% 6 Missing ⚠️
nipype/algorithms/misc.py 0.00% 4 Missing ⚠️
nipype/interfaces/io.py 0.00% 3 Missing ⚠️
nipype/interfaces/afni/model.py 0.00% 2 Missing ⚠️
nipype/utils/draw_gantt_chart.py 0.00% 2 Missing ⚠️
nipype/interfaces/afni/utils.py 0.00% 1 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3676      +/-   ##
==========================================
+ Coverage   70.87%   70.89%   +0.02%     
==========================================
  Files        1276     1276              
  Lines       59238    59209      -29     
  Branches     9812     9814       +2     
==========================================
- Hits        41984    41977       -7     
+ Misses      16079    16061      -18     
+ Partials     1175     1171       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

nipype/interfaces/afni/utils.py Outdated Show resolved Hide resolved
nipype/interfaces/cmtk/nx.py Outdated Show resolved Hide resolved
nipype/interfaces/cmtk/nx.py Outdated Show resolved Hide resolved
Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caught a couple new things.

nipype/interfaces/cmtk/convert.py Outdated Show resolved Hide resolved
nipype/interfaces/cmtk/convert.py Outdated Show resolved Hide resolved
nipype/interfaces/cmtk/convert.py Outdated Show resolved Hide resolved
nipype/interfaces/slicer/generate_classes.py Outdated Show resolved Hide resolved
nipype/interfaces/slicer/generate_classes.py Show resolved Hide resolved
Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a merge conflict resolved, but otherwise good to go.

DimitriPapadopoulos and others added 8 commits October 6, 2024 17:58
SIM101 Multiple `isinstance` calls for expression, merge into a single call
SIM103 Return the condition directly
SIM113 Use `enumerate()` for index variable in `for` loop
SIM115 Use a context manager for opening files
SIM118 Use `key in dict` instead of `key in dict.keys()`
SIM201 Use `... != ...` instead of `not ... == ...`
SIM401 Use `.get()` instead of an `if` block
Co-authored-by: Chris Markiewicz <[email protected]>
@effigies effigies merged commit ccec546 into nipy:master Oct 6, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants