Skip to content

Commit

Permalink
deploy: b200351
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Jul 5, 2024
1 parent ab26a3c commit e127788
Show file tree
Hide file tree
Showing 65 changed files with 579 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 034fd1be21e09f3fc75ba088e0bbbf50
config: 78c626af9f4a5b5cd6e2ca6bdfeddd31
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified .doctrees/api/audeer.doctree
Binary file not shown.
Binary file modified .doctrees/api/audeer.progress_bar.doctree
Binary file not shown.
Binary file modified .doctrees/api/audeer.run_tasks.doctree
Binary file not shown.
Binary file added .doctrees/api/audeer.unique.doctree
Binary file not shown.
Binary file modified .doctrees/changelog.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
4 changes: 2 additions & 2 deletions _modules/audeer/core/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@


<div class="version">
v2.0.0
v2.1.0
</div>


Expand Down Expand Up @@ -179,7 +179,7 @@ <h1>Source code for audeer.core.config</h1><div class="highlight"><pre>



Built with <a href="https://www.sphinx-doc.org/en/master/">Sphinx</a> on 2024/01/25 using the <a href="https://github.com/audeering/sphinx-audeering-theme/">audEERING theme</a>
Built with <a href="https://www.sphinx-doc.org/en/master/">Sphinx</a> on 2024/07/05 using the <a href="https://github.com/audeering/sphinx-audeering-theme/">audEERING theme</a>

</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/audeer/core/io.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@


<div class="version">
v2.0.0
v2.1.0
</div>


Expand Down Expand Up @@ -1193,7 +1193,7 @@ <h1>Source code for audeer.core.io</h1><div class="highlight"><pre>



Built with <a href="https://www.sphinx-doc.org/en/master/">Sphinx</a> on 2024/01/25 using the <a href="https://github.com/audeering/sphinx-audeering-theme/">audEERING theme</a>
Built with <a href="https://www.sphinx-doc.org/en/master/">Sphinx</a> on 2024/07/05 using the <a href="https://github.com/audeering/sphinx-audeering-theme/">audEERING theme</a>

</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions _modules/audeer/core/path.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@


<div class="version">
v2.0.0
v2.1.0
</div>


Expand Down Expand Up @@ -287,7 +287,7 @@ <h1>Source code for audeer.core.path</h1><div class="highlight"><pre>



Built with <a href="https://www.sphinx-doc.org/en/master/">Sphinx</a> on 2024/01/25 using the <a href="https://github.com/audeering/sphinx-audeering-theme/">audEERING theme</a>
Built with <a href="https://www.sphinx-doc.org/en/master/">Sphinx</a> on 2024/07/05 using the <a href="https://github.com/audeering/sphinx-audeering-theme/">audEERING theme</a>

</p>
</div>
Expand Down
61 changes: 56 additions & 5 deletions _modules/audeer/core/tqdm.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@


<div class="version">
v2.0.0
v2.1.0
</div>


Expand Down Expand Up @@ -138,7 +138,9 @@
<div itemprop="articleBody">

<h1>Source code for audeer.core.tqdm</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Sequence</span>
<span></span><span class="kn">import</span> <span class="nn">threading</span>
<span class="kn">import</span> <span class="nn">time</span>
<span class="kn">import</span> <span class="nn">typing</span>

<span class="kn">from</span> <span class="nn">tqdm</span> <span class="kn">import</span> <span class="n">tqdm</span>

Expand Down Expand Up @@ -182,11 +184,12 @@ <h1>Source code for audeer.core.tqdm</h1><div class="highlight"><pre>


