Skip to content

Commit 4b59be9

Browse files
committed
v1.1.4
1 parent da0b531 commit 4b59be9

27 files changed

+81
-79
lines changed

.devel/pytest/test_paths.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ def test_paths():
1919
assert "wut" in clustbench.get_battery_names("../clustering-data-v1/")
2020
assert "x1" in clustbench.get_dataset_names("wut", "../clustering-data-v1/")
2121

22+
assert len(clustbench.load_dataset("wut", "x2", "../clustering-data-v1/")["labels"]) == 2
23+
24+
assert len(clustbench.assertload_dataset("wut", "x2", url="https://github.com/gagolews/clustering-data-v1/raw/v1.1.0")["labels"]) == 2
25+
2226

2327
if __name__ == "__main__":
2428
test_paths()

.devel/sphinx/news.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## 1.1.3 (2023-12-11)
3+
## 1.1.4 (2023-12-12)
44

55
- [BUGFIX] #5: `load_dataset` threw an `OSError` while trying to load
66
a dataset.

NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## 1.1.3 (2023-12-11)
3+
## 1.1.4 (2023-12-12)
44

55
- [BUGFIX] #5: `load_dataset` threw an `OSError` while trying to load
66
a dataset.

clustbench/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# ############################################################################ #
2222

2323
# version string, e.g., "1.0.0.9001" or "1.1.1"
24-
__version__ = "1.1.3"
24+
__version__ = "1.1.4"
2525

2626

2727
from .get_names import get_dataset_names, get_battery_names

