Skip to content

Commit

Permalink
Deploying to gh-pages from @ 0d8992f πŸš€
Browse files Browse the repository at this point in the history
  • Loading branch information
bmario committed Dec 19, 2024
1 parent b17c3bc commit 1458378
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 7 deletions.
Binary file modified .doctrees/api/pandas.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
5 changes: 4 additions & 1 deletion api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ <h1>API Reference<a class="headerlink" href="#api-reference" title="Permalink to
<li class="toctree-l2"><a class="reference internal" href="history-client.html#metricq.history_client.InvalidHistoryResponse"><code class="docutils literal notranslate"><span class="pre">InvalidHistoryResponse</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="pandas.html">Pandas History Client</a></li>
<li class="toctree-l1"><a class="reference internal" href="pandas.html">Pandas History Client</a><ul>
<li class="toctree-l2"><a class="reference internal" href="pandas.html#metricq.pandas.PandasHistoryClient"><code class="docutils literal notranslate"><span class="pre">PandasHistoryClient</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="drain.html">Drain</a><ul>
<li class="toctree-l2"><a class="reference internal" href="drain.html#metricq.Drain"><code class="docutils literal notranslate"><span class="pre">Drain</span></code></a></li>
</ul>
Expand Down
104 changes: 103 additions & 1 deletion api/pandas.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,18 @@
<li class="toctree-l2"><a class="reference internal" href="sink.html">Sink</a></li>
<li class="toctree-l2"><a class="reference internal" href="source.html">Source</a></li>
<li class="toctree-l2"><a class="reference internal" href="history-client.html">History Client</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Pandas History Client</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Pandas History Client</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#metricq.pandas.PandasHistoryClient"><code class="docutils literal notranslate"><span class="pre">PandasHistoryClient</span></code></a><ul>
<li class="toctree-l4"><a class="reference internal" href="#metricq.pandas.PandasHistoryClient.connect"><code class="docutils literal notranslate"><span class="pre">PandasHistoryClient.connect()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#metricq.pandas.PandasHistoryClient.stop"><code class="docutils literal notranslate"><span class="pre">PandasHistoryClient.stop()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#metricq.pandas.PandasHistoryClient.client"><code class="docutils literal notranslate"><span class="pre">PandasHistoryClient.client</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#metricq.pandas.PandasHistoryClient.get_metrics"><code class="docutils literal notranslate"><span class="pre">PandasHistoryClient.get_metrics()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#metricq.pandas.PandasHistoryClient.history_aggregate_timeline"><code class="docutils literal notranslate"><span class="pre">PandasHistoryClient.history_aggregate_timeline()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="#metricq.pandas.PandasHistoryClient.history_raw_timeline"><code class="docutils literal notranslate"><span class="pre">PandasHistoryClient.history_raw_timeline()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="drain.html">Drain</a></li>
<li class="toctree-l2"><a class="reference internal" href="subscriber.html">Subscriber</a></li>
<li class="toctree-l2"><a class="reference internal" href="client-common.html">Common client operation</a></li>
Expand Down Expand Up @@ -91,6 +102,97 @@

