Skip to content

Commit

Permalink
deploy: a8b3281
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl5766 committed Nov 8, 2024
1 parent 9e0c368 commit 0966335
Show file tree
Hide file tree
Showing 9 changed files with 1,005 additions and 22 deletions.
11 changes: 10 additions & 1 deletion API/algs.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@
<li class="toctree-l1"><a class="reference internal" href="imfs.html">cvpl_tools.im.fs.py</a></li>
<li class="toctree-l1"><a class="reference internal" href="ndblock.html">cvpl_tools.im.ndblock.py</a></li>
<li class="toctree-l1"><a class="reference internal" href="seg_process.html">cvpl_tools.im.seg_process.py</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">cvpl_tools.im.algs</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">cvpl_tools.im.algs</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#cvpl_tools.im.algs.dask_label.label"><code class="docutils literal notranslate"><span class="pre">label()</span></code></a></li>
</ul>
</li>
</ul>

</div>
Expand Down Expand Up @@ -89,6 +92,12 @@
<span id="algs"></span><h1>cvpl_tools/im/algs<a class="headerlink" href="#cvpl-tools-im-algs" title="Permalink to this heading"></a></h1>
<p>This subdirectory defines relevant algorithms for parallel processing of nd-images.</p>
<p class="rubric">APIs</p>
<dl class="py function">
<dt class="sig sig-object py" id="cvpl_tools.im.algs.dask_label.label">
<span class="sig-prename descclassname"><span class="pre">cvpl_tools.im.algs.dask_label.</span></span><span class="sig-name descname"><span class="pre">label</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">im</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span><span class="p"><span class="pre">[</span></span><span class="pre">Any</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">dtype</span><span class="p"><span class="pre">[</span></span><span class="pre">_ScalarType_co</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">Array</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="ndblock.html#cvpl_tools.im.ndblock.NDBlock" title="cvpl_tools.im.ndblock.NDBlock"><span class="pre">NDBlock</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">cptr</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">CachePointer</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output_dtype</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dtype</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">viewer_args</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</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">ndarray</span><span class="p"><span class="pre">[</span></span><span class="pre">Any</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">dtype</span><span class="p"><span class="pre">[</span></span><span class="pre">_ScalarType_co</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">Array</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference internal" href="ndblock.html#cvpl_tools.im.ndblock.NDBlock" title="cvpl_tools.im.ndblock.NDBlock"><span class="pre">NDBlock</span></a></span></span><a class="headerlink" href="#cvpl_tools.im.algs.dask_label.label" title="Permalink to this definition"></a></dt>
<dd><p>Return (lbl_im, nlbl) where lbl_im is a globally labeled image of the same type/chunk size as the input</p>
</dd></dl>

</section>


Expand Down
259 changes: 258 additions & 1 deletion API/imfs.html

Large diffs are not rendered by default.

32 changes: 24 additions & 8 deletions API/ndblock.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<li class="toctree-l3"><a class="reference internal" href="#cvpl_tools.im.ndblock.NDBlock.is_numpy"><code class="docutils literal notranslate"><span class="pre">NDBlock.is_numpy()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cvpl_tools.im.ndblock.NDBlock.load"><code class="docutils literal notranslate"><span class="pre">NDBlock.load()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cvpl_tools.im.ndblock.NDBlock.map_ndblocks"><code class="docutils literal notranslate"><span class="pre">NDBlock.map_ndblocks()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cvpl_tools.im.ndblock.NDBlock.persist"><code class="docutils literal notranslate"><span class="pre">NDBlock.persist()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cvpl_tools.im.ndblock.NDBlock.reduce"><code class="docutils literal notranslate"><span class="pre">NDBlock.reduce()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cvpl_tools.im.ndblock.NDBlock.save"><code class="docutils literal notranslate"><span class="pre">NDBlock.save()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cvpl_tools.im.ndblock.NDBlock.select_columns"><code class="docutils literal notranslate"><span class="pre">NDBlock.select_columns()</span></code></a></li>
Expand Down Expand Up @@ -120,12 +121,11 @@
from the side of the tail first</p>
<dl class="py method">
<dt class="sig sig-object py" id="cvpl_tools.im.ndblock.NDBlock.as_dask_array">
<span class="sig-name descname"><span class="pre">as_dask_array</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tmp_dirpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</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">Array</span></span></span><a class="headerlink" href="#cvpl_tools.im.ndblock.NDBlock.as_dask_array" title="Permalink to this definition"></a></dt>
<span class="sig-name descname"><span class="pre">as_dask_array</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">storage_options</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</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">Array</span></span></span><a class="headerlink" href="#cvpl_tools.im.ndblock.NDBlock.as_dask_array" title="Permalink to this definition"></a></dt>
<dd><p>Get a copy of the array value as dask array</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>tmp_dirpath</strong> – Avoid double computation, best provided if input format
is ReprFormat.DICT_BLOCK_INDEX_SLICES and is dask instead of numpy</p>
<dd class="field-odd"><p><strong>storage_options</strong> – Optionally, specify a compression format when persist</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>converted/retrieved dask array</p>
Expand Down Expand Up @@ -173,7 +173,8 @@
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>file</strong> – The path to load from, same as used in the save() function</p></li>
<li><p><strong>storage_options</strong> – Specifies options in saving method and saved file format</p></li>
<li><p><strong>storage_options</strong> – Specifies options in saving method and saved file format; this includes ‘compressor’ and
‘port_protocol’</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
Expand Down Expand Up @@ -208,6 +209,23 @@
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cvpl_tools.im.ndblock.NDBlock.persist">
<span class="sig-name descname"><span class="pre">persist</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">compressor</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#cvpl_tools.im.ndblock.NDBlock" title="cvpl_tools.im.ndblock.NDBlock"><span class="pre">NDBlock</span></a></span></span><a class="headerlink" href="#cvpl_tools.im.ndblock.NDBlock.persist" title="Permalink to this definition"></a></dt>
<dd><p>Using dask client persist() to save and reload the NDBlock object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ndblock</strong> – The NDBlock to be saved</p></li>
<li><p><strong>compressor</strong> – The compression used</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Reloaded NDBlock object; if is numpy, then no saving is done and the object is directly returned</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="cvpl_tools.im.ndblock.NDBlock.reduce">
<span class="sig-name descname"><span class="pre">reduce</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">force_numpy</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</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">ndarray</span><span class="p"><span class="pre">[</span></span><span class="pre">Any</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">dtype</span><span class="p"><span class="pre">[</span></span><span class="pre">_ScalarType_co</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">Array</span></span></span><a class="headerlink" href="#cvpl_tools.im.ndblock.NDBlock.reduce" title="Permalink to this definition"></a></dt>
Expand Down Expand Up @@ -262,13 +280,11 @@

<dl class="py method">
<dt class="sig sig-object py" id="cvpl_tools.im.ndblock.NDBlock.to_dask_array">
<span class="sig-name descname"><span class="pre">to_dask_array</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tmp_dirpath</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cvpl_tools.im.ndblock.NDBlock.to_dask_array" title="Permalink to this definition"></a></dt>
<span class="sig-name descname"><span class="pre">to_dask_array</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">storage_options</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#cvpl_tools.im.ndblock.NDBlock.to_dask_array" title="Permalink to this definition"></a></dt>
<dd><p>Convert representation format to dask array</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>tmp_dirpath</strong> – An empty path to create a temporary save file, best provided if input format
is ReprFormat.DICT_BLOCK_INDEX_SLICES and is dask instead of numpy, and you want to
avoid repeated computations</p>
<dd class="field-odd"><p><strong>storage_options</strong> – Optionally, specify a compression format when persist</p>
</dd>
</dl>
</dd></dl>
Expand Down
Loading

0 comments on commit 0966335

Please sign in to comment.