|
2 | 2 | from cached_property import cached_property |
3 | 3 |
|
4 | 4 | import numpy as np |
5 | | -from sympy import Dummy |
6 | | -from sympy.core.decorators import call_highest_priority |
7 | 5 | from sympy.core.sympify import converter as sympify_converter |
8 | 6 |
|
9 | 7 | from devito.finite_differences import Differentiable |
@@ -123,33 +121,6 @@ def __subfunc_setup__(cls, *args, **kwargs): |
123 | 121 | funcs = funcs.tolist() |
124 | 122 | return funcs |
125 | 123 |
|
126 | | - @call_highest_priority('__mul__') |
127 | | - def __rmul__(self, other): |
128 | | - """ |
129 | | - Prevents Functions to be interpreted as matrices in 2D becaue of `.shape` |
130 | | - TODO: Remove after sympy 1.7 |
131 | | - """ |
132 | | - if getattr(other, 'is_DiscreteFunction', False): |
133 | | - tmp_func = Dummy(other.name) |
134 | | - simplemul = super(TensorFunction, self).__rmul__(tmp_func) |
135 | | - return simplemul.subs(tmp_func, other) |
136 | | - # honest sympy matrices defer to their class's routine |
137 | | - if getattr(other, 'is_Matrix', False): |
138 | | - return self._eval_matrix_rmul(other) |
139 | | - return super(TensorFunction, self).__rmul__(other) |
140 | | - |
141 | | - @call_highest_priority('__rmul__') |
142 | | - def __mul__(self, other): |
143 | | - """ |
144 | | - Prevents Functions to be interpreted as matrices in 2D becaue of `.shape` |
145 | | - TODO: Remove after sympy 1.7 |
146 | | - """ |
147 | | - if getattr(other, 'is_DiscreteFunction', False): |
148 | | - tmp_func = Dummy(other.name) |
149 | | - simplemul = super(TensorFunction, self).__mul__(tmp_func) |
150 | | - return simplemul.subs(tmp_func, other) |
151 | | - return super(TensorFunction, self).__mul__(other) |
152 | | - |
153 | 124 | def __getattr__(self, name): |
154 | 125 | """ |
155 | 126 | Try calling a dynamically created FD shortcut. |
|
0 commit comments