Skip to content

Commit

Permalink
Pydra gen: added task name to input and output specs to aid debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Aug 23, 2023
1 parent e5d5e08 commit c27bd9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ namespace MR

s += "]\n\n";

s += name_string + "_input_spec = specs.SpecInfo(name='Input', fields=input_fields, bases=(specs.ShellSpec,))\n\n\n";
s += name_string + "_input_spec = specs.SpecInfo(name='" + name_string + "_input', fields=input_fields, bases=(specs.ShellSpec,))\n\n\n";

s += "output_fields = [\n";

Expand Down Expand Up @@ -1257,7 +1257,7 @@ namespace MR
}

s += "]\n";
s += name_string + "_output_spec = specs.SpecInfo(name='Output', fields=output_fields, bases=(specs.ShellOutSpec,))\n\n\n";
s += name_string + "_output_spec = specs.SpecInfo(name='" + name_string + "_output', fields=output_fields, bases=(specs.ShellOutSpec,))\n\n\n";

// Create actual class
s += "class " + name_string + "(ShellCommandTask):\n";
Expand Down
4 changes: 2 additions & 2 deletions lib/mrtrix3/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,9 +1218,9 @@ def escape_id(id_: str) -> str:
)

text += f"input_fields = {inputs_str}\n"
text += f"{task_name}_input_spec = specs.SpecInfo(name='Input', fields=input_fields, bases=(specs.ShellSpec,))\n\n"
text += f"{task_name}_input_spec = specs.SpecInfo(name='{task_name}_input', fields=input_fields, bases=(specs.ShellSpec,))\n\n"
text += f"output_fields = {outputs_str}\n"
text += f"{task_name}_output_spec = specs.SpecInfo(name='Output', fields=output_fields, bases=(specs.ShellOutSpec,))\n\n"
text += f"{task_name}_output_spec = specs.SpecInfo(name='{task_name}_output', fields=output_fields, bases=(specs.ShellOutSpec,))\n\n"
text += f"class {task_name}(ShellCommandTask):\n"
indent = " "
text += indent + "\"\"\"\n"
Expand Down

0 comments on commit c27bd9d

Please sign in to comment.