<section id="pandas-history-client">
<h1>Pandas History Client<a class="headerlink" href="#pandas-history-client" title="Permalink to this heading"></a></h1>
<dl class="py class">
<dt class="sig sig-object py" id="metricq.pandas.PandasHistoryClient">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">metricq.pandas.</span></span><span class="sig-name descname"><span class="pre">PandasHistoryClient</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#metricq.pandas.PandasHistoryClient" title="Permalink to this definition"></a></dt>
<dd><p>This can be used similarly to a <a class="reference internal" href="history-client.html#metricq.HistoryClient" title="metricq.HistoryClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">metricq.HistoryClient</span></code></a>, but the data
methods return pandas structures.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Consider this class experimental, the type signatures may change at any time.</p>
</div>
<dl class="py method">
<dt class="sig sig-object py" id="metricq.pandas.PandasHistoryClient.connect">
<em class="property"><span class="pre">await</span> </em><span class="sig-name descname"><span class="pre">connect</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#metricq.pandas.PandasHistoryClient.connect" title="Permalink to this definition"></a></dt>
<dd><p>Connect to the MetricQ network.
You can either use this method, or use the class as an async context manager.</p>
<dl class="field-list simple">
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.13)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="metricq.pandas.PandasHistoryClient.stop">
<em class="property"><span class="pre">await</span> </em><span class="sig-name descname"><span class="pre">stop</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#metricq.pandas.PandasHistoryClient.stop" title="Permalink to this definition"></a></dt>
<dd><p>Stop the client and disconnect from the MetricQ network.
Do not call this if you use the class as an async context manager.</p>
<dl class="field-list simple">
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.13)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">None</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="metricq.pandas.PandasHistoryClient.client">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">client</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference internal" href="history-client.html#metricq.HistoryClient" title="metricq.history_client.HistoryClient"><span class="pre">HistoryClient</span></a></em><a class="headerlink" href="#metricq.pandas.PandasHistoryClient.client" title="Permalink to this definition"></a></dt>
<dd><p>Access the underlying <a class="reference internal" href="history-client.html#metricq.HistoryClient" title="metricq.HistoryClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">metricq.HistoryClient</span></code></a> instance.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="metricq.pandas.PandasHistoryClient.get_metrics">
<em class="property"><span class="pre">await</span> </em><span class="sig-name descname"><span class="pre">get_metrics</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#metricq.pandas.PandasHistoryClient.get_metrics" title="Permalink to this definition"></a></dt>
<dd><p>The method works like <a class="reference internal" href="client-common.html#metricq.Client.get_metrics" title="metricq.Client.get_metrics"><code class="xref py py-meth docutils literal notranslate"><span class="pre">metricq.Client.get_metrics()</span></code></a>, but sets
<code class="code docutils literal notranslate"><span class="pre">historic=True</span></code> by default. See documentation there for a detailed
description of the remaining arguments.</p>
<dl class="field-list simple">
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.13)"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a>, <a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Any" title="(in Python v3.13)"><code class="xref py py-data docutils literal notranslate"><span class="pre">Any</span></code></a>]]</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="metricq.pandas.PandasHistoryClient.history_aggregate_timeline">
<em class="property"><span class="pre">await</span> </em><span class="sig-name descname"><span class="pre">history_aggregate_timeline</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#metricq.pandas.PandasHistoryClient.history_aggregate_timeline" title="Permalink to this definition"></a></dt>
<dd><p>The method works like <a class="reference internal" href="history-client.html#metricq.HistoryClient.history_aggregate_timeline" title="metricq.HistoryClient.history_aggregate_timeline"><code class="xref py py-meth docutils literal notranslate"><span class="pre">metricq.HistoryClient.history_aggregate_timeline()</span></code></a>,
but returns a <code class="xref py py-class docutils literal notranslate"><span class="pre">pandas.DataFrame</span></code>.
The dataframe will have the following columns:
:rtype: <code class="xref py py-class docutils literal notranslate"><span class="pre">DataFrame</span></code></p>
<ul class="simple">
<li><p>timestamp</p></li>
<li><p>minimum</p></li>
<li><p>maximum</p></li>
<li><p>sum</p></li>
<li><p>count</p></li>
<li><p>integral_ns</p></li>
<li><p>active_time</p></li>
<li><p>mean</p></li>
<li><p>mean_integral</p></li>
<li><p>mean_sum</p></li>
<li><p>integral_s</p></li>
</ul>
<p>For details of those, see the documentation of <a class="reference internal" href="misc.html#metricq.TimeAggregate" title="metricq.TimeAggregate"><code class="xref py py-class docutils literal notranslate"><span class="pre">metricq.TimeAggregate</span></code></a>.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="metricq.pandas.PandasHistoryClient.history_raw_timeline">
<em class="property"><span class="pre">await</span> </em><span class="sig-name descname"><span class="pre">history_raw_timeline</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#metricq.pandas.PandasHistoryClient.history_raw_timeline" title="Permalink to this definition"></a></dt>
<dd><p>The method works like <a class="reference internal" href="history-client.html#metricq.HistoryClient.history_raw_timeline" title="metricq.HistoryClient.history_raw_timeline"><code class="xref py py-meth docutils literal notranslate"><span class="pre">metricq.HistoryClient.history_raw_timeline()</span></code></a>,
but returns a <code class="xref py py-class docutils literal notranslate"><span class="pre">pandas.DataFrame</span></code> instead of a list of
<a class="reference internal" href="misc.html#metricq.TimeValue" title="metricq.TimeValue"><code class="xref py py-class docutils literal notranslate"><span class="pre">metricq.TimeValue</span></code></a> objects.
The dataframe will have the following columns:
:rtype: <code class="xref py py-class docutils literal notranslate"><span class="pre">DataFrame</span></code></p>
<ul class="simple">
<li><p>timestamp</p></li>
<li><p>value</p></li>
</ul>
</dd></dl>

</dd></dl>

</section>


Expand Down
22 changes: 20 additions & 2 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ <h2 id="C">C</h2>
<li><a href="api/client-common.html#metricq.Client">(class in metricq)</a>
</li>
</ul></li>
<li><a href="api/pandas.html#metricq.pandas.PandasHistoryClient.client">client (metricq.pandas.PandasHistoryClient property)</a>
</li>
<li><a href="api/subscriber.html#metricq.Subscriber.collect_data">collect_data() (metricq.Subscriber method)</a>
</li>
<li><a href="api/client-common.html#metricq.Agent.connect">connect() (metricq.Agent method)</a>
Expand All @@ -204,6 +206,8 @@ <h2 id="C">C</h2>
<li><a href="api/drain.html#metricq.Drain.connect">(metricq.Drain method)</a>
</li>
<li><a href="api/history-client.html#metricq.HistoryClient.connect">(metricq.HistoryClient method)</a>
</li>
<li><a href="api/pandas.html#metricq.pandas.PandasHistoryClient.connect">(metricq.pandas.PandasHistoryClient method)</a>
</li>
<li><a href="api/sink.html#metricq.Sink.connect">(metricq.Sink method)</a>
</li>
Expand Down Expand Up @@ -310,6 +314,8 @@ <h2 id="G">G</h2>

