Skip to content

Commit

Permalink
Sort using natural key order
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Dec 13, 2023
1 parent abc3347 commit 3a5a18a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
6 changes: 4 additions & 2 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ <h2 id="E">E</h2>
<li><a href="index.html#pystream.models.config.EnvConfig.Config">EnvConfig.Config (class in pystream.models.config)</a>
</li>
<li><a href="index.html#pystream.models.config.EnvConfig.Config.extra">extra (pystream.models.config.EnvConfig.Config attribute)</a>
</li>
<li><a href="index.html#pystream.models.squire.extract_number">extract_number() (in module pystream.models.squire)</a>
</li>
</ul></td>
</tr></table>
Expand Down Expand Up @@ -236,6 +234,10 @@ <h2 id="M">M</h2>

<h2 id="N">N</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.models.squire.natural_sort_key">natural_sort_key() (in module pystream.models.squire)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#pystream.models.config.EnvConfig.ngrok_token">ngrok_token (pystream.models.config.EnvConfig attribute)</a>
</li>
Expand Down
10 changes: 5 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -474,18 +474,18 @@ <h1>Models<a class="headerlink" href="#models" title="Permalink to this heading"
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="pystream.models.squire.extract_number">
<span class="sig-prename descclassname"><span class="pre">pystream.models.squire.</span></span><span class="sig-name descname"><span class="pre">extract_number</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">int</span></span></span><a class="headerlink" href="#pystream.models.squire.extract_number" title="Permalink to this definition"></a></dt>
<dd><p>Use a regular expression to find the numeric part in the filename.</p>
<dt class="sig sig-object py" id="pystream.models.squire.natural_sort_key">
<span class="sig-prename descclassname"><span class="pre">pystream.models.squire.</span></span><span class="sig-name descname"><span class="pre">natural_sort_key</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</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">List</span><span class="p"><span class="pre">[</span></span><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">str</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></span><a class="headerlink" href="#pystream.models.squire.natural_sort_key" title="Permalink to this definition"></a></dt>
<dd><p>Key function for sorting filenames in a natural way.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>filename</strong> – Takes the filename as an argument.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Returns the index of the numeric part in the filename.</p>
<dd class="field-even"><p>Returns a list of elements derived from splitting the filename into parts using a regular expression.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
<dd class="field-odd"><p>List[Union[int, str]]</p>
</dd>
</dl>
</dd></dl>
Expand Down
Binary file modified docs/objects.inv
Binary file not shown.
Loading

0 comments on commit 3a5a18a

Please sign in to comment.