Skip to content

Commit 0154a89

Browse files
committed
remove deprecated isintlike
1 parent 56f2581 commit 0154a89

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

krypy/utils.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
import scipy.linalg.blas as blas
1616
from scipy.sparse import isspmatrix
1717

18-
# from scipy.sparse.linalg import LinearOperator, aslinearoperator
19-
from scipy.sparse.sputils import isintlike
20-
2118
__all__ = [
2219
"ArgumentError",
2320
"AssumptionError",
@@ -143,6 +140,13 @@ def shape_vecs(*args):
143140
return flat_vecs, ret_args
144141

145142

143+
def isint(x):
144+
try:
145+
return int(x) == x
146+
except:
147+
return False
148+
149+
146150
def ip_euclid(X, Y):
147151
"""Euclidean inner product.
148152
@@ -1369,7 +1373,7 @@ class LinearOperator(object):
13691373
"""
13701374

13711375
def __init__(self, shape, dtype, dot=None, dot_adj=None):
1372-
if len(shape) != 2 or not isintlike(shape[0]) or not isintlike(shape[1]):
1376+
if len(shape) != 2 or not isint(shape[0]) or not isint(shape[1]):
13731377
raise LinearOperatorError("shape must be (m,n) with m and n " "integer")
13741378
self.shape = shape
13751379
self.dtype = numpy.dtype(dtype) # defaults to float64
@@ -1525,7 +1529,7 @@ def __init__(self, A, p):
15251529
raise LinearOperatorError("LinearOperator expected as A")
15261530
if A.shape[0] != A.shape[1]:
15271531
raise LinearOperatorError("square LinearOperator expected as A")
1528-
if not isintlike(p):
1532+
if not isint(p):
15291533
raise LinearOperatorError("integer expected as p")
15301534
self.args = (A, p)
15311535
super(_PowerLinearOperator, self).__init__(

0 commit comments

Comments
 (0)