From 71df9af61486a7bbfb10bd48e78edaf012b67d9a Mon Sep 17 00:00:00 2001 From: lkugler <lukas.kugler@gmail.com> Date: Thu, 18 Jan 2024 12:26:00 +0100 Subject: [PATCH] docs --- docs/source/custom_scripts.rst | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/source/custom_scripts.rst b/docs/source/custom_scripts.rst index 350a8a6..bedf0e1 100644 --- a/docs/source/custom_scripts.rst +++ b/docs/source/custom_scripts.rst @@ -23,11 +23,19 @@ Calling :meth:`dartwrf.workflows.WorkFlows.assimilate` triggers the execution of Recipe to add new functionality ******************************* -Do you need a new script? If not, use an existing one. -If you need write a new script, you need to +Option 1: Add a function in an existing script +---------------------------------------------- -#. write a workflow method (`dartwrf/workflows.py`), e.g. copy and modify an existing one, -#. therein you call the script with :meth:`dartwrf.utils.ClusterConfig.run_job` available via `self.cluster.run_job`, be careful which command-line arguments you need -#. write the script and parse the command-line arguments -#. call whatever python functions you may need +Easy. Only change the respective script in ``dartwrf/``. + + +Option 2: Add a new script +-------------------------- + +Let's say you need a new script ``verification.py``. Then you need to do the following: + +#. Write a workflow method ``WorkFlow.call_verif()`` in ``dartwrf/workflows.py``, e.g. copy and modify an existing one, +#. Inside, you call ``verification.py`` with :meth:`dartwrf.utils.ClusterConfig.run_job` (this will submit a SLURM job). Be careful which command-line arguments you need. +#. Write the script ``verification.py`` and parse the command-line arguments. +#. Lastly, call the workflow method ``WorkFlow.call_verif()`` from your control-script, e.g. ``cycled_exp.py``. -- GitLab