<div class="viewcode-block" id="progress_bar"><a class="viewcode-back" href="../../../api/audeer.progress_bar.html#audeer.progress_bar">[docs]</a><span class="k">def</span> <span class="nf">progress_bar</span><span class="p">(</span>
<span class="n">iterable</span><span class="p">:</span> <span class="n">Sequence</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">iterable</span><span class="p">:</span> <span class="n">typing</span><span class="o">.</span><span class="n">Sequence</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="o">*</span><span class="p">,</span>
<span class="n">total</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">desc</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">disable</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="n">maximum_refresh_time</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">tqdm</span><span class="p">:</span>
<span class="w"> </span><span class="sa">r</span><span class="sd">&quot;&quot;&quot;Progress bar with optional text on the right.</span>

Expand Down Expand Up @@ -220,22 +223,70 @@ <h1>Source code for audeer.core.tqdm</h1><div class="highlight"><pre>
<span class="sd"> total: total number of iterations</span>
<span class="sd"> desc: text shown on the right of the progress bar</span>
<span class="sd"> disable: don&#39;t show the display bar</span>
<span class="sd"> maximum_refresh_time: refresh the progress bar</span>
<span class="sd"> at least every ``maximum_refresh_time`` seconds,</span>
<span class="sd"> using another thread.</span>
<span class="sd"> If ``None``,</span>
<span class="sd"> no refreshing is enforced</span>

<span class="sd"> Returns:</span>
<span class="sd"> progress bar object</span>

<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">desc</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">desc</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="k">return</span> <span class="n">tqdm</span><span class="p">(</span>
<span class="k">return</span> <span class="n">tqdm_wrapper</span><span class="p">(</span>
<span class="n">iterable</span><span class="o">=</span><span class="n">iterable</span><span class="p">,</span>
<span class="n">maximum_refresh_time</span><span class="o">=</span><span class="n">maximum_refresh_time</span><span class="p">,</span>
<span class="n">ncols</span><span class="o">=</span><span class="n">config</span><span class="o">.</span><span class="n">TQDM_COLUMNS</span><span class="p">,</span>
<span class="n">bar_format</span><span class="o">=</span><span class="n">config</span><span class="o">.</span><span class="n">TQDM_FORMAT</span><span class="p">,</span>
<span class="n">total</span><span class="o">=</span><span class="n">total</span><span class="p">,</span>
<span class="n">disable</span><span class="o">=</span><span class="n">disable</span><span class="p">,</span>
<span class="n">desc</span><span class="o">=</span><span class="n">format_display_message</span><span class="p">(</span><span class="n">desc</span><span class="p">,</span> <span class="n">pbar</span><span class="o">=</span><span class="kc">True</span><span class="p">),</span>
<span class="n">leave</span><span class="o">=</span><span class="n">config</span><span class="o">.</span><span class="n">TQDM_LEAVE</span><span class="p">,</span>
<span class="p">)</span></div>


<span class="k">def</span> <span class="nf">tqdm_wrapper</span><span class="p">(</span>
<span class="n">iterable</span><span class="p">:</span> <span class="n">typing</span><span class="o">.</span><span class="n">Sequence</span><span class="p">,</span>
<span class="n">maximum_refresh_time</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span>
<span class="o">*</span><span class="n">args</span><span class="p">,</span>
<span class="o">**</span><span class="n">kwargs</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">tqdm</span><span class="p">:</span>
<span class="w"> </span><span class="sa">r</span><span class="sd">&quot;&quot;&quot;Tqdm progress bar wrapper to enforce update once a second.</span>

<span class="sd"> When using tqdm with large time durations</span>
<span class="sd"> between single steps of the iteration,</span>
<span class="sd"> it will not automatically update the elapsed time,</span>
<span class="sd"> but needs to be forced,</span>
<span class="sd"> see https://github.com/tqdm/tqdm/issues/861#issuecomment-2197893883.</span>

<span class="sd"> Args:</span>
<span class="sd"> iterable: sequence to iterate through</span>
<span class="sd"> maximum_refresh_time: refresh the progress bar</span>
<span class="sd"> at least every ``maximum_refresh_time`` seconds,</span>
<span class="sd"> using another thread.</span>
<span class="sd"> If ``None``,</span>
<span class="sd"> no refreshing is enforced</span>
<span class="sd"> args: arguments passed on to ``tqdm``</span>
<span class="sd"> kwargs: keyword arguments passed on to ``tqdm``</span>

<span class="sd"> Returns:</span>
<span class="sd"> progress bar object</span>

<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">pbar</span> <span class="o">=</span> <span class="n">tqdm</span><span class="p">(</span><span class="n">iterable</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">refresh</span><span class="p">():</span>
<span class="k">while</span> <span class="ow">not</span> <span class="n">pbar</span><span class="o">.</span><span class="n">disable</span><span class="p">:</span>
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="n">maximum_refresh_time</span><span class="p">)</span>
<span class="n">pbar</span><span class="o">.</span><span class="n">refresh</span><span class="p">()</span>

<span class="k">if</span> <span class="n">maximum_refresh_time</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">thread</span> <span class="o">=</span> <span class="n">threading</span><span class="o">.</span><span class="n">Thread</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="n">refresh</span><span class="p">,</span> <span class="n">daemon</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">thread</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>

<span class="k">return</span> <span class="n">pbar</span>
</pre></div>

</div>
Expand All @@ -251,7 +302,7 @@ <h1>Source code for audeer.core.tqdm</h1><div class="highlight"><pre>



Built with <a href="https://www.sphinx-doc.org/en/master/">Sphinx</a> on 2024/01/25 using the <a href="https://github.com/audeering/sphinx-audeering-theme/">audEERING theme</a>
Built with <a href="https://www.sphinx-doc.org/en/master/">Sphinx</a> on 2024/07/05 using the <a href="https://github.com/audeering/sphinx-audeering-theme/">audEERING theme</a>

</p>
</div>
Expand Down
Loading

0 comments on commit e127788

Please sign in to comment.