Skip to content

Commit 113a619

Browse files
committed
Fix two 1290 regressions
1 parent 1e21303 commit 113a619

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/aspire/basis/steerable.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,14 @@ def filter_to_basis_mat(self, f, method="evaluate_t", truncate=True, **kwargs):
504504
" Try `evaluate_t` or `expand`."
505505
)
506506

507-
coef = Coef(self, np.eye(self.count, dtype=self.dtype))
508-
img = coef.evaluate()
509-
# Note this may raise at run time for filters requiring `pixel_size` (eg CTFFilter)
507+
# Note this may raise at filter run time for filters requiring `pixel_size` (eg CTFFilter)
510508
# Alternative is to make `pixel_size` required for all calls to `filter_to_basis_mat`.
511-
img.pixel_size = kwargs.get("pixel_size", None)
509+
coef = Coef(
510+
self,
511+
np.eye(self.count, dtype=self.dtype),
512+
pixel_size=kwargs.get("pixel_size", None),
513+
)
514+
img = coef.evaluate()
512515

513516
# Expansion can fail for some filters on specific basis vectors.
514517
# Loop over the expanding the filtered basis vectors one by one,

tests/test_covar2d_denoiser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ def test_filter_to_basis_mat_ctf(coef, basis):
193193

194194
# Apply evaluate->filter->expand manually
195195
imgs = coef.evaluate()
196-
imgs.pixel_size = pixel_size # Possible in future get from `Coef`
197196
imgs_manual = imgs.filter(filt)
198197
coef_manual = basis.expand(imgs_manual)
199198

0 commit comments

Comments
 (0)