Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bwohlberg committed Feb 28, 2024
1 parent 3b92eef commit 05e7da1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions scico/test/functional/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
functional.L1MinusL2Norm,
functional.NuclearNorm,
functional.AnisotropicTVNorm,
functional.IsotropicTVNorm,
functional.TVNorm,
]
NO_COMPLEX = [functional.NonNegativeIndicator]

Expand Down
3 changes: 3 additions & 0 deletions scico/test/functional/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class TestJit:
functional.Functional,
functional.ScaledFunctional,
functional.SeparableFunctional,
functional.AnisotropicTVNorm, # requires input_shape parameter in order to be jittable
functional.IsotropicTVNorm, # requires input_shape parameter in order to be jittable
functional.TVNorm, # requires input_shape parameter in order to be jittable
functional.BM3D,
functional.BM4D,
]
Expand Down
14 changes: 7 additions & 7 deletions scico/test/functional/test_tvnorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ def setup_method(self):
N = 32
x_gt = create_circular_phantom(
(N, N), [0.6 * N, 0.4 * N, 0.2 * N, 0.1 * N], [0.25, 1, 0, 0.5]
)
).astype(np.float32)
gr, gc = np.ogrid[0:N, 0:N]
x_gt += (gr + gc) / (4 * N)
x_gt += ((gr + gc) / (4 * N)).astype(np.float32)
σ = 0.02
noise, key = scico.random.randn(x_gt.shape, seed=0)
noise, key = scico.random.randn(x_gt.shape, seed=0, dtype=np.float32)
y = x_gt + σ * noise
self.x_gt = x_gt
self.y = y
Expand Down Expand Up @@ -110,12 +110,12 @@ def setup_method(self):
N = 32
x2d = create_circular_phantom(
(N, N), [0.6 * N, 0.4 * N, 0.2 * N, 0.1 * N], [0.25, 1, 0, 0.5]
)
).astype(np.float32)
gr, gc = np.ogrid[0:N, 0:N]
x2d += (gr + gc) / (4 * N)
x_gt = np.stack((0.9 * x2d, np.zeros(x2d.shape), 1.1 * x2d))
x2d += ((gr + gc) / (4 * N)).astype(np.float32)
x_gt = np.stack((0.9 * x2d, np.zeros(x2d.shape), 1.1 * x2d), dtype=np.float32)
σ = 0.02
noise, key = scico.random.randn(x_gt.shape, seed=0)
noise, key = scico.random.randn(x_gt.shape, seed=0, dtype=np.float32)
y = x_gt + σ * noise
self.x_gt = x_gt
self.y = y
Expand Down

0 comments on commit 05e7da1

Please sign in to comment.