Skip to content

Commit

Permalink
api: fix symbolic coefficient conservation at rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Aug 23, 2023
1 parent 9b63f91 commit 25c856a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Binary file removed devito/mpatches/.__init__.py.swp
Binary file not shown.
Binary file removed devito/mpatches/.rationaltools.py.swp
Binary file not shown.
6 changes: 5 additions & 1 deletion devito/types/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import numpy as np
import sympy

from sympy.core.assumptions import _assume_rules
from cached_property import cached_property

Expand Down Expand Up @@ -855,11 +856,14 @@ def __str__(self):

__repr__ = __str__

def _sympystr(self, printer):
def _sympystr(self, printer, **kwargs):
return str(self)

_latex = _sympystr

def _pretty(self, printer, **kwargs):
return printer._print_Function(self, func_name=self.name)

def __eq__(self, other):
try:
return (self.function is other.function and
Expand Down
2 changes: 1 addition & 1 deletion devito/types/dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class DiscreteFunction(AbstractFunction, ArgProvider, Differentiable):
The type of the underlying data object.
"""

__rkwargs__ = AbstractFunction.__rkwargs__ + ('staggered',)
__rkwargs__ = AbstractFunction.__rkwargs__ + ('staggered', 'coefficients')

def __init_finalize__(self, *args, function=None, **kwargs):
# Staggering metadata
Expand Down

0 comments on commit 25c856a

Please sign in to comment.