Skip to content

Commit f01d61e

Browse files
committed
Parameterize 3D (F)FB tests
1 parent c357bb0 commit f01d61e

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

tests/test_FBbasis3D.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from unittest import TestCase
33

44
import numpy as np
5+
from parameterized import parameterized_class
56

67
from aspire.basis import FBBasis3D
78

@@ -10,10 +11,20 @@
1011
DATA_DIR = os.path.join(os.path.dirname(__file__), "saved_test_data")
1112

1213

14+
# NOTE: Class with default values is already present, so don't list it below.
15+
@parameterized_class(
16+
("L", "dtype"),
17+
[
18+
(8, np.float64),
19+
(16, np.float32),
20+
(16, np.float64),
21+
],
22+
)
1323
class FBBasis3DTestCase(TestCase, Steerable3DMixin, UniversalBasisMixin):
24+
L = 8
25+
dtype = np.float32
26+
1427
def setUp(self):
15-
self.L = 8
16-
self.dtype = np.float32
1728
self.basis = FBBasis3D((self.L, self.L, self.L), dtype=self.dtype)
1829
self.seed = 9161341
1930

tests/test_FFBbasis3D.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from unittest import TestCase
33

44
import numpy as np
5+
from parameterized import parameterized_class
56

67
from aspire.basis import FFBBasis3D
78

@@ -10,10 +11,22 @@
1011
DATA_DIR = os.path.join(os.path.dirname(__file__), "saved_test_data")
1112

1213

14+
# NOTE: Class with default values is already present, so don't list it below.
15+
@parameterized_class(
16+
("L", "dtype"),
17+
[
18+
(8, np.float64),
19+
(16, np.float32),
20+
(16, np.float64),
21+
(32, np.float32),
22+
(32, np.float64),
23+
],
24+
)
1325
class FFBBasis3DTestCase(TestCase, Steerable3DMixin, UniversalBasisMixin):
26+
L = 8
27+
dtype = np.float32
28+
1429
def setUp(self):
15-
self.L = 8
16-
self.dtype = np.float32
1730
self.basis = FFBBasis3D((self.L, self.L, self.L), dtype=self.dtype)
1831
self.seed = 9161341
1932

0 commit comments

Comments
 (0)