Skip to content

Commit

Permalink
Parameterize 3D (F)FB tests
Browse files Browse the repository at this point in the history
  • Loading branch information
janden committed May 30, 2022
1 parent f499e44 commit 8a15644
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
15 changes: 13 additions & 2 deletions tests/test_FBbasis3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from unittest import TestCase

import numpy as np
from parameterized import parameterized_class

from aspire.basis import FBBasis3D

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


# NOTE: Class with default values is already present, so don't list it below.
@parameterized_class(
("L", "dtype"),
[
(8, np.float64),
(16, np.float32),
(16, np.float64),
],
)
class FBBasis3DTestCase(TestCase, Steerable3DMixin):
L = 8
dtype = np.float32

def setUp(self):
self.L = 8
self.dtype = np.float32
self.basis = FBBasis3D((self.L, self.L, self.L), dtype=self.dtype)
self.seed = 9161341

Expand Down
17 changes: 15 additions & 2 deletions tests/test_FFBbasis3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from unittest import TestCase

import numpy as np
from parameterized import parameterized_class

from aspire.basis import FFBBasis3D

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


# NOTE: Class with default values is already present, so don't list it below.
@parameterized_class(
("L", "dtype"),
[
(8, np.float64),
(16, np.float32),
(16, np.float64),
(32, np.float32),
(32, np.float64),
],
)
class FFBBasis3DTestCase(TestCase, Steerable3DMixin):
L = 8
dtype = np.float32

def setUp(self):
self.L = 8
self.dtype = np.float32
self.basis = FFBBasis3D((self.L, self.L, self.L), dtype=self.dtype)
self.seed = 9161341

Expand Down

0 comments on commit 8a15644

Please sign in to comment.