Skip to content

Commit

Permalink
Merge pull request #912 from DimitriPapadopoulos/C4
Browse files Browse the repository at this point in the history
STY: Apply ruff/flake8-comprehensions preview rule C409
  • Loading branch information
effigies authored Dec 21, 2024
2 parents c570b3d + f6449de commit d6d726e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
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

0 comments on commit d6d726e

Please sign in to comment.