-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_datasets.py
More file actions
executable file
·69 lines (54 loc) · 1.6 KB
/
test_datasets.py
File metadata and controls
executable file
·69 lines (54 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""
Test the models and regularizer
> python test_generation.py
"""
#!/usr/bin/env python
import os
import unittest
WORKING_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
print(WORKING_DIR)
import sys
sys.path.insert(1, os.path.join(WORKING_DIR, "dysts"))
from dysts.datasets import load_dataset
from dysts.systems import get_attractor_list
class TestUtilities(unittest.TestCase):
"""
Tests helper utilities
"""
# def test_fourier(self):
# """
# Test discrete fourier analysis
# """
# data_test = np.ones((1000, 3))
# assert True
def test_attractor_list(self):
"""
Test fetching list of attractors
"""
assert len(get_attractor_list()) > 130
class TestDatasets(unittest.TestCase):
"""
Tests models
"""
def test_univariate(self):
"""
Test univariate data loader
"""
data = load_dataset(data_format="numpy", standardize=True)
assert (
data.shape[0] > 131
), "Imported time series collection has the wrong shape"
assert (
data.shape[-1] == 1000
), "Imported time series collection has the wrong shape"
def test_multivariate(self):
"""
Test multivariate data loader
"""
data = load_dataset(subsets="train", univariate=False, standardize=False)
assert data.dataset["Rossler"]["values"].shape == (
1000,
3,
), "Imported time series collection has the wrong shape"
if __name__ == "__main__":
unittest.main()