You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blog/console-based-representation-in-astx/index.html
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1822,9 +1822,9 @@ <h1 id="example-an-ast-of-a-series-of-mathematical-operations">Example: an AST o
1822
1822
$~~~~$ <code>a</code>, <code>b</code>, and <code>c</code> are variables.\
1823
1823
The first thing to do is, in your Jupyter Notebook instance, import <code>display</code>, which will allow you to have a basic visualization of the AST, and the astx library itself. </p>
1824
1824
<divclass="language-python highlight"><pre><span></span><code><spanid="__span-0-1"><aid="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><spanclass="c1"># import display for AST visualization</span>
<p>Then we create an instance of the Module class, and this instance will be the first node of the tree, or the root node. After that, we declare the variables and literal that will be part of the basic operation that we will parse into an AST.</p>
</span><spanid="__span-4-6"><aid="__codelineno-4-6" name="__codelineno-4-6" href="#__codelineno-4-6"></a><spanclass="c1"># Creating a dummy dataset</span>
1886
1886
</span><spanid="__span-4-7"><aid="__codelineno-4-7" name="__codelineno-4-7" href="#__codelineno-4-7"></a><spanclass="n">num_rows</span><spanclass="o">=</span><spanclass="mi">100</span><spanclass="c1"># Number of rows</span>
@@ -1966,19 +1966,20 @@ <h3 class="code-label">
1966
1966
<divclass="language-python highlight"><pre><span></span><code><spanid="__span-6-1"><aid="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a><spanclass="c1"># Dynamic task scheduling with Dask</span>
<p>Given Makim's active development, pinning to a specific version is recommended to ensure consistency.</p>
1830
1830
<p>For this tutorial, we will disable the output color feature provided by typer, the command-line interface engine used by <strong>Makim</strong>.</p>
<p>To demonstrate the basic usage of <code>plum-dispatch</code>, let's start with a simple example. Suppose we have a function that needs to behave differently when passed an integer versus when it's passed a string.</p>
<p>In this example, <code>Processor</code> has two <code>process</code> methods, one for integers and one for strings. <code>plum-dispatch</code> takes care of determining which method to call based on the type of <code>data</code>.</p>
1820
1821
<h3id="advanced-example-working-with-asts">Advanced Example: Working with ASTs<aclass="headerlink" href="#advanced-example-working-with-asts" title="Permanent link"> #</a></h3>
0 commit comments