Skip to content

Commit 7faf923

Browse files
committed
Remove hardcoding from complex conversion tests
1 parent a311f9b commit 7faf923

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/test_FBbasis2D.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from aspire.image import Image
1010
from aspire.utils import complex_type, real_type, utest_tolerance
1111
from aspire.utils.coor_trans import grid_2d
12+
from aspire.utils.random import randn
1213

1314
from ._basis_util import Steerable2DMixin
1415

@@ -366,8 +367,7 @@ def testElement(self):
366367
self.assertTrue(np.allclose(coef, coef_ref, atol=1e-4))
367368

368369
def testComplexCoversion(self):
369-
# Load a reasonable input
370-
x = np.load(os.path.join(DATA_DIR, "fbbasis_coefficients_8_8.npy"))
370+
x = randn(*self.basis.sz, seed=self.seed)
371371

372372
# Express in an FB basis
373373
v1 = self.basis.expand(x.astype(self.dtype))
@@ -381,8 +381,7 @@ def testComplexCoversion(self):
381381
self.assertTrue(np.allclose(v1, v2))
382382

383383
def testComplexCoversionErrorsToComplex(self):
384-
# Load a reasonable input
385-
x = np.load(os.path.join(DATA_DIR, "fbbasis_coefficients_8_8.npy"))
384+
x = randn(*self.basis.sz, seed=self.seed)
386385

387386
# Express in an FB basis
388387
v1 = self.basis.expand(x.astype(self.dtype))
@@ -407,8 +406,7 @@ def testComplexCoversionErrorsToComplex(self):
407406
_ = self.basis.to_complex(v1.reshape(-1))
408407

409408
def testComplexCoversionErrorsToReal(self):
410-
# Load a reasonable input
411-
x = np.load(os.path.join(DATA_DIR, "fbbasis_coefficients_8_8.npy"))
409+
x = randn(*self.basis.sz, seed=self.seed)
412410

413411
# Express in an FB basis
414412
cv1 = self.basis.to_complex(self.basis.expand(x.astype(self.dtype)))

0 commit comments

Comments
 (0)