Skip to content

Commit 5334700

Browse files
committed
api: fix non-integer Mul args
1 parent 3f2d49d commit 5334700

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

devito/finite_differences/differentiable.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -552,17 +552,13 @@ def __new__(cls, *args, **kwargs):
552552
nums, others = split(args, lambda e: isinstance(e, (int, float,
553553
sympy.Number, np.number)))
554554
scalar = sympy.Mul(*nums)
555-
try:
556-
scalar = sympy.Integer(scalar)
557-
except TypeError:
558-
pass
559555

560556
# a*0 -> 0
561557
if scalar == 0:
562558
return sympy.S.Zero
563559

564560
# a*1 -> a
565-
if scalar == 1:
561+
if int(scalar) == 1:
566562
args = others
567563
else:
568564
args = [scalar] + others

0 commit comments

Comments
 (0)