Closed Davide-sd closed 2 years ago
If you are using this to input into solve, the experimental override of solve in the package already does this. Try something like this:
var('a b c')
eq1 =@ a - b = c/a
solve(eq1,a)
This should return both the typeset and python code versions of the solutions.
Is there a more general reason the rewrite
would be needed?
Hello gutow, this is a very nice package.
Thank you.
@Davide-sd should this issue remain open? Is there another use for rewrite
other then making input for solve
?
Please leave it open for a few more days, as I'm still trying this module and I have to fully understand if this feature might be useful or what...
@gutow : how do you usually run tests on your local machine? I naively run the pytest
command from the root folder, but I got the following error:
_________________ERROR collecting tests/test_algebraic_equation.py _________________________________________
tests/test_algebraic_equation.py:55: in <module>
exec(execstr, globals(), locals())
<string>:1: in <module>
???
E TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
@gutow : how do you usually run tests on your local machine? I naively run the
pytest
command from the root folder, but I got the following error:_________________ERROR collecting tests/test_algebraic_equation.py _________________________________________ tests/test_algebraic_equation.py:55: in <module> exec(execstr, globals(), locals()) <string>:1: in <module> ??? E TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
Davide, Sorry about that. In my rush to get out the fix to be compatible with sympy 1.11 (added a function that isn't part of function class), I did not update the way tests load and override the sympy functions.
I am working on a more robust way of doing this that should not require updating tests when sympy adds other non-compliant functions.
If you need to run tests you can fix this by adding the string 'piecewise_exclusive'
to skip
list that begins on line 49 of test_algebraic_equation.py.
Hello gutow, this is a very nice package.
Would it be possible to implement the
rewrite
method so that when a user executeeq.rewrite(Add)
it returnseq.lhs - eq.rhs
, like SymPy'sEq
does?