<ul>
<li><a href="api/history-client.html#metricq.HistoryClient.get_metrics">(metricq.HistoryClient method)</a>
</li>
<li><a href="api/pandas.html#metricq.pandas.PandasHistoryClient.get_metrics">(metricq.pandas.PandasHistoryClient method)</a>
</li>
</ul></li>
</ul></td>
Expand All @@ -321,13 +327,21 @@ <h2 id="H">H</h2>
<li><a href="api/history-client.html#metricq.HistoryClient.history_aggregate">history_aggregate() (metricq.HistoryClient method)</a>
</li>
<li><a href="api/history-client.html#metricq.HistoryClient.history_aggregate_timeline">history_aggregate_timeline() (metricq.HistoryClient method)</a>

<ul>
<li><a href="api/pandas.html#metricq.pandas.PandasHistoryClient.history_aggregate_timeline">(metricq.pandas.PandasHistoryClient method)</a>
</li>
</ul></li>
<li><a href="api/history-client.html#metricq.HistoryClient.history_data_request">history_data_request() (metricq.HistoryClient method)</a>
</li>
<li><a href="api/history-client.html#metricq.HistoryClient.history_last_value">history_last_value() (metricq.HistoryClient method)</a>
</li>
<li><a href="api/history-client.html#metricq.HistoryClient.history_raw_timeline">history_raw_timeline() (metricq.HistoryClient method)</a>

<ul>
<li><a href="api/pandas.html#metricq.pandas.PandasHistoryClient.history_raw_timeline">(metricq.pandas.PandasHistoryClient method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="api/history-client.html#metricq.HistoryClient">HistoryClient (class in metricq)</a>
Expand Down Expand Up @@ -470,18 +484,20 @@ <h2 id="O">O</h2>
<h2 id="P">P</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="api/pandas.html#metricq.pandas.PandasHistoryClient">PandasHistoryClient (class in metricq.pandas)</a>
</li>
<li><a href="api/source.html#metricq.IntervalSource.period">period (metricq.IntervalSource property)</a>
</li>
<li><a href="api/misc.html#metricq.Timestamp.posix">posix (metricq.Timestamp property)</a>
</li>
<li><a href="api/misc.html#metricq.Timestamp.posix_ms">posix_ms (metricq.Timestamp property)</a>
</li>
<li><a href="api/misc.html#metricq.Timestamp.posix_ns">posix_ns (metricq.Timestamp property)</a>
</li>
<li><a href="api/misc.html#metricq.Timestamp.posix_us">posix_us (metricq.Timestamp property)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="api/misc.html#metricq.Timestamp.posix_us">posix_us (metricq.Timestamp property)</a>
</li>
<li><a href="api/misc.html#metricq.Timedelta.precise_string">precise_string (metricq.Timedelta property)</a>
</li>
<li><a href="api/exceptions.html#metricq.exceptions.PublishFailed">PublishFailed</a>
Expand Down Expand Up @@ -574,6 +590,8 @@ <h2 id="S">S</h2>

<ul>
<li><a href="api/client-common.html#metricq.Client.stop">(metricq.Client method)</a>
</li>
<li><a href="api/pandas.html#metricq.pandas.PandasHistoryClient.stop">(metricq.pandas.PandasHistoryClient method)</a>
</li>
<li><a href="api/source.html#metricq.SynchronousSource.stop">(metricq.SynchronousSource method)</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion howto/history-client.html
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ <h2>Fetching raw values<a class="headerlink" href="#fetching-raw-values" title="
</section>
<section id="getting-pandas-dataframes">
<h2>Getting Pandas DataFrames<a class="headerlink" href="#getting-pandas-dataframes" title="Permalink to this heading"></a></h2>
<p>You can get historic data in the form of Pandas DataFrames using <code class="xref py py-class docutils literal notranslate"><span class="pre">metricq.pandas.PandasHistoryClient</span></code>.
<p>You can get historic data in the form of Pandas DataFrames using <a class="reference internal" href="../api/pandas.html#metricq.pandas.PandasHistoryClient" title="metricq.pandas.PandasHistoryClient"><code class="xref py py-class docutils literal notranslate"><span class="pre">metricq.pandas.PandasHistoryClient</span></code></a>.
This is useful if you want to use the data in a Jupyter notebook or similar.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">metric</span> <span class="o">=</span> <span class="s2">&quot;elab.ariel.power&quot;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">now</span> <span class="o">=</span> <span class="n">metricq</span><span class="o">.</span><span class="n">Timestamp</span><span class="o">.</span><span class="n">now</span><span class="p">()</span>
Expand Down
Loading

0 comments on commit 1458378

Please sign in to comment.