Skip to content

Commit

Permalink
Push final release
Browse files Browse the repository at this point in the history
  • Loading branch information
Domi020 committed Mar 18, 2024
1 parent b6ecaba commit f68df61
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
48 changes: 28 additions & 20 deletions docs/cpdbench/examples/ExampleDatasets.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,21 @@ <h1 class="modulename">
</span><span id="L-14"><a href="#L-14"><span class="linenos">14</span></a>
</span><span id="L-15"><a href="#L-15"><span class="linenos">15</span></a>
</span><span id="L-16"><a href="#L-16"><span class="linenos">16</span></a><span class="k">def</span> <span class="nf">dataset_get_apple_dataset</span><span class="p">():</span>
</span><span id="L-17"><a href="#L-17"><span class="linenos">17</span></a> <span class="n">raw_data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="s2">&quot;data/apple.npy&quot;</span><span class="p">)</span>
</span><span id="L-18"><a href="#L-18"><span class="linenos">18</span></a> <span class="n">timeseries</span> <span class="o">=</span> <span class="n">raw_data</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span>
</span><span id="L-19"><a href="#L-19"><span class="linenos">19</span></a> <span class="n">reshaped_ts</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="n">timeseries</span><span class="p">,</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="n">timeseries</span><span class="o">.</span><span class="n">size</span><span class="p">])</span>
</span><span id="L-20"><a href="#L-20"><span class="linenos">20</span></a> <span class="k">return</span> <span class="n">CPDNdarrayDataset</span><span class="p">(</span><span class="n">reshaped_ts</span><span class="p">,</span> <span class="p">[</span><span class="mi">337</span><span class="p">])</span>
</span><span id="L-21"><a href="#L-21"><span class="linenos">21</span></a>
</span><span id="L-22"><a href="#L-22"><span class="linenos">22</span></a>
</span><span id="L-23"><a href="#L-23"><span class="linenos">23</span></a><span class="k">def</span> <span class="nf">dataset_get_bitcoin_dataset</span><span class="p">():</span>
</span><span id="L-24"><a href="#L-24"><span class="linenos">24</span></a> <span class="n">raw_data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="s2">&quot;data/bitcoin.npy&quot;</span><span class="p">)</span>
</span><span id="L-25"><a href="#L-25"><span class="linenos">25</span></a> <span class="n">timeseries</span> <span class="o">=</span> <span class="n">raw_data</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span>
</span><span id="L-26"><a href="#L-26"><span class="linenos">26</span></a> <span class="n">reshaped_ts</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="n">timeseries</span><span class="p">,</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="n">timeseries</span><span class="o">.</span><span class="n">size</span><span class="p">])</span>
</span><span id="L-27"><a href="#L-27"><span class="linenos">27</span></a> <span class="k">return</span> <span class="n">CPDNdarrayDataset</span><span class="p">(</span><span class="n">reshaped_ts</span><span class="p">,</span> <span class="p">[</span><span class="mi">569</span><span class="p">])</span>
</span><span id="L-17"><a href="#L-17"><span class="linenos">17</span></a> <span class="n">path</span> <span class="o">=</span> <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">(</span><span class="vm">__file__</span><span class="p">)</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">resolve</span><span class="p">()</span>
</span><span id="L-18"><a href="#L-18"><span class="linenos">18</span></a> <span class="n">path</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="n">joinpath</span><span class="p">(</span><span class="s2">&quot;data&quot;</span><span class="p">,</span> <span class="s2">&quot;apple.npy&quot;</span><span class="p">)</span>
</span><span id="L-19"><a href="#L-19"><span class="linenos">19</span></a> <span class="n">raw_data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">path</span><span class="p">))</span>
</span><span id="L-20"><a href="#L-20"><span class="linenos">20</span></a> <span class="n">timeseries</span> <span class="o">=</span> <span class="n">raw_data</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span>
</span><span id="L-21"><a href="#L-21"><span class="linenos">21</span></a> <span class="n">reshaped_ts</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="n">timeseries</span><span class="p">,</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="n">timeseries</span><span class="o">.</span><span class="n">size</span><span class="p">])</span>
</span><span id="L-22"><a href="#L-22"><span class="linenos">22</span></a> <span class="k">return</span> <span class="n">CPDNdarrayDataset</span><span class="p">(</span><span class="n">reshaped_ts</span><span class="p">,</span> <span class="p">[</span><span class="mi">337</span><span class="p">])</span>
</span><span id="L-23"><a href="#L-23"><span class="linenos">23</span></a>
</span><span id="L-24"><a href="#L-24"><span class="linenos">24</span></a>
</span><span id="L-25"><a href="#L-25"><span class="linenos">25</span></a><span class="k">def</span> <span class="nf">dataset_get_bitcoin_dataset</span><span class="p">():</span>
</span><span id="L-26"><a href="#L-26"><span class="linenos">26</span></a> <span class="n">path</span> <span class="o">=</span> <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">(</span><span class="vm">__file__</span><span class="p">)</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">resolve</span><span class="p">()</span>
</span><span id="L-27"><a href="#L-27"><span class="linenos">27</span></a> <span class="n">path</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="n">joinpath</span><span class="p">(</span><span class="s2">&quot;data&quot;</span><span class="p">,</span> <span class="s2">&quot;bitcoin.npy&quot;</span><span class="p">)</span>
</span><span id="L-28"><a href="#L-28"><span class="linenos">28</span></a> <span class="n">raw_data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">path</span><span class="p">))</span>
</span><span id="L-29"><a href="#L-29"><span class="linenos">29</span></a> <span class="n">timeseries</span> <span class="o">=</span> <span class="n">raw_data</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span>
</span><span id="L-30"><a href="#L-30"><span class="linenos">30</span></a> <span class="n">reshaped_ts</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="n">timeseries</span><span class="p">,</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="n">timeseries</span><span class="o">.</span><span class="n">size</span><span class="p">])</span>
</span><span id="L-31"><a href="#L-31"><span class="linenos">31</span></a> <span class="k">return</span> <span class="n">CPDNdarrayDataset</span><span class="p">(</span><span class="n">reshaped_ts</span><span class="p">,</span> <span class="p">[</span><span class="mi">569</span><span class="p">])</span>
</span></pre></div>


