Skip to content

Commit

Permalink
api: add w= for weights shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Aug 20, 2024
1 parent 327b6cf commit cacb60d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions devito/finite_differences/derivative.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,9 @@ def _process_x0(cls, dims, **kwargs):

return x0

<<<<<<< HEAD
def __call__(self, x0=None, fd_order=None, side=None, method=None):
side = side or self._side

=======
@classmethod
def _process_weights(cls, **kwargs):
weights = kwargs.get('weights')
weights = kwargs.get('weights', kwargs.get('w'))
if weights is None:
return None
elif isinstance(weights, sympy.Function):
Expand All @@ -226,7 +221,7 @@ def _process_weights(cls, **kwargs):
return as_tuple(weights)

def __call__(self, x0=None, fd_order=None, side=None, method=None, weights=None):
>>>>>>> a14fdae7e (api: revamp custom coefficients API to be passed to derivatives directly)
side = side or self._side
x0 = self._process_x0(self.dims, x0=x0)
_x0 = frozendict({**self.x0, **x0})
if self.ndims == 1:
Expand Down

0 comments on commit cacb60d

Please sign in to comment.