Skip to content

Commit

Permalink
deploy: b334c93
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterKraus committed Nov 20, 2024
1 parent 087864b commit 510b035
Show file tree
Hide file tree
Showing 18 changed files with 131 additions and 103 deletions.
18 changes: 14 additions & 4 deletions main/_sources/usage.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,23 @@ Each *job* stores its data and logs in its own *job* folder, which is a subfolde
Note that a *pipeline* dashboard functionality is planned for a future version of ``tomato``.


Final job data
**************
Final job data and metadata
***************************
By default, all data in the *job* folder is processed to create a NetCDF file. The NetCDF files can be read using :func:`xaray.open_datatree`, returning a :class:`xarray.DataTree`.

In the root node of the :class:`~xarray.DataTree`, a copy of the full *payload* is included, serialised as a json :class:`str`. Additionally, execution-specific metadata, such as the *pipeline* ``name``, and *job* submission/execution/completion time are stored on the root node, too.
In the root node of the :class:`~xarray.DataTree`, the :obj:`attrs` dictionary contains all **tomato**-relevant metadata. This currently includes:

The child nodes of the :class:`~xarray.DataTree` contain the actual data from each *pipeline* *component*, unit-annotated using the CF Metadata Conventions. The node names correspond to the ``role`` that *component* fullfils in a *pipeline*.
- ``tomato_version`` which is the version of **tomato** used to create the NetCDF file,
- ``tomato_Job`` which is the *job* object serialised as a json :class:`str`, containing the full *payload*, sample information, as well as *job* submission/execution/completion time.

The child nodes of the :class:`~xarray.DataTree` contain:

- the actual data from each *pipeline* *component*, unit-annotated using the CF Metadata Conventions. The node names correspond to the ``role`` that *component* fullfils in a *pipeline*.
- a ``tomato_Component`` entry in the :obj:`attrs` object, which is the *component* object serialised as a json :class:`str`, containing information about the *device* address and channel that define the *component*, the *driver* and *device* names, as well as the *component* capabilities.

.. note::

The ``tomato_Job`` and ``tomato_Component`` entries can be converted back to the source objects using :func:`tomato.models.Job.model_validate_json` and :func:`tomato.models.Component.model_validate_json`, respectively.

.. note::

Expand Down
2 changes: 1 addition & 1 deletion main/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '1.0rc3.dev1',
VERSION: '1.0rc3.dev2',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
16 changes: 8 additions & 8 deletions main/apidoc/tomato.daemon.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>tomato.daemon package &mdash; tomato 1.0rc3.dev1 documentation</title>
<title>tomato.daemon package &mdash; tomato 1.0rc3.dev2 documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/autodoc_pydantic.css" type="text/css" />
Expand All @@ -16,7 +16,7 @@

<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=31ac4bcd"></script>
<script src="../_static/documentation_options.js?v=0654c1a7"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/js/theme.js"></script>
Expand All @@ -39,7 +39,7 @@
<img src="../_static/tomato.png" class="logo" alt="Logo"/>
</a>
<div class="version">
1.0rc3.dev1
1.0rc3.dev2
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
Expand Down Expand Up @@ -287,9 +287,9 @@ <h3><strong>tomato.daemon.cmd</strong>: command parsing for tomato daemon<a clas

<dl class="py function">
<dt class="sig sig-object py" id="tomato.daemon.io.merge_netcdfs">
<span class="sig-prename descclassname"><span class="pre">tomato.daemon.io.</span></span><span class="sig-name descname"><span class="pre">merge_netcdfs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">jobpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">outpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Path</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tomato.daemon.io.merge_netcdfs" title="Link to this definition"></a></dt>
<dd><p>Merges the individual pickled <code class="xref py py-class docutils literal notranslate"><span class="pre">xr.Datasets</span></code> of each Component found in
<cite>jobpath</cite> into a single <code class="xref py py-class docutils literal notranslate"><span class="pre">xr.DataTree</span></code>, which is then stored in the NetCDF file,
<span class="sig-prename descclassname"><span class="pre">tomato.daemon.io.</span></span><span class="sig-name descname"><span class="pre">merge_netcdfs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">job</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="tomato.html#tomato.models.Job" title="tomato.models.Job"><span class="pre">Job</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">snapshot</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tomato.daemon.io.merge_netcdfs" title="Link to this definition"></a></dt>
<dd><p>Merges the individual pickled <code class="xref py py-class docutils literal notranslate"><span class="pre">xr.Datasets</span></code> of each Component found in <code class="xref py py-obj docutils literal notranslate"><span class="pre">job.jobpath</span></code>
into a single <code class="xref py py-class docutils literal notranslate"><span class="pre">xr.DataTree</span></code>, which is then stored in the NetCDF file,
using the Component <cite>role</cite> as the group label.</p>
</dd></dl>

Expand Down Expand Up @@ -388,7 +388,7 @@ <h3><strong>tomato.daemon.cmd</strong>: command parsing for tomato daemon<a clas

<dl class="py function">
<dt class="sig sig-object py" id="tomato.daemon.job.job_main_loop">
<span class="sig-prename descclassname"><span class="pre">tomato.daemon.job.</span></span><span class="sig-name descname"><span class="pre">job_main_loop</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">context</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Context</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">port</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">payload</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="../quickstart.html#dgbowl_schemas.tomato.payload.Payload" title="dgbowl_schemas.tomato.payload_1_0.Payload"><span class="pre">Payload</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">pipname</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">jobpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">snappath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">logpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Path</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="headerlink" href="#tomato.daemon.job.job_main_loop" title="Link to this definition"></a></dt>
<span class="sig-prename descclassname"><span class="pre">tomato.daemon.job.</span></span><span class="sig-name descname"><span class="pre">job_main_loop</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">context</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Context</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">port</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">job</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference internal" href="tomato.html#tomato.models.Job" title="tomato.models.Job"><span class="pre">Job</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">pipname</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">logpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Path</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="headerlink" href="#tomato.daemon.job.job_main_loop" title="Link to this definition"></a></dt>
<dd><p>The main loop function of <cite>tomato-job</cite>, split for better readability.</p>
</dd></dl>

Expand Down Expand Up @@ -422,7 +422,7 @@ <h3><strong>tomato.daemon.cmd</strong>: command parsing for tomato daemon<a clas
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Other Versions</span>
v: 1.0rc3.dev1
v: 1.0rc3.dev2
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
Expand Down
Loading

0 comments on commit 510b035

Please sign in to comment.