Expand Down Expand Up @@ -125,10 +129,12 @@ <h1 class="modulename">
</div>
<a class="headerlink" href="#dataset_get_apple_dataset"></a>
<div class="pdoc-code codehilite"><pre><span></span><span id="dataset_get_apple_dataset-17"><a href="#dataset_get_apple_dataset-17"><span class="linenos">17</span></a><span class="k">def</span> <span class="nf">dataset_get_apple_dataset</span><span class="p">():</span>
</span><span id="dataset_get_apple_dataset-18"><a href="#dataset_get_apple_dataset-18"><span class="linenos">18</span></a> <span class="n">raw_data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="s2">&quot;data/apple.npy&quot;</span><span class="p">)</span>
</span><span id="dataset_get_apple_dataset-19"><a href="#dataset_get_apple_dataset-19"><span class="linenos">19</span></a> <span class="n">timeseries</span> <span class="o">=</span> <span class="n">raw_data</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span>
</span><span id="dataset_get_apple_dataset-20"><a href="#dataset_get_apple_dataset-20"><span class="linenos">20</span></a> <span class="n">reshaped_ts</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="n">timeseries</span><span class="p">,</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="n">timeseries</span><span class="o">.</span><span class="n">size</span><span class="p">])</span>
</span><span id="dataset_get_apple_dataset-21"><a href="#dataset_get_apple_dataset-21"><span class="linenos">21</span></a> <span class="k">return</span> <span class="n">CPDNdarrayDataset</span><span class="p">(</span><span class="n">reshaped_ts</span><span class="p">,</span> <span class="p">[</span><span class="mi">337</span><span class="p">])</span>
</span><span id="dataset_get_apple_dataset-18"><a href="#dataset_get_apple_dataset-18"><span class="linenos">18</span></a> <span class="n">path</span> <span class="o">=</span> <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">(</span><span class="vm">__file__</span><span class="p">)</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">resolve</span><span class="p">()</span>
</span><span id="dataset_get_apple_dataset-19"><a href="#dataset_get_apple_dataset-19"><span class="linenos">19</span></a> <span class="n">path</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="n">joinpath</span><span class="p">(</span><span class="s2">&quot;data&quot;</span><span class="p">,</span> <span class="s2">&quot;apple.npy&quot;</span><span class="p">)</span>
</span><span id="dataset_get_apple_dataset-20"><a href="#dataset_get_apple_dataset-20"><span class="linenos">20</span></a> <span class="n">raw_data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">path</span><span class="p">))</span>
</span><span id="dataset_get_apple_dataset-21"><a href="#dataset_get_apple_dataset-21"><span class="linenos">21</span></a> <span class="n">timeseries</span> <span class="o">=</span> <span class="n">raw_data</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span>
</span><span id="dataset_get_apple_dataset-22"><a href="#dataset_get_apple_dataset-22"><span class="linenos">22</span></a> <span class="n">reshaped_ts</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="n">timeseries</span><span class="p">,</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="n">timeseries</span><span class="o">.</span><span class="n">size</span><span class="p">])</span>
</span><span id="dataset_get_apple_dataset-23"><a href="#dataset_get_apple_dataset-23"><span class="linenos">23</span></a> <span class="k">return</span> <span class="n">CPDNdarrayDataset</span><span class="p">(</span><span class="n">reshaped_ts</span><span class="p">,</span> <span class="p">[</span><span class="mi">337</span><span class="p">])</span>
</span></pre></div>


