Skip to content

Commit

Permalink
Change collections.Iterable to collections.abc.Iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuki Fukuda authored Mar 6, 2022
1 parent d33ef4e commit e5833f6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deltasigma/_axisLabels.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def axisLabels(ran, incr):
ran = np.asarray(ran)
ran[np.abs(ran) < 1e-6] = 0
s = []
if not isinstance(incr, collections.Iterable):
if not isinstance(incr, collections.abc.Iterable):
incr = int(incr)
first = 0
elif len(incr) == 2:
Expand Down
4 changes: 2 additions & 2 deletions deltasigma/_pulse.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def pulse(S, tp=(0., 1.), dt=1., tfinal=10., nosum=False):
_, df = rat(tfinal, 1e-3)
delta_t = 1./lcm(dd, lcm(ddt, df))
delta_t = max(1e-3, delta_t) # Put a lower limit on delta_t
if (isinstance(S, collections.Iterable) and len(S)) \
and (isinstance(S[0], collections.Iterable) and len(S[0])) \
if (isinstance(S, collections.abc.Iterable) and len(S)) \
and (isinstance(S[0], collections.abc.Iterable) and len(S[0])) \
and (isinstance(S[0][0], lti) or _is_zpk(S[0][0]) or _is_num_den(S[0][0]) \
or _is_A_B_C_D(S[0][0])):
pass
Expand Down
2 changes: 1 addition & 1 deletion deltasigma/_simulateDSM_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def simulateDSM(u, arg2, nlev=2, x0=0.):
# need to set order and form now.
order = carray(zeros).shape[0] if form == 2 else ABCD.shape[0] - nq

if not isinstance(x0, collections.Iterable):
if not isinstance(x0, collections.abc.Iterable):
x0 = x0*np.ones((order,), dtype=np.float64)
else:
x0 = np.array(x0).reshape((-1,))
Expand Down
2 changes: 1 addition & 1 deletion deltasigma/_simulateSNR.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def simulateSNR(arg1, osr, amp=None, f0=0, nlev=2, f=None, k=13,
amp = np.concatenate((np.arange(- 120, -20 + 1, 10),
np.array((-15,)),
np.arange(-10, 1)))
elif not isinstance(amp, collections.Iterable):
elif not isinstance(amp, collections.abc.Iterable):
amp = np.array((amp, ))
else:
amp = np.asarray(amp)
Expand Down

0 comments on commit e5833f6

Please sign in to comment.