diff --git a/docs/components.rst b/docs/components.rst index 46dcacbe3..d35727f2a 100644 --- a/docs/components.rst +++ b/docs/components.rst @@ -86,16 +86,16 @@ Shell Command Tasks name="Input", fields=[ ( "in_file", File, - { "help_string": "input file ...", + { "help": "input file ...", "position": 1, "mandatory": True } ), ( "out_file", str, - { "help_string": "name of output ...", + { "help": "name of output ...", "position": 2, "output_file_template": "{in_file}_br" } ), ( "mask", bool, - { "help_string": "create binary mask", + { "help": "create binary mask", "argstr": "-m", } ) ], bases=(ShellDef,) ) diff --git a/docs/input_spec.rst b/docs/input_spec.rst index bafaa37a8..4e1148c30 100644 --- a/docs/input_spec.rst +++ b/docs/input_spec.rst @@ -16,16 +16,16 @@ Let's start from the previous example: name="Input", fields=[ ( "in_file", File, - { "help_string": "input file ...", + { "help": "input file ...", "position": 1, "mandatory": True } ), ( "out_file", str, - { "help_string": "name of output ...", + { "help": "name of output ...", "position": 2, "output_file_template": "{in_file}_br" } ), ( "mask", bool, - { "help_string": "create binary mask", + { "help": "create binary mask", "argstr": "-m", } ) ], bases=(ShellDef,) ) @@ -109,10 +109,10 @@ There are also special types provided by Pydra: Metadata -------- -In the example we used multiple keys in the metadata dictionary including `help_string`, +In the example we used multiple keys in the metadata dictionary including `help`, `position`, etc. In this section all allowed key will be described: -`help_string` (`str`, mandatory): +`help` (`str`, mandatory): A short description of the input field. `mandatory` (`bool`, default: `False`): diff --git a/docs/output_spec.rst b/docs/output_spec.rst index 347b8b1a5..7ade54e2c 100644 --- a/docs/output_spec.rst +++ b/docs/output_spec.rst @@ -23,7 +23,7 @@ a customized `output_spec` can be used, e.g.: type=File, metadata={ "output_file_template": "{inp1}", - "help_string": "output file", + "help": "output file", "requires": ["inp1", "inp2"] }, ), @@ -58,7 +58,7 @@ Metadata The metadata dictionary for `output_spec` can include: -`help_string` (`str`, mandatory): +`help` (`str`, mandatory): A short description of the input field. The same as in `input_spec`. `mandatory` (`bool`, default: `False`): diff --git a/new-docs/source/tutorial/canonical-form.ipynb b/new-docs/source/tutorial/canonical-form.ipynb index 6a957aa8f..242e89351 100644 --- a/new-docs/source/tutorial/canonical-form.ipynb +++ b/new-docs/source/tutorial/canonical-form.ipynb @@ -1,287 +1,287 @@ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Canonical (dataclass) task form\n", - "\n", - "Under the hood, all Python, shell and workflow task definitions generated by the\n", - "`pydra.design.*.define` decorators/functions are translated to\n", - "[dataclasses](https://docs.python.org/3/library/dataclasses.html) by the\n", - "[Attrs](https://www.attrs.org/en/stable/). While the more compact syntax described\n", - "in the [Python-tasks](./python.html), [Shell-tasks](./shell.html) and [Workflow](./workflow.html)\n", - "tutorials is convenient when designing tasks for specific use cases, it is too magical\n", - "for linters follow. Therefore, when designing task definitions to be used by third\n", - "parties (e.g. `pydra-fsl`, `pydra-ants`) it is recommended to favour the, more\n", - "explicit, \"canonical\" dataclass form.\n", - "\n", - "The syntax of the canonical form is close to that used by the\n", - "[Attrs](https://www.attrs.org/en/stable/) package itself, with class type annotations\n", - "used to define the fields of the inputs and outputs of the task. Tasks defined in canonical\n", - "form will be able to be statically type-checked by [MyPy](https://mypy-lang.org/)." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Python-task definitions\n", - "\n", - "Python tasks in dataclass form are decorated by `pydra.design.python.define`\n", - "with inputs listed as type annotations. Outputs are similarly defined in a nested class\n", - "called `Outputs`. The function to be executed should be a staticmethod called `function`.\n", - "Default values can also be set directly, as with Attrs classes.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from pprint import pprint\n", - "from pydra.engine.helpers import fields_dict\n", - "from pydra.engine.specs import PythonDef, PythonOutputs\n", - "from pydra.design import python\n", - "\n", - "\n", - "@python.define\n", - "class CanonicalPythonDef:\n", - " \"\"\"Canonical Python task definition class for testing\n", - "\n", - " Args:\n", - " a: First input\n", - " to be inputted\n", - " b: Second input\n", - " \"\"\"\n", - "\n", - " a: int\n", - " b: float = 2.0 # set default value\n", - "\n", - " class Outputs:\n", - " \"\"\"\n", - " Args:\n", - " c: Sum of a and b\n", - " d: Product of a and b\n", - " \"\"\"\n", - "\n", - " c: float\n", - " d: float\n", - "\n", - " @staticmethod\n", - " def function(a, b):\n", - " return a + b, a / b\n", - "\n", - "pprint(fields_dict(CanonicalPythonDef))\n", - "pprint(fields_dict(CanonicalPythonDef.Outputs))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "To set additional attributes other than the type and default, such as `allowed_values`\n", - "and `validators`, `python.arg` and `python.out` can be used instead." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import attrs.validators\n", - "\n", - "\n", - "@python.define\n", - "class CanonicalPythonDef:\n", - " \"\"\"Canonical Python task definition class for testing\n", - "\n", - " Args:\n", - " a: First input\n", - " to be inputted\n", - " b: Second input\n", - " \"\"\"\n", - "\n", - " a: int = python.arg(allowed_values=[1, 2, 3, 4, 5])\n", - " b: float = python.arg(default=2.0, validator=attrs.validators.not_(0))\n", - "\n", - " class Outputs:\n", - " \"\"\"\n", - " Args:\n", - " c: Sum of a and b\n", - " d: Product of a and b\n", - " \"\"\"\n", - "\n", - " c: float\n", - " d: float\n", - "\n", - " @staticmethod\n", - " def function(a, b):\n", - " return a + b, a / b\n", - "\n", - "pprint(fields_dict(CanonicalPythonDef))\n", - "pprint(fields_dict(CanonicalPythonDef.Outputs))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "In order to allow static type-checkers to check the type of outputs of tasks added\n", - "to workflows, it is also necessary to explicitly extend from the `pydra.engine.specs.PythonDef`\n", - "and `pydra.engine.specs.PythonOutputs` classes (they are otherwise set as bases by the\n", - "`define` method implicitly). Thus the \"canonical\" is as follows" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "\n", - "@python.define\n", - "class CanonicalPythonDef(PythonDef[\"CanonicalPythonDef.Outputs\"]):\n", - " \"\"\"Canonical Python task definition class for testing\n", - "\n", - " Args:\n", - " a: First input\n", - " to be inputted\n", - " b: Second input\n", - " \"\"\"\n", - "\n", - " a: int\n", - " b: float = 2.0 # set default value\n", - "\n", - " class Outputs(PythonOutputs):\n", - " \"\"\"\n", - " Args:\n", - " c: Sum of a and b\n", - " d: Product of a and b\n", - " \"\"\"\n", - "\n", - " c: float\n", - " d: float\n", - "\n", - " @staticmethod\n", - " def function(a, b):\n", - " return a + b, a / b" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Shell-task definitions\n", - "\n", - "The canonical form of shell tasks is the same as for Python tasks, except a string `executable`\n", - "attribute replaces the `function` staticmethod." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import os\n", - "from pathlib import Path\n", - "from fileformats import generic\n", - "from pydra.design import shell\n", - "from pydra.engine.specs import ShellDef, ShellOutputs\n", - "from pydra.utils.typing import MultiInputObj\n", - "\n", - "\n", - "@shell.define\n", - "class CpWithSize(ShellDef[\"CpWithSize.Outputs\"]):\n", - "\n", - " executable = \"cp\"\n", - "\n", - " in_fs_objects: MultiInputObj[generic.FsObject]\n", - " recursive: bool = shell.arg(argstr=\"-R\")\n", - " text_arg: str = shell.arg(argstr=\"--text-arg\")\n", - " int_arg: int | None = shell.arg(argstr=\"--int-arg\")\n", - " tuple_arg: tuple[int, str] | None = shell.arg(argstr=\"--tuple-arg\")\n", - "\n", - " class Outputs(ShellOutputs):\n", - "\n", - " @staticmethod\n", - " def get_file_size(out_file: Path) -> int:\n", - " \"\"\"Calculate the file size\"\"\"\n", - " result = os.stat(out_file)\n", - " return result.st_size\n", - "\n", - " out_file: generic.File\n", - " out_file_size: int = shell.out(callable=get_file_size)\n", - "\n", - "\n", - "pprint(fields_dict(CpWithSize))\n", - "pprint(fields_dict(CpWithSize.Outputs))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Workflow definitions\n", - "\n", - "Workflows can also be defined in canonical form, which is the same as for Python tasks\n", - "but with a staticmethod called `constructor` that constructs the workflow." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "from pydra.design import python, workflow\n", - "from pydra.engine.specs import WorkflowDef, WorkflowOutputs\n", - "\n", - "# Example python task definitions\n", - "@python.define\n", - "def Add(a, b):\n", - " return a + b\n", - "\n", - "\n", - "@python.define\n", - "def Mul(a, b):\n", - " return a * b\n", - "\n", - "\n", - "@workflow.define\n", - "class CanonicalWorkflowDef(WorkflowDef[\"CanonicalWorkflowDef.Outputs\"]):\n", - "\n", - " @staticmethod\n", - " def a_converter(value):\n", - " if value is None:\n", - " return value\n", - " return float(value)\n", - "\n", - " a: int\n", - " b: float = workflow.arg(\n", - " help_string=\"A float input\",\n", - " converter=a_converter,\n", - " )\n", - "\n", - " @staticmethod\n", - " def constructor(a, b):\n", - " add = workflow.add(Add(a=a, b=b))\n", - " mul = workflow.add(Mul(a=add.out, b=b))\n", - " return mul.out\n", - "\n", - " class Outputs(WorkflowOutputs):\n", - " out: float" - ] - } - ], - "metadata": { - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 2 + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Canonical (dataclass) task form\n", + "\n", + "Under the hood, all Python, shell and workflow task definitions generated by the\n", + "`pydra.design.*.define` decorators/functions are translated to\n", + "[dataclasses](https://docs.python.org/3/library/dataclasses.html) by the\n", + "[Attrs](https://www.attrs.org/en/stable/). While the more compact syntax described\n", + "in the [Python-tasks](./python.html), [Shell-tasks](./shell.html) and [Workflow](./workflow.html)\n", + "tutorials is convenient when designing tasks for specific use cases, it is too magical\n", + "for linters follow. Therefore, when designing task definitions to be used by third\n", + "parties (e.g. `pydra-fsl`, `pydra-ants`) it is recommended to favour the, more\n", + "explicit, \"canonical\" dataclass form.\n", + "\n", + "The syntax of the canonical form is close to that used by the\n", + "[Attrs](https://www.attrs.org/en/stable/) package itself, with class type annotations\n", + "used to define the fields of the inputs and outputs of the task. Tasks defined in canonical\n", + "form will be able to be statically type-checked by [MyPy](https://mypy-lang.org/)." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Python-task definitions\n", + "\n", + "Python tasks in dataclass form are decorated by `pydra.design.python.define`\n", + "with inputs listed as type annotations. Outputs are similarly defined in a nested class\n", + "called `Outputs`. The function to be executed should be a staticmethod called `function`.\n", + "Default values can also be set directly, as with Attrs classes.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from pprint import pprint\n", + "from pydra.engine.helpers import fields_dict\n", + "from pydra.engine.specs import PythonDef, PythonOutputs\n", + "from pydra.design import python\n", + "\n", + "\n", + "@python.define\n", + "class CanonicalPythonDef:\n", + " \"\"\"Canonical Python task definition class for testing\n", + "\n", + " Args:\n", + " a: First input\n", + " to be inputted\n", + " b: Second input\n", + " \"\"\"\n", + "\n", + " a: int\n", + " b: float = 2.0 # set default value\n", + "\n", + " class Outputs:\n", + " \"\"\"\n", + " Args:\n", + " c: Sum of a and b\n", + " d: Product of a and b\n", + " \"\"\"\n", + "\n", + " c: float\n", + " d: float\n", + "\n", + " @staticmethod\n", + " def function(a, b):\n", + " return a + b, a / b\n", + "\n", + "pprint(fields_dict(CanonicalPythonDef))\n", + "pprint(fields_dict(CanonicalPythonDef.Outputs))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To set additional attributes other than the type and default, such as `allowed_values`\n", + "and `validators`, `python.arg` and `python.out` can be used instead." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import attrs.validators\n", + "\n", + "\n", + "@python.define\n", + "class CanonicalPythonDef:\n", + " \"\"\"Canonical Python task definition class for testing\n", + "\n", + " Args:\n", + " a: First input\n", + " to be inputted\n", + " b: Second input\n", + " \"\"\"\n", + "\n", + " a: int = python.arg(allowed_values=[1, 2, 3, 4, 5])\n", + " b: float = python.arg(default=2.0, validator=attrs.validators.not_(0))\n", + "\n", + " class Outputs:\n", + " \"\"\"\n", + " Args:\n", + " c: Sum of a and b\n", + " d: Product of a and b\n", + " \"\"\"\n", + "\n", + " c: float\n", + " d: float\n", + "\n", + " @staticmethod\n", + " def function(a, b):\n", + " return a + b, a / b\n", + "\n", + "pprint(fields_dict(CanonicalPythonDef))\n", + "pprint(fields_dict(CanonicalPythonDef.Outputs))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In order to allow static type-checkers to check the type of outputs of tasks added\n", + "to workflows, it is also necessary to explicitly extend from the `pydra.engine.specs.PythonDef`\n", + "and `pydra.engine.specs.PythonOutputs` classes (they are otherwise set as bases by the\n", + "`define` method implicitly). Thus the \"canonical\" is as follows" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "@python.define\n", + "class CanonicalPythonDef(PythonDef[\"CanonicalPythonDef.Outputs\"]):\n", + " \"\"\"Canonical Python task definition class for testing\n", + "\n", + " Args:\n", + " a: First input\n", + " to be inputted\n", + " b: Second input\n", + " \"\"\"\n", + "\n", + " a: int\n", + " b: float = 2.0 # set default value\n", + "\n", + " class Outputs(PythonOutputs):\n", + " \"\"\"\n", + " Args:\n", + " c: Sum of a and b\n", + " d: Product of a and b\n", + " \"\"\"\n", + "\n", + " c: float\n", + " d: float\n", + "\n", + " @staticmethod\n", + " def function(a, b):\n", + " return a + b, a / b" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Shell-task definitions\n", + "\n", + "The canonical form of shell tasks is the same as for Python tasks, except a string `executable`\n", + "attribute replaces the `function` staticmethod." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "from pathlib import Path\n", + "from fileformats import generic\n", + "from pydra.design import shell\n", + "from pydra.engine.specs import ShellDef, ShellOutputs\n", + "from pydra.utils.typing import MultiInputObj\n", + "\n", + "\n", + "@shell.define\n", + "class CpWithSize(ShellDef[\"CpWithSize.Outputs\"]):\n", + "\n", + " executable = \"cp\"\n", + "\n", + " in_fs_objects: MultiInputObj[generic.FsObject]\n", + " recursive: bool = shell.arg(argstr=\"-R\")\n", + " text_arg: str = shell.arg(argstr=\"--text-arg\")\n", + " int_arg: int | None = shell.arg(argstr=\"--int-arg\")\n", + " tuple_arg: tuple[int, str] | None = shell.arg(argstr=\"--tuple-arg\")\n", + "\n", + " class Outputs(ShellOutputs):\n", + "\n", + " @staticmethod\n", + " def get_file_size(out_file: Path) -> int:\n", + " \"\"\"Calculate the file size\"\"\"\n", + " result = os.stat(out_file)\n", + " return result.st_size\n", + "\n", + " out_file: generic.File\n", + " out_file_size: int = shell.out(callable=get_file_size)\n", + "\n", + "\n", + "pprint(fields_dict(CpWithSize))\n", + "pprint(fields_dict(CpWithSize.Outputs))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Workflow definitions\n", + "\n", + "Workflows can also be defined in canonical form, which is the same as for Python tasks\n", + "but with a staticmethod called `constructor` that constructs the workflow." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from pydra.design import python, workflow\n", + "from pydra.engine.specs import WorkflowDef, WorkflowOutputs\n", + "\n", + "# Example python task definitions\n", + "@python.define\n", + "def Add(a, b):\n", + " return a + b\n", + "\n", + "\n", + "@python.define\n", + "def Mul(a, b):\n", + " return a * b\n", + "\n", + "\n", + "@workflow.define\n", + "class CanonicalWorkflowDef(WorkflowDef[\"CanonicalWorkflowDef.Outputs\"]):\n", + "\n", + " @staticmethod\n", + " def a_converter(value):\n", + " if value is None:\n", + " return value\n", + " return float(value)\n", + "\n", + " a: int\n", + " b: float = workflow.arg(\n", + " help=\"A float input\",\n", + " converter=a_converter,\n", + " )\n", + "\n", + " @staticmethod\n", + " def constructor(a, b):\n", + " add = workflow.add(Add(a=a, b=b))\n", + " mul = workflow.add(Mul(a=add.out, b=b))\n", + " return mul.out\n", + "\n", + " class Outputs(WorkflowOutputs):\n", + " out: float" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 2 } diff --git a/new-docs/source/tutorial/python.ipynb b/new-docs/source/tutorial/python.ipynb index 8d9370c52..140500343 100644 --- a/new-docs/source/tutorial/python.ipynb +++ b/new-docs/source/tutorial/python.ipynb @@ -119,8 +119,8 @@ "@python.define(\n", " inputs={\"a\": python.arg(allowed_values=[1, 2, 3]), \"b\": python.arg(default=10.0)},\n", " outputs={\n", - " \"c\": python.out(type=float, help_string=\"the sum of the inputs\"),\n", - " \"d\": python.out(type=float, help_string=\"the difference of the inputs\"),\n", + " \"c\": python.out(type=float, help=\"the sum of the inputs\"),\n", + " \"d\": python.out(type=float, help=\"the difference of the inputs\"),\n", " },\n", ")\n", "def AugmentedTaskDef(a, b):\n", @@ -195,11 +195,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'a': arg(name='a', type=, default=EMPTY, help_string='First input to be inputted', requires=[], converter=None, validator=None, allowed_values=(), xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False),\n", - " 'b': arg(name='b', type=, default=EMPTY, help_string='Second input', requires=[], converter=None, validator=None, allowed_values=(), xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False),\n", - " 'function': arg(name='function', type=typing.Callable, default=, help_string='', requires=[], converter=None, validator=None, allowed_values=(), xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False)}\n", - "{'c': out(name='c', type=, default=EMPTY, help_string='Sum of a and b', requires=[], converter=None, validator=None),\n", - " 'd': out(name='d', type=, default=EMPTY, help_string='Product of a and b', requires=[], converter=None, validator=None)}\n" + "{'a': arg(name='a', type=, default=EMPTY, help='First input to be inputted', requires=[], converter=None, validator=None, allowed_values=(), xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False),\n", + " 'b': arg(name='b', type=, default=EMPTY, help='Second input', requires=[], converter=None, validator=None, allowed_values=(), xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False),\n", + " 'function': arg(name='function', type=typing.Callable, default=, help='', requires=[], converter=None, validator=None, allowed_values=(), xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False)}\n", + "{'c': out(name='c', type=, default=EMPTY, help='Sum of a and b', requires=[], converter=None, validator=None),\n", + " 'd': out(name='d', type=, default=EMPTY, help='Product of a and b', requires=[], converter=None, validator=None)}\n" ] } ], diff --git a/new-docs/source/tutorial/shell.ipynb b/new-docs/source/tutorial/shell.ipynb index c6f4e64af..3b90c6488 100644 --- a/new-docs/source/tutorial/shell.ipynb +++ b/new-docs/source/tutorial/shell.ipynb @@ -163,17 +163,17 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'executable': arg(name='executable', type=typing.Union[str, typing.Sequence[str]], default='cp', help_string=\"the first part of the command, can be a string, e.g. 'ls', or a list, e.g. ['ls', '-l', 'dirname']\", requires=[], converter=None, validator=, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=0, sep=None, allowed_values=None, container_path=False, formatter=None),\n", - " 'in_fs_objects': arg(name='in_fs_objects', type=pydra.utils.typing.MultiInputObj[fileformats.generic.fsobject.FsObject], default=EMPTY, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=1, sep=' ', allowed_values=None, container_path=False, formatter=None),\n", - " 'int_arg': arg(name='int_arg', type=int | None, default=None, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--int-arg', position=5, sep=None, allowed_values=None, container_path=False, formatter=None),\n", - " 'out_dir': outarg(name='out_dir', type=, default=EMPTY, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=2, sep=None, allowed_values=None, container_path=False, formatter=None, path_template='out_dir', keep_extension=False),\n", - " 'recursive': arg(name='recursive', type=, default=False, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='-R', position=3, sep=None, allowed_values=None, container_path=False, formatter=None),\n", - " 'text_arg': arg(name='text_arg', type=str | None, default=None, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--text-arg', position=4, sep=None, allowed_values=None, container_path=False, formatter=None),\n", - " 'tuple_arg': arg(name='tuple_arg', type=tuple[int, str] | None, default=None, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--tuple-arg', position=6, sep=None, allowed_values=None, container_path=False, formatter=None)}\n", - "{'out_dir': outarg(name='out_dir', type=, default=EMPTY, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=2, sep=None, allowed_values=None, container_path=False, formatter=None, path_template='out_dir', keep_extension=False),\n", - " 'return_code': out(name='return_code', type=, default=EMPTY, help_string=\"The process' exit code.\", requires=[], converter=None, validator=None, callable=None),\n", - " 'stderr': out(name='stderr', type=, default=EMPTY, help_string='The standard error stream produced by the command.', requires=[], converter=None, validator=None, callable=None),\n", - " 'stdout': out(name='stdout', type=, default=EMPTY, help_string='The standard output stream produced by the command.', requires=[], converter=None, validator=None, callable=None)}\n" + "{'executable': arg(name='executable', type=typing.Union[str, typing.Sequence[str]], default='cp', help=\"the first part of the command, can be a string, e.g. 'ls', or a list, e.g. ['ls', '-l', 'dirname']\", requires=[], converter=None, validator=, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=0, sep=None, allowed_values=None, container_path=False, formatter=None),\n", + " 'in_fs_objects': arg(name='in_fs_objects', type=pydra.utils.typing.MultiInputObj[fileformats.generic.fsobject.FsObject], default=EMPTY, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=1, sep=' ', allowed_values=None, container_path=False, formatter=None),\n", + " 'int_arg': arg(name='int_arg', type=int | None, default=None, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--int-arg', position=5, sep=None, allowed_values=None, container_path=False, formatter=None),\n", + " 'out_dir': outarg(name='out_dir', type=, default=EMPTY, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=2, sep=None, allowed_values=None, container_path=False, formatter=None, path_template='out_dir', keep_extension=False),\n", + " 'recursive': arg(name='recursive', type=, default=False, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='-R', position=3, sep=None, allowed_values=None, container_path=False, formatter=None),\n", + " 'text_arg': arg(name='text_arg', type=str | None, default=None, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--text-arg', position=4, sep=None, allowed_values=None, container_path=False, formatter=None),\n", + " 'tuple_arg': arg(name='tuple_arg', type=tuple[int, str] | None, default=None, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--tuple-arg', position=6, sep=None, allowed_values=None, container_path=False, formatter=None)}\n", + "{'out_dir': outarg(name='out_dir', type=, default=EMPTY, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=2, sep=None, allowed_values=None, container_path=False, formatter=None, path_template='out_dir', keep_extension=False),\n", + " 'return_code': out(name='return_code', type=, default=EMPTY, help=\"The process' exit code.\", requires=[], converter=None, validator=None, callable=None),\n", + " 'stderr': out(name='stderr', type=, default=EMPTY, help='The standard error stream produced by the command.', requires=[], converter=None, validator=None, callable=None),\n", + " 'stdout': out(name='stdout', type=, default=EMPTY, help='The standard output stream produced by the command.', requires=[], converter=None, validator=None, callable=None)}\n" ] } ], @@ -249,19 +249,19 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'executable': arg(name='executable', type=typing.Union[str, typing.Sequence[str]], default='cp', help_string=\"the first part of the command, can be a string, e.g. 'ls', or a list, e.g. ['ls', '-l', 'dirname']\", requires=[], converter=None, validator=, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=0, sep=None, allowed_values=None, container_path=False, formatter=None),\n", - " 'in_fs_objects': arg(name='in_fs_objects', type=pydra.utils.typing.MultiInputObj[fileformats.generic.fsobject.FsObject], default=EMPTY, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=1, sep=' ', allowed_values=None, container_path=False, formatter=None),\n", - " 'int_arg': arg(name='int_arg', type=int | None, default=None, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--int-arg', position=4, sep=None, allowed_values=None, container_path=False, formatter=None),\n", - " 'out_dir': outarg(name='out_dir', type=, default=EMPTY, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-2, sep=None, allowed_values=None, container_path=False, formatter=None, path_template='out_dir', keep_extension=False),\n", - " 'out_file': outarg(name='out_file', type=fileformats.generic.file.File | None, default=None, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-1, sep=None, allowed_values=None, container_path=False, formatter=None, path_template='out_file', keep_extension=False),\n", - " 'recursive': arg(name='recursive', type=, default=False, help_string='If source_file designates a directory, cp copies the directory and the entire subtree connected at that point.', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='-R', position=2, sep=None, allowed_values=None, container_path=False, formatter=None),\n", - " 'text_arg': arg(name='text_arg', type=, default=EMPTY, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--text-arg', position=3, sep=None, allowed_values=None, container_path=False, formatter=None),\n", - " 'tuple_arg': arg(name='tuple_arg', type=tuple[int, str], default=EMPTY, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--tuple-arg', position=5, sep=None, allowed_values=None, container_path=False, formatter=None)}\n", - "{'out_dir': outarg(name='out_dir', type=, default=EMPTY, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-2, sep=None, allowed_values=None, container_path=False, formatter=None, path_template='out_dir', keep_extension=False),\n", - " 'out_file': outarg(name='out_file', type=fileformats.generic.file.File | None, default=None, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-1, sep=None, allowed_values=None, container_path=False, formatter=None, path_template='out_file', keep_extension=False),\n", - " 'return_code': out(name='return_code', type=, default=EMPTY, help_string=\"The process' exit code.\", requires=[], converter=None, validator=None, callable=None),\n", - " 'stderr': out(name='stderr', type=, default=EMPTY, help_string='The standard error stream produced by the command.', requires=[], converter=None, validator=None, callable=None),\n", - " 'stdout': out(name='stdout', type=, default=EMPTY, help_string='The standard output stream produced by the command.', requires=[], converter=None, validator=None, callable=None)}\n" + "{'executable': arg(name='executable', type=typing.Union[str, typing.Sequence[str]], default='cp', help=\"the first part of the command, can be a string, e.g. 'ls', or a list, e.g. ['ls', '-l', 'dirname']\", requires=[], converter=None, validator=, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=0, sep=None, allowed_values=None, container_path=False, formatter=None),\n", + " 'in_fs_objects': arg(name='in_fs_objects', type=pydra.utils.typing.MultiInputObj[fileformats.generic.fsobject.FsObject], default=EMPTY, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=1, sep=' ', allowed_values=None, container_path=False, formatter=None),\n", + " 'int_arg': arg(name='int_arg', type=int | None, default=None, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--int-arg', position=4, sep=None, allowed_values=None, container_path=False, formatter=None),\n", + " 'out_dir': outarg(name='out_dir', type=, default=EMPTY, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-2, sep=None, allowed_values=None, container_path=False, formatter=None, path_template='out_dir', keep_extension=False),\n", + " 'out_file': outarg(name='out_file', type=fileformats.generic.file.File | None, default=None, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-1, sep=None, allowed_values=None, container_path=False, formatter=None, path_template='out_file', keep_extension=False),\n", + " 'recursive': arg(name='recursive', type=, default=False, help='If source_file designates a directory, cp copies the directory and the entire subtree connected at that point.', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='-R', position=2, sep=None, allowed_values=None, container_path=False, formatter=None),\n", + " 'text_arg': arg(name='text_arg', type=, default=EMPTY, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--text-arg', position=3, sep=None, allowed_values=None, container_path=False, formatter=None),\n", + " 'tuple_arg': arg(name='tuple_arg', type=tuple[int, str], default=EMPTY, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--tuple-arg', position=5, sep=None, allowed_values=None, container_path=False, formatter=None)}\n", + "{'out_dir': outarg(name='out_dir', type=, default=EMPTY, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-2, sep=None, allowed_values=None, container_path=False, formatter=None, path_template='out_dir', keep_extension=False),\n", + " 'out_file': outarg(name='out_file', type=fileformats.generic.file.File | None, default=None, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-1, sep=None, allowed_values=None, container_path=False, formatter=None, path_template='out_file', keep_extension=False),\n", + " 'return_code': out(name='return_code', type=, default=EMPTY, help=\"The process' exit code.\", requires=[], converter=None, validator=None, callable=None),\n", + " 'stderr': out(name='stderr', type=, default=EMPTY, help='The standard error stream produced by the command.', requires=[], converter=None, validator=None, callable=None),\n", + " 'stdout': out(name='stdout', type=, default=EMPTY, help='The standard output stream produced by the command.', requires=[], converter=None, validator=None, callable=None)}\n" ] } ], @@ -275,7 +275,7 @@ " \"--tuple-arg \"\n", " ),\n", " inputs={\"recursive\": shell.arg(\n", - " help_string=(\n", + " help=(\n", " \"If source_file designates a directory, cp copies the directory and \"\n", " \"the entire subtree connected at that point.\"\n", " )\n", @@ -365,17 +365,17 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'executable': arg(name='executable', type=typing.Union[str, typing.Sequence[str]], default='cp', help_string=\"the first part of the command, can be a string, e.g. 'ls', or a list, e.g. ['ls', '-l', 'dirname']\", requires=[], converter=None, validator=, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=0, sep=None, allowed_values=None, container_path=False, formatter=None),\n", - " 'in_fs_objects': arg(name='in_fs_objects', type=pydra.utils.typing.MultiInputObj[fileformats.generic.fsobject.FsObject], default=EMPTY, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=5, sep=None, allowed_values=None, container_path=False, formatter=None),\n", - " 'int_arg': arg(name='int_arg', type=int | None, default=None, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--int-arg', position=1, sep=None, allowed_values=None, container_path=False, formatter=None),\n", - " 'recursive': arg(name='recursive', type=, default=False, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='-R', position=2, sep=None, allowed_values=None, container_path=False, formatter=None),\n", - " 'text_arg': arg(name='text_arg', type=, default=EMPTY, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--text-arg', position=3, sep=None, allowed_values=None, container_path=False, formatter=None),\n", - " 'tuple_arg': arg(name='tuple_arg', type=tuple[int, str] | None, default=None, help_string='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--tuple-arg', position=4, sep=None, allowed_values=None, container_path=False, formatter=None)}\n", - "{'out_file': out(name='out_file', type=, default=EMPTY, help_string='', requires=[], converter=None, validator=None, callable=None),\n", - " 'out_file_size': out(name='out_file_size', type=, default=EMPTY, help_string='', requires=[], converter=None, validator=None, callable=),\n", - " 'return_code': out(name='return_code', type=, default=EMPTY, help_string=\"The process' exit code.\", requires=[], converter=None, validator=None, callable=None),\n", - " 'stderr': out(name='stderr', type=, default=EMPTY, help_string='The standard error stream produced by the command.', requires=[], converter=None, validator=None, callable=None),\n", - " 'stdout': out(name='stdout', type=, default=EMPTY, help_string='The standard output stream produced by the command.', requires=[], converter=None, validator=None, callable=None)}\n" + "{'executable': arg(name='executable', type=typing.Union[str, typing.Sequence[str]], default='cp', help=\"the first part of the command, can be a string, e.g. 'ls', or a list, e.g. ['ls', '-l', 'dirname']\", requires=[], converter=None, validator=, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=0, sep=None, allowed_values=None, container_path=False, formatter=None),\n", + " 'in_fs_objects': arg(name='in_fs_objects', type=pydra.utils.typing.MultiInputObj[fileformats.generic.fsobject.FsObject], default=EMPTY, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=5, sep=None, allowed_values=None, container_path=False, formatter=None),\n", + " 'int_arg': arg(name='int_arg', type=int | None, default=None, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--int-arg', position=1, sep=None, allowed_values=None, container_path=False, formatter=None),\n", + " 'recursive': arg(name='recursive', type=, default=False, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='-R', position=2, sep=None, allowed_values=None, container_path=False, formatter=None),\n", + " 'text_arg': arg(name='text_arg', type=, default=EMPTY, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--text-arg', position=3, sep=None, allowed_values=None, container_path=False, formatter=None),\n", + " 'tuple_arg': arg(name='tuple_arg', type=tuple[int, str] | None, default=None, help='', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='--tuple-arg', position=4, sep=None, allowed_values=None, container_path=False, formatter=None)}\n", + "{'out_file': out(name='out_file', type=, default=EMPTY, help='', requires=[], converter=None, validator=None, callable=None),\n", + " 'out_file_size': out(name='out_file_size', type=, default=EMPTY, help='', requires=[], converter=None, validator=None, callable=),\n", + " 'return_code': out(name='return_code', type=, default=EMPTY, help=\"The process' exit code.\", requires=[], converter=None, validator=None, callable=None),\n", + " 'stderr': out(name='stderr', type=, default=EMPTY, help='The standard error stream produced by the command.', requires=[], converter=None, validator=None, callable=None),\n", + " 'stdout': out(name='stdout', type=, default=EMPTY, help='The standard output stream produced by the command.', requires=[], converter=None, validator=None, callable=None)}\n" ] } ], @@ -432,8 +432,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "ACommand input fields: [arg(name='in_file', type=, default=EMPTY, help_string='output file', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-2, sep=None, allowed_values=None, container_path=False, formatter=None), outarg(name='out_file', type=, default=EMPTY, help_string='output file', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-1, sep=None, allowed_values=None, container_path=False, formatter=None, path_template=None, keep_extension=False), arg(name='executable', type=typing.Union[str, typing.Sequence[str]], default='a-command', help_string=\"the first part of the command, can be a string, e.g. 'ls', or a list, e.g. ['ls', '-l', 'dirname']\", requires=[], converter=None, validator=, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=0, sep=None, allowed_values=None, container_path=False, formatter=None)]\n", - "ACommand input fields: [outarg(name='out_file', type=, default=EMPTY, help_string='output file', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-1, sep=None, allowed_values=None, container_path=False, formatter=None, path_template=None, keep_extension=False), out(name='out_file_size', type=, default=EMPTY, help_string='size of the output directory', requires=[], converter=None, validator=None, callable=), out(name='return_code', type=, default=EMPTY, help_string=\"The process' exit code.\", requires=[], converter=None, validator=None, callable=None), out(name='stdout', type=, default=EMPTY, help_string='The standard output stream produced by the command.', requires=[], converter=None, validator=None, callable=None), out(name='stderr', type=, default=EMPTY, help_string='The standard error stream produced by the command.', requires=[], converter=None, validator=None, callable=None)]\n" + "ACommand input fields: [arg(name='in_file', type=, default=EMPTY, help='output file', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-2, sep=None, allowed_values=None, container_path=False, formatter=None), outarg(name='out_file', type=, default=EMPTY, help='output file', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-1, sep=None, allowed_values=None, container_path=False, formatter=None, path_template=None, keep_extension=False), arg(name='executable', type=typing.Union[str, typing.Sequence[str]], default='a-command', help=\"the first part of the command, can be a string, e.g. 'ls', or a list, e.g. ['ls', '-l', 'dirname']\", requires=[], converter=None, validator=, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=0, sep=None, allowed_values=None, container_path=False, formatter=None)]\n", + "ACommand input fields: [outarg(name='out_file', type=, default=EMPTY, help='output file', requires=[], converter=None, validator=None, xor=(), copy_mode=, copy_collation=, copy_ext_decomp=, readonly=False, argstr='', position=-1, sep=None, allowed_values=None, container_path=False, formatter=None, path_template=None, keep_extension=False), out(name='out_file_size', type=, default=EMPTY, help='size of the output directory', requires=[], converter=None, validator=None, callable=), out(name='return_code', type=, default=EMPTY, help=\"The process' exit code.\", requires=[], converter=None, validator=None, callable=None), out(name='stdout', type=, default=EMPTY, help='The standard output stream produced by the command.', requires=[], converter=None, validator=None, callable=None), out(name='stderr', type=, default=EMPTY, help='The standard error stream produced by the command.', requires=[], converter=None, validator=None, callable=None)]\n" ] } ], @@ -444,15 +444,15 @@ "ACommand = shell.define(\n", " \"a-command\",\n", " inputs={\n", - " \"in_file\": shell.arg(type=File, help_string=\"output file\", argstr=\"\", position=-2)\n", + " \"in_file\": shell.arg(type=File, help=\"output file\", argstr=\"\", position=-2)\n", " },\n", " outputs={\n", " \"out_file\": shell.outarg(\n", - " type=File, help_string=\"output file\", argstr=\"\", position=-1\n", + " type=File, help=\"output file\", argstr=\"\", position=-1\n", " ),\n", " \"out_file_size\": {\n", " \"type\": int,\n", - " \"help_string\": \"size of the output directory\",\n", + " \"help\": \"size of the output directory\",\n", " \"callable\": get_file_size,\n", " }\n", " },\n", diff --git a/pydra/design/base.py b/pydra/design/base.py index cbb9d8e5c..5524cfe93 100644 --- a/pydra/design/base.py +++ b/pydra/design/base.py @@ -166,7 +166,7 @@ class Field: from name to field, by default it is None default : Any, optional the default value for the field, by default it is EMPTY - help_string: str, optional + help: str, optional A short description of the input field. requires: str | list[str | list[str] | Requirement], optional The input fields that are required to be provided, along with the optional allowed @@ -186,7 +186,7 @@ class Field: default: ty.Any = attrs.field( default=EMPTY, converter=attrs.Converter(convert_default_value, takes_self=True) ) - help_string: str = "" + help: str = "" requires: list[RequirementSet] = attrs.field( factory=list, converter=requires_converter ) @@ -211,7 +211,7 @@ class Arg(Field): The type of the field, by default it is Any default : Any, optional the default value for the field, by default it is EMPTY - help_string: str + help: str A short description of the input field. allowed_values: list, optional List of allowed values for the field. @@ -253,7 +253,7 @@ class Out(Field): The type of the field, by default it is Any default : Any, optional the default value for the field, by default it is EMPTY - help_string: str, optional + help: str, optional A short description of the input field. requires: list, optional Names of the inputs that are required together with the field. @@ -315,8 +315,8 @@ def get_fields(klass, field_type, auto_attribs, helps) -> dict[str, Field]: fields_dict[atr_name] = atr if atr_name in type_hints: atr.type = type_hints[atr_name] - if not atr.help_string: - atr.help_string = helps.get(atr_name, "") + if not atr.help: + atr.help = helps.get(atr_name, "") elif atr_name in type_hints: if atr_name in fields_dict: fields_dict[atr_name].type = type_hints[atr_name] @@ -325,13 +325,13 @@ def get_fields(klass, field_type, auto_attribs, helps) -> dict[str, Field]: name=atr_name, type=type_hints[atr_name], default=atr, - help_string=helps.get(atr_name, ""), + help=helps.get(atr_name, ""), ) if auto_attribs: for atr_name, type_ in type_hints.items(): if atr_name not in list(fields_dict) + ["Task", "Outputs"]: fields_dict[atr_name] = field_type( - name=atr_name, type=type_, help_string=helps.get(atr_name, "") + name=atr_name, type=type_, help=helps.get(atr_name, "") ) return fields_dict @@ -582,18 +582,18 @@ def ensure_field_objects( ) else: arg.name = input_name - if not arg.help_string: - arg.help_string = input_helps.get(input_name, "") + if not arg.help: + arg.help = input_helps.get(input_name, "") elif is_type(arg): inputs[input_name] = arg_type( type=arg, name=input_name, - help_string=input_helps.get(input_name, ""), + help=input_helps.get(input_name, ""), ) elif isinstance(arg, dict): arg_kwds = copy(arg) - if "help_string" not in arg_kwds: - arg_kwds["help_string"] = input_helps.get(input_name, "") + if "help" not in arg_kwds: + arg_kwds["help"] = input_helps.get(input_name, "") inputs[input_name] = arg_type( name=input_name, **arg_kwds, @@ -616,18 +616,18 @@ def ensure_field_objects( ) else: out.name = output_name - if not out.help_string: - out.help_string = output_helps.get(output_name, "") + if not out.help: + out.help = output_helps.get(output_name, "") elif inspect.isclass(out) or ty.get_origin(out): outputs[output_name] = out_type( type=out, name=output_name, - help_string=output_helps.get(output_name, ""), + help=output_helps.get(output_name, ""), ) elif isinstance(out, dict): out_kwds = copy(out) - if "help_string" not in out_kwds: - out_kwds["help_string"] = output_helps.get(output_name, "") + if "help" not in out_kwds: + out_kwds["help"] = output_helps.get(output_name, "") outputs[output_name] = out_type( name=output_name, **out_kwds, @@ -637,7 +637,7 @@ def ensure_field_objects( name=output_name, type=ty.get_type_hints(out).get("return", ty.Any), callable=out, - help_string=re.split(r"\n\s*\n", out.__doc__)[0] if out.__doc__ else "", + help=re.split(r"\n\s*\n", out.__doc__)[0] if out.__doc__ else "", ) else: raise ValueError( diff --git a/pydra/design/boutiques.py b/pydra/design/boutiques.py index 410f85534..20bcc3efd 100644 --- a/pydra/design/boutiques.py +++ b/pydra/design/boutiques.py @@ -23,7 +23,7 @@ class arg(shell.arg): The type of the field, by default it is Any default : Any, optional the default value for the field, by default it is EMPTY - help_string: str + help: str A short description of the input field. allowed_values: list, optional List of allowed values for the field. @@ -57,7 +57,7 @@ class out(shell.out): The type of the field, by default it is Any default : Any, optional the default value for the field, by default it is EMPTY - help_string: str, optional + help: str, optional A short description of the input field. requires: list, optional Names of the inputs that are required together with the field. @@ -178,7 +178,7 @@ def _prepare_input_spec(bosh_spec: dict[str, ty.Any], names_subset=None): arg( name=name, type=tp, - help_string=input.get("description", None) or input["name"], + help=input.get("description", None) or input["name"], mandatory=not input["optional"], argstr=input.get("command-line-flag", None), ) @@ -212,7 +212,7 @@ def _prepare_output_spec(bosh_spec: dict[str, ty.Any], input_keys, names_subset= out( name=name, type=File, - help_string=output.get("description", None) or output["name"], + help=output.get("description", None) or output["name"], mandatory=not output["optional"], output_file_template=path_template, ) diff --git a/pydra/design/python.py b/pydra/design/python.py index 75b30c910..128c583fe 100644 --- a/pydra/design/python.py +++ b/pydra/design/python.py @@ -25,7 +25,7 @@ class arg(Arg): Parameters ---------- - help_string: str + help: str A short description of the input field. default : Any, optional the default value for the argument @@ -67,7 +67,7 @@ class out(Out): from name to field, by default it is None type: type, optional The type of the field, by default it is Any - help_string: str, optional + help: str, optional A short description of the input field. requires: list, optional Names of the inputs that are required together with the field. diff --git a/pydra/design/shell.py b/pydra/design/shell.py index 5e38f9ffa..9c70882e4 100644 --- a/pydra/design/shell.py +++ b/pydra/design/shell.py @@ -41,7 +41,7 @@ class arg(Arg): Parameters ---------- - help_string: str + help: str A short description of the input field. default : Any, optional the default value for the argument @@ -140,7 +140,7 @@ class outarg(Out, arg): Parameters ---------- - help_string: str + help: str A short description of the input field. default : Any, optional the default value for the argument @@ -364,7 +364,7 @@ def make( position=0, default=executable, validator=attrs.validators.min_len(1), - help_string=EXECUTABLE_HELP_STRING, + help=EXECUTABLE_HELP_STRING, ) # Set positions for the remaining inputs that don't have an explicit position diff --git a/pydra/design/tests/test_python.py b/pydra/design/tests/test_python.py index 00d233846..47d4347da 100644 --- a/pydra/design/tests/test_python.py +++ b/pydra/design/tests/test_python.py @@ -61,19 +61,19 @@ def func(a: int) -> float: SampleDef = python.define( func, - inputs={"a": python.arg(help_string="The argument to be doubled")}, - outputs={"b": python.out(help_string="the doubled output", type=Decimal)}, + inputs={"a": python.arg(help="The argument to be doubled")}, + outputs={"b": python.out(help="the doubled output", type=Decimal)}, ) assert issubclass(SampleDef, PythonDef) inputs = sorted(list_fields(SampleDef), key=sort_key) outputs = sorted(list_fields(SampleDef.Outputs), key=sort_key) assert inputs == [ - python.arg(name="a", type=int, help_string="The argument to be doubled"), + python.arg(name="a", type=int, help="The argument to be doubled"), python.arg(name="function", type=ty.Callable, default=func), ] assert outputs == [ - python.out(name="b", type=Decimal, help_string="the doubled output"), + python.out(name="b", type=Decimal, help="the doubled output"), ] outputs = SampleDef.Outputs(b=Decimal(2.0)) assert isinstance(outputs.b, Decimal) @@ -175,8 +175,8 @@ def SampleDef(a: int, b: float) -> tuple[float, float]: inputs = sorted(list_fields(SampleDef), key=sort_key) outputs = sorted(list_fields(SampleDef.Outputs), key=sort_key) assert inputs == [ - python.arg(name="a", type=int, help_string="First input to be inputted"), - python.arg(name="b", type=float, help_string="Second input"), + python.arg(name="a", type=int, help="First input to be inputted"), + python.arg(name="b", type=float, help="Second input"), python.arg( name="function", type=ty.Callable, @@ -184,8 +184,8 @@ def SampleDef(a: int, b: float) -> tuple[float, float]: ), ] assert outputs == [ - python.out(name="c", type=float, help_string="Sum of a and b"), - python.out(name="d", type=float, help_string="product of a and b"), + python.out(name="c", type=float, help="Sum of a and b"), + python.out(name="d", type=float, help="product of a and b"), ] assert attrs.fields(SampleDef).function.default.__name__ == "SampleDef" @@ -210,8 +210,8 @@ def SampleDef(a: int, b: float) -> tuple[float, float]: inputs = sorted(list_fields(SampleDef), key=sort_key) outputs = sorted(list_fields(SampleDef.Outputs), key=sort_key) assert inputs == [ - python.arg(name="a", type=int, help_string="First input to be inputted"), - python.arg(name="b", type=float, help_string="Second input"), + python.arg(name="a", type=int, help="First input to be inputted"), + python.arg(name="b", type=float, help="Second input"), python.arg( name="function", type=ty.Callable, @@ -219,8 +219,8 @@ def SampleDef(a: int, b: float) -> tuple[float, float]: ), ] assert outputs == [ - python.out(name="c", type=float, help_string="Sum of a and b"), - python.out(name="d", type=float, help_string="Product of a and b"), + python.out(name="c", type=float, help="Sum of a and b"), + python.out(name="d", type=float, help="Product of a and b"), ] assert attrs.fields(SampleDef).function.default.__name__ == "SampleDef" @@ -253,8 +253,8 @@ def SampleDef(a: int, b: float) -> tuple[float, float]: inputs = sorted(list_fields(SampleDef), key=sort_key) outputs = sorted(list_fields(SampleDef.Outputs), key=sort_key) assert inputs == [ - python.arg(name="a", type=int, help_string="First input to be inputted"), - python.arg(name="b", type=float, help_string="Second input"), + python.arg(name="a", type=int, help="First input to be inputted"), + python.arg(name="b", type=float, help="Second input"), python.arg( name="function", type=ty.Callable, @@ -262,8 +262,8 @@ def SampleDef(a: int, b: float) -> tuple[float, float]: ), ] assert outputs == [ - python.out(name="c", type=float, help_string="Sum of a and b"), - python.out(name="d", type=float, help_string="Product of a and b"), + python.out(name="c", type=float, help="Sum of a and b"), + python.out(name="d", type=float, help="Product of a and b"), ] assert attrs.fields(SampleDef).function.default.__name__ == "SampleDef" @@ -301,8 +301,8 @@ def function(a, b): inputs = sorted(list_fields(SampleDef), key=sort_key) outputs = sorted(list_fields(SampleDef.Outputs), key=sort_key) assert inputs == [ - python.arg(name="a", type=int, help_string="First input to be inputted"), - python.arg(name="b", type=float, default=2.0, help_string="Second input"), + python.arg(name="a", type=int, help="First input to be inputted"), + python.arg(name="b", type=float, default=2.0, help="Second input"), python.arg( name="function", type=ty.Callable, @@ -310,8 +310,8 @@ def function(a, b): ), ] assert outputs == [ - python.out(name="c", type=float, help_string="Sum of a and b"), - python.out(name="d", type=float, help_string="Product of a and b"), + python.out(name="c", type=float, help="Sum of a and b"), + python.out(name="d", type=float, help="Product of a and b"), ] assert SampleDef.function.__name__ == "function" SampleDef(a=1) @@ -353,14 +353,14 @@ def function(a, b): def test_interface_with_class_no_auto_attribs(): @python.define(auto_attribs=False) class SampleDef: - a: int = python.arg(help_string="First input to be inputted") - b: float = python.arg(help_string="Second input") + a: int = python.arg(help="First input to be inputted") + b: float = python.arg(help="Second input") x: int class Outputs: - c: float = python.out(help_string="Sum of a and b") - d: float = python.out(help_string="Product of a and b") + c: float = python.out(help="Sum of a and b") + d: float = python.out(help="Product of a and b") y: str @@ -372,8 +372,8 @@ def function(a, b): inputs = sorted(list_fields(SampleDef), key=sort_key) outputs = sorted(list_fields(SampleDef.Outputs), key=sort_key) assert inputs == [ - python.arg(name="a", type=int, help_string="First input to be inputted"), - python.arg(name="b", type=float, help_string="Second input"), + python.arg(name="a", type=int, help="First input to be inputted"), + python.arg(name="b", type=float, help="Second input"), python.arg( name="function", type=ty.Callable, @@ -381,8 +381,8 @@ def function(a, b): ), ] assert outputs == [ - python.out(name="c", type=float, help_string="Sum of a and b"), - python.out(name="d", type=float, help_string="Product of a and b"), + python.out(name="c", type=float, help="Sum of a and b"), + python.out(name="d", type=float, help="Product of a and b"), ] assert SampleDef.function.__name__ == "function" SampleDef(a=1, b=2.0) diff --git a/pydra/design/tests/test_shell.py b/pydra/design/tests/test_shell.py index 1f35b4e82..316c7db6f 100644 --- a/pydra/design/tests/test_shell.py +++ b/pydra/design/tests/test_shell.py @@ -36,7 +36,7 @@ def test_interface_template(): default="cp", type=str | ty.Sequence[str], position=0, - help_string=shell.EXECUTABLE_HELP_STRING, + help=shell.EXECUTABLE_HELP_STRING, ), shell.arg(name="in_path", type=FsObject, position=1), output, @@ -46,17 +46,17 @@ def test_interface_template(): shell.out( name="return_code", type=int, - help_string=RETURN_CODE_HELP, + help=RETURN_CODE_HELP, ), shell.out( name="stderr", type=str, - help_string=STDERR_HELP, + help=STDERR_HELP, ), shell.out( name="stdout", type=str, - help_string=STDOUT_HELP, + help=STDOUT_HELP, ), ] intf = Cp(in_path=File.mock("in-path.txt")) @@ -83,7 +83,7 @@ def test_interface_template_w_types_and_path_template_ext(): default="trim-png", type=str | ty.Sequence[str], position=0, - help_string=shell.EXECUTABLE_HELP_STRING, + help=shell.EXECUTABLE_HELP_STRING, ), shell.arg(name="in_image", type=image.Png, position=1), output, @@ -93,17 +93,17 @@ def test_interface_template_w_types_and_path_template_ext(): shell.out( name="return_code", type=int, - help_string=RETURN_CODE_HELP, + help=RETURN_CODE_HELP, ), shell.out( name="stderr", type=str, - help_string=STDERR_HELP, + help=STDERR_HELP, ), shell.out( name="stdout", type=str, - help_string=STDOUT_HELP, + help=STDOUT_HELP, ), ] TrimPng(in_image=image.Png.mock()) @@ -123,7 +123,7 @@ def test_interface_template_w_modify(): default="trim-png", type=str | ty.Sequence[str], position=0, - help_string=shell.EXECUTABLE_HELP_STRING, + help=shell.EXECUTABLE_HELP_STRING, ), shell.arg( name="image", type=image.Png, position=1, copy_mode=File.CopyMode.copy @@ -138,17 +138,17 @@ def test_interface_template_w_modify(): shell.out( name="return_code", type=int, - help_string=RETURN_CODE_HELP, + help=RETURN_CODE_HELP, ), shell.out( name="stderr", type=str, - help_string=STDERR_HELP, + help=STDERR_HELP, ), shell.out( name="stdout", type=str, - help_string=STDOUT_HELP, + help=STDOUT_HELP, ), ] TrimPng(image=image.Png.mock()) @@ -181,7 +181,7 @@ def test_interface_template_more_complex(): default="cp", type=str | ty.Sequence[str], position=0, - help_string=shell.EXECUTABLE_HELP_STRING, + help=shell.EXECUTABLE_HELP_STRING, ), shell.arg( name="in_fs_objects", type=MultiInputObj[FsObject], position=1, sep=" " @@ -215,17 +215,17 @@ def test_interface_template_more_complex(): shell.out( name="return_code", type=int, - help_string=RETURN_CODE_HELP, + help=RETURN_CODE_HELP, ), shell.out( name="stderr", type=str, - help_string=STDERR_HELP, + help=STDERR_HELP, ), shell.out( name="stdout", type=str, - help_string=STDOUT_HELP, + help=STDOUT_HELP, ), ] Cp(in_fs_objects=[File.sample(), File.sample(seed=1)]) @@ -247,7 +247,7 @@ def test_interface_template_with_overrides_and_optionals(): "--int-arg " "--tuple-arg " ), - inputs={"recursive": shell.arg(help_string=RECURSIVE_HELP)}, + inputs={"recursive": shell.arg(help=RECURSIVE_HELP)}, outputs={ "out_dir": shell.outarg(position=-2), "out_file": shell.outarg(position=-1), @@ -279,7 +279,7 @@ def test_interface_template_with_overrides_and_optionals(): default="cp", type=str | ty.Sequence[str], position=0, - help_string=shell.EXECUTABLE_HELP_STRING, + help=shell.EXECUTABLE_HELP_STRING, ), shell.arg( name="in_fs_objects", type=MultiInputObj[FsObject], position=1, sep=" " @@ -289,7 +289,7 @@ def test_interface_template_with_overrides_and_optionals(): argstr="-R", type=bool, default=False, - help_string=RECURSIVE_HELP, + help=RECURSIVE_HELP, position=2, ), shell.arg(name="text_arg", argstr="--text-arg", type=str, position=3), @@ -313,17 +313,17 @@ def test_interface_template_with_overrides_and_optionals(): shell.out( name="return_code", type=int, - help_string=RETURN_CODE_HELP, + help=RETURN_CODE_HELP, ), shell.out( name="stderr", type=str, - help_string=STDERR_HELP, + help=STDERR_HELP, ), shell.out( name="stdout", type=str, - help_string=STDOUT_HELP, + help=STDOUT_HELP, ), ] @@ -354,7 +354,7 @@ def test_interface_template_with_defaults(): default="cp", type=str | ty.Sequence[str], position=0, - help_string=shell.EXECUTABLE_HELP_STRING, + help=shell.EXECUTABLE_HELP_STRING, ), shell.arg( name="in_fs_objects", type=MultiInputObj[FsObject], position=1, sep=" " @@ -378,17 +378,17 @@ def test_interface_template_with_defaults(): shell.out( name="return_code", type=int, - help_string=RETURN_CODE_HELP, + help=RETURN_CODE_HELP, ), shell.out( name="stderr", type=str, - help_string=STDERR_HELP, + help=STDERR_HELP, ), shell.out( name="stdout", type=str, - help_string=STDOUT_HELP, + help=STDOUT_HELP, ), ] Cp(in_fs_objects=[File.sample(), File.sample(seed=1)]) @@ -422,7 +422,7 @@ def test_interface_template_with_type_overrides(): default="cp", type=str | ty.Sequence[str], position=0, - help_string=shell.EXECUTABLE_HELP_STRING, + help=shell.EXECUTABLE_HELP_STRING, ), shell.arg( name="in_fs_objects", type=MultiInputObj[FsObject], position=1, sep=" " @@ -448,17 +448,17 @@ def test_interface_template_with_type_overrides(): shell.out( name="return_code", type=int, - help_string=RETURN_CODE_HELP, + help=RETURN_CODE_HELP, ), shell.out( name="stderr", type=str, - help_string=STDERR_HELP, + help=STDERR_HELP, ), shell.out( name="stdout", type=str, - help_string=STDOUT_HELP, + help=STDOUT_HELP, ), ] @@ -472,17 +472,17 @@ class Ls(ShellDef["Ls.Outputs"]): executable = "ls" directory: Directory = shell.arg( - help_string="the directory to list the contents of", + help="the directory to list the contents of", argstr="", position=-1, ) hidden: bool = shell.arg( - help_string=("display hidden FS objects"), + help=("display hidden FS objects"), argstr="-a", default=False, ) long_format: bool = shell.arg( - help_string=( + help=( "display properties of FS object, such as permissions, size and " "timestamps " ), @@ -490,20 +490,20 @@ class Ls(ShellDef["Ls.Outputs"]): argstr="-l", ) human_readable: bool = shell.arg( - help_string="display file sizes in human readable form", + help="display file sizes in human readable form", argstr="-h", default=False, requires=["long_format"], ) complete_date: bool = shell.arg( - help_string="Show complete date in long format", + help="Show complete date in long format", argstr="-T", default=False, requires=["long_format"], xor=["date_format_str"], ) date_format_str: str | None = shell.arg( - help_string="format string for ", + help="format string for ", argstr="-D", default=None, requires=["long_format"], @@ -513,7 +513,7 @@ class Ls(ShellDef["Ls.Outputs"]): @shell.outputs class Outputs(ShellOutputs): entries: list = shell.out( - help_string="list of entries returned by ls command", + help="list of entries returned by ls command", callable=list_entries, ) @@ -523,18 +523,18 @@ class Outputs(ShellOutputs): inputs={ "directory": shell.arg( type=Directory, - help_string="the directory to list the contents of", + help="the directory to list the contents of", argstr="", position=-1, ), "hidden": shell.arg( type=bool, - help_string="display hidden FS objects", + help="display hidden FS objects", argstr="-a", ), "long_format": { # Mix it up with a full dictionary based definition "type": bool, - "help_string": ( + "help": ( "display properties of FS object, such as permissions, size and " "timestamps " ), @@ -542,13 +542,13 @@ class Outputs(ShellOutputs): }, "human_readable": shell.arg( type=bool, - help_string="display file sizes in human readable form", + help="display file sizes in human readable form", argstr="-h", requires=["long_format"], ), "complete_date": shell.arg( type=bool, - help_string="Show complete date in long format", + help="Show complete date in long format", argstr="-T", default=False, requires=["long_format"], @@ -556,7 +556,7 @@ class Outputs(ShellOutputs): ), "date_format_str": shell.arg( type=str | None, - help_string="format string for ", + help="format string for ", argstr="-D", requires=["long_format"], xor=["complete_date"], @@ -565,7 +565,7 @@ class Outputs(ShellOutputs): outputs={ "entries": shell.out( type=list, - help_string="list of entries returned by ls command", + help="list of entries returned by ls command", callable=list_entries, ) }, @@ -667,7 +667,7 @@ class Outputs: inputs={ "x": shell.arg( type=File, - help_string="an input file", + help="an input file", argstr="", position=1, ), @@ -675,7 +675,7 @@ class Outputs: outputs={ "y": shell.outarg( type=File, - help_string="path of output file", + help="path of output file", argstr="", path_template="{x}_out", ), @@ -699,11 +699,11 @@ class A: executable = "cp" - x: File = shell.arg(help_string="an input file", argstr="", position=1) + x: File = shell.arg(help="an input file", argstr="", position=1) class Outputs: y: File = shell.outarg( - help_string="the output file", + help="the output file", path_template="{x}_out", argstr="", position=-1, @@ -719,7 +719,7 @@ class Outputs: output = shell.outarg( name="y", type=File, - help_string="the output file", + help="the output file", path_template="{x}_out", argstr="", position=-1, @@ -732,12 +732,12 @@ class Outputs: type=str | ty.Sequence[str], argstr="", position=0, - help_string=shell.EXECUTABLE_HELP_STRING, + help=shell.EXECUTABLE_HELP_STRING, ), shell.arg( name="x", type=File, - help_string="an input file", + help="an input file", argstr="", position=1, ), @@ -748,17 +748,17 @@ class Outputs: shell.out( name="return_code", type=int, - help_string=RETURN_CODE_HELP, + help=RETURN_CODE_HELP, ), shell.out( name="stderr", type=str, - help_string=STDERR_HELP, + help=STDERR_HELP, ), shell.out( name="stdout", type=str, - help_string=STDOUT_HELP, + help=STDOUT_HELP, ), ] @@ -770,7 +770,7 @@ def test_shell_output_field_name_dynamic(): inputs={ "x": shell.arg( type=File, - help_string="an input file", + help="an input file", argstr="", position=1, ), @@ -778,7 +778,7 @@ def test_shell_output_field_name_dynamic(): outputs={ "y": shell.outarg( type=File, - help_string="path of output file", + help="path of output file", argstr="", path_template="{x}_out", ), @@ -796,13 +796,11 @@ def get_file_size(y: Path): def test_shell_bases_dynamic(A, tmp_path): B = shell.define( name="B", - inputs={ - "y": shell.arg(type=File, help_string="output file", argstr="", position=-1) - }, + inputs={"y": shell.arg(type=File, help="output file", argstr="", position=-1)}, outputs={ "out_file_size": { "type": int, - "help_string": "size of the output directory", + "help": "size of the output directory", "callable": get_file_size, } }, @@ -863,7 +861,7 @@ def test_shell_inputs_outputs_bases_dynamic(tmp_path): inputs={ "directory": shell.arg( type=Directory, - help_string="input directory", + help="input directory", argstr="", position=-1, ) @@ -871,7 +869,7 @@ def test_shell_inputs_outputs_bases_dynamic(tmp_path): outputs={ "entries": shell.out( type=list, - help_string="list of entries returned by ls command", + help="list of entries returned by ls command", callable=list_entries, ) }, @@ -883,7 +881,7 @@ def test_shell_inputs_outputs_bases_dynamic(tmp_path): "hidden": shell.arg( type=bool, argstr="-a", - help_string="show hidden files", + help="show hidden files", default=False, ) }, @@ -906,20 +904,18 @@ def test_shell_inputs_outputs_bases_static(tmp_path): class A: executable = "ls" - directory: Directory = shell.arg( - help_string="input directory", argstr="", position=-1 - ) + directory: Directory = shell.arg(help="input directory", argstr="", position=-1) class Outputs: entries: list = shell.out( - help_string="list of entries returned by ls command", + help="list of entries returned by ls command", callable=list_entries, ) @shell.define class B(A): hidden: bool = shell.arg( - help_string="show hidden files", + help="show hidden files", argstr="-a", default=False, ) @@ -941,12 +937,12 @@ def test_shell_missing_executable_static(): @shell.define class A: directory: Directory = shell.arg( - help_string="input directory", argstr="", position=-1 + help="input directory", argstr="", position=-1 ) class Outputs: entries: list = shell.out( - help_string="list of entries returned by ls command", + help="list of entries returned by ls command", callable=list_entries, ) @@ -961,7 +957,7 @@ def test_shell_missing_executable_dynamic(): inputs={ "directory": shell.arg( type=Directory, - help_string="input directory", + help="input directory", argstr="", position=-1, ), @@ -969,7 +965,7 @@ def test_shell_missing_executable_dynamic(): outputs={ "entries": shell.out( type=list, - help_string="list of entries returned by ls command", + help="list of entries returned by ls command", callable=list_entries, ) }, diff --git a/pydra/design/tests/test_workflow.py b/pydra/design/tests/test_workflow.py index 10d091db3..086155d8b 100644 --- a/pydra/design/tests/test_workflow.py +++ b/pydra/design/tests/test_workflow.py @@ -137,7 +137,7 @@ class MyTestWorkflow(WorkflowDef["MyTestWorkflow.Outputs"]): a: int b: float = workflow.arg( - help_string="A float input", + help="A float input", converter=a_converter, ) @@ -159,9 +159,7 @@ class Outputs(WorkflowOutputs): # if this is a good idea or not assert sorted(list_fields(MyTestWorkflow), key=attrgetter("name")) == [ workflow.arg(name="a", type=int), - workflow.arg( - name="b", type=float, help_string="A float input", converter=a_converter - ), + workflow.arg(name="b", type=float, help="A float input", converter=a_converter), workflow.arg(name="constructor", type=ty.Callable, default=constructor), ] assert list_fields(MyTestWorkflow.Outputs) == [ @@ -262,15 +260,15 @@ def MyTestWorkflow(a: int, b: float) -> tuple[float, float]: return mul.out, divide.divided assert list_fields(MyTestWorkflow) == [ - workflow.arg(name="a", type=int, help_string="An integer input"), - workflow.arg(name="b", type=float, help_string="A float input"), + workflow.arg(name="a", type=int, help="An integer input"), + workflow.arg(name="b", type=float, help="A float input"), workflow.arg( name="constructor", type=ty.Callable, default=MyTestWorkflow().constructor ), ] assert list_fields(MyTestWorkflow.Outputs) == [ - workflow.out(name="out1", type=float, help_string="The first output"), - workflow.out(name="out2", type=float, help_string="The second output"), + workflow.out(name="out1", type=float, help="The first output"), + workflow.out(name="out2", type=float, help="The second output"), ] workflow_spec = MyTestWorkflow(a=1, b=2.0) wf = Workflow.construct(workflow_spec) diff --git a/pydra/design/workflow.py b/pydra/design/workflow.py index 25d89f3e1..fe700c5cb 100644 --- a/pydra/design/workflow.py +++ b/pydra/design/workflow.py @@ -27,7 +27,7 @@ class arg(Arg): Parameters ---------- - help_string: str + help: str A short description of the input field. default : Any, optional the default value for the argument @@ -72,7 +72,7 @@ class out(Out): from name to field, by default it is None type: type, optional The type of the field, by default it is Any - help_string: str, optional + help: str, optional A short description of the input field. requires: list, optional Names of the inputs that are required together with the field. diff --git a/pydra/engine/core.py b/pydra/engine/core.py index 33dcb885c..aa42e99e7 100644 --- a/pydra/engine/core.py +++ b/pydra/engine/core.py @@ -1020,8 +1020,8 @@ async def _run_task(self, submitter, rerun=False, environment=None): # wf_out_nm, lf = con # task_nm, task_out_nm = lf.name, lf.field # if task_out_nm == "all_": - # help_string = f"all outputs from {task_nm}" - # fields.append((wf_out_nm, dict, {"help_string": help_string})) + # help = f"all outputs from {task_nm}" + # fields.append((wf_out_nm, dict, {"help": help})) # else: # from pydra.utils.typing import TypeParser @@ -1029,14 +1029,14 @@ async def _run_task(self, submitter, rerun=False, environment=None): # # providing proper type and some help string # task_output_spec = getattr(self, task_nm).output_spec # out_fld = attr.fields_dict(task_output_spec)[task_out_nm] - # help_string = ( - # f"{out_fld.metadata.get('help_string', '')} (from {task_nm})" + # help = ( + # f"{out_fld.metadata.get('help', '')} (from {task_nm})" # ) # if TypeParser.get_origin(lf.type) is StateArray: # type_ = TypeParser.get_item_type(lf.type) # else: # type_ = lf.type - # fields.append((wf_out_nm, type_, {"help_string": help_string})) + # fields.append((wf_out_nm, type_, {"help": help})) # self.output_spec = SpecInfo(name="Output", fields=fields, bases=(BaseDef,)) # logger.info("Added %s to %s", self.output_spec, self) diff --git a/pydra/engine/specs.py b/pydra/engine/specs.py index 5c18b27ae..9d9f27320 100644 --- a/pydra/engine/specs.py +++ b/pydra/engine/specs.py @@ -484,9 +484,9 @@ class WorkflowDef(TaskDef[WorkflowOutputsType]): class ShellOutputs(TaskOutputs): """Output definition of a generic shell process.""" - return_code: int = shell.out(help_string=RETURN_CODE_HELP) - stdout: str = shell.out(help_string=STDOUT_HELP) - stderr: str = shell.out(help_string=STDERR_HELP) + return_code: int = shell.out(help=RETURN_CODE_HELP) + stdout: str = shell.out(help=STDOUT_HELP) + stderr: str = shell.out(help=STDERR_HELP) @classmethod def from_task( diff --git a/pydra/engine/tests/test_dockertask.py b/pydra/engine/tests/test_dockertask.py index c11d212a0..d6893fac5 100644 --- a/pydra/engine/tests/test_dockertask.py +++ b/pydra/engine/tests/test_dockertask.py @@ -114,7 +114,7 @@ def test_docker_outputspec_1(plugin, tmp_path): customised output_spec, adding files to the output, providing specific pathname output_path is automatically added to the bindings """ - outputs = [shell.out(name="newfile", type=File, help_string="new file")] + outputs = [shell.out(name="newfile", type=File, help="new file")] docky = shell.define("touch newfile_tmp.txt", outputs=outputs)( environment=Docker(image="ubuntu") ) @@ -143,7 +143,7 @@ def test_docker_inputspec_1(tmp_path): mandatory=True, position=1, argstr="", - help_string="input file", + help="input file", ) ] @@ -176,7 +176,7 @@ def test_docker_inputspec_1a(tmp_path): default=filename, position=1, argstr="", - help_string="input file", + help="input file", ) ] @@ -209,7 +209,7 @@ def test_docker_inputspec_2(plugin, tmp_path): type=File, position=1, argstr="", - help_string="input file 1", + help="input file 1", ), shell.arg( name="file2", @@ -217,7 +217,7 @@ def test_docker_inputspec_2(plugin, tmp_path): default=filename_2, position=2, argstr="", - help_string="input file 2", + help="input file 2", ), ] docky = shell.define(cmd, inputs=inputs)( @@ -253,7 +253,7 @@ def test_docker_inputspec_2a_except(plugin, tmp_path): default=filename_1, position=1, argstr="", - help_string="input file 1", + help="input file 1", ), shell.arg( name="file2", @@ -261,7 +261,7 @@ def test_docker_inputspec_2a_except(plugin, tmp_path): mandatory=True, position=2, argstr="", - help_string="input file 2", + help="input file 2", ), ] @@ -299,7 +299,7 @@ def test_docker_inputspec_2a(plugin, tmp_path): default=filename_1, position=1, argstr="", - help_string="input file 1", + help="input file 1", ), shell.arg( name="file2", @@ -307,7 +307,7 @@ def test_docker_inputspec_2a(plugin, tmp_path): mandatory=True, position=2, argstr="", - help_string="input file 2", + help="input file 2", ), ] @@ -338,7 +338,7 @@ def test_docker_inputspec_3(plugin, tmp_path): mandatory=True, position=1, argstr="", - help_string="input file", + help="input file", container_path=True, ) ] @@ -375,14 +375,14 @@ def test_docker_cmd_inputspec_copyfile_1(plugin, tmp_path): mandatory=True, position=1, argstr="", - help_string="orig file", + help="orig file", copyfile="copy", ), shell.arg( name="out_file", type=str, output_file_template="{orig_file}", - help_string="output file", + help="output file", ), ] @@ -426,7 +426,7 @@ def test_docker_inputspec_state_1(plugin, tmp_path): mandatory=True, position=1, argstr="", - help_string="input file", + help="input file", ) ] @@ -463,7 +463,7 @@ def test_docker_inputspec_state_1b(plugin, tmp_path): mandatory=True, position=1, argstr="", - help_string="input file", + help="input file", ) ] docky = shell.define(cmd, inputs=inputs)( @@ -493,7 +493,7 @@ def test_docker_wf_inputspec_1(plugin, tmp_path): mandatory=True, position=1, argstr="", - help_string="input file", + help="input file", ) ] @@ -536,7 +536,7 @@ def test_docker_wf_state_inputspec_1(plugin, tmp_path): mandatory=True, position=1, argstr="", - help_string="input file", + help="input file", ) ] @@ -581,7 +581,7 @@ def test_docker_wf_ndst_inputspec_1(plugin, tmp_path): mandatory=True, position=1, argstr="", - help_string="input file", + help="input file", ) ] diff --git a/pydra/engine/tests/test_environments.py b/pydra/engine/tests/test_environments.py index 85366d605..d306381c6 100644 --- a/pydra/engine/tests/test_environments.py +++ b/pydra/engine/tests/test_environments.py @@ -178,7 +178,7 @@ def create_shelly_inputfile(tempdir, filename, name, executable): name="file", type=File, position=1, - help_string="files", + help="files", mandatory=True, argstr="", ) @@ -354,14 +354,14 @@ def create_shelly_outputfile(tempdir, filename, name, executable="cp"): name="file_orig", type=File, position=2, - help_string="new file", + help="new file", argstr="", ), shell.arg( name="file_copy", type=str, output_file_template="{file_orig}_copy", - help_string="output file", + help="output file", argstr="", ), ] diff --git a/pydra/engine/tests/test_helpers_file.py b/pydra/engine/tests/test_helpers_file.py index ee0479133..2d9d97cbd 100644 --- a/pydra/engine/tests/test_helpers_file.py +++ b/pydra/engine/tests/test_helpers_file.py @@ -367,7 +367,7 @@ def test_output_template(tmp_path): "mandatory": True, "position": 1, "argstr": "", - "help_string": "input file", + "help": "input file", }, ), ), @@ -380,7 +380,7 @@ def test_output_template(tmp_path): "position": 2, "argstr": "--opt", "output_file_template": "{in_file}.out", - "help_string": "optional file output", + "help": "optional file output", }, ), ), diff --git a/pydra/engine/tests/test_nipype1_convert.py b/pydra/engine/tests/test_nipype1_convert.py index c51ead782..60739bd6e 100644 --- a/pydra/engine/tests/test_nipype1_convert.py +++ b/pydra/engine/tests/test_nipype1_convert.py @@ -12,7 +12,7 @@ def find_txt(output_dir: Path) -> File: return files[0] -interf_inputs = [shell.arg(name="test", type=ty.Any, help_string="test")] +interf_inputs = [shell.arg(name="test", type=ty.Any, help="test")] interf_outputs = [shell.out(name="test_out", type=File, callable=find_txt)] @@ -26,7 +26,7 @@ class Interf_3(ShellDef["Interf_3.Outputs"]): executable = ["testing", "command"] - in_file: str = shell.arg(help_string="in_file", argstr="{in_file}") + in_file: str = shell.arg(help="in_file", argstr="{in_file}") @shell.outputs class Outputs(ShellOutputs): @@ -37,9 +37,7 @@ class Outputs(ShellOutputs): class TouchInterf(ShellDef["TouchInterf.Outputs"]): """class with customized input and executables""" - new_file: str = shell.outarg( - help_string="new_file", argstr="", path_template="{new_file}" - ) + new_file: str = shell.outarg(help="new_file", argstr="", path_template="{new_file}") executable = "touch" @shell.outputs @@ -57,7 +55,7 @@ def test_interface_specs_2(): """testing if class input/output definition are overwritten properly by the user's specs""" my_input_spec = SpecInfo( name="Input", - fields=[("my_inp", ty.Any, {"help_string": "my inp"})], + fields=[("my_inp", ty.Any, {"help": "my inp"})], bases=(ShellDef,), ) my_output_spec = SpecInfo( diff --git a/pydra/engine/tests/test_shelltask.py b/pydra/engine/tests/test_shelltask.py index e5507a24d..b8ee5494a 100644 --- a/pydra/engine/tests/test_shelltask.py +++ b/pydra/engine/tests/test_shelltask.py @@ -292,7 +292,7 @@ def test_shell_cmd_inputspec_1(plugin, results_function, tmp_path): "opt_n", attr.ib( type=bool, - metadata={"position": 1, "argstr": "-n", "help_string": "option"}, + metadata={"position": 1, "argstr": "-n", "help": "option"}, ), ) ], @@ -333,14 +333,14 @@ def test_shell_cmd_inputspec_2(plugin, results_function, tmp_path): "opt_hello", attr.ib( type=str, - metadata={"position": 3, "help_string": "todo", "argstr": ""}, + metadata={"position": 3, "help": "todo", "argstr": ""}, ), ), ( "opt_n", attr.ib( type=bool, - metadata={"position": 1, "help_string": "todo", "argstr": "-n"}, + metadata={"position": 1, "help": "todo", "argstr": "-n"}, ), ), ], @@ -378,7 +378,7 @@ def test_shell_cmd_inputspec_3(plugin, results_function, tmp_path): type=str, metadata={ "position": 1, - "help_string": "text", + "help": "text", "mandatory": True, "argstr": "", }, @@ -415,7 +415,7 @@ def test_shell_cmd_inputspec_3a(plugin, results_function, tmp_path): ( "text", str, - {"position": 1, "help_string": "text", "mandatory": True, "argstr": ""}, + {"position": 1, "help": "text", "mandatory": True, "argstr": ""}, ) ], bases=(ShellDef,), @@ -449,7 +449,7 @@ def test_shell_cmd_inputspec_3b(plugin, results_function, tmp_path): type=str, metadata={ "position": 1, - "help_string": "text", + "help": "text", "mandatory": True, "argstr": "", }, @@ -483,7 +483,7 @@ def test_shell_cmd_inputspec_3c_exception(plugin, tmp_path): type=str, metadata={ "position": 1, - "help_string": "text", + "help": "text", "mandatory": True, "argstr": "", }, @@ -516,7 +516,7 @@ def test_shell_cmd_inputspec_3c(plugin, results_function, tmp_path): default=None, metadata={ "position": 1, - "help_string": "text", + "help": "text", "mandatory": False, "argstr": "", }, @@ -549,7 +549,7 @@ def test_shell_cmd_inputspec_4(plugin, results_function, tmp_path): attr.ib( type=str, default="Hello", - metadata={"position": 1, "help_string": "text", "argstr": ""}, + metadata={"position": 1, "help": "text", "argstr": ""}, ), ) ], @@ -576,9 +576,7 @@ def test_shell_cmd_inputspec_4a(plugin, results_function, tmp_path): cmd_exec = "echo" my_input_spec = SpecInfo( name="Input", - fields=[ - ("text", str, "Hello", {"position": 1, "help_string": "text", "argstr": ""}) - ], + fields=[("text", str, "Hello", {"position": 1, "help": "text", "argstr": ""})], bases=(ShellDef,), ) @@ -606,7 +604,7 @@ def test_shell_cmd_inputspec_4b(plugin, results_function, tmp_path): attr.ib( type=str, default="Hi", - metadata={"position": 1, "help_string": "text", "argstr": ""}, + metadata={"position": 1, "help": "text", "argstr": ""}, ), ) ], @@ -638,7 +636,7 @@ def test_shell_cmd_inputspec_4c_exception(plugin): default="Hello", metadata={ "position": 1, - "help_string": "text", + "help": "text", "mandatory": True, "argstr": "", }, @@ -668,7 +666,7 @@ def test_shell_cmd_inputspec_4d_exception(plugin): default="Hello", metadata={ "position": 1, - "help_string": "text", + "help": "text", "output_file_template": "exception", "argstr": "", }, @@ -699,7 +697,7 @@ def test_shell_cmd_inputspec_5_nosubm(plugin, results_function, tmp_path): type=bool, metadata={ "position": 1, - "help_string": "opt t", + "help": "opt t", "argstr": "-t", "xor": ["opt_S"], }, @@ -711,7 +709,7 @@ def test_shell_cmd_inputspec_5_nosubm(plugin, results_function, tmp_path): type=bool, metadata={ "position": 2, - "help_string": "opt S", + "help": "opt S", "argstr": "-S", "xor": ["opt_t"], }, @@ -748,7 +746,7 @@ def test_shell_cmd_inputspec_5a_exception(plugin, tmp_path): type=bool, metadata={ "position": 1, - "help_string": "opt t", + "help": "opt t", "argstr": "-t", "xor": ["opt_S"], }, @@ -760,7 +758,7 @@ def test_shell_cmd_inputspec_5a_exception(plugin, tmp_path): type=bool, metadata={ "position": 2, - "help_string": "opt S", + "help": "opt S", "argstr": "-S", "xor": ["opt_t"], }, @@ -800,7 +798,7 @@ def test_shell_cmd_inputspec_6(plugin, results_function, tmp_path): type=bool, metadata={ "position": 2, - "help_string": "opt t", + "help": "opt t", "argstr": "-t", "requires": ["opt_l"], }, @@ -810,7 +808,7 @@ def test_shell_cmd_inputspec_6(plugin, results_function, tmp_path): "opt_l", attr.ib( type=bool, - metadata={"position": 1, "help_string": "opt l", "argstr": "-l"}, + metadata={"position": 1, "help": "opt l", "argstr": "-l"}, ), ), ], @@ -846,7 +844,7 @@ def test_shell_cmd_inputspec_6a_exception(plugin): type=bool, metadata={ "position": 2, - "help_string": "opt t", + "help": "opt t", "argstr": "-t", "requires": ["opt_l"], }, @@ -856,7 +854,7 @@ def test_shell_cmd_inputspec_6a_exception(plugin): "opt_l", attr.ib( type=bool, - metadata={"position": 1, "help_string": "opt l", "argstr": "-l"}, + metadata={"position": 1, "help": "opt l", "argstr": "-l"}, ), ), ], @@ -888,7 +886,7 @@ def test_shell_cmd_inputspec_6b(plugin, results_function, tmp_path): type=bool, metadata={ "position": 2, - "help_string": "opt t", + "help": "opt t", "argstr": "-t", "requires": ["opt_l"], }, @@ -898,7 +896,7 @@ def test_shell_cmd_inputspec_6b(plugin, results_function, tmp_path): "opt_l", attr.ib( type=bool, - metadata={"position": 1, "help_string": "opt l", "argstr": "-l"}, + metadata={"position": 1, "help": "opt l", "argstr": "-l"}, ), ), ], @@ -938,7 +936,7 @@ def test_shell_cmd_inputspec_7(plugin, results_function, tmp_path): type=str, metadata={ "output_file_template": "{args}", - "help_string": "output file", + "help": "output file", }, ), ) @@ -983,7 +981,7 @@ def test_shell_cmd_inputspec_7a(plugin, results_function, tmp_path): metadata={ "output_file_template": "{args}", "output_field_name": "out1_changed", - "help_string": "output file", + "help": "output file", }, ), ) @@ -1021,7 +1019,7 @@ def test_shell_cmd_inputspec_7b(plugin, results_function, tmp_path): "newfile", attr.ib( type=str, - metadata={"position": 1, "help_string": "new file", "argstr": ""}, + metadata={"position": 1, "help": "new file", "argstr": ""}, ), ), ( @@ -1030,7 +1028,7 @@ def test_shell_cmd_inputspec_7b(plugin, results_function, tmp_path): type=str, metadata={ "output_file_template": "{newfile}", - "help_string": "output file", + "help": "output file", }, ), ), @@ -1069,7 +1067,7 @@ def test_shell_cmd_inputspec_7c(plugin, results_function, tmp_path): type=str, metadata={ "output_file_template": "{args}.txt", - "help_string": "output file", + "help": "output file", }, ), ) @@ -1107,7 +1105,7 @@ def test_shell_cmd_inputspec_8(plugin, results_function, tmp_path): "newfile", attr.ib( type=str, - metadata={"position": 2, "help_string": "new file", "argstr": ""}, + metadata={"position": 2, "help": "new file", "argstr": ""}, ), ), ( @@ -1117,7 +1115,7 @@ def test_shell_cmd_inputspec_8(plugin, results_function, tmp_path): metadata={ "position": 1, "argstr": "-t", - "help_string": "time of modif.", + "help": "time of modif.", }, ), ), @@ -1127,7 +1125,7 @@ def test_shell_cmd_inputspec_8(plugin, results_function, tmp_path): type=str, metadata={ "output_file_template": "{newfile}", - "help_string": "output file", + "help": "output file", }, ), ), @@ -1164,7 +1162,7 @@ def test_shell_cmd_inputspec_8a(plugin, results_function, tmp_path): "newfile", attr.ib( type=str, - metadata={"position": 2, "help_string": "new file", "argstr": ""}, + metadata={"position": 2, "help": "new file", "argstr": ""}, ), ), ( @@ -1174,7 +1172,7 @@ def test_shell_cmd_inputspec_8a(plugin, results_function, tmp_path): metadata={ "position": 1, "argstr": "-t {time}", - "help_string": "time of modif.", + "help": "time of modif.", }, ), ), @@ -1184,7 +1182,7 @@ def test_shell_cmd_inputspec_8a(plugin, results_function, tmp_path): type=str, metadata={ "output_file_template": "{newfile}", - "help_string": "output file", + "help": "output file", }, ), ), @@ -1225,7 +1223,7 @@ def test_shell_cmd_inputspec_9(tmp_path, plugin, results_function): "file_orig", attr.ib( type=File, - metadata={"position": 2, "help_string": "new file", "argstr": ""}, + metadata={"position": 2, "help": "new file", "argstr": ""}, ), ), ( @@ -1234,7 +1232,7 @@ def test_shell_cmd_inputspec_9(tmp_path, plugin, results_function): type=str, metadata={ "output_file_template": "{file_orig}_copy", - "help_string": "output file", + "help": "output file", "argstr": "", }, ), @@ -1278,7 +1276,7 @@ def test_shell_cmd_inputspec_9a(tmp_path, plugin, results_function): "file_orig", attr.ib( type=File, - metadata={"position": 2, "help_string": "new file", "argstr": ""}, + metadata={"position": 2, "help": "new file", "argstr": ""}, ), ), ( @@ -1287,7 +1285,7 @@ def test_shell_cmd_inputspec_9a(tmp_path, plugin, results_function): type=str, metadata={ "output_file_template": "{file_orig}_copy", - "help_string": "output file", + "help": "output file", "argstr": "", }, ), @@ -1325,7 +1323,7 @@ def test_shell_cmd_inputspec_9b(tmp_path, plugin, results_function): "file_orig", attr.ib( type=File, - metadata={"position": 2, "help_string": "new file", "argstr": ""}, + metadata={"position": 2, "help": "new file", "argstr": ""}, ), ), ( @@ -1335,7 +1333,7 @@ def test_shell_cmd_inputspec_9b(tmp_path, plugin, results_function): metadata={ "output_file_template": "{file_orig}_copy", "keep_extension": False, - "help_string": "output file", + "help": "output file", "argstr": "", }, ), @@ -1376,7 +1374,7 @@ def test_shell_cmd_inputspec_9c(tmp_path, plugin, results_function): "file_orig", attr.ib( type=File, - metadata={"position": 2, "help_string": "new file", "argstr": ""}, + metadata={"position": 2, "help": "new file", "argstr": ""}, ), ), ( @@ -1386,7 +1384,7 @@ def test_shell_cmd_inputspec_9c(tmp_path, plugin, results_function): metadata={ "output_file_template": "{file_orig}", "keep_extension": False, - "help_string": "output file", + "help": "output file", "argstr": "", }, ), @@ -1429,7 +1427,7 @@ def test_shell_cmd_inputspec_9d(tmp_path, plugin, results_function): "file_orig", attr.ib( type=File, - metadata={"position": 2, "help_string": "new file", "argstr": ""}, + metadata={"position": 2, "help": "new file", "argstr": ""}, ), ), ( @@ -1438,7 +1436,7 @@ def test_shell_cmd_inputspec_9d(tmp_path, plugin, results_function): type=str, metadata={ "output_file_template": "{file_orig}_copy", - "help_string": "output file", + "help": "output file", "argstr": "", }, ), @@ -1489,7 +1487,7 @@ def test_shell_cmd_inputspec_10(plugin, results_function, tmp_path): "position": 1, "argstr": "...", "sep": " ", - "help_string": "list of files", + "help": "list of files", "mandatory": True, }, ), @@ -1537,7 +1535,7 @@ def test_shell_cmd_inputspec_10_err(tmp_path): metadata={ "position": 1, "argstr": "", - "help_string": "a file", + "help": "a file", "mandatory": True, }, ), @@ -1560,7 +1558,7 @@ def test_shell_cmd_inputspec_11(tmp_path): type=MultiInputObj[str], metadata={ "argstr": "...", - "help_string": "The list of input image files to be segmented.", + "help": "The list of input image files to be segmented.", }, ), ) @@ -1572,7 +1570,7 @@ def test_shell_cmd_inputspec_11(tmp_path): attr.ib( type=MultiOutputFile, metadata={ - "help_string": "Corrected Output Images: should specify the same number of images as inputVolume, if only one element is given, then it is used as a file pattern where %s is replaced by the imageVolumeType, and %d by the index list location.", + "help": "Corrected Output Images: should specify the same number of images as inputVolume, if only one element is given, then it is used as a file pattern where %s is replaced by the imageVolumeType, and %d by the index list location.", "output_file_template": "{inputFiles}", }, ), @@ -1633,14 +1631,14 @@ def template_function(inputs): "file_orig", attr.ib( type=File, - metadata={"position": 2, "help_string": "new file", "argstr": ""}, + metadata={"position": 2, "help": "new file", "argstr": ""}, ), ), ( "number", attr.ib( type=int, - metadata={"help_string": "a number", "mandatory": True}, + metadata={"help": "a number", "mandatory": True}, ), ), ( @@ -1649,7 +1647,7 @@ def template_function(inputs): type=str, metadata={ "output_file_template": template_function, - "help_string": "output file", + "help": "output file", "argstr": "", }, ), @@ -1686,7 +1684,7 @@ def test_shell_cmd_inputspec_with_iterable(): "iterable_1", ty.Iterable[int], { - "help_string": "iterable input 1", + "help": "iterable input 1", "argstr": "--in1", }, ), @@ -1694,7 +1692,7 @@ def test_shell_cmd_inputspec_with_iterable(): "iterable_2", ty.Iterable[str], { - "help_string": "iterable input 2", + "help": "iterable input 2", "argstr": "--in2...", }, ), @@ -1732,7 +1730,7 @@ def test_shell_cmd_inputspec_copyfile_1(plugin, results_function, tmp_path): metadata={ "position": 1, "argstr": "", - "help_string": "orig file", + "help": "orig file", "mandatory": True, "copyfile": True, }, @@ -1744,7 +1742,7 @@ def test_shell_cmd_inputspec_copyfile_1(plugin, results_function, tmp_path): type=str, metadata={ "output_file_template": "{orig_file}", - "help_string": "output file", + "help": "output file", }, ), ), @@ -1794,7 +1792,7 @@ def test_shell_cmd_inputspec_copyfile_1a(plugin, results_function, tmp_path): metadata={ "position": 1, "argstr": "", - "help_string": "orig file", + "help": "orig file", "mandatory": True, "copyfile": "hardlink", }, @@ -1806,7 +1804,7 @@ def test_shell_cmd_inputspec_copyfile_1a(plugin, results_function, tmp_path): type=str, metadata={ "output_file_template": "{orig_file}", - "help_string": "output file", + "help": "output file", }, ), ), @@ -1873,7 +1871,7 @@ def test_shell_cmd_inputspec_copyfile_1b(plugin, results_function, tmp_path): metadata={ "position": 1, "argstr": "", - "help_string": "orig file", + "help": "orig file", "mandatory": True, }, ), @@ -1884,7 +1882,7 @@ def test_shell_cmd_inputspec_copyfile_1b(plugin, results_function, tmp_path): type=str, metadata={ "output_file_template": "{orig_file}", - "help_string": "output file", + "help": "output file", }, ), ), @@ -1923,7 +1921,7 @@ def test_shell_cmd_inputspec_state_1(plugin, results_function, tmp_path): type=str, metadata={ "position": 1, - "help_string": "text", + "help": "text", "mandatory": True, "argstr": "", }, @@ -1961,7 +1959,7 @@ def test_shell_cmd_inputspec_typeval_1(): "text", attr.ib( type=int, - metadata={"position": 1, "argstr": "", "help_string": "text"}, + metadata={"position": 1, "argstr": "", "help": "text"}, ), ) ], @@ -1980,7 +1978,7 @@ def test_shell_cmd_inputspec_typeval_2(): my_input_spec = SpecInfo( name="Input", - fields=[("text", int, {"position": 1, "argstr": "", "help_string": "text"})], + fields=[("text", int, {"position": 1, "argstr": "", "help": "text"})], bases=(ShellDef,), ) @@ -2000,7 +1998,7 @@ def test_shell_cmd_inputspec_state_1a(plugin, results_function, tmp_path): ( "text", str, - {"position": 1, "help_string": "text", "mandatory": True, "argstr": ""}, + {"position": 1, "help": "text", "mandatory": True, "argstr": ""}, ) ], bases=(ShellDef,), @@ -2037,7 +2035,7 @@ def test_shell_cmd_inputspec_state_2(plugin, results_function, tmp_path): type=str, metadata={ "output_file_template": "{args}", - "help_string": "output file", + "help": "output file", }, ), ) @@ -2081,7 +2079,7 @@ def test_shell_cmd_inputspec_state_3(plugin, results_function, tmp_path): type=File, metadata={ "position": 1, - "help_string": "files", + "help": "files", "mandatory": True, "argstr": "", }, @@ -2131,7 +2129,7 @@ def test_shell_cmd_inputspec_copyfile_state_1(plugin, results_function, tmp_path metadata={ "position": 1, "argstr": "", - "help_string": "orig file", + "help": "orig file", "mandatory": True, "copyfile": "copy", }, @@ -2143,7 +2141,7 @@ def test_shell_cmd_inputspec_copyfile_state_1(plugin, results_function, tmp_path type=str, metadata={ "output_file_template": "{orig_file}", - "help_string": "output file", + "help": "output file", }, ), ), @@ -2195,7 +2193,7 @@ def test_wf_shell_cmd_2(plugin_dask_opt, tmp_path): type=str, metadata={ "output_file_template": "{args}", - "help_string": "output file", + "help": "output file", }, ), ) @@ -2242,7 +2240,7 @@ def test_wf_shell_cmd_2a(plugin, tmp_path): type=str, metadata={ "output_file_template": "{args}", - "help_string": "output file", + "help": "output file", }, ), ) @@ -2290,7 +2288,7 @@ def test_wf_shell_cmd_3(plugin, tmp_path): type=str, metadata={ "output_file_template": "{args}", - "help_string": "output file", + "help": "output file", }, ), ) @@ -2307,7 +2305,7 @@ def test_wf_shell_cmd_3(plugin, tmp_path): type=File, metadata={ "position": 1, - "help_string": "output file", + "help": "output file", "argstr": "", }, ), @@ -2320,7 +2318,7 @@ def test_wf_shell_cmd_3(plugin, tmp_path): "position": 2, "argstr": "", "output_file_template": "{orig_file}_copy", - "help_string": "output file", + "help": "output file", }, ), ), @@ -2387,7 +2385,7 @@ def test_wf_shell_cmd_3a(plugin, tmp_path): type=str, metadata={ "output_file_template": "{args}", - "help_string": "output file", + "help": "output file", }, ), ) @@ -2404,7 +2402,7 @@ def test_wf_shell_cmd_3a(plugin, tmp_path): type=str, metadata={ "position": 1, - "help_string": "output file", + "help": "output file", "argstr": "", }, ), @@ -2417,7 +2415,7 @@ def test_wf_shell_cmd_3a(plugin, tmp_path): "position": 2, "argstr": "", "output_file_template": "{orig_file}_cp", - "help_string": "output file", + "help": "output file", }, ), ), @@ -2482,7 +2480,7 @@ def test_wf_shell_cmd_state_1(plugin, tmp_path): type=str, metadata={ "output_file_template": "{args}", - "help_string": "output file", + "help": "output file", }, ), ) @@ -2499,7 +2497,7 @@ def test_wf_shell_cmd_state_1(plugin, tmp_path): type=str, metadata={ "position": 1, - "help_string": "output file", + "help": "output file", "argstr": "", }, ), @@ -2512,7 +2510,7 @@ def test_wf_shell_cmd_state_1(plugin, tmp_path): "position": 2, "argstr": "", "output_file_template": "{orig_file}_copy", - "help_string": "output file", + "help": "output file", }, ), ), @@ -2580,7 +2578,7 @@ def test_wf_shell_cmd_ndst_1(plugin, tmp_path): type=str, metadata={ "output_file_template": "{args}", - "help_string": "output file", + "help": "output file", }, ), ) @@ -2597,7 +2595,7 @@ def test_wf_shell_cmd_ndst_1(plugin, tmp_path): type=str, metadata={ "position": 1, - "help_string": "output file", + "help": "output file", "argstr": "", }, ), @@ -2610,7 +2608,7 @@ def test_wf_shell_cmd_ndst_1(plugin, tmp_path): "position": 2, "argstr": "", "output_file_template": "{orig_file}_copy", - "help_string": "output file", + "help": "output file", }, ), ), @@ -2924,7 +2922,7 @@ def test_shell_cmd_outputspec_6(plugin, results_function, tmp_path): type=File, metadata={ "output_file_template": "{args}", - "help_string": "output file", + "help": "output file", }, ), ) @@ -2959,7 +2957,7 @@ def test_shell_cmd_outputspec_6a(): ( "out1", File, - {"output_file_template": "{args}", "help_string": "output file"}, + {"output_file_template": "{args}", "help": "output file"}, ) ], bases=(ShellOutputs,), @@ -2994,7 +2992,7 @@ def test_shell_cmd_outputspec_7(tmp_path, plugin, results_function): attr.ib( type=File, metadata={ - "help_string": "script file", + "help": "script file", "mandatory": True, "position": 1, "argstr": "", @@ -3009,7 +3007,7 @@ def test_shell_cmd_outputspec_7(tmp_path, plugin, results_function): "position": 2, "argstr": "...", "sep": " ", - "help_string": "list of name indices", + "help": "list of name indices", "mandatory": True, }, ), @@ -3027,7 +3025,7 @@ def test_shell_cmd_outputspec_7(tmp_path, plugin, results_function): type=MultiOutputFile, metadata={ "output_file_template": "file{files_id}.txt", - "help_string": "output file", + "help": "output file", }, ), ) @@ -3070,7 +3068,7 @@ def test_shell_cmd_outputspec_7a(tmp_path, plugin, results_function): attr.ib( type=File, metadata={ - "help_string": "script file", + "help": "script file", "mandatory": True, "position": 1, "argstr": "", @@ -3085,7 +3083,7 @@ def test_shell_cmd_outputspec_7a(tmp_path, plugin, results_function): "position": 2, "argstr": "...", "sep": " ", - "help_string": "list of name indices", + "help": "list of name indices", "mandatory": True, }, ), @@ -3103,7 +3101,7 @@ def test_shell_cmd_outputspec_7a(tmp_path, plugin, results_function): type=MultiOutputFile, metadata={ "output_file_template": "file{files_id}.txt", - "help_string": "output file", + "help": "output file", }, ), ) @@ -3155,7 +3153,7 @@ def get_stderr(stderr): type=File, metadata={ "output_file_template": "{args}", - "help_string": "output file", + "help": "output file", }, ), ), @@ -3163,7 +3161,7 @@ def get_stderr(stderr): "out_file_index", attr.ib( type=int, - metadata={"help_string": "output file", "callable": get_file_index}, + metadata={"help": "output file", "callable": get_file_index}, ), ), ( @@ -3171,7 +3169,7 @@ def get_stderr(stderr): attr.ib( type=str, metadata={ - "help_string": "The standard error output", + "help": "The standard error output", "callable": get_stderr, }, ), @@ -3203,9 +3201,7 @@ def test_shell_cmd_outputspec_8b_error(): fields=[ ( "out", - attr.ib( - type=int, metadata={"help_string": "output file", "value": "val"} - ), + attr.ib(type=int, metadata={"help": "output file", "value": "val"}), ) ], bases=(ShellOutputs,), @@ -3239,7 +3235,7 @@ def get_lowest_directory(directory_path): type=Directory, metadata={ "output_file_template": "{args}", - "help_string": "output file", + "help": "output file", }, ), ) @@ -3282,7 +3278,7 @@ def get_lowest_directory(directory_path): type=str, metadata={ "position": 1, - "help_string": "new directory", + "help": "new directory", "argstr": "", }, ), @@ -3300,7 +3296,7 @@ def get_lowest_directory(directory_path): type=Directory, metadata={ "output_file_template": "{resultsDir}", - "help_string": "output file", + "help": "output file", }, ), ) @@ -3347,7 +3343,7 @@ def test_shell_cmd_state_outputspec_1(plugin, results_function, tmp_path): type=File, metadata={ "output_file_template": "{args}", - "help_string": "output file", + "help": "output file", }, ), ) @@ -3413,12 +3409,12 @@ def test_shell_cmd_inputspec_outputspec_1(): ( "file1", str, - {"help_string": "1st creadted file", "argstr": "", "position": 1}, + {"help": "1st creadted file", "argstr": "", "position": 1}, ), ( "file2", str, - {"help_string": "2nd creadted file", "argstr": "", "position": 2}, + {"help": "2nd creadted file", "argstr": "", "position": 2}, ), ], bases=(ShellDef,), @@ -3430,12 +3426,12 @@ def test_shell_cmd_inputspec_outputspec_1(): ( "newfile1", File, - {"output_file_template": "{file1}", "help_string": "newfile 1"}, + {"output_file_template": "{file1}", "help": "newfile 1"}, ), ( "newfile2", File, - {"output_file_template": "{file2}", "help_string": "newfile 2"}, + {"output_file_template": "{file2}", "help": "newfile 2"}, ), ], bases=(ShellOutputs,), @@ -3467,12 +3463,12 @@ def test_shell_cmd_inputspec_outputspec_1a(): ( "file1", str, - {"help_string": "1st creadted file", "argstr": "", "position": 1}, + {"help": "1st creadted file", "argstr": "", "position": 1}, ), ( "file2", str, - {"help_string": "2nd creadted file", "argstr": "", "position": 2}, + {"help": "2nd creadted file", "argstr": "", "position": 2}, ), ], bases=(ShellDef,), @@ -3484,12 +3480,12 @@ def test_shell_cmd_inputspec_outputspec_1a(): ( "newfile1", File, - {"output_file_template": "{file1}", "help_string": "newfile 1"}, + {"output_file_template": "{file1}", "help": "newfile 1"}, ), ( "newfile2", File, - {"output_file_template": "{file2}", "help_string": "newfile 2"}, + {"output_file_template": "{file2}", "help": "newfile 2"}, ), ], bases=(ShellOutputs,), @@ -3520,12 +3516,12 @@ def test_shell_cmd_inputspec_outputspec_2(): ( "file1", str, - {"help_string": "1st creadted file", "argstr": "", "position": 1}, + {"help": "1st creadted file", "argstr": "", "position": 1}, ), ( "file2", str, - {"help_string": "2nd creadted file", "argstr": "", "position": 2}, + {"help": "2nd creadted file", "argstr": "", "position": 2}, ), ], bases=(ShellDef,), @@ -3539,7 +3535,7 @@ def test_shell_cmd_inputspec_outputspec_2(): File, { "output_file_template": "{file1}", - "help_string": "newfile 1", + "help": "newfile 1", "requires": ["file1"], }, ), @@ -3548,7 +3544,7 @@ def test_shell_cmd_inputspec_outputspec_2(): File, { "output_file_template": "{file2}", - "help_string": "newfile 1", + "help": "newfile 1", "requires": ["file1", "file2"], }, ), @@ -3587,12 +3583,12 @@ def test_shell_cmd_inputspec_outputspec_2a(): ( "file1", str, - {"help_string": "1st creadted file", "argstr": "", "position": 1}, + {"help": "1st creadted file", "argstr": "", "position": 1}, ), ( "file2", str, - {"help_string": "2nd creadted file", "argstr": "", "position": 2}, + {"help": "2nd creadted file", "argstr": "", "position": 2}, ), ], bases=(ShellDef,), @@ -3606,7 +3602,7 @@ def test_shell_cmd_inputspec_outputspec_2a(): File, { "output_file_template": "{file1}", - "help_string": "newfile 1", + "help": "newfile 1", "requires": ["file1"], }, ), @@ -3615,7 +3611,7 @@ def test_shell_cmd_inputspec_outputspec_2a(): File, { "output_file_template": "{file2}", - "help_string": "newfile 1", + "help": "newfile 1", "requires": ["file1", "file2"], }, ), @@ -3662,14 +3658,14 @@ def test_shell_cmd_inputspec_outputspec_3(): ( "file1", str, - {"help_string": "1st creadted file", "argstr": "", "position": 1}, + {"help": "1st creadted file", "argstr": "", "position": 1}, ), ( "file2", str, - {"help_string": "2nd creadted file", "argstr": "", "position": 2}, + {"help": "2nd creadted file", "argstr": "", "position": 2}, ), - ("additional_inp", int, {"help_string": "additional inp"}), + ("additional_inp", int, {"help": "additional inp"}), ], bases=(ShellDef,), ) @@ -3680,14 +3676,14 @@ def test_shell_cmd_inputspec_outputspec_3(): ( "newfile1", File, - {"output_file_template": "{file1}", "help_string": "newfile 1"}, + {"output_file_template": "{file1}", "help": "newfile 1"}, ), ( "newfile2", File, { "output_file_template": "{file2}", - "help_string": "newfile 1", + "help": "newfile 1", "requires": ["file1", "additional_inp"], }, ), @@ -3723,14 +3719,14 @@ def test_shell_cmd_inputspec_outputspec_3a(): ( "file1", str, - {"help_string": "1st creadted file", "argstr": "", "position": 1}, + {"help": "1st creadted file", "argstr": "", "position": 1}, ), ( "file2", str, - {"help_string": "2nd creadted file", "argstr": "", "position": 2}, + {"help": "2nd creadted file", "argstr": "", "position": 2}, ), - ("additional_inp", str, {"help_string": "additional inp"}), + ("additional_inp", str, {"help": "additional inp"}), ], bases=(ShellDef,), ) @@ -3741,14 +3737,14 @@ def test_shell_cmd_inputspec_outputspec_3a(): ( "newfile1", File, - {"output_file_template": "{file1}", "help_string": "newfile 1"}, + {"output_file_template": "{file1}", "help": "newfile 1"}, ), ( "newfile2", File, { "output_file_template": "{file2}", - "help_string": "newfile 1", + "help": "newfile 1", "requires": ["file1", "additional_inp"], }, ), @@ -3797,9 +3793,9 @@ def test_shell_cmd_inputspec_outputspec_4(): ( "file1", str, - {"help_string": "1st creadted file", "argstr": "", "position": 1}, + {"help": "1st creadted file", "argstr": "", "position": 1}, ), - ("additional_inp", int, {"help_string": "additional inp"}), + ("additional_inp", int, {"help": "additional inp"}), ], bases=(ShellDef,), ) @@ -3812,7 +3808,7 @@ def test_shell_cmd_inputspec_outputspec_4(): File, { "output_file_template": "{file1}", - "help_string": "newfile 1", + "help": "newfile 1", "requires": ["file1", ("additional_inp", [2, 3])], }, ) @@ -3852,9 +3848,9 @@ def test_shell_cmd_inputspec_outputspec_4a(): ( "file1", str, - {"help_string": "1st creadted file", "argstr": "", "position": 1}, + {"help": "1st creadted file", "argstr": "", "position": 1}, ), - ("additional_inp", int, {"help_string": "additional inp"}), + ("additional_inp", int, {"help": "additional inp"}), ], bases=(ShellDef,), ) @@ -3867,7 +3863,7 @@ def test_shell_cmd_inputspec_outputspec_4a(): File, { "output_file_template": "{file1}", - "help_string": "newfile 1", + "help": "newfile 1", "requires": ["file1", ("additional_inp", [2, 3])], }, ) @@ -3902,10 +3898,10 @@ def test_shell_cmd_inputspec_outputspec_5(): ( "file1", str, - {"help_string": "1st creadted file", "argstr": "", "position": 1}, + {"help": "1st creadted file", "argstr": "", "position": 1}, ), - ("additional_inp_A", int, {"help_string": "additional inp A"}), - ("additional_inp_B", str, {"help_string": "additional inp B"}), + ("additional_inp_A", int, {"help": "additional inp A"}), + ("additional_inp_B", str, {"help": "additional inp B"}), ], bases=(ShellDef,), ) @@ -3918,7 +3914,7 @@ def test_shell_cmd_inputspec_outputspec_5(): File, { "output_file_template": "{file1}", - "help_string": "newfile 1", + "help": "newfile 1", # requires is a list of list so it's treated as el[0] OR el[1] OR... "requires": [ ["file1", "additional_inp_A"], @@ -3956,10 +3952,10 @@ def test_shell_cmd_inputspec_outputspec_5a(): ( "file1", str, - {"help_string": "1st creadted file", "argstr": "", "position": 1}, + {"help": "1st creadted file", "argstr": "", "position": 1}, ), - ("additional_inp_A", str, {"help_string": "additional inp A"}), - ("additional_inp_B", int, {"help_string": "additional inp B"}), + ("additional_inp_A", str, {"help": "additional inp A"}), + ("additional_inp_B", int, {"help": "additional inp B"}), ], bases=(ShellDef,), ) @@ -3972,7 +3968,7 @@ def test_shell_cmd_inputspec_outputspec_5a(): File, { "output_file_template": "{file1}", - "help_string": "newfile 1", + "help": "newfile 1", # requires is a list of list so it's treated as el[0] OR el[1] OR... "requires": [ ["file1", "additional_inp_A"], @@ -4010,10 +4006,10 @@ def test_shell_cmd_inputspec_outputspec_5b(): ( "file1", str, - {"help_string": "1st creadted file", "argstr": "", "position": 1}, + {"help": "1st creadted file", "argstr": "", "position": 1}, ), - ("additional_inp_A", str, {"help_string": "additional inp A"}), - ("additional_inp_B", str, {"help_string": "additional inp B"}), + ("additional_inp_A", str, {"help": "additional inp A"}), + ("additional_inp_B", str, {"help": "additional inp B"}), ], bases=(ShellDef,), ) @@ -4026,7 +4022,7 @@ def test_shell_cmd_inputspec_outputspec_5b(): File, { "output_file_template": "{file1}", - "help_string": "newfile 1", + "help": "newfile 1", # requires is a list of list so it's treated as el[0] OR el[1] OR... "requires": [ ["file1", "additional_inp_A"], @@ -4063,9 +4059,9 @@ def test_shell_cmd_inputspec_outputspec_6_except(): ( "file1", str, - {"help_string": "1st creadted file", "argstr": "", "position": 1}, + {"help": "1st creadted file", "argstr": "", "position": 1}, ), - ("additional_inp_A", str, {"help_string": "additional inp A"}), + ("additional_inp_A", str, {"help": "additional inp A"}), ], bases=(ShellDef,), ) @@ -4078,7 +4074,7 @@ def test_shell_cmd_inputspec_outputspec_6_except(): File, { "output_file_template": "{file1}", - "help_string": "newfile 1", + "help": "newfile 1", # requires has invalid syntax "requires": [["file1", "additional_inp_A"], "file1"], }, @@ -4130,7 +4126,7 @@ def change_name(file): attr.ib( type=File, metadata={ - "help_string": "input file to skull strip", + "help": "input file to skull strip", "position": 1, "mandatory": True, "argstr": "", @@ -4142,7 +4138,7 @@ def change_name(file): attr.ib( type=str, metadata={ - "help_string": "name of output skull stripped image", + "help": "name of output skull stripped image", "position": 2, "argstr": "", "output_file_template": "{in_file}_brain", @@ -4154,7 +4150,7 @@ def change_name(file): attr.ib( type=bool, metadata={ - "help_string": "create surface outline image", + "help": "create surface outline image", "argstr": "-o", }, ), @@ -4164,7 +4160,7 @@ def change_name(file): attr.ib( type=bool, metadata={ - "help_string": "create binary mask image", + "help": "create binary mask image", "argstr": "-m", }, ), @@ -4173,7 +4169,7 @@ def change_name(file): "skull", attr.ib( type=bool, - metadata={"help_string": "create skull image", "argstr": "-s"}, + metadata={"help": "create skull image", "argstr": "-s"}, ), ), ( @@ -4181,7 +4177,7 @@ def change_name(file): attr.ib( type=bool, metadata={ - "help_string": "Don't generate segmented output", + "help": "Don't generate segmented output", "argstr": "-n", }, ), @@ -4191,7 +4187,7 @@ def change_name(file): attr.ib( type=float, metadata={ - "help_string": "fractional intensity threshold", + "help": "fractional intensity threshold", "argstr": "-f", }, ), @@ -4201,7 +4197,7 @@ def change_name(file): attr.ib( type=float, metadata={ - "help_string": "vertical gradient in fractional intensity threshold (-1, 1)", + "help": "vertical gradient in fractional intensity threshold (-1, 1)", "argstr": "-g", "allowed_values": {"min_val": -1, "max_val": 1}, }, @@ -4209,16 +4205,14 @@ def change_name(file): ), ( "radius", - attr.ib( - type=int, metadata={"argstr": "-r", "help_string": "head radius"} - ), + attr.ib(type=int, metadata={"argstr": "-r", "help": "head radius"}), ), ( "center", attr.ib( type=ty.List[int], metadata={ - "help_string": "center of gravity in voxels", + "help": "center of gravity in voxels", "argstr": "-c", "allowed_values": {"min_value": 0, "max_value": 3}, }, @@ -4230,7 +4224,7 @@ def change_name(file): type=bool, metadata={ "argstr": "-t", - "help_string": "apply thresholding to segmented brain image and mask", + "help": "apply thresholding to segmented brain image and mask", }, ), ), @@ -4240,7 +4234,7 @@ def change_name(file): type=bool, metadata={ "argstr": "-e", - "help_string": "generate a vtk mesh brain surface", + "help": "generate a vtk mesh brain surface", }, ), ), @@ -4249,7 +4243,7 @@ def change_name(file): attr.ib( type=bool, metadata={ - "help_string": "robust brain centre estimation (iterates BET several times)", + "help": "robust brain centre estimation (iterates BET several times)", "argstr": "-R", "xor": _xor_inputs, }, @@ -4260,7 +4254,7 @@ def change_name(file): attr.ib( type=bool, metadata={ - "help_string": "improve BET if FOV is very small in Z (by temporarily padding end slices", + "help": "improve BET if FOV is very small in Z (by temporarily padding end slices", "argstr": "-Z", "xor": _xor_inputs, }, @@ -4271,7 +4265,7 @@ def change_name(file): attr.ib( type=bool, metadata={ - "help_string": "eye & optic nerve cleanup (can be useful in SIENA)", + "help": "eye & optic nerve cleanup (can be useful in SIENA)", "argstr": "-S", "xor": _xor_inputs, }, @@ -4282,7 +4276,7 @@ def change_name(file): attr.ib( type=bool, metadata={ - "help_string": "run bet2 and then betsurf to get additional skull and scalp surfaces (includes registrations)", + "help": "run bet2 and then betsurf to get additional skull and scalp surfaces (includes registrations)", "argstr": "-A", "xor": _xor_inputs, }, @@ -4293,7 +4287,7 @@ def change_name(file): attr.ib( type=ty.Union[File, str], metadata={ - "help_string": "as with creating surfaces, when also feeding in non-brain-extracted T2 (includes registrations)", + "help": "as with creating surfaces, when also feeding in non-brain-extracted T2 (includes registrations)", "argstr": "-A2", "xor": _xor_inputs, }, @@ -4306,7 +4300,7 @@ def change_name(file): metadata={ "argstr": "-F", "xor": _xor_inputs, - "help_string": "apply to 4D fMRI data", + "help": "apply to 4D fMRI data", }, ), ), @@ -4317,16 +4311,16 @@ def change_name(file): metadata={ "argstr": "-B", "xor": _xor_inputs, - "help_string": "bias field and neck cleanup", + "help": "bias field and neck cleanup", }, ), ), - # ("number_classes", int, attr.ib(metadata={"help_string": 'number of tissue-type classes', "argstr": '-n', + # ("number_classes", int, attr.ib(metadata={"help": 'number of tissue-type classes', "argstr": '-n', # "allowed_values": {"min_val": 1, "max_val": 10}})), # ("output_biasfield", bool, - # attr.ib(metadata={"help_string": 'output estimated bias field', "argstr": '-b'})), + # attr.ib(metadata={"help": 'output estimated bias field', "argstr": '-b'})), # ("output_biascorrected", bool, - # attr.ib(metadata={"help_string": 'output restored image (bias-corrected image)', "argstr": '-B'})), + # attr.ib(metadata={"help": 'output restored image (bias-corrected image)', "argstr": '-B'})), ], bases=(ShellDef,), ) @@ -4353,9 +4347,7 @@ def test_shell_cmd_optional_output_file1(tmp_path): fields=[ ( "input", - attr.ib( - type=File, metadata={"argstr": "", "help_string": "input file"} - ), + attr.ib(type=File, metadata={"argstr": "", "help": "input file"}), ), ( "output", @@ -4364,7 +4356,7 @@ def test_shell_cmd_optional_output_file1(tmp_path): metadata={ "argstr": "", "output_file_template": "out.txt", - "help_string": "output file", + "help": "output file", }, ), ), @@ -4376,7 +4368,7 @@ def test_shell_cmd_optional_output_file1(tmp_path): metadata={ "argstr": "--not-used", "output_file_template": "out.txt", - "help_string": "dummy output", + "help": "dummy output", }, ), ), @@ -4404,9 +4396,7 @@ def test_shell_cmd_optional_output_file2(tmp_path): fields=[ ( "input", - attr.ib( - type=File, metadata={"argstr": "", "help_string": "input file"} - ), + attr.ib(type=File, metadata={"argstr": "", "help": "input file"}), ), ( "output", @@ -4416,7 +4406,7 @@ def test_shell_cmd_optional_output_file2(tmp_path): metadata={ "argstr": "", "output_file_template": "out.txt", - "help_string": "dummy output", + "help": "dummy output", }, ), ), @@ -4451,7 +4441,7 @@ def test_shell_cmd_non_existing_outputs_1(tmp_path): attr.ib( type=str, metadata={ - "help_string": """ + "help": """ base name of the pretend outputs. """, "mandatory": True, @@ -4469,7 +4459,7 @@ def test_shell_cmd_non_existing_outputs_1(tmp_path): attr.ib( type=File, metadata={ - "help_string": "fictional output #1", + "help": "fictional output #1", "output_file_template": "{out_name}_1.nii", }, ), @@ -4479,7 +4469,7 @@ def test_shell_cmd_non_existing_outputs_1(tmp_path): attr.ib( type=File, metadata={ - "help_string": "fictional output #2", + "help": "fictional output #2", "output_file_template": "{out_name}_2.nii", }, ), @@ -4512,7 +4502,7 @@ def test_shell_cmd_non_existing_outputs_2(tmp_path): attr.ib( type=str, metadata={ - "help_string": """ + "help": """ base name of the pretend outputs. """, "mandatory": True, @@ -4531,7 +4521,7 @@ def test_shell_cmd_non_existing_outputs_2(tmp_path): attr.ib( type=File, metadata={ - "help_string": "fictional output #1", + "help": "fictional output #1", "output_file_template": "{out_name}_1.nii", }, ), @@ -4541,7 +4531,7 @@ def test_shell_cmd_non_existing_outputs_2(tmp_path): attr.ib( type=File, metadata={ - "help_string": "fictional output #2", + "help": "fictional output #2", "output_file_template": "{out_name}_2.nii", }, ), @@ -4578,7 +4568,7 @@ def test_shell_cmd_non_existing_outputs_3(tmp_path): attr.ib( type=str, metadata={ - "help_string": """ + "help": """ base name of the pretend outputs. """, "mandatory": True, @@ -4597,7 +4587,7 @@ def test_shell_cmd_non_existing_outputs_3(tmp_path): attr.ib( type=File, metadata={ - "help_string": "fictional output #1", + "help": "fictional output #1", "output_file_template": "{out_name}_1.nii", "mandatory": True, }, @@ -4608,7 +4598,7 @@ def test_shell_cmd_non_existing_outputs_3(tmp_path): attr.ib( type=File, metadata={ - "help_string": "fictional output #2", + "help": "fictional output #2", "output_file_template": "{out_name}_2.nii", }, ), @@ -4645,7 +4635,7 @@ def test_shell_cmd_non_existing_outputs_4(tmp_path): attr.ib( type=str, metadata={ - "help_string": """ + "help": """ base name of the pretend outputs. """, "mandatory": True, @@ -4664,7 +4654,7 @@ def test_shell_cmd_non_existing_outputs_4(tmp_path): attr.ib( type=File, metadata={ - "help_string": "fictional output #1", + "help": "fictional output #1", "output_file_template": "{out_name}_1.nii", "mandatory": True, }, @@ -4675,7 +4665,7 @@ def test_shell_cmd_non_existing_outputs_4(tmp_path): attr.ib( type=File, metadata={ - "help_string": "fictional output #2", + "help": "fictional output #2", "output_file_template": "{out_name}_2.nii", "mandatory": True, }, @@ -4710,7 +4700,7 @@ def test_shell_cmd_non_existing_outputs_multi_1(tmp_path): attr.ib( type=MultiInputObj, metadata={ - "help_string": """ + "help": """ base name of the pretend outputs. """, "mandatory": True, @@ -4729,7 +4719,7 @@ def test_shell_cmd_non_existing_outputs_multi_1(tmp_path): attr.ib( type=MultiOutputFile, metadata={ - "help_string": "fictional output #1", + "help": "fictional output #1", "output_file_template": "{out_name}", }, ), @@ -4763,7 +4753,7 @@ def test_shell_cmd_non_existing_outputs_multi_2(tmp_path): attr.ib( type=MultiInputObj, metadata={ - "help_string": """ + "help": """ base name of the pretend outputs. """, "sep": " test_1_real.nii", # hacky way of creating an extra file with that name @@ -4783,7 +4773,7 @@ def test_shell_cmd_non_existing_outputs_multi_2(tmp_path): attr.ib( type=MultiOutputFile, metadata={ - "help_string": "fictional output #1", + "help": "fictional output #1", "output_file_template": "{out_name}_real.nii", }, ), @@ -4824,7 +4814,7 @@ def spec_info(formatter): attr.ib( type=str, metadata={ - "help_string": """ + "help": """ just a dummy name """, "mandatory": True, @@ -4836,7 +4826,7 @@ def spec_info(formatter): attr.ib( type=str, metadata={ - "help_string": """ + "help": """ just a dummy name """, "mandatory": True, @@ -4848,7 +4838,7 @@ def spec_info(formatter): attr.ib( type=ty.List, metadata={ - "help_string": """ + "help": """ combines in1 and in2 into a list """, # When providing a formatter all other metadata options are discarded. @@ -4943,7 +4933,7 @@ def spec_info(formatter): attr.ib( type=str, metadata={ - "help_string": "in1", + "help": "in1", }, ), ), @@ -4952,7 +4942,7 @@ def spec_info(formatter): attr.ib( type=str, metadata={ - "help_string": "in2", + "help": "in2", }, ), ), @@ -4961,7 +4951,7 @@ def spec_info(formatter): attr.ib( type=ty.List, metadata={ - "help_string": """ + "help": """ uses in1 """, # When providing a formatter all other metadata options are discarded. @@ -5020,7 +5010,7 @@ def test_shellcommand_error_msg(tmp_path): ( "in1", str, - {"help_string": "a dummy string", "argstr": "", "mandatory": True}, + {"help": "a dummy string", "argstr": "", "mandatory": True}, ), ], bases=(ShellDef,), diff --git a/pydra/engine/tests/test_shelltask_inputspec.py b/pydra/engine/tests/test_shelltask_inputspec.py index cd491670f..78815655c 100644 --- a/pydra/engine/tests/test_shelltask_inputspec.py +++ b/pydra/engine/tests/test_shelltask_inputspec.py @@ -34,7 +34,7 @@ def test_shell_cmd_inputs_1(): "inpA", attr.ib( type=str, - metadata={"position": 1, "help_string": "inp1", "argstr": ""}, + metadata={"position": 1, "help": "inp1", "argstr": ""}, ), ) ], @@ -51,9 +51,7 @@ def test_shell_cmd_inputs_1a(): """additional input without provided position""" my_input_spec = SpecInfo( name="Input", - fields=[ - ("inpA", attr.ib(type=str, metadata={"help_string": "inpA", "argstr": ""})) - ], + fields=[("inpA", attr.ib(type=str, metadata={"help": "inpA", "argstr": ""}))], bases=(ShellDef,), ) @@ -73,7 +71,7 @@ def test_shell_cmd_inputs_1b(): "inpA", attr.ib( type=str, - metadata={"position": -1, "help_string": "inpA", "argstr": ""}, + metadata={"position": -1, "help": "inpA", "argstr": ""}, ), ) ], @@ -97,7 +95,7 @@ def test_shell_cmd_inputs_1_st(): "inpA", attr.ib( type=str, - metadata={"position": 1, "help_string": "inp1", "argstr": ""}, + metadata={"position": 1, "help": "inp1", "argstr": ""}, ), ) ], @@ -124,14 +122,14 @@ def test_shell_cmd_inputs_2(): "inpA", attr.ib( type=str, - metadata={"position": 2, "help_string": "inpA", "argstr": ""}, + metadata={"position": 2, "help": "inpA", "argstr": ""}, ), ), ( "inpB", attr.ib( type=str, - metadata={"position": 1, "help_string": "inpN", "argstr": ""}, + metadata={"position": 1, "help": "inpN", "argstr": ""}, ), ), ], @@ -150,8 +148,8 @@ def test_shell_cmd_inputs_2a(): my_input_spec = SpecInfo( name="Input", fields=[ - ("inpA", attr.ib(type=str, metadata={"help_string": "inpA", "argstr": ""})), - ("inpB", attr.ib(type=str, metadata={"help_string": "inpB", "argstr": ""})), + ("inpA", attr.ib(type=str, metadata={"help": "inpA", "argstr": ""})), + ("inpB", attr.ib(type=str, metadata={"help": "inpB", "argstr": ""})), ], bases=(ShellDef,), ) @@ -176,14 +174,14 @@ def test_shell_cmd_inputs_2_err(): "inpA", attr.ib( type=str, - metadata={"position": 1, "help_string": "inpA", "argstr": ""}, + metadata={"position": 1, "help": "inpA", "argstr": ""}, ), ), ( "inpB", attr.ib( type=str, - metadata={"position": 1, "help_string": "inpB", "argstr": ""}, + metadata={"position": 1, "help": "inpB", "argstr": ""}, ), ), ], @@ -209,14 +207,14 @@ def test_shell_cmd_inputs_2_noerr(): "inpA", attr.ib( type=str, - metadata={"position": 1, "help_string": "inpA", "argstr": ""}, + metadata={"position": 1, "help": "inpA", "argstr": ""}, ), ), ( "inpB", attr.ib( type=str, - metadata={"position": 1, "help_string": "inpB", "argstr": ""}, + metadata={"position": 1, "help": "inpB", "argstr": ""}, ), ), ], @@ -236,17 +234,17 @@ def test_shell_cmd_inputs_3(): "inpA", attr.ib( type=str, - metadata={"position": 1, "help_string": "inpA", "argstr": ""}, + metadata={"position": 1, "help": "inpA", "argstr": ""}, ), ), ( "inpB", attr.ib( type=str, - metadata={"position": -1, "help_string": "inpB", "argstr": ""}, + metadata={"position": -1, "help": "inpB", "argstr": ""}, ), ), - ("inpC", attr.ib(type=str, metadata={"help_string": "inpC", "argstr": ""})), + ("inpC", attr.ib(type=str, metadata={"help": "inpC", "argstr": ""})), ], bases=(ShellDef,), ) @@ -272,7 +270,7 @@ def test_shell_cmd_inputs_argstr_1(): "inpA", attr.ib( type=str, - metadata={"position": 1, "help_string": "inpA", "argstr": "-v"}, + metadata={"position": 1, "help": "inpA", "argstr": "-v"}, ), ) ], @@ -293,7 +291,7 @@ def test_shell_cmd_inputs_argstr_2(): "inpA", attr.ib( type=bool, - metadata={"position": 1, "help_string": "inpA", "argstr": "-v"}, + metadata={"position": 1, "help": "inpA", "argstr": "-v"}, ), ) ], @@ -317,7 +315,7 @@ def test_shell_cmd_inputs_list_1(): "inpA", attr.ib( type=ty.List[str], - metadata={"position": 2, "help_string": "inpA", "argstr": ""}, + metadata={"position": 2, "help": "inpA", "argstr": ""}, ), ) ], @@ -340,7 +338,7 @@ def test_shell_cmd_inputs_list_2(): "inpA", attr.ib( type=ty.List[str], - metadata={"position": 2, "help_string": "inpA", "argstr": "-v"}, + metadata={"position": 2, "help": "inpA", "argstr": "-v"}, ), ) ], @@ -362,7 +360,7 @@ def test_shell_cmd_inputs_list_3(): "inpA", attr.ib( type=ty.List[str], - metadata={"position": 2, "help_string": "inpA", "argstr": "-v..."}, + metadata={"position": 2, "help": "inpA", "argstr": "-v..."}, ), ) ], @@ -387,7 +385,7 @@ def test_shell_cmd_inputs_list_sep_1(): type=MultiInputObj[str], metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "sep": ",", "argstr": "", }, @@ -417,7 +415,7 @@ def test_shell_cmd_inputs_list_sep_2(): type=MultiInputObj[str], metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "sep": ",", "argstr": "-v", }, @@ -447,7 +445,7 @@ def test_shell_cmd_inputs_list_sep_2a(): type=MultiInputObj[str], metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "sep": ",", "argstr": "-v {inpA}", }, @@ -477,7 +475,7 @@ def test_shell_cmd_inputs_list_sep_3(): type=MultiInputObj[str], metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "sep": ",", "argstr": "-v...", }, @@ -507,7 +505,7 @@ def test_shell_cmd_inputs_list_sep_3a(): type=MultiInputObj[str], metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "sep": ",", "argstr": "-v {inpA}...", }, @@ -537,7 +535,7 @@ def test_shell_cmd_inputs_sep_4(): type=MultiInputObj[str], metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "sep": ",", "argstr": "-v...", }, @@ -562,7 +560,7 @@ def test_shell_cmd_inputs_sep_4a(): type=str, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "sep": ",", "argstr": "-v...", }, @@ -587,7 +585,7 @@ def test_shell_cmd_inputs_format_1(): type=str, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "-v {inpA}", }, ), @@ -611,7 +609,7 @@ def test_shell_cmd_inputs_format_2(): type=MultiInputObj[str], metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "-v {inpA}...", }, ), @@ -639,7 +637,7 @@ def test_shell_cmd_inputs_format_3(): type=float, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "-v {inpA:.5f}", }, ), @@ -663,7 +661,7 @@ def test_shell_cmd_inputs_mandatory_1(): type=str, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -689,7 +687,7 @@ def test_shell_cmd_inputs_not_given_1(): type=MultiInputObj, metadata={ "argstr": "--arg1", - "help_string": "Command line argument 1", + "help": "Command line argument 1", }, ), ), @@ -699,7 +697,7 @@ def test_shell_cmd_inputs_not_given_1(): type=MultiInputObj, metadata={ "argstr": "--arg2", - "help_string": "Command line argument 2", + "help": "Command line argument 2", }, ), ), @@ -709,7 +707,7 @@ def test_shell_cmd_inputs_not_given_1(): type=File, metadata={ "argstr": "--arg3", - "help_string": "Command line argument 3", + "help": "Command line argument 3", }, ), ), @@ -734,7 +732,7 @@ def test_shell_cmd_inputs_template_1(): type=str, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -746,7 +744,7 @@ def test_shell_cmd_inputs_template_1(): type=str, metadata={ "position": 2, - "help_string": "outA", + "help": "outA", "argstr": "-o", "output_file_template": "{inpA}_out", }, @@ -775,7 +773,7 @@ def test_shell_cmd_inputs_template_1a(): type=str, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -786,7 +784,7 @@ def test_shell_cmd_inputs_template_1a(): attr.ib( type=str, metadata={ - "help_string": "outA", + "help": "outA", "output_file_template": "{inpA}_out", }, ), @@ -810,7 +808,7 @@ def test_shell_cmd_inputs_template_2(): "inpB", attr.ib( type=str, - metadata={"position": 1, "help_string": "inpB", "argstr": ""}, + metadata={"position": 1, "help": "inpB", "argstr": ""}, ), ), ( @@ -819,7 +817,7 @@ def test_shell_cmd_inputs_template_2(): type=str, metadata={ "position": 2, - "help_string": "outB", + "help": "outB", "argstr": "-o", "output_file_template": "{inpB}_out", }, @@ -853,7 +851,7 @@ def test_shell_cmd_inputs_template_3(tmp_path): type=str, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -865,7 +863,7 @@ def test_shell_cmd_inputs_template_3(tmp_path): type=str, metadata={ "position": 2, - "help_string": "inpB", + "help": "inpB", "argstr": "", "mandatory": True, }, @@ -876,7 +874,7 @@ def test_shell_cmd_inputs_template_3(tmp_path): attr.ib( type=str, metadata={ - "help_string": "outA", + "help": "outA", "output_file_template": "{inpA}_out", }, ), @@ -886,7 +884,7 @@ def test_shell_cmd_inputs_template_3(tmp_path): attr.ib( type=str, metadata={ - "help_string": "outB", + "help": "outB", "output_file_template": "{inpB}_out", }, ), @@ -897,7 +895,7 @@ def test_shell_cmd_inputs_template_3(tmp_path): type=str, metadata={ "position": -1, - "help_string": "outAB", + "help": "outAB", "argstr": "-o {outA} {outB}", "readonly": True, }, @@ -933,7 +931,7 @@ def test_shell_cmd_inputs_template_3a(): type=str, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -945,7 +943,7 @@ def test_shell_cmd_inputs_template_3a(): type=str, metadata={ "position": 2, - "help_string": "inpB", + "help": "inpB", "argstr": "", "mandatory": True, }, @@ -957,7 +955,7 @@ def test_shell_cmd_inputs_template_3a(): type=str, metadata={ "position": -1, - "help_string": "outAB", + "help": "outAB", "argstr": "-o {outA} {outB}", "readonly": True, }, @@ -968,7 +966,7 @@ def test_shell_cmd_inputs_template_3a(): attr.ib( type=str, metadata={ - "help_string": "outA", + "help": "outA", "output_file_template": "{inpA}_out", }, ), @@ -978,7 +976,7 @@ def test_shell_cmd_inputs_template_3a(): attr.ib( type=str, metadata={ - "help_string": "outB", + "help": "outB", "output_file_template": "{inpB}_out", }, ), @@ -1014,7 +1012,7 @@ def test_shell_cmd_inputs_template_4(): type=str, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1024,7 +1022,7 @@ def test_shell_cmd_inputs_template_4(): "inpB", attr.ib( type=str, - metadata={"position": 2, "help_string": "inpB", "argstr": ""}, + metadata={"position": 2, "help": "inpB", "argstr": ""}, ), ), ( @@ -1033,7 +1031,7 @@ def test_shell_cmd_inputs_template_4(): type=str, metadata={ "position": -1, - "help_string": "outAB", + "help": "outAB", "argstr": "-o {outA} {outB}", "readonly": True, }, @@ -1044,7 +1042,7 @@ def test_shell_cmd_inputs_template_4(): attr.ib( type=str, metadata={ - "help_string": "outA", + "help": "outA", "output_file_template": "{inpA}_out", }, ), @@ -1054,7 +1052,7 @@ def test_shell_cmd_inputs_template_4(): attr.ib( type=str, metadata={ - "help_string": "outB", + "help": "outB", "output_file_template": "{inpB}_out", }, ), @@ -1080,7 +1078,7 @@ def test_shell_cmd_inputs_template_5_ex(): type=str, metadata={ "position": -1, - "help_string": "outAB", + "help": "outAB", "argstr": "-o", "readonly": True, }, @@ -1111,7 +1109,7 @@ def test_shell_cmd_inputs_template_6(): type=str, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1123,7 +1121,7 @@ def test_shell_cmd_inputs_template_6(): type=ty.Union[str, bool], metadata={ "position": 2, - "help_string": "outA", + "help": "outA", "argstr": "-o", "output_file_template": "{inpA}_out", }, @@ -1171,7 +1169,7 @@ def test_shell_cmd_inputs_template_6a(): type=str, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1184,7 +1182,7 @@ def test_shell_cmd_inputs_template_6a(): default=False, metadata={ "position": 2, - "help_string": "outA", + "help": "outA", "argstr": "-o", "output_file_template": "{inpA}_out", }, @@ -1230,7 +1228,7 @@ def test_shell_cmd_inputs_template_7(tmp_path: Path): type=File, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1242,7 +1240,7 @@ def test_shell_cmd_inputs_template_7(tmp_path: Path): type=str, metadata={ "position": 2, - "help_string": "outA", + "help": "outA", "argstr": "", "output_file_template": "{inpA}_out", }, @@ -1278,7 +1276,7 @@ def test_shell_cmd_inputs_template_7a(tmp_path: Path): type=File, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1290,7 +1288,7 @@ def test_shell_cmd_inputs_template_7a(tmp_path: Path): type=str, metadata={ "position": 2, - "help_string": "outA", + "help": "outA", "argstr": "", "keep_extension": True, "output_file_template": "{inpA}_out", @@ -1327,7 +1325,7 @@ def test_shell_cmd_inputs_template_7b(tmp_path: Path): type=File, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1339,7 +1337,7 @@ def test_shell_cmd_inputs_template_7b(tmp_path: Path): type=str, metadata={ "position": 2, - "help_string": "outA", + "help": "outA", "argstr": "", "keep_extension": False, "output_file_template": "{inpA}_out", @@ -1374,7 +1372,7 @@ def test_shell_cmd_inputs_template_8(tmp_path: Path): type=File, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1386,7 +1384,7 @@ def test_shell_cmd_inputs_template_8(tmp_path: Path): type=str, metadata={ "position": 2, - "help_string": "outA", + "help": "outA", "argstr": "", "output_file_template": "{inpA}_out.txt", }, @@ -1422,7 +1420,7 @@ def test_shell_cmd_inputs_template_9(tmp_path: Path): type=File, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1434,7 +1432,7 @@ def test_shell_cmd_inputs_template_9(tmp_path: Path): type=int, metadata={ "position": 2, - "help_string": "inp int", + "help": "inp int", "argstr": "-i", "mandatory": True, }, @@ -1446,7 +1444,7 @@ def test_shell_cmd_inputs_template_9(tmp_path: Path): type=str, metadata={ "position": 3, - "help_string": "outA", + "help": "outA", "argstr": "-o", "output_file_template": "{inpA}_{inpInt}_out.txt", }, @@ -1484,7 +1482,7 @@ def test_shell_cmd_inputs_template_9a(tmp_path: Path): type=File, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1496,7 +1494,7 @@ def test_shell_cmd_inputs_template_9a(tmp_path: Path): type=str, metadata={ "position": 2, - "help_string": "inp str", + "help": "inp str", "argstr": "-i", "mandatory": True, }, @@ -1508,7 +1506,7 @@ def test_shell_cmd_inputs_template_9a(tmp_path: Path): type=str, metadata={ "position": 3, - "help_string": "outA", + "help": "outA", "argstr": "-o", "output_file_template": "{inpA}_{inpStr}_out.txt", }, @@ -1546,7 +1544,7 @@ def test_shell_cmd_inputs_template_9b_err(tmp_path: Path): type=File, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1558,7 +1556,7 @@ def test_shell_cmd_inputs_template_9b_err(tmp_path: Path): type=File, metadata={ "position": 2, - "help_string": "inp file", + "help": "inp file", "argstr": "-i", "mandatory": True, }, @@ -1570,7 +1568,7 @@ def test_shell_cmd_inputs_template_9b_err(tmp_path: Path): type=str, metadata={ "position": 3, - "help_string": "outA", + "help": "outA", "argstr": "-o", "output_file_template": "{inpA}_{inpFile}_out.txt", }, @@ -1610,7 +1608,7 @@ def test_shell_cmd_inputs_template_9c_err(tmp_path: Path): type=File, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1622,7 +1620,7 @@ def test_shell_cmd_inputs_template_9c_err(tmp_path: Path): type=str, metadata={ "position": 2, - "help_string": "inp str with extension", + "help": "inp str with extension", "argstr": "-i", "mandatory": True, }, @@ -1634,7 +1632,7 @@ def test_shell_cmd_inputs_template_9c_err(tmp_path: Path): type=str, metadata={ "position": 3, - "help_string": "outA", + "help": "outA", "argstr": "-o", "output_file_template": "{inpA}_{inpStr}_out.txt", }, @@ -1670,7 +1668,7 @@ def test_shell_cmd_inputs_template_10(): type=float, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "{inpA:.1f}", "mandatory": True, }, @@ -1682,7 +1680,7 @@ def test_shell_cmd_inputs_template_10(): type=str, metadata={ "position": 2, - "help_string": "outA", + "help": "outA", "argstr": "-o", "output_file_template": "file_{inpA:.1f}_out", }, @@ -1712,7 +1710,7 @@ def test_shell_cmd_inputs_template_requires_1(): attr.ib( type=str, metadata={ - "help_string": "input file", + "help": "input file", "mandatory": True, "argstr": "", }, @@ -1722,7 +1720,7 @@ def test_shell_cmd_inputs_template_requires_1(): "with_tpl", attr.ib( type=bool, - metadata={"help_string": "enable template"}, + metadata={"help": "enable template"}, ), ), ( @@ -1730,7 +1728,7 @@ def test_shell_cmd_inputs_template_requires_1(): attr.ib( type=str, metadata={ - "help_string": "output file", + "help": "output file", "argstr": "--tpl", "output_file_template": "tpl.{in_file}", "requires": {"with_tpl"}, @@ -1768,7 +1766,7 @@ def template_fun(inputs): type=str, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1780,7 +1778,7 @@ def template_fun(inputs): type=str, metadata={ "position": 2, - "help_string": "outA", + "help": "outA", "argstr": "-o", "output_file_template": template_fun, }, @@ -1816,7 +1814,7 @@ def template_fun(inputs): type=str, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1827,7 +1825,7 @@ def template_fun(inputs): attr.ib( type=int, metadata={ - "help_string": "inpB", + "help": "inpB", "mandatory": True, }, ), @@ -1838,7 +1836,7 @@ def template_fun(inputs): type=str, metadata={ "position": 2, - "help_string": "outA", + "help": "outA", "argstr": "-o", "output_file_template": template_fun, }, @@ -1871,7 +1869,7 @@ def test_shell_cmd_inputs_template_1_st(): type=str, metadata={ "position": 1, - "help_string": "inpA", + "help": "inpA", "argstr": "", "mandatory": True, }, @@ -1883,7 +1881,7 @@ def test_shell_cmd_inputs_template_1_st(): type=str, metadata={ "position": 2, - "help_string": "outA", + "help": "outA", "argstr": "-o", "output_file_template": "{inpA}_out", }, @@ -1920,7 +1918,7 @@ def test_shell_cmd_inputs_denoise_image( attr.ib( type=int, metadata={ - "help_string": """ + "help": """ 2/3/4 This option forces the image to be treated as a specified-dimensional image. If not specified, the program tries to infer the dimensionality from @@ -1936,7 +1934,7 @@ def test_shell_cmd_inputs_denoise_image( attr.ib( type=File, metadata={ - "help_string": "A scalar image is expected as input for noise correction.", + "help": "A scalar image is expected as input for noise correction.", "argstr": "-i", "mandatory": True, }, @@ -1947,7 +1945,7 @@ def test_shell_cmd_inputs_denoise_image( attr.ib( type=str, metadata={ - "help_string": """ + "help": """ Rician/(Gaussian) Employ a Rician or Gaussian noise model. """, @@ -1961,7 +1959,7 @@ def test_shell_cmd_inputs_denoise_image( attr.ib( type=str, metadata={ - "help_string": "If a mask image is specified, denoising is only performed in the mask region.", + "help": "If a mask image is specified, denoising is only performed in the mask region.", "argstr": "-x", }, ), @@ -1972,7 +1970,7 @@ def test_shell_cmd_inputs_denoise_image( type=int, default=1, metadata={ - "help_string": """ + "help": """ (1)/2/3/... Running noise correction on large images can be time consuming. To lessen computation time, the input image can be resampled. @@ -1989,7 +1987,7 @@ def test_shell_cmd_inputs_denoise_image( type=int, default=1, metadata={ - "help_string": "Patch radius. Default = 1x1x1", + "help": "Patch radius. Default = 1x1x1", "argstr": "-p", }, ), @@ -2000,7 +1998,7 @@ def test_shell_cmd_inputs_denoise_image( type=int, default=2, metadata={ - "help_string": "Search radius. Default = 2x2x2.", + "help": "Search radius. Default = 2x2x2.", "argstr": "-r", }, ), @@ -2010,7 +2008,7 @@ def test_shell_cmd_inputs_denoise_image( attr.ib( type=str, metadata={ - "help_string": """ + "help": """ The output consists of the noise corrected version of the input image. Optionally, one can also output the estimated noise image. """, @@ -2024,7 +2022,7 @@ def test_shell_cmd_inputs_denoise_image( type=ty.Union[str, bool], default=False, metadata={ - "help_string": """ + "help": """ The output consists of the noise corrected version of the input image. Optionally, one can also output the estimated noise image. """, @@ -2037,7 +2035,7 @@ def test_shell_cmd_inputs_denoise_image( attr.ib( type=str, metadata={ - "help_string": "Combined output", + "help": "Combined output", "argstr": "-o [{correctedImage}, {noiseImage}]", "position": -1, "readonly": True, @@ -2050,7 +2048,7 @@ def test_shell_cmd_inputs_denoise_image( type=bool, default=False, metadata={ - "help_string": "Get Version Information.", + "help": "Get Version Information.", "argstr": "--version", }, ), @@ -2060,7 +2058,7 @@ def test_shell_cmd_inputs_denoise_image( attr.ib( type=int, default=0, - metadata={"help_string": "(0)/1. Verbose output. ", "argstr": "-v"}, + metadata={"help": "(0)/1. Verbose output. ", "argstr": "-v"}, ), ), ( @@ -2069,7 +2067,7 @@ def test_shell_cmd_inputs_denoise_image( type=bool, default=False, metadata={ - "help_string": "Print the help menu (short version)", + "help": "Print the help menu (short version)", "argstr": "-h", }, ), @@ -2079,7 +2077,7 @@ def test_shell_cmd_inputs_denoise_image( attr.ib( type=int, metadata={ - "help_string": "Print the help menu.", + "help": "Print the help menu.", "argstr": "--help", }, ), @@ -2170,16 +2168,16 @@ def test_shell_cmd_inputs_denoise_image( class SimpleTaskXor(ShellDef["SimpleTaskXor.Outputs"]): input_1: str = shell.arg( - help_string="help", + help="help", xor=("input_1", "input_2", "input_3"), ) input_2: bool = shell.arg( - help_string="help", + help="help", argstr="--i2", xor=("input_1", "input_2", "input_3"), ) input_3: bool = shell.arg( - help_string="help", + help="help", xor=("input_1", "input_2", "input_3"), ) diff --git a/pydra/engine/tests/test_singularity.py b/pydra/engine/tests/test_singularity.py index 1af55843e..a1f72d7b4 100644 --- a/pydra/engine/tests/test_singularity.py +++ b/pydra/engine/tests/test_singularity.py @@ -214,7 +214,7 @@ def test_singularity_inputspec_1(plugin, tmp_path): "mandatory": True, "position": 1, "argstr": "", - "help_string": "input file", + "help": "input file", }, ), ) @@ -256,7 +256,7 @@ def test_singularity_inputspec_1a(plugin, tmp_path): attr.ib( type=File, default=filename, - metadata={"position": 1, "argstr": "", "help_string": "input file"}, + metadata={"position": 1, "argstr": "", "help": "input file"}, ), ) ], @@ -300,7 +300,7 @@ def test_singularity_inputspec_2(plugin, tmp_path): metadata={ "position": 1, "argstr": "", - "help_string": "input file 1", + "help": "input file 1", }, ), ), @@ -312,7 +312,7 @@ def test_singularity_inputspec_2(plugin, tmp_path): metadata={ "position": 2, "argstr": "", - "help_string": "input file 2", + "help": "input file 2", }, ), ), @@ -361,7 +361,7 @@ def test_singularity_inputspec_2a_except(plugin, tmp_path): metadata={ "position": 1, "argstr": "", - "help_string": "input file 1", + "help": "input file 1", }, ), ), @@ -372,7 +372,7 @@ def test_singularity_inputspec_2a_except(plugin, tmp_path): metadata={ "position": 2, "argstr": "", - "help_string": "input file 2", + "help": "input file 2", }, ), ), @@ -421,7 +421,7 @@ def test_singularity_inputspec_2a(plugin, tmp_path): metadata={ "position": 1, "argstr": "", - "help_string": "input file 1", + "help": "input file 1", }, ), ), @@ -432,7 +432,7 @@ def test_singularity_inputspec_2a(plugin, tmp_path): metadata={ "position": 2, "argstr": "", - "help_string": "input file 2", + "help": "input file 2", }, ), ), @@ -477,7 +477,7 @@ def test_singularity_cmd_inputspec_copyfile_1(plugin, tmp_path): metadata={ "position": 1, "argstr": "", - "help_string": "orig file", + "help": "orig file", "mandatory": True, "copyfile": True, }, @@ -489,7 +489,7 @@ def test_singularity_cmd_inputspec_copyfile_1(plugin, tmp_path): type=str, metadata={ "output_file_template": "{orig_file}", - "help_string": "output file", + "help": "output file", }, ), ), @@ -545,7 +545,7 @@ def test_singularity_inputspec_state_1(tmp_path): "mandatory": True, "position": 1, "argstr": "", - "help_string": "input file", + "help": "input file", }, ), ) @@ -595,7 +595,7 @@ def test_singularity_inputspec_state_1b(plugin, tmp_path): "mandatory": True, "position": 1, "argstr": "", - "help_string": "input file", + "help": "input file", }, ), ) @@ -638,7 +638,7 @@ def test_singularity_wf_inputspec_1(plugin, tmp_path): "mandatory": True, "position": 1, "argstr": "", - "help_string": "input file", + "help": "input file", }, ), ) @@ -694,7 +694,7 @@ def test_singularity_wf_state_inputspec_1(plugin, tmp_path): "mandatory": True, "position": 1, "argstr": "", - "help_string": "input file", + "help": "input file", }, ), ) @@ -751,7 +751,7 @@ def test_singularity_wf_ndst_inputspec_1(plugin, tmp_path): "mandatory": True, "position": 1, "argstr": "", - "help_string": "input file", + "help": "input file", }, ), ) diff --git a/pydra/engine/tests/test_task.py b/pydra/engine/tests/test_task.py index 104992f38..896398d06 100644 --- a/pydra/engine/tests/test_task.py +++ b/pydra/engine/tests/test_task.py @@ -591,7 +591,7 @@ def testfunc(a): my_input_spec = SpecInfo( name="Input", - fields=[("a", attr.ib(type=float, metadata={"help_string": "input a"}))], + fields=[("a", attr.ib(type=float, metadata={"help": "input a"}))], bases=(FunctionDef,), ) @@ -610,7 +610,7 @@ def testfunc(a): my_input_spec = SpecInfo( name="Input", - fields=[("a", attr.ib(type=int, metadata={"help_string": "input a"}))], + fields=[("a", attr.ib(type=int, metadata={"help": "input a"}))], bases=(FunctionDef,), ) with pytest.raises(TypeError): @@ -631,7 +631,7 @@ def testfunc(a): fields=[ ( "a", - attr.ib(type=float, metadata={"position": 1, "help_string": "input a"}), + attr.ib(type=float, metadata={"position": 1, "help": "input a"}), ) ], bases=(FunctionDef,), @@ -666,7 +666,7 @@ def testfunc(a: int): my_input_spec = SpecInfo( name="Input", - fields=[("a", attr.ib(type=float, metadata={"help_string": "input a"}))], + fields=[("a", attr.ib(type=float, metadata={"help": "input a"}))], bases=(FunctionDef,), ) @@ -686,7 +686,7 @@ def testfunc(a: int): my_input_spec = SpecInfo( name="Input", - fields=[("a", float, {"help_string": "input a"})], + fields=[("a", float, {"help": "input a"})], bases=(FunctionDef,), ) @@ -710,7 +710,7 @@ def testfunc(a): "a", attr.ib( type=int, - metadata={"help_string": "input a", "allowed_values": [0, 1, 2]}, + metadata={"help": "input a", "allowed_values": [0, 1, 2]}, ), ) ], @@ -737,7 +737,7 @@ def testfunc(a): "a", attr.ib( type=int, - metadata={"help_string": "input a", "allowed_values": [0, 1, 2]}, + metadata={"help": "input a", "allowed_values": [0, 1, 2]}, ), ) ], @@ -762,15 +762,11 @@ def testfunc(a, b=1): fields=[ ( "a", - attr.ib( - type=int, metadata={"help_string": "input a", "mandatory": True} - ), + attr.ib(type=int, metadata={"help": "input a", "mandatory": True}), ), ( "b", - attr.ib( - type=int, metadata={"help_string": "input b", "mandatory": True} - ), + attr.ib(type=int, metadata={"help": "input b", "mandatory": True}), ), ], bases=(FunctionDef,), @@ -795,11 +791,9 @@ def testfunc(a, b=1): fields=[ ( "a", - attr.ib( - type=int, metadata={"help_string": "input a", "mandatory": True} - ), + attr.ib(type=int, metadata={"help": "input a", "mandatory": True}), ), - ("b", attr.ib(type=int, default=10, metadata={"help_string": "input b"})), + ("b", attr.ib(type=int, default=10, metadata={"help": "input b"})), ], bases=(FunctionDef,), ) @@ -820,9 +814,7 @@ def testfunc(a): my_input_spec = SpecInfo( name="Input", - fields=[ - ("a", attr.ib(type=MultiInputObj, metadata={"help_string": "input a"})) - ], + fields=[("a", attr.ib(type=MultiInputObj, metadata={"help": "input a"}))], bases=(FunctionDef,), ) @@ -841,7 +833,7 @@ def testfunc(a): my_output_spec = SpecInfo( name="Output", - fields=[("out1", attr.ib(type=float, metadata={"help_string": "output"}))], + fields=[("out1", attr.ib(type=float, metadata={"help": "output"}))], bases=(BaseDef,), ) @@ -861,7 +853,7 @@ def testfunc(a): my_output_spec = SpecInfo( name="Output", - fields=[("out1", attr.ib(type=int, metadata={"help_string": "output"}))], + fields=[("out1", attr.ib(type=int, metadata={"help": "output"}))], bases=(BaseDef,), ) @@ -881,7 +873,7 @@ def testfunc(a) -> int: my_output_spec = SpecInfo( name="Output", - fields=[("out1", attr.ib(type=float, metadata={"help_string": "output"}))], + fields=[("out1", attr.ib(type=float, metadata={"help": "output"}))], bases=(BaseDef,), ) @@ -902,7 +894,7 @@ def testfunc(a) -> int: my_output_spec = SpecInfo( name="Output", - fields=[("out1", float, {"help_string": "output"})], + fields=[("out1", float, {"help": "output"})], bases=(BaseDef,), ) @@ -925,7 +917,7 @@ def testfunc(a, b): fields=[ ( "out_list", - attr.ib(type=MultiOutputObj, metadata={"help_string": "output"}), + attr.ib(type=MultiOutputObj, metadata={"help": "output"}), ) ], bases=(BaseDef,), @@ -950,7 +942,7 @@ def testfunc(a): fields=[ ( "out_1el", - attr.ib(type=MultiOutputObj, metadata={"help_string": "output"}), + attr.ib(type=MultiOutputObj, metadata={"help": "output"}), ) ], bases=(BaseDef,), @@ -1117,7 +1109,7 @@ def test_audit_shellcommandtask_file(tmp_path): metadata={ "position": 1, "argstr": "", - "help_string": "text", + "help": "text", "mandatory": True, }, ), @@ -1129,7 +1121,7 @@ def test_audit_shellcommandtask_file(tmp_path): metadata={ "position": 2, "argstr": "", - "help_string": "text", + "help": "text", "mandatory": True, }, ), diff --git a/pydra/utils/tests/utils.py b/pydra/utils/tests/utils.py index 8bf993292..411435234 100644 --- a/pydra/utils/tests/utils.py +++ b/pydra/utils/tests/utils.py @@ -35,14 +35,14 @@ class GenericShellTask(specs.ShellDef["GenericShellTask.Outputs"]): """class with customized input and executables""" in_file: File = shell.arg( - help_string="the input file", + help="the input file", argstr="", copy_mode="copy", ) class Outputs(specs.ShellOutputs): out: File = shell.outarg( - help_string="output file name", + help="output file name", argstr="", position=-1, path_template="{in_file}", @@ -61,7 +61,7 @@ class SpecificShellTask(specs.ShellDef["SpecificShellTask.Outputs"]): executable = "echo" in_file: MyFormatX = shell.arg( - help_string="the input file", + help="the input file", argstr="", copy_mode="copy", sep=" ", @@ -69,7 +69,7 @@ class SpecificShellTask(specs.ShellDef["SpecificShellTask.Outputs"]): class Outputs(specs.ShellOutputs): out: MyFormatX = shell.outarg( - help_string="output file name", + help="output file name", argstr="", position=-1, path_template="{in_file}", # Pass through un-altered @@ -84,7 +84,7 @@ def other_specific_func_task(in_file: MyOtherFormatX) -> MyOtherFormatX: class OtherSpecificShellTask(ShellTask): in_file: MyOtherFormatX = shell.arg( - help_string="the input file", + help="the input file", argstr="", copy_mode="copy", sep=" ", @@ -92,7 +92,7 @@ class OtherSpecificShellTask(ShellTask): class Outputs(specs.ShellOutputs): out: MyOtherFormatX = shell.outarg( - help_string="output file name", + help="output file name", argstr="", position=-1, path_template="{in_file}", # Pass through un-altered