Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd27a6f

Browse files
authored
Cache all datasets at the beginning of tests takes too long (#573)
Check on list files rather than cache all wich takes too long
1 parent 8ca2890 commit fd27a6f

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

conftest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ def pytest_collection_modifyitems(config, items):
4040
item.add_marker(skip_marker)
4141

4242
# Skip related doctests if UCR UEA datasets cannot be fetched
43-
ucr_uea_datasets = True
4443
try:
4544
datasets = UCR_UEA_datasets()
46-
datasets.cache_all()
4745
ucr_uea_datasets = bool(datasets.list_datasets())
4846
except Exception as exc:
49-
warnings.warn("Error caching UCR UEA datasets: {}".format(exc))
47+
ucr_uea_datasets = False
48+
warnings.warn("Error listing UCR UEA datasets: {}".format(exc))
5049

5150
if not ucr_uea_datasets:
5251
warnings.warn("Skipping doctests requiring UCR UEA dataset download")
@@ -57,5 +56,7 @@ def pytest_collection_modifyitems(config, items):
5756
"tslearn.datasets.ucr_uea.UCR_UEA_datasets.list_multivariate_datasets",
5857
"tslearn.datasets.ucr_uea.UCR_UEA_datasets.list_univariate_datasets",
5958
"tslearn.datasets.ucr_uea.UCR_UEA_datasets.load_dataset",
59+
"tslearn.datasets.ucr_uea.UCR_UEA_datasets.baseline_accuracy",
60+
"tslearn.datasets.ucr_uea.UCR_UEA_datasets.list_cached_datasets"
6061
]:
6162
item.add_marker(skip_marker)

tslearn/datasets/ucr_uea.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def list_datasets(self):
198198
Returns
199199
-------
200200
list of str:
201-
A list of names of all (univariate and multivariate) dataset namas.
201+
A list of names of all (univariate and multivariate) dataset names.
202202
"""
203203
return (self.list_univariate_datasets()
204204
+ self.list_multivariate_datasets())

0 commit comments

Comments
 (0)