diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index b13075d87..12dd75a69 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -182,7 +182,7 @@ jobs: docker exec slurm bash -c "ls -la /pydra && echo list pydra dir" docker exec slurm bash -c "CONFIGURE_OPTS=\"-with-openssl=/opt/openssl\" pyenv install -v ${{ matrix.python-version }}" docker exec slurm bash -c "pyenv global ${{ matrix.python-version }}" - docker exec slurm bash -c "pip install --upgrade pip && pip install -e /pydra[test,psij] && python -c 'import pydra.engine; print(pydra.utils.__version__)'" + docker exec slurm bash -c "pip install --upgrade pip && pip install 'numpy<2' -e /pydra[test,psij] && python -c 'import pydra.engine; print(pydra.utils.__version__)'" - name: Run pytest run: | docker exec slurm bash -c "cd /pydra; pytest pydra/workers/tests/test_worker.py --only-worker=slurm --color=yes" @@ -315,9 +315,12 @@ jobs: with: auto-activate-base: true activate-environment: "" + # We generate dummy aliases so they can be deleted by conda later without throwing an error - name: Install MRtrix via Conda run: | - conda install -c mrtrix3 mrtrix3 + alias shview='ls' + alias mrview='ls' + conda install -c conda-forge -c MRtrix3 mrtrix3 libstdcxx-ng mrconvert --version - name: Set up Python uses: actions/setup-python@v5 diff --git a/docs/source/tutorial/7-canonical-form.ipynb b/docs/source/tutorial/7-canonical-form.ipynb index 428ef217a..d834249fe 100644 --- a/docs/source/tutorial/7-canonical-form.ipynb +++ b/docs/source/tutorial/7-canonical-form.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Canonical form and serialisation\n", + "# Canonical forms\n", "\n", "## Canonical task form\n", "\n", @@ -28,7 +28,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Python-tasks\n", + "### Python-tasks\n", "\n", "Python tasks in dataclass form are decorated by `pydra.compose.python.define`\n", "with inputs listed as type annotations. Outputs are similarly defined in a nested class\n", @@ -135,7 +135,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Shell-tasks\n", + "### Shell-tasks\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." @@ -183,7 +183,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Workflow definitions\n", + "### 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." @@ -242,7 +242,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Converting to/from dictionaries\n", + "## Conversion to/from dictionaries\n", "\n", "As well as the dataclass-like canonical form, it is also possible to represent all tasks\n", "in a nested dictionary form, which could be written to a static file (e.g. in JSON or\n", diff --git a/pydra/compose/base/field.py b/pydra/compose/base/field.py index d72f2bfaf..6d620e7d3 100644 --- a/pydra/compose/base/field.py +++ b/pydra/compose/base/field.py @@ -229,7 +229,12 @@ def mandatory(self): @requires.validator def _requires_validator(self, _, value): - if value and self.type not in (ty.Any, bool) and not is_optional(self.type): + if ( + value + and self.type not in (ty.Any, bool) + and not is_optional(self.type) + and not issubclass(self.type, ty.Sequence) + ): raise ValueError( f"Fields with requirements must be of optional type (i.e. in union " f"with None) or boolean, not type {self.type} ({self!r})"