Skip to content

Commit

Permalink
deploy: 86658e8
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer2368 committed Oct 27, 2024
1 parent 7d47a01 commit cae42f0
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 12 deletions.
Binary file modified .doctrees/autoapi/lasdi/timing/index.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
84 changes: 84 additions & 0 deletions _sources/autoapi/lasdi/timing/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ lasdi.timing

.. py:module:: lasdi.timing
.. autoapi-nested-parse::

.. _NumPy docstring standard:
https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard



Classes
-------
Expand All @@ -17,36 +23,114 @@ Module Contents

.. py:class:: Timer
A light-weight timer class.



.. py:attribute:: names
Dictionary that maps job names to job indices.

:type: :obj:`dict(str:int)`


.. py:attribute:: calls
:value: []


List that stores the number of calls for each job.

:type: :obj:`list(int)`


.. py:attribute:: times
:value: []


List that stores the total time for each job.

:type: :obj:`list(float)`


.. py:attribute:: starts
:value: []


List that stores the start time for each job.
If the job is not running, :obj:`None` is stored instead.

:type: :obj:`list(float)`


.. py:method:: start(name)
Start a job named :obj:`name`.
If the job is not listed, register the job in the job list.

Args:
name (:obj:`str`): Name of the job to be started.

Note:
The job must not have started before calling this method.

Returns:
Does not return a value.




.. py:method:: end(name)
End a job named :obj:`name`.
Increase the number of calls and the runtime for the job.

Args:
name (:obj:`str`): Name of the job to be ended.

Note:
The job must have started before calling this method.

Returns:
Does not return a value.




.. py:method:: print()
Print the list of jobs and their number of calls, total time and time per each call.

Returns:
Does not return a value.



.. py:method:: export()
Export the list of jobs and their number of calls and total time
into a dictionary.

Note:
All jobs must be ended before calling this method.

Returns:
:obj:`dict` that contains "names", "calls", and "times" as keys



.. py:method:: load(dict_)
Load the list of jobs and their number of calls and total time
from a dictionary.

Args:
`dict_` (:obj:`dict`): Dictionary that contains the list of jobs and their calls and times.

Note:
:obj:`dict_['names']`, :obj:`dict_['calls']` and :obj:`dict_['times']` must have the same size.

Returns:
Does not return a value



91 changes: 80 additions & 11 deletions autoapi/lasdi/timing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h2>Classes<a class="headerlink" href="#classes" title="Permalink to this headin
<table class="autosummary longtable docutils align-default">
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#lasdi.timing.Timer" title="lasdi.timing.Timer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Timer</span></code></a></p></td>
<td><p></p></td>
<td><p>A light-weight timer class.</p></td>
</tr>
</tbody>
</table>
Expand All @@ -111,50 +111,119 @@ <h2>Module Contents<a class="headerlink" href="#module-contents" title="Permalin
<dl class="py class">
<dt class="sig sig-object py" id="lasdi.timing.Timer">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">lasdi.timing.</span></span><span class="sig-name descname"><span class="pre">Timer</span></span><a class="headerlink" href="#lasdi.timing.Timer" title="Permalink to this definition"></a></dt>
<dd><dl class="py attribute">
<dd><p>A light-weight timer class.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="lasdi.timing.Timer.names">
<span class="sig-name descname"><span class="pre">names</span></span><a class="headerlink" href="#lasdi.timing.Timer.names" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dd><p>Dictionary that maps job names to job indices.</p>
<dl class="field-list simple">
<dt class="field-odd">Type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">dict(str:int)</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="lasdi.timing.Timer.calls">
<span class="sig-name descname"><span class="pre">calls</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">[]</span></em><a class="headerlink" href="#lasdi.timing.Timer.calls" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dd><p>List that stores the number of calls for each job.</p>
<dl class="field-list simple">
<dt class="field-odd">Type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">list(int)</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="lasdi.timing.Timer.times">
<span class="sig-name descname"><span class="pre">times</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">[]</span></em><a class="headerlink" href="#lasdi.timing.Timer.times" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dd><p>List that stores the total time for each job.</p>
<dl class="field-list simple">
<dt class="field-odd">Type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">list(float)</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="lasdi.timing.Timer.starts">
<span class="sig-name descname"><span class="pre">starts</span></span><em class="property"><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="pre">[]</span></em><a class="headerlink" href="#lasdi.timing.Timer.starts" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dd><p>List that stores the start time for each job.
If the job is not running, <code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code> is stored instead.</p>
<dl class="field-list simple">
<dt class="field-odd">Type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">list(float)</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="lasdi.timing.Timer.start">
<span class="sig-name descname"><span class="pre">start</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#lasdi.timing.Timer.start" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dd><p>Start a job named <code class="xref py py-obj docutils literal notranslate"><span class="pre">name</span></code>.
If the job is not listed, register the job in the job list.</p>
<dl class="simple">
<dt>Args:</dt><dd><p>name (<code class="xref py py-obj docutils literal notranslate"><span class="pre">str</span></code>): Name of the job to be started.</p>
</dd>
<dt>Note:</dt><dd><p>The job must not have started before calling this method.</p>
</dd>
<dt>Returns:</dt><dd><p>Does not return a value.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="lasdi.timing.Timer.end">
<span class="sig-name descname"><span class="pre">end</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#lasdi.timing.Timer.end" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dd><p>End a job named <code class="xref py py-obj docutils literal notranslate"><span class="pre">name</span></code>.
Increase the number of calls and the runtime for the job.</p>
<dl class="simple">
<dt>Args:</dt><dd><p>name (<code class="xref py py-obj docutils literal notranslate"><span class="pre">str</span></code>): Name of the job to be ended.</p>
</dd>
<dt>Note:</dt><dd><p>The job must have started before calling this method.</p>
</dd>
<dt>Returns:</dt><dd><p>Does not return a value.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="lasdi.timing.Timer.print">
<span class="sig-name descname"><span class="pre">print</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#lasdi.timing.Timer.print" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dd><p>Print the list of jobs and their number of calls, total time and time per each call.</p>
<dl class="simple">
<dt>Returns:</dt><dd><p>Does not return a value.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="lasdi.timing.Timer.export">
<span class="sig-name descname"><span class="pre">export</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#lasdi.timing.Timer.export" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dd><p>Export the list of jobs and their number of calls and total time
into a dictionary.</p>
<dl class="simple">
<dt>Note:</dt><dd><p>All jobs must be ended before calling this method.</p>
</dd>
<dt>Returns:</dt><dd><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">dict</span></code> that contains “names”, “calls”, and “times” as keys</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="lasdi.timing.Timer.load">
<span class="sig-name descname"><span class="pre">load</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dict_</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#lasdi.timing.Timer.load" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dd><p>Load the list of jobs and their number of calls and total time
from a dictionary.</p>
<dl class="simple">
<dt>Args:</dt><dd><p><cite>dict_</cite> (<code class="xref py py-obj docutils literal notranslate"><span class="pre">dict</span></code>): Dictionary that contains the list of jobs and their calls and times.</p>
</dd>
<dt>Note:</dt><dd><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">dict_['names']</span></code>, <code class="xref py py-obj docutils literal notranslate"><span class="pre">dict_['calls']</span></code> and <code class="xref py py-obj docutils literal notranslate"><span class="pre">dict_['times']</span></code> must have the same size.</p>
</dd>
<dt>Returns:</dt><dd><p>Does not return a value</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit cae42f0

Please sign in to comment.