diff --git a/.devel/sphinx/alphamarek.py b/.devel/sphinx/alphamarek.py index b30d8f5..c148ca9 100644 --- a/.devel/sphinx/alphamarek.py +++ b/.devel/sphinx/alphamarek.py @@ -113,7 +113,7 @@ def get_book_template(self, e): self.format_btitle(e, 'title'), self.format_volume_and_series(e), sentence [ - field('publisher'), + optional_field('publisher'), optional_field('address'), self.format_edition(e) ], diff --git a/.devel/sphinx/bibliography.bib b/.devel/sphinx/bibliography.bib index a88d994..da2a127 100644 --- a/.devel/sphinx/bibliography.bib +++ b/.devel/sphinx/bibliography.bib @@ -45,14 +45,14 @@ @book{datawranglingpy publisher = {Zenodo}, address = {Melbourne}, url = {https://datawranglingpy.gagolewski.com/}, - year = {2022} + year = {2024} } @book{deepr, author = {M. Gagolewski}, title = {Deep {R} Programming}, url = {https://deepr.gagolewski.com/}, - year = {2023}, + year = {2024}, doi = {10.5281/zenodo.7490464}, isbn = {978-0-6455719-2-9}, publisher = {Zenodo}, diff --git a/clustbench/load_results.py b/clustbench/load_results.py index d1fae37..a79e35e 100644 --- a/clustbench/load_results.py +++ b/clustbench/load_results.py @@ -213,7 +213,9 @@ def save_results(filename, results, expanduser=True, expandvars=True): >>> results_path = os.path.join("~", "Projects", "clustering-results-v1", "original") >>> res = clustbench.load_results("*", "wut", "x2", 3, path=results_path) >>> print(res.keys()) - >>> clustbench.save_results("x1.result3.gz", clustbench.transpose_results(res)[3]) + >>> clustbench.save_results( + ... os.path.join(results_path, "method", "wut", "x2.result3.gz"), + ... clustbench.transpose_results(res)[3]) """ if type(results) is not dict: raise ValueError("`results` is not a dict") @@ -223,11 +225,11 @@ def save_results(filename, results, expanduser=True, expandvars=True): if not np.all(res.min().isin([0, 1])): raise ValueError("Minimal label neither 0 nor 1.") - mx = res.max() - if not mx[0] >= 1: + mx = res.max(axis=None) + if not mx >= 1: raise ValueError("At least 1 cluster is necessary.") - if not np.all(mx == mx[0]): + if not np.all(res.max(axis=0) == mx): raise ValueError("All partitions should be of the same cardinality.") if not np.all(res.apply(np.bincount).iloc[1:, :] > 0):