Expand All @@ -146,11 +152,13 @@ <h1 class="modulename">

</div>
<a class="headerlink" href="#dataset_get_bitcoin_dataset"></a>
<div class="pdoc-code codehilite"><pre><span></span><span id="dataset_get_bitcoin_dataset-24"><a href="#dataset_get_bitcoin_dataset-24"><span class="linenos">24</span></a><span class="k">def</span> <span class="nf">dataset_get_bitcoin_dataset</span><span class="p">():</span>
</span><span id="dataset_get_bitcoin_dataset-25"><a href="#dataset_get_bitcoin_dataset-25"><span class="linenos">25</span></a> <span class="n">raw_data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="s2">&quot;data/bitcoin.npy&quot;</span><span class="p">)</span>
</span><span id="dataset_get_bitcoin_dataset-26"><a href="#dataset_get_bitcoin_dataset-26"><span class="linenos">26</span></a> <span class="n">timeseries</span> <span class="o">=</span> <span class="n">raw_data</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span>
</span><span id="dataset_get_bitcoin_dataset-27"><a href="#dataset_get_bitcoin_dataset-27"><span class="linenos">27</span></a> <span class="n">reshaped_ts</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="n">timeseries</span><span class="p">,</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="n">timeseries</span><span class="o">.</span><span class="n">size</span><span class="p">])</span>
</span><span id="dataset_get_bitcoin_dataset-28"><a href="#dataset_get_bitcoin_dataset-28"><span class="linenos">28</span></a> <span class="k">return</span> <span class="n">CPDNdarrayDataset</span><span class="p">(</span><span class="n">reshaped_ts</span><span class="p">,</span> <span class="p">[</span><span class="mi">569</span><span class="p">])</span>
<div class="pdoc-code codehilite"><pre><span></span><span id="dataset_get_bitcoin_dataset-26"><a href="#dataset_get_bitcoin_dataset-26"><span class="linenos">26</span></a><span class="k">def</span> <span class="nf">dataset_get_bitcoin_dataset</span><span class="p">():</span>
</span><span id="dataset_get_bitcoin_dataset-27"><a href="#dataset_get_bitcoin_dataset-27"><span class="linenos">27</span></a> <span class="n">path</span> <span class="o">=</span> <span class="n">pathlib</span><span class="o">.</span><span class="n">Path</span><span class="p">(</span><span class="vm">__file__</span><span class="p">)</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">resolve</span><span class="p">()</span>
</span><span id="dataset_get_bitcoin_dataset-28"><a href="#dataset_get_bitcoin_dataset-28"><span class="linenos">28</span></a> <span class="n">path</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="n">joinpath</span><span class="p">(</span><span class="s2">&quot;data&quot;</span><span class="p">,</span> <span class="s2">&quot;bitcoin.npy&quot;</span><span class="p">)</span>
</span><span id="dataset_get_bitcoin_dataset-29"><a href="#dataset_get_bitcoin_dataset-29"><span class="linenos">29</span></a> <span class="n">raw_data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">path</span><span class="p">))</span>
</span><span id="dataset_get_bitcoin_dataset-30"><a href="#dataset_get_bitcoin_dataset-30"><span class="linenos">30</span></a> <span class="n">timeseries</span> <span class="o">=</span> <span class="n">raw_data</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">]</span>
</span><span id="dataset_get_bitcoin_dataset-31"><a href="#dataset_get_bitcoin_dataset-31"><span class="linenos">31</span></a> <span class="n">reshaped_ts</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="n">timeseries</span><span class="p">,</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="n">timeseries</span><span class="o">.</span><span class="n">size</span><span class="p">])</span>
</span><span id="dataset_get_bitcoin_dataset-32"><a href="#dataset_get_bitcoin_dataset-32"><span class="linenos">32</span></a> <span class="k">return</span> <span class="n">CPDNdarrayDataset</span><span class="p">(</span><span class="n">reshaped_ts</span><span class="p">,</span> <span class="p">[</span><span class="mi">569</span><span class="p">])</span>
</span></pre></div>


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "cpdbench"
version = "0.0.4"
version = "1.0.0"
description = 'A benchmarking framework to run and evaluate changepoint detection algorithms.'
readme = "README.md"
requires-python = ">=3.9"
Expand Down

0 comments on commit f68df61

Please sign in to comment.