Skip to content

Commit

Permalink
deploy: 8ffcf52
Browse files Browse the repository at this point in the history
  • Loading branch information
utf committed Dec 5, 2023
1 parent 2966b5e commit 6bf25bd
Show file tree
Hide file tree
Showing 53 changed files with 1,372 additions and 669 deletions.
Binary file modified .doctrees/changelog.doctree
Binary file not shown.
Binary file modified .doctrees/contributing.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/index.doctree
Binary file not shown.
Binary file modified .doctrees/jobflow.core.doctree
Binary file not shown.
Binary file modified .doctrees/jobflow.managers.doctree
Binary file not shown.
Binary file modified .doctrees/jobflow.utils.doctree
Binary file not shown.
266 changes: 202 additions & 64 deletions .doctrees/nbsphinx/tutorials/5-dynamic-flows.ipynb

Large diffs are not rendered by default.

Binary file modified .doctrees/tutorials/5-dynamic-flows.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ <h1>All modules for which code is available</h1>

</aside>
</div>
</div><script src="../_static/documentation_options.js?v=468bc497"></script>
</div><script src="../_static/documentation_options.js?v=e2f3408e"></script>
<script src="../_static/doctools.js?v=888ff710"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/scripts/furo.js?v=32e29ea5"></script>
Expand Down
47 changes: 24 additions & 23 deletions _modules/jobflow/core/flow.html

Large diffs are not rendered by default.

41 changes: 25 additions & 16 deletions _modules/jobflow/core/job.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ <h1>Source code for jobflow.core.job</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">jobflow.utils.uuid</span> <span class="kn">import</span> <span class="n">suuid</span>

<span class="k">if</span> <span class="n">typing</span><span class="o">.</span><span class="n">TYPE_CHECKING</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Callable</span><span class="p">,</span> <span class="n">Hashable</span><span class="p">,</span> <span class="n">Sequence</span>
<span class="kn">from</span> <span class="nn">collections.abc</span> <span class="kn">import</span> <span class="n">Hashable</span><span class="p">,</span> <span class="n">Sequence</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Callable</span>

<span class="kn">from</span> <span class="nn">networkx</span> <span class="kn">import</span> <span class="n">DiGraph</span>
<span class="kn">from</span> <span class="nn">pydantic</span> <span class="kn">import</span> <span class="n">BaseModel</span>
Expand All @@ -270,8 +271,6 @@ <h1>Source code for jobflow.core.job</h1><div class="highlight"><pre>

<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>

<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;job&quot;</span><span class="p">,</span> <span class="s2">&quot;Job&quot;</span><span class="p">,</span> <span class="s2">&quot;Response&quot;</span><span class="p">,</span> <span class="s2">&quot;JobConfig&quot;</span><span class="p">,</span> <span class="s2">&quot;store_inputs&quot;</span><span class="p">]</span>


<div class="viewcode-block" id="JobConfig">
<a class="viewcode-back" href="../../../jobflow.core.html#jobflow.core.job.JobConfig">[docs]</a>
Expand Down Expand Up @@ -821,6 +820,7 @@ <h1>Source code for jobflow.core.job</h1><div class="highlight"><pre>

<span class="kn">from</span> <span class="nn">jobflow</span> <span class="kn">import</span> <span class="n">CURRENT_JOB</span>
<span class="kn">from</span> <span class="nn">jobflow.core.flow</span> <span class="kn">import</span> <span class="n">get_flow</span>
<span class="kn">from</span> <span class="nn">jobflow.core.schemas</span> <span class="kn">import</span> <span class="n">JobStoreDocument</span>

<span class="n">index_str</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">&quot;, </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">index</span><span class="si">}</span><span class="s2">&quot;</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">index</span> <span class="o">!=</span> <span class="mi">1</span> <span class="k">else</span> <span class="s2">&quot;&quot;</span>
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Starting job - </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="si">}</span><span class="s2"> (</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">uuid</span><span class="si">}{</span><span class="n">index_str</span><span class="si">}</span><span class="s2">)&quot;</span><span class="p">)</span>
Expand Down Expand Up @@ -894,15 +894,15 @@ <h1>Source code for jobflow.core.job</h1><div class="highlight"><pre>
<span class="p">)</span> <span class="kn">from</span> <span class="nn">err</span>

