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-comprehensions preview rule C409 #912

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions niworkflows/interfaces/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,7 @@ def _run_interface(self, runtime):

if self.inputs.check_hdr:
hdr = nii.header
curr_units = tuple(
[None if u == 'unknown' else u for u in hdr.get_xyzt_units()]
)
curr_units = tuple(None if u == 'unknown' else u for u in hdr.get_xyzt_units())
curr_codes = (int(hdr['qform_code']), int(hdr['sform_code']))

# Default to mm, use sec if data type is bold
Expand Down Expand Up @@ -1164,9 +1162,7 @@ def _run_interface(self, runtime):

if self.inputs.check_hdr:
hdr = nii.header
curr_units = tuple(
[None if u == 'unknown' else u for u in hdr.get_xyzt_units()]
)
curr_units = tuple(None if u == 'unknown' else u for u in hdr.get_xyzt_units())
curr_codes = (int(hdr['qform_code']), int(hdr['sform_code']))

# Default to mm, use sec if data type is bold
Expand Down
4 changes: 2 additions & 2 deletions niworkflows/reports/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,9 @@ def _process_orderings(orderings, layout):
for bids_file in layout.get()
}
# remove the all None member if it exists
none_member = tuple([None for k in orderings])
none_member = tuple(None for k in orderings)
if none_member in all_value_combos:
all_value_combos.remove(tuple([None for k in orderings]))
all_value_combos.remove(tuple(None for k in orderings))
# see what values exist for each entity
unique_values = [
{value[idx] for value in all_value_combos} for idx in range(len(orderings))
Expand Down
Loading