This commit is contained in:
@@ -441,6 +441,15 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#dagpipe.node--design-principles" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Design principles
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -897,6 +906,15 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#dagpipe.node--design-principles" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Design principles
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -1088,27 +1106,21 @@
|
||||
|
||||
<div class="doc doc-contents first">
|
||||
|
||||
<p>Defines the Node abstraction used by dagpipe.</p>
|
||||
<h3 id="dagpipe.node--summary">Summary</h3>
|
||||
<p>Defines the <code>Node</code> abstraction used by <code>dagpipe</code>.</p>
|
||||
<p>A node represents a single unit of pipeline execution logic. It consumes one
|
||||
<code>State</code> and produces zero, one, or many new <code>State</code> objects.</p>
|
||||
<p>Nodes are connected using a <code>Graph</code> and executed by an <code>Engine</code>.</p>
|
||||
<hr />
|
||||
<h4 id="dagpipe.node--summary">Summary</h4>
|
||||
<p>A Node represents a single unit of pipeline execution logic. It consumes one
|
||||
State and produces zero, one, or many new States.</p>
|
||||
<p>Nodes are connected using Graph and executed by Engine.</p>
|
||||
<h3 id="dagpipe.node--design-principles">Design principles</h3>
|
||||
<ul>
|
||||
<li><strong>Pure:</strong> Must not mutate input state.</li>
|
||||
<li><strong>Deterministic:</strong> Same input produces same output.</li>
|
||||
<li><strong>Stateless:</strong> Recommended to be stateless for reuse.</li>
|
||||
<li><strong>Composable:</strong> Nodes enable branching execution graphs.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<details class="notes" open>
|
||||
<summary>Notes</summary>
|
||||
<p><strong>Design Principles:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span>
|
||||
<span class="normal">3</span>
|
||||
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- **Pure:** Must not mutate input state.
|
||||
- **Deterministic:** Same input produces same output.
|
||||
- **Stateless:** Recommended to be stateless for reuse.
|
||||
- **Composable:** Nodes enable branching execution graphs.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
|
||||
<div class="doc doc-children">
|
||||
|
||||
@@ -1180,11 +1192,13 @@ State and produces zero, one, or many new States.</p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span>
|
||||
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span><code>- Represents a deterministic unit of execution in the pipeline graph.
|
||||
- Consumes one State and produces zero, one, or many derived States.
|
||||
- Consumes one `State` and produces zero, one, or many derived states.
|
||||
- Defines execution logic and enables branching, filtering, and transformation.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
<p><strong>Guarantees:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Nodes must never mutate the input State. Instances are singletons per subclass and reused across executions.
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Nodes must never mutate the input `State`.
|
||||
- Instances are singletons per subclass and reused across executions.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
|
||||
@@ -1229,7 +1243,7 @@ State and produces zero, one, or many new States.</p>
|
||||
|
||||
|
||||
</h6>
|
||||
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="fm">__new__</span><span class="p">()</span>
|
||||
<div class="language-python doc-signature highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="fm">__new__</span><span class="p">()</span> <span class="o">-></span> <span class="nf">Node</span>
|
||||
</span></code></pre></div></td></tr></table></div>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
@@ -1248,6 +1262,7 @@ State and produces zero, one, or many new States.</p>
|
||||
<tbody>
|
||||
<tr class="doc-section-item">
|
||||
<td><code>Node</code></td> <td>
|
||||
<code><a class="autorefs autorefs-internal" title="dagpipe.node.Node" href="#dagpipe.node.Node">Node</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
@@ -1384,7 +1399,7 @@ State and produces zero, one, or many new States.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Create a child State attributed to this node.</p>
|
||||
<p>Create a child <code>State</code> attributed to this node.</p>
|
||||
|
||||
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
@@ -1401,7 +1416,7 @@ State and produces zero, one, or many new States.</p>
|
||||
<tr class="doc-section-item">
|
||||
<td><code>state</code></td>
|
||||
<td>
|
||||
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
@@ -1469,7 +1484,7 @@ State and produces zero, one, or many new States.</p>
|
||||
<tbody>
|
||||
<tr class="doc-section-item">
|
||||
<td><code>State</code></td> <td>
|
||||
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
@@ -1484,7 +1499,9 @@ State and produces zero, one, or many new States.</p>
|
||||
<details class="notes" open>
|
||||
<summary>Notes</summary>
|
||||
<p><strong>Responsibilities:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Convenience wrapper around State.fork() that automatically records this node's ID in state history.
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><code>- Convenience wrapper around `State.fork()` that automatically
|
||||
records this node's ID in state history.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
</div>
|
||||
@@ -1600,7 +1617,7 @@ State and produces zero, one, or many new States.</p>
|
||||
<tr class="doc-section-item">
|
||||
<td><code>state</code></td>
|
||||
<td>
|
||||
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
@@ -1626,7 +1643,7 @@ State and produces zero, one, or many new States.</p>
|
||||
<tbody>
|
||||
<tr class="doc-section-item">
|
||||
<td><code>State</code></td> <td>
|
||||
<code><span title="typing.Iterable">Iterable</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a>]</code>
|
||||
<code><span title="typing.Iterable">Iterable</span>[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a>]</code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
@@ -1641,7 +1658,13 @@ State and produces zero, one, or many new States.</p>
|
||||
<details class="notes" open>
|
||||
<summary>Notes</summary>
|
||||
<p><strong>Responsibilities:</strong></p>
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>- Subclasses implement specific resolution behavior. Must not mutate input state. Should use fork() to create child states. May yield zero states to terminate a branch.
|
||||
<div class="language-text highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
|
||||
<span class="normal">2</span>
|
||||
<span class="normal">3</span>
|
||||
<span class="normal">4</span></pre></div></td><td class="code"><div><pre><span></span><code>- Subclasses implement specific resolution behavior.
|
||||
- Must not mutate input state.
|
||||
- Should use `fork()` to create child states.
|
||||
- May yield zero states to terminate a branch.
|
||||
</code></pre></div></td></tr></table></div>
|
||||
</details>
|
||||
</div>
|
||||
@@ -1661,7 +1684,7 @@ State and produces zero, one, or many new States.</p>
|
||||
|
||||
<div class="doc doc-contents ">
|
||||
|
||||
<p>Execute this node on a State.</p>
|
||||
<p>Execute this node on a <code>State</code>.</p>
|
||||
|
||||
|
||||
<p><span class="doc-section-title">Parameters:</span></p>
|
||||
@@ -1678,7 +1701,7 @@ State and produces zero, one, or many new States.</p>
|
||||
<tr class="doc-section-item">
|
||||
<td><code>state</code></td>
|
||||
<td>
|
||||
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a></code>
|
||||
<code><a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a></code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
@@ -1704,7 +1727,7 @@ State and produces zero, one, or many new States.</p>
|
||||
<tbody>
|
||||
<tr class="doc-section-item">
|
||||
<td>
|
||||
<code>tuple[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../dagpipe/state/#dagpipe.state.State">State</a>, ...]</code>
|
||||
<code>tuple[<a class="autorefs autorefs-internal" title="dagpipe.state.State" href="../state/#dagpipe.state.State">State</a>, ...]</code>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
@@ -1732,7 +1755,7 @@ Derived execution states.</p>
|
||||
</td>
|
||||
<td>
|
||||
<div class="doc-md-description">
|
||||
<p>If resolve() yields a non-State object.</p>
|
||||
<p>If <code>resolve()</code> yields a non-<code>State</code> object.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user