@@ -31,7 +31,7 @@ def test_dictionary_vector_space():
31
31
assert np .allclose (my_vector_space .get_basis ().flatten (),
32
32
snapshots .flatten ())
33
33
assert np .allclose (my_vector_space .get_shift_vector (), 0 )
34
- assert np .allclose (my_vector_space .get_dimension () , 6 )
34
+ assert np .allclose (my_vector_space .extents ()[ - 1 ] , 6 )
35
35
36
36
# test with a shift
37
37
my_shifter = utils .create_average_shifter (snapshots )
@@ -43,7 +43,7 @@ def test_dictionary_vector_space():
43
43
(original_snapshots - np .mean (original_snapshots , axis = 2 )[:, :, None ]).flatten ())
44
44
assert np .allclose (my_vector_space .get_shift_vector (),
45
45
np .mean (original_snapshots , axis = 2 ))
46
- assert np .allclose (my_vector_space .get_dimension () , 6 )
46
+ assert np .allclose (my_vector_space .extents ()[ - 1 ] , 6 )
47
47
48
48
# test with a shift and splitting
49
49
my_shifter = utils .create_average_shifter (snapshots )
@@ -54,7 +54,7 @@ def test_dictionary_vector_space():
54
54
my_splitter )
55
55
assert np .allclose (my_vector_space .get_shift_vector (),
56
56
np .mean (snapshots , axis = 2 ))
57
- assert np .allclose (my_vector_space .get_dimension () , 12 )
57
+ assert np .allclose (my_vector_space .extents ()[ - 1 ] , 12 )
58
58
59
59
# test with a shift, splitting, and orthogonalization
60
60
my_shifter = utils .create_average_shifter (snapshots )
@@ -66,7 +66,7 @@ def test_dictionary_vector_space():
66
66
my_orthogonalizer )
67
67
assert np .allclose (my_vector_space .get_shift_vector (),
68
68
np .mean (snapshots , axis = 2 ))
69
- assert np .allclose (my_vector_space .get_dimension () , 12 )
69
+ assert np .allclose (my_vector_space .extents ()[ - 1 ] , 12 )
70
70
basis = my_vector_space .get_basis ()
71
71
basis = _tensor_to_matrix (basis )
72
72
assert np .allclose (basis .transpose () @ basis , np .eye (12 ))
@@ -82,7 +82,7 @@ def test_vector_space_from_pod():
82
82
u , s , v = np .linalg .svd (snapshotMatrix , full_matrices = False )
83
83
basis_tensor = my_vector_space .get_basis ()
84
84
assert np .allclose (u .reshape (basis_tensor .shape ), basis_tensor )
85
- assert np .allclose (6 , my_vector_space .get_dimension () )
85
+ assert np .allclose (6 , my_vector_space .extents ()[ - 1 ] )
86
86
assert np .allclose (0 , my_vector_space .get_shift_vector ())
87
87
88
88
# test with a shift
@@ -93,7 +93,7 @@ def test_vector_space_from_pod():
93
93
assert np .allclose (u .reshape (basis_tensor .shape ), basis_tensor ) # FAILS
94
94
assert np .allclose (my_vector_space .get_shift_vector (),
95
95
np .mean (original_snapshots , axis = 2 ))
96
- assert np .allclose (my_vector_space .get_dimension () , 6 )
96
+ assert np .allclose (my_vector_space .extents ()[ - 1 ] , 6 )
97
97
98
98
# test with a shift and splitting
99
99
snapshots = np .random .normal (size = (3 , 8 , 6 ))
@@ -107,7 +107,7 @@ def test_vector_space_from_pod():
107
107
assert np .allclose (u .reshape (basis_tensor .shape ), basis_tensor )
108
108
assert np .allclose (my_vector_space .get_shift_vector (),
109
109
np .mean (original_snapshots , axis = 2 ))
110
- assert np .allclose (my_vector_space .get_dimension () , 12 )
110
+ assert np .allclose (my_vector_space .extents ()[ - 1 ] , 12 )
111
111
112
112
# test with a shift, splitting, and orthogonalization
113
113
snapshots = np .random .normal (size = (3 , 8 , 6 ))
@@ -124,7 +124,7 @@ def test_vector_space_from_pod():
124
124
assert np .allclose (u .reshape (basis_tensor .shape ), basis_tensor )
125
125
assert np .allclose (my_vector_space .get_shift_vector (),
126
126
np .mean (original_snapshots , axis = 2 ))
127
- assert np .allclose (my_vector_space .get_dimension () , 12 )
127
+ assert np .allclose (my_vector_space .extents ()[ - 1 ] , 12 )
128
128
129
129
130
130
@pytest .mark .mpi_skip
@@ -139,7 +139,7 @@ def test_trial_space_from_scaled_pod():
139
139
u = u .reshape (basis_tensor .shape )
140
140
u = my_scaler .post_scale (u )
141
141
assert np .allclose (u , basis_tensor ), print (u , my_vector_space .get_basis ())
142
- assert np .allclose (6 , my_vector_space .get_dimension () )
142
+ assert np .allclose (6 , my_vector_space .extents ()[ - 1 ] )
143
143
assert np .allclose (0 , my_vector_space .get_shift_vector ())
144
144
145
145
# test with a shift
@@ -159,7 +159,7 @@ def test_trial_space_from_scaled_pod():
159
159
assert np .allclose (basis_tensor , u ) # FAILS
160
160
assert np .allclose (my_vector_space .get_shift_vector (),
161
161
np .mean (original_snapshots , axis = 2 ))
162
- assert np .allclose (my_vector_space .get_dimension () , 6 )
162
+ assert np .allclose (my_vector_space .extents ()[ - 1 ] , 6 )
163
163
164
164
# test with a shift and splitting
165
165
snapshots = np .random .normal (size = (3 , 8 , 6 ))
@@ -180,7 +180,7 @@ def test_trial_space_from_scaled_pod():
180
180
assert np .allclose (basis_tensor , u )
181
181
assert np .allclose (my_vector_space .get_shift_vector (),
182
182
np .mean (original_snapshots , axis = 2 ))
183
- assert np .allclose (my_vector_space .get_dimension () , 12 )
183
+ assert np .allclose (my_vector_space .extents ()[ - 1 ] , 12 )
184
184
185
185
# test with a shift, splitting, and orthogonalization
186
186
snapshots = np .random .normal (size = (3 , 8 , 6 ))
@@ -207,7 +207,7 @@ def test_trial_space_from_scaled_pod():
207
207
assert np .allclose (basis_tensor , u )
208
208
assert np .allclose (my_vector_space .get_shift_vector (),
209
209
np .mean (original_snapshots , axis = 2 ))
210
- assert np .allclose (my_vector_space .get_dimension () , 12 )
210
+ assert np .allclose (my_vector_space .extents ()[ - 1 ] , 12 )
211
211
212
212
213
213
if __name__ == "__main__" :
0 commit comments