Skip to content

Commit

Permalink
Merge pull request #101 from tirkarthi/fix-abc
Browse files Browse the repository at this point in the history
Import ABC from collections.abc for Python 3.10 compatibility.
  • Loading branch information
avigan authored Feb 8, 2022
2 parents c09eb54 + 76f411d commit 1406c6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sphere/utils/imutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@author: avigan
'''

import collections
import collections.abc
import numpy as np
import scipy.fftpack as fft
import scipy.ndimage as ndimage
Expand Down Expand Up @@ -147,7 +147,7 @@ def shift(array, shift_value, method='fft', mode='constant', cval=0):
raise ValueError('This function can shift only 1D or 2D arrays')

# check that shift value is fine
if isinstance(shift_value, collections.Iterable):
if isinstance(shift_value, collections.abc.Iterable):
shift_value = np.array(shift_value).ravel()
if (shift_value.size != Ndim):
raise ValueError('Number of dimensions in array and shift don\'t match')
Expand Down Expand Up @@ -722,7 +722,7 @@ def scale(array, scale_value, center=None, new_dim=None, method='fft', mode='con
'The center of rotation is exactly at ((dimx-1)/2, dimy/2).')

# check that scale value is fine
if isinstance(scale_value, collections.Iterable):
if isinstance(scale_value, collections.abc.Iterable):
scale_value = np.array(scale_value).ravel()
if (scale_value.size != Ndim):
raise ValueError('Number of dimensions in array and scale value don\'t match')
Expand Down

0 comments on commit 1406c6b

Please sign in to comment.