<span class="n">save</span> <span class="o">=</span> <span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="s2">&quot;output&quot;</span> <span class="k">if</span> <span class="n">v</span> <span class="ow">is</span> <span class="kc">True</span> <span class="k">else</span> <span class="n">v</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_kwargs</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span>
<span class="n">data</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;uuid&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">uuid</span><span class="p">,</span>
<span class="s2">&quot;index&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">index</span><span class="p">,</span>
<span class="s2">&quot;output&quot;</span><span class="p">:</span> <span class="n">output</span><span class="p">,</span>
<span class="s2">&quot;completed_at&quot;</span><span class="p">:</span> <span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">isoformat</span><span class="p">(),</span>
<span class="s2">&quot;metadata&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">,</span>
<span class="s2">&quot;hosts&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">hosts</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
<span class="p">}</span>
<span class="n">data</span><span class="p">:</span> <span class="n">JobStoreDocument</span> <span class="o">=</span> <span class="n">JobStoreDocument</span><span class="p">(</span>
<span class="n">uuid</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">uuid</span><span class="p">,</span>
<span class="n">index</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">index</span><span class="p">,</span>
<span class="n">output</span><span class="o">=</span><span class="n">output</span><span class="p">,</span>
<span class="n">completed_at</span><span class="o">=</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">isoformat</span><span class="p">(),</span>
<span class="n">metadata</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">metadata</span><span class="p">,</span>
<span class="n">hosts</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">hosts</span><span class="p">,</span>
<span class="n">name</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">store</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;uuid&quot;</span><span class="p">,</span> <span class="s2">&quot;index&quot;</span><span class="p">],</span> <span class="n">save</span><span class="o">=</span><span class="n">save</span><span class="p">)</span>

<span class="n">CURRENT_JOB</span><span class="o">.</span><span class="n">reset</span><span class="p">()</span>
Expand Down Expand Up @@ -1521,6 +1521,8 @@ <h1>Source code for jobflow.core.job</h1><div class="highlight"><pre>



<div class="viewcode-block" id="apply_schema">
<a class="viewcode-back" href="../../../jobflow.core.html#jobflow.core.job.apply_schema">[docs]</a>
<span class="k">def</span> <span class="nf">apply_schema</span><span class="p">(</span><span class="n">output</span><span class="p">:</span> <span class="n">Any</span><span class="p">,</span> <span class="n">schema</span><span class="p">:</span> <span class="nb">type</span><span class="p">[</span><span class="n">BaseModel</span><span class="p">]</span> <span class="o">|</span> <span class="kc">None</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Apply schema to job outputs.</span>
Expand Down Expand Up @@ -1556,7 +1558,8 @@ <h1>Source code for jobflow.core.job</h1><div class="highlight"><pre>
<span class="sa">f</span><span class="s2">&quot;of </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">output</span><span class="p">)</span><span class="o">.</span><span class="vm">__name__</span><span class="si">}</span><span class="s2">.&quot;</span>
<span class="p">)</span>

<span class="k">return</span> <span class="n">schema</span><span class="p">(</span><span class="o">**</span><span class="n">output</span><span class="p">)</span>
<span class="k">return</span> <span class="n">schema</span><span class="p">(</span><span class="o">**</span><span class="n">output</span><span class="p">)</span></div>



<div class="viewcode-block" id="store_inputs">
Expand All @@ -1578,6 +1581,8 @@ <h1>Source code for jobflow.core.job</h1><div class="highlight"><pre>



<div class="viewcode-block" id="prepare_replace">
<a class="viewcode-back" href="../../../jobflow.core.html#jobflow.core.job.prepare_replace">[docs]</a>
<span class="k">def</span> <span class="nf">prepare_replace</span><span class="p">(</span>
<span class="n">replace</span><span class="p">:</span> <span class="n">jobflow</span><span class="o">.</span><span class="n">Flow</span> <span class="o">|</span> <span class="n">Job</span> <span class="o">|</span> <span class="nb">list</span><span class="p">[</span><span class="n">Job</span><span class="p">],</span>
<span class="n">current_job</span><span class="p">:</span> <span class="n">Job</span><span class="p">,</span>
Expand Down Expand Up @@ -1634,9 +1639,12 @@ <h1>Source code for jobflow.core.job</h1><div class="highlight"><pre>

<span class="n">replace</span> <span class="o">=</span> <span class="n">Flow</span><span class="p">(</span><span class="n">jobs</span><span class="o">=</span><span class="n">replace</span><span class="p">,</span> <span class="n">output</span><span class="o">=</span><span class="n">replace</span><span class="o">.</span><span class="n">output</span><span class="p">)</span>

<span class="k">return</span> <span class="n">replace</span>
<span class="k">return</span> <span class="n">replace</span></div>



<div class="viewcode-block" id="pass_manager_config">
<a class="viewcode-back" href="../../../jobflow.core.html#jobflow.core.job.pass_manager_config">[docs]</a>
<span class="k">def</span> <span class="nf">pass_manager_config</span><span class="p">(</span>
<span class="n">jobs</span><span class="p">:</span> <span class="n">Job</span> <span class="o">|</span> <span class="n">jobflow</span><span class="o">.</span><span class="n">Flow</span> <span class="o">|</span> <span class="nb">list</span><span class="p">[</span><span class="n">Job</span> <span class="o">|</span> <span class="n">jobflow</span><span class="o">.</span><span class="n">Flow</span><span class="p">],</span>
<span class="n">manager_config</span><span class="p">:</span> <span class="nb">dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">],</span>
Expand Down Expand Up @@ -1674,7 +1682,8 @@ <h1>Source code for jobflow.core.job</h1><div class="highlight"><pre>

<span class="c1"># update manager config</span>
<span class="k">for</span> <span class="n">ajob</span> <span class="ow">in</span> <span class="n">all_jobs</span><span class="p">:</span>
<span class="n">ajob</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">manager_config</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="n">manager_config</span><span class="p">)</span>
<span class="n">ajob</span><span class="o">.</span><span class="n">config</span><span class="o">.</span><span class="n">manager_config</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="n">manager_config</span><span class="p">)</span></div>

</pre></div>
</article>
</div>
Expand Down Expand Up @@ -1706,7 +1715,7 @@ <h1>Source code for jobflow.core.job</h1><div class="highlight"><pre>

</aside>
</div>
</div><script src="../../../_static/documentation_options.js?v=468bc497"></script>
</div><script src="../../../_static/documentation_options.js?v=e2f3408e"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../_static/scripts/furo.js?v=32e29ea5"></script>
Expand Down
9 changes: 5 additions & 4 deletions _modules/jobflow/core/maker.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,6 @@ <h1>Source code for jobflow.core.maker</h1><div class="highlight"><pre>

<span class="kn">import</span> <span class="nn">jobflow</span>

<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;Maker&quot;</span><span class="p">]</span>


<div class="viewcode-block" id="Maker">
<a class="viewcode-back" href="../../../jobflow.core.html#jobflow.core.maker.Maker">[docs]</a>
Expand Down Expand Up @@ -488,6 +486,8 @@ <h1>Source code for jobflow.core.maker</h1><div class="highlight"><pre>



<div class="viewcode-block" id="recursive_call">
<a class="viewcode-back" href="../../../jobflow.core.html#jobflow.core.maker.recursive_call">[docs]</a>
<span class="k">def</span> <span class="nf">recursive_call</span><span class="p">(</span>
<span class="n">obj</span><span class="p">:</span> <span class="n">Maker</span><span class="p">,</span>
<span class="n">func</span><span class="p">:</span> <span class="n">Callable</span><span class="p">[[</span><span class="n">Maker</span><span class="p">],</span> <span class="n">Maker</span><span class="p">],</span>
Expand Down Expand Up @@ -567,7 +567,8 @@ <h1>Source code for jobflow.core.maker</h1><div class="highlight"><pre>
<span class="n">new_obj</span> <span class="o">=</span> <span class="n">obj</span><span class="o">.</span><span class="n">from_dict</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
<span class="k">if</span> <span class="n">_filter</span><span class="p">(</span><span class="n">obj</span><span class="p">):</span>
<span class="n">new_obj</span> <span class="o">=</span> <span class="n">func</span><span class="p">(</span><span class="n">new_obj</span><span class="p">)</span>
<span class="k">return</span> <span class="n">new_obj</span>
<span class="k">return</span> <span class="n">new_obj</span></div>

</pre></div>
</article>
</div>
Expand Down Expand Up @@ -599,7 +600,7 @@ <h1>Source code for jobflow.core.maker</h1><div class="highlight"><pre>

</aside>
</div>
</div><script src="../../../_static/documentation_options.js?v=468bc497"></script>
</div><script src="../../../_static/documentation_options.js?v=e2f3408e"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../_static/scripts/furo.js?v=32e29ea5"></script>
Expand Down
Loading

0 comments on commit 6bf25bd

Please sign in to comment.