Skip to content

Commit 5ad9283

Browse files
committed
api: add retrocompat to is_imaginary for older sympy
1 parent d6980b7 commit 5ad9283

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

devito/types/basic.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,12 @@ def _eval_is_real(self):
429429
return not self.is_imaginary
430430

431431
def _eval_is_imaginary(self):
432-
return np.iscomplexobj(self.dtype(0))
432+
try:
433+
return np.iscomplexobj(self.dtype(0))
434+
except TypeError:
435+
# Non-callabale dtype, likely non-numpy
436+
# Assuming it's not complex
437+
return False
433438

434439
@property
435440
def indices(self):

0 commit comments

Comments
 (0)