diff --git a/docs/source/explanation/conditional-lazy.rst b/docs/source/explanation/conditional-lazy.rst new file mode 100644 index 000000000..2ddb9be34 --- /dev/null +++ b/docs/source/explanation/conditional-lazy.rst @@ -0,0 +1,4 @@ +Conditional construction and lazy evaluation +===================================================== + +Work in progress... diff --git a/docs/source/explanation/conditional-logic.rst b/docs/source/explanation/conditional-logic.rst deleted file mode 100644 index 3ed2c600e..000000000 --- a/docs/source/explanation/conditional-logic.rst +++ /dev/null @@ -1,4 +0,0 @@ -Conditional construction -======================== - -Work in progress... diff --git a/docs/source/explanation/lazy-evaluation.rst b/docs/source/explanation/lazy-evaluation.rst deleted file mode 100644 index 4ad81b111..000000000 --- a/docs/source/explanation/lazy-evaluation.rst +++ /dev/null @@ -1,4 +0,0 @@ -Lazy evaluation -=============== - -Work in progress.... diff --git a/docs/source/howto/create-task-package.rst b/docs/source/explanation/splitting-combining.rst similarity index 65% rename from docs/source/howto/create-task-package.rst rename to docs/source/explanation/splitting-combining.rst index 3170372bb..08991c6ea 100644 --- a/docs/source/howto/create-task-package.rst +++ b/docs/source/explanation/splitting-combining.rst @@ -1,4 +1,4 @@ -Creating a task package +Splitting and combining ======================= Work in progress.... diff --git a/docs/source/howto/create-task-package.ipynb b/docs/source/howto/create-task-package.ipynb new file mode 100644 index 000000000..6479dbc78 --- /dev/null +++ b/docs/source/howto/create-task-package.ipynb @@ -0,0 +1,23 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Creating a task package" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + } + ], + "metadata": { + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/source/howto/install.ipynb b/docs/source/howto/install.ipynb new file mode 100644 index 000000000..6a0887c1c --- /dev/null +++ b/docs/source/howto/install.ipynb @@ -0,0 +1,93 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Installation" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Pydra is a pure Python package, which only depends on two packages `attrs` and `fileformats`. Therefore, it is straightforward to install via pip" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [ + "pip install pydra" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To install a development version use the `dev` install option" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "zsh:1: no matches found: pydra[dev]\n", + "Note: you may need to restart the kernel to use updated packages.\n" + ] + } + ], + "source": [ + "git clone git@github.com:nipype/pydra.git\n", + "pip install -e ./pydra[dev]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "vscode": { + "languageId": "shellscript" + } + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "wf12", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.5" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/source/howto/install.rst b/docs/source/howto/install.rst deleted file mode 100644 index 9bf6f470e..000000000 --- a/docs/source/howto/install.rst +++ /dev/null @@ -1,8 +0,0 @@ -Installation -============ - -Pydra can be installed using pip: - -.. code-block:: bash - - $ pip install pydra diff --git a/docs/source/howto/port-from-nipype.ipynb b/docs/source/howto/port-from-nipype.ipynb new file mode 100644 index 000000000..3f673cd56 --- /dev/null +++ b/docs/source/howto/port-from-nipype.ipynb @@ -0,0 +1,23 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Port interfaces from Nipype" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + } + ], + "metadata": { + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/source/howto/port-from-nipype.rst b/docs/source/howto/port-from-nipype.rst deleted file mode 100644 index 31a1e3ed0..000000000 --- a/docs/source/howto/port-from-nipype.rst +++ /dev/null @@ -1,4 +0,0 @@ -Porting tasks from Nipype -========================= - -Work in progress.... diff --git a/docs/source/index.rst b/docs/source/index.rst index f480c8780..6d84dfe15 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -112,11 +112,12 @@ Indices and tables :caption: Explanation :hidden: - explanation/conditional-logic + explanation/splitting-combining explanation/typing explanation/hashing-caching + explanation/conditional-lazy explanation/provenance - explanation/lazy-evaluation + .. toctree:: :maxdepth: 2 diff --git a/pydra/engine/workflow/base.py b/pydra/engine/workflow/base.py index b3aa00171..56c3447e6 100644 --- a/pydra/engine/workflow/base.py +++ b/pydra/engine/workflow/base.py @@ -124,6 +124,11 @@ def construct( return wf + @classmethod + def clear_cache(cls): + """Clear the cache of constructed workflows""" + cls._constructed.clear() + def add(self, task_spec: TaskSpec[OutputsType], name=None) -> OutputsType: """Add a node to the workflow