Skip to content

Commit 317de54

Browse files
committed
Fix PIL deprecation warning
1 parent ff37bec commit 317de54

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/aspire/apple/picking.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ def read_mrc(self):
191191
size = tuple((np.array(im.shape) / self.mrc_shrink_factor).astype(int))
192192

193193
# Note, float64 required for signal.correlate call accuracy.
194-
im = np.asarray(Image.fromarray(im).resize(size, Image.BICUBIC)).astype(
195-
np.float64, copy=False
196-
)
194+
im = np.asarray(
195+
Image.fromarray(im).resize(size, Image.Resampling.BICUBIC)
196+
).astype(np.float64, copy=False)
197197

198198
im = signal.correlate(
199199
im,

src/aspire/storage/micrograph.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def _read(self):
8585

8686
if self.shrink_factor is not None:
8787
size = tuple((np.array(im.shape) / self.shrink_factor).astype(int))
88-
im = np.array(PILImage.fromarray(im).resize(size, PILImage.BICUBIC))
88+
im = np.array(
89+
PILImage.fromarray(im).resize(size, PILImage.Resampling.BICUBIC)
90+
)
8991

9092
if self.gauss_filter_size is not None:
9193
im = signal.correlate(

0 commit comments

Comments
 (0)