clustbench/load_dataset.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,16 @@ def load_dataset(
136136
labels = []
137137
i = 0
138138
while True:
139-
try:
140-
f = base_name + ".labels%d.gz" % i
141-
ll = np.loadtxt(f, dtype="int")
142-
if ll.ndim != 1 or ll.shape[0] != data.shape[0]:
143-
raise ValueError("Incorrect number of labels in '%s'." % f)
144-
145-
labels.append(ll)
146-
i += 1
147-
except OSError:
148-
# this could be done better with glob.glob for local files,
149-
# but not for remote URLs
150-
break
139+
f = base_name + ".labels%d.gz" % i
140+
if not np.DataSource().exists(f):
141+
break # stop trying to find more label vectors
142+
143+
ll = np.loadtxt(f, dtype="int")
144+
if ll.ndim != 1 or ll.shape[0] != data.shape[0]:
145+
raise ValueError("Incorrect number of labels in '%s'." % f)
146+
147+
labels.append(ll)
148+
i += 1
151149

152150
n_clusters = np.array([np.max(ll) for ll in labels])
153151

docs/_static/documentation_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const DOCUMENTATION_OPTIONS = {
2-
VERSION: '1.1.3',
2+
VERSION: '1.1.4',
33
LANGUAGE: 'en',
44
COLLAPSE_INDEX: false,
55
BUILDER: 'html',

docs/clustbench-documentation.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
<a class="sidebar-brand" href="index.html">Clustering Benchmarks</a>
169169
</span>
170170
<div class="sidebar-brand">
171-
1.1.3
171+
1.1.4
172172
</div>
173173
<form class="sidebar-search-container" method="get" action="search.html" role="search">
174174
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -843,7 +843,7 @@ <h1>Documentation<a class="headerlink" href="#documentation" title="Link to this
843843
Some rights reserved. Licensed under <a href='https://creativecommons.org/licenses/by-nc-nd/4.0/'>CC BY-NC-ND 4.0</a>.
844844
Built with <a href="https://sphinx-doc.org/">Sphinx</a>
845845
and a customised <a href="https://github.com/pradyunsg/furo">Furo</a> theme.
846-
Last updated on 2023-12-11T15:14:53+1100.
846+
Last updated on 2023-12-12T14:31:23+1100.
847847
This site will never display any ads: it is a non-profit project.
848848
It does not collect any data.
849849
</div>
@@ -896,7 +896,7 @@ <h1>Documentation<a class="headerlink" href="#documentation" title="Link to this
896896

897897
</aside>
898898
</div>
899-
</div><script src="_static/documentation_options.js?v=cb7bf70b"></script>
899+
</div><script src="_static/documentation_options.js?v=00f267c6"></script>
900900
<script src="_static/doctools.js?v=888ff710"></script>
901901
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
902902
<script src="_static/scripts/furo.js?v=32e29ea5"></script>

docs/genindex.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
<a class="sidebar-brand" href="index.html">Clustering Benchmarks</a>
167167
</span>
168168
<div class="sidebar-brand">
169-
1.1.3
169+
1.1.4
170170
</div>
171171
<form class="sidebar-search-container" method="get" action="search.html" role="search">
172172
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -398,7 +398,7 @@ <h2>T</h2>
398398
Some rights reserved. Licensed under <a href='https://creativecommons.org/licenses/by-nc-nd/4.0/'>CC BY-NC-ND 4.0</a>.
399399
Built with <a href="https://sphinx-doc.org/">Sphinx</a>
400400
and a customised <a href="https://github.com/pradyunsg/furo">Furo</a> theme.
401-
Last updated on 2023-12-11T15:14:53+1100.
401+
Last updated on 2023-12-12T14:31:23+1100.
402402
This site will never display any ads: it is a non-profit project.
403403
It does not collect any data.
404404
</div>
@@ -413,7 +413,7 @@ <h2>T</h2>
413413

414414
</aside>
415415
</div>
416-
</div><script src="_static/documentation_options.js?v=cb7bf70b"></script>
416+
</div><script src="_static/documentation_options.js?v=00f267c6"></script>
417417
<script src="_static/doctools.js?v=888ff710"></script>
418418
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
419419
<script src="_static/scripts/furo.js?v=32e29ea5"></script>

docs/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
<a class="sidebar-brand" href="#">Clustering Benchmarks</a>
169169
</span>
170170
<div class="sidebar-brand">
171-
1.1.3
171+
1.1.4
172172
</div>
173173
<form class="sidebar-search-container" method="get" action="search.html" role="search">
174174
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -381,7 +381,7 @@ <h1>A Framework for Benchmarking Clustering Algorithms<a class="headerlink" href
381381
Some rights reserved. Licensed under <a href='https://creativecommons.org/licenses/by-nc-nd/4.0/'>CC BY-NC-ND 4.0</a>.
382382
Built with <a href="https://sphinx-doc.org/">Sphinx</a>
383383
and a customised <a href="https://github.com/pradyunsg/furo">Furo</a> theme.
384-
Last updated on 2023-12-11T15:14:53+1100.
384+
Last updated on 2023-12-12T14:31:23+1100.
385385
This site will never display any ads: it is a non-profit project.
386386
It does not collect any data.
387387
</div>
@@ -414,7 +414,7 @@ <h1>A Framework for Benchmarking Clustering Algorithms<a class="headerlink" href
414414

415415
</aside>
416416
</div>
417-
</div><script src="_static/documentation_options.js?v=cb7bf70b"></script>
417+
</div><script src="_static/documentation_options.js?v=00f267c6"></script>
418418
<script src="_static/doctools.js?v=888ff710"></script>
419419
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
420420
<script src="_static/scripts/furo.js?v=32e29ea5"></script>

docs/news.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
<a class="sidebar-brand" href="index.html">Clustering Benchmarks</a>
169169
</span>
170170
<div class="sidebar-brand">
171-
1.1.3
171+
1.1.4
172172
</div>
173173
<form class="sidebar-search-container" method="get" action="search.html" role="search">
174174
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
@@ -257,7 +257,7 @@
257257
<section class="tex2jax_ignore mathjax_ignore" id="changelog">
258258
<h1>Changelog<a class="headerlink" href="#changelog" title="Link to this heading">#</a></h1>
259259
<section id="id1">
260-
<h2>1.1.3 (2023-12-11)<a class="headerlink" href="#id1" title="Link to this heading">#</a></h2>
260+
<h2>1.1.4 (2023-12-12)<a class="headerlink" href="#id1" title="Link to this heading">#</a></h2>
261261
<ul class="simple">
262262
<li><p>[BUGFIX] #5: <code class="docutils literal notranslate"><span class="pre">load_dataset</span></code> threw an <code class="docutils literal notranslate"><span class="pre">OSError</span></code> while trying to load
263263
a dataset.</p></li>
@@ -346,7 +346,7 @@ <h2>0.0.0 (2015-12-29)<a class="headerlink" href="#id6" title="Link to this head
346346
Some rights reserved. Licensed under <a href='https://creativecommons.org/licenses/by-nc-nd/4.0/'>CC BY-NC-ND 4.0</a>.
347347
Built with <a href="https://sphinx-doc.org/">Sphinx</a>
348348
and a customised <a href="https://github.com/pradyunsg/furo">Furo</a> theme.
349-
Last updated on 2023-12-11T15:14:53+1100.
349+
Last updated on 2023-12-12T14:31:23+1100.
350350
This site will never display any ads: it is a non-profit project.
351351
It does not collect any data.
352352
</div>
@@ -368,7 +368,7 @@ <h2>0.0.0 (2015-12-29)<a class="headerlink" href="#id6" title="Link to this head
368368
<div class="toc-tree">
369369
<ul>
370370
<li><a class="reference internal" href="#">Changelog</a><ul>
371-
<li><a class="reference internal" href="#id1">1.1.3 (2023-12-11)</a></li>
371+
<li><a class="reference internal" href="#id1">1.1.4 (2023-12-12)</a></li>
372372
<li><a class="reference internal" href="#id2">1.1.2 (2023-10-19)</a></li>
373373
<li><a class="reference internal" href="#id3">1.1.1 (2022-10-06)</a></li>
374374
<li><a class="reference internal" href="#id4">1.1.0 (2022-09-17)</a></li>
@@ -385,7 +385,7 @@ <h2>0.0.0 (2015-12-29)<a class="headerlink" href="#id6" title="Link to this head
385385

386386
</aside>
387387
</div>
388-
</div><script src="_static/documentation_options.js?v=cb7bf70b"></script>
388+
</div><script src="_static/documentation_options.js?v=00f267c6"></script>
389389
<script src="_static/doctools.js?v=888ff710"></script>
390390
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
391391
<script src="_static/scripts/furo.js?v=32e29ea5"></script>

0 commit comments

Comments
 (0)