Skip to content

Commit 68e09c7

Browse files
committed
touching up format_arg super handling
1 parent 1bcc2ec commit 68e09c7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

nipype2pydra/interface/base.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ def replace_super(match):
13001300
for m in UsedSymbols.ALWAYS_OMIT_MODULES
13011301
):
13021302
raise KeyError(
1303-
f"Require special mapping for {match.group(1)} in {base} class "
1303+
f"Require special mapping for '{match.group(1)}' in {base} class "
13041304
"as methods in that module are being omitted from the conversion"
13051305
) from None
13061306
raise
@@ -1365,7 +1365,10 @@ def unwrap_nested_methods(self, method_body, additional_args=()):
13651365
)
13661366
return cleanup_function_body(method_body)
13671367

1368-
SPECIAL_SUPER_MAPPINGS = {CommandLine._list_outputs: "{}"}
1368+
SPECIAL_SUPER_MAPPINGS = {
1369+
CommandLine._list_outputs: "{}",
1370+
CommandLine._format_arg: "argstr.format(**inputs)",
1371+
}
13691372

13701373
INPUT_KEYS = [
13711374
"allowed_values",

nipype2pydra/interface/shell_command.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ def format_arg_code(self):
296296
if {val_arg} is None:
297297
return ""
298298
{body}
299-
return argstr.format(**inputs)
300299
301300
302301
"""
@@ -358,7 +357,7 @@ def defaults_code(self):
358357

359358
code_str = f"""def _gen_filename(name, inputs):
360359
parsed_inputs = _parse_inputs(inputs) if inputs else {{}}
361-
{body}
360+
{body}
362361
"""
363362
# Create separate default function for each input field with genfile, which
364363
# reference the magic "_gen_filename" method

0 commit comments

Comments
 (0)