Skip to content

Commit ea4458e

Browse files
committed
sty: use f-string within normalization interface
1 parent 1f9a0cf commit ea4458e

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

niworkflows/interfaces/norm.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,20 +161,11 @@ def _get_settings(self):
161161
NIWORKFLOWS_LOG.info("User-defined settings, overriding defaults")
162162
return self.inputs.settings
163163

164-
# Define a prefix for output files based on the modality of the moving image.
165-
filestart = "{}-mni_registration_{}_".format(
166-
self.inputs.moving.lower(), self.inputs.flavor
167-
)
168-
169164
data_dir = load_data()
170165
# Get a list of settings files that match the flavor.
171-
filenames = [
172-
path.name
173-
for path in data_dir.iterdir()
174-
if path.name.startswith(filestart) and path.name.endswith(".json")
175-
]
176-
# Return the settings files.
177-
return [str(data_dir / f) for f in sorted(filenames)]
166+
return sorted([str(path) for path in data_dir.glob(
167+
f"{self.inputs.moving.lower()}-mni_registration_{self.inputs.flavor}_*.json"
168+
)])
178169

179170
def _run_interface(self, runtime):
180171
# Get a list of settings files.

0 commit comments

Comments
 (0)