Skip to content
Snippets Groups Projects
Commit 0e9965e6 authored by lkugler's avatar lkugler
Browse files

docs

parent 4844b3ec
No related branches found
No related tags found
No related merge requests found
Adding and modifying scripts Adding and modifying scripts
============================ ============================
Workflow methods are defined in the :class:`dartwrf.WorkFlows` class (`dartwrf/workflows.py`). Workflow methods are defined in the :class:`dartwrf.workflows.WorkFlows` class (`dartwrf/workflows.py`).
A workflow method is for example :meth:`dartwrf.WorkFlows.assimilate`, which can be run like this A workflow method is for example :meth:`dartwrf.workflows.WorkFlows.assimilate`, which can be run like this
.. code-block:: python .. code-block:: python
from dartwrf.workflows import WorkFlows from dartwrf.workflows import WorkFlows
...@@ -16,7 +16,7 @@ A workflow method is for example :meth:`dartwrf.WorkFlows.assimilate`, which can ...@@ -16,7 +16,7 @@ A workflow method is for example :meth:`dartwrf.WorkFlows.assimilate`, which can
id = w.assimilate(assim_time, prior_init_time, prior_valid_time, prior_path_exp) id = w.assimilate(assim_time, prior_init_time, prior_valid_time, prior_path_exp)
Calling :meth:`dartwrf.WorkFlows.assimilate` triggers the execution of the script `dartwrf/assim_synth_obs.py`. Calling :meth:`dartwrf.workflows.WorkFlows.assimilate` triggers the execution of the script `dartwrf/assim_synth_obs.py`.
- Why do I need a separate script (in this case `assim_synth_obs.py`) to execute a script? - Why do I need a separate script (in this case `assim_synth_obs.py`) to execute a script?
Because some users need to use SLURM, which can only call scripts, not run python code directly. Because some users need to use SLURM, which can only call scripts, not run python code directly.
...@@ -26,6 +26,7 @@ Recipe to add new functionality ...@@ -26,6 +26,7 @@ Recipe to add new functionality
Do you need a new script? If not, use an existing one. Do you need a new script? If not, use an existing one.
If you need write a new script, you need to If you need write a new script, you need to
#. write a workflow method (`dartwrf/workflows.py`), e.g. copy and modify an existing one, #. 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 #. 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 #. write the script and parse the command-line arguments
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment