Skip to content

Commit dd9e493

Browse files
author
Vic-Nas
committed
Auto-generate docs and bump version to 0.17 [skip ci]
1 parent a115cae commit dd9e493

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.16
1+
0.17

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="vicutils",
9-
version="0.16",
9+
version="0.17",
1010
packages=find_packages(),
1111
install_requires=[],
1212

vicutils/printBin.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ <h2 class="section-title" id="header-functions">Functions</h2>
7979
<div class="desc"><p>Calculates the depth (height) of a binary tree.</p></div>
8080
</dd>
8181
<dt id="printBin.mapNodesToCodes"><code class="name flex">
82-
<span>def <span class="ident">mapNodesToCodes</span></span>(<span>node<a title="printBin.BinaryNode" href="#printBin.BinaryNode">BinaryNode</a>,<br>valueFillChar,<br>unitSize,<br>code='',<br>memo=None)</span>
82+
<span>def <span class="ident">mapNodesToCodes</span></span>(<span>node, valueFillChar, unitSize, code='', memo=None)</span>
8383
</code></dt>
8484
<dd>
8585
<details class="source">
8686
<summary>
8787
<span>Expand source code</span>
8888
</summary>
89-
<pre><code class="python">def mapNodesToCodes(node: BinaryNode, valueFillChar, unitSize, code=&#34;&#34;, memo=None):
89+
<pre><code class="python">def mapNodesToCodes(node, valueFillChar, unitSize, code=&#34;&#34;, memo=None):
9090
&#34;&#34;&#34;
9191
Recursively maps all nodes to their binary path codes.
9292

@@ -239,14 +239,14 @@ <h2 id="args">Args</h2>
239239
</dl></div>
240240
</dd>
241241
<dt id="printBin.nodeToString"><code class="name flex">
242-
<span>def <span class="ident">nodeToString</span></span>(<span>node: <a title="printBin.BinaryNode" href="#printBin.BinaryNode">BinaryNode</a>,<br>depth=-1,<br>valueFillChar=None,<br>connectorFillChar=None,<br>unitSize=None,<br>removeEmpty=True)</span>
242+
<span>def <span class="ident">nodeToString</span></span>(<span>node: <a title="printBin.BinaryNode" href="#printBin.BinaryNode">BinaryNode</a>,<br>depth=-1,<br>valueFillChar=None,<br>connectorFillChar=None,<br>unitSize=None,<br>removeEmpty=True,<br>showConnectors=True)</span>
243243
</code></dt>
244244
<dd>
245245
<details class="source">
246246
<summary>
247247
<span>Expand source code</span>
248248
</summary>
249-
<pre><code class="python">def nodeToString(node: BinaryNode, depth=-1, valueFillChar=None, connectorFillChar=None, unitSize=None, removeEmpty=True):
249+
<pre><code class="python">def nodeToString(node: BinaryNode, depth=-1, valueFillChar=None, connectorFillChar=None, unitSize=None, removeEmpty=True, showConnectors=True):
250250
&#34;&#34;&#34;
251251
Converts a binary tree into a string representation for visualization.
252252

@@ -257,10 +257,16 @@ <h2 id="args">Args</h2>
257257
connectorFillChar: Character for filling horizontal gaps between node pairs
258258
unitSize: Size for centering values
259259
removeEmpty: Whether to remove empty leading columns
260+
showConnectors: Whether to show connector lines (/ and \) between nodes
260261
&#34;&#34;&#34;
261262
mat = nodeToMat(node, depth=depth, valueFillChar=valueFillChar,
262263
connectorFillChar=connectorFillChar, unitSize=unitSize, removeEmpty=removeEmpty)
263-
return &#34;\n&#34;.join(&#34;&#34;.join(row) for row in mat)</code></pre>
264+
265+
if showConnectors:
266+
return &#34;\n&#34;.join(&#34;&#34;.join(row) for row in mat)
267+
else:
268+
# Only include even rows (node values, skip odd rows with connectors)
269+
return &#34;\n&#34;.join(&#34;&#34;.join(mat[i]) for i in range(0, len(mat), 2))</code></pre>
264270
</details>
265271
<div class="desc"><p>Converts a binary tree into a string representation for visualization.</p>
266272
<h2 id="args">Args</h2>
@@ -277,6 +283,8 @@ <h2 id="args">Args</h2>
277283
<dd>Size for centering values</dd>
278284
<dt><strong><code>removeEmpty</code></strong></dt>
279285
<dd>Whether to remove empty leading columns</dd>
286+
<dt><strong><code>showConnectors</code></strong></dt>
287+
<dd>Whether to show connector lines (/ and ) between nodes</dd>
280288
</dl></div>
281289
</dd>
282290
</dl>

0 commit comments

Comments
 (0)