Skip to content

Commit c89d3cb

Browse files
committed
sympy: Should have checked previous commit before building my sandcastle on it
1 parent 4a4c71a commit c89d3cb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

devito/finite_differences/derivative.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ def __new__(cls, expr, *dims, **kwargs):
9999
expr = diffify(expr)
100100
except Exception as e:
101101
raise ValueError("`expr` must be a Differentiable object") from e
102+
if isinstance(expr, sympy.Number):
103+
return 0
102104

103105
new_dims, orders, fd_o, var_count = cls._process_kwargs(expr, *dims, **kwargs)
104106

@@ -268,7 +270,7 @@ def __call__(self, x0=None, fd_order=None, side=None, method=None, **kwargs):
268270
return self._rebuild(**rkw)
269271

270272
def _rebuild(self, *args, **kwargs):
271-
if kwargs and not args:
273+
if not args:
272274
kwargs['preprocessed'] = True
273275
expr = super()._rebuild(**kwargs)
274276
else:

0 commit comments

Comments
 (0)