New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid syntax result from Integrate command. #332
Comments
It probably is SymPy's hyper() and probably appears because Mathics doesn't know of a Mathematica equivalent - perhaps there isn't one. So this is a translation from SymPy results into the Wolfram Language. In that regard to your other bug mathics/Mathics#1591 which is also related to conversion from SymPy into the Wolfram Language. Personally, I don't think I will be looking at this for a while. However if you are interested in digging deeper you might check to see what would happen if you wrote this in SymPy and then compare the results. |
This is because Mathics doesn't add parentheses around the leading |
Thanks for finding this. Removing parentheses from result is not good thing to do. Hopefully someone familiar with Mathics code could fix this. |
You can get the same thing with |
No one is born being familiar with Mathics code. Mathics is an open source project. That means anyone who is interested enough in solving a problem in the code, can do so. There are a number of long-standing problems in Mathics that, personally, I want to address before this kind of thing. Basically where one would start to look is in how sympy expressions are converted to Mathics expressions. I don't doubt that these bugs will get fixed. But in the scheme of things, unless there is good reason otherwise, for me it is going to be a while before I look at such things. |
Thanks --- I was looking through the codebase to solve this. Why would that be the culprit --- I was thinking that it had something to do with the implementation of |
Note the corrected grep: |
Where does Mathics determine how to format |
Something that we could start to do is to create a module to handle hypergeometic functions. You can mimic the code from the exptrig module. |
Regarding the format of "power" it is defined in the mathics.builtin.arithfns.basic module |
What decides if something is wrapped in parentheses? I see |
I go something that works, I just need to deal with the fact that integers don't have precision. |
Here's my preliminary diff:
Anything I should change before submitting a PR? |
Does this pass all of the existing tests and doctests? And a test should be added that catches this particular problem. A quick look and this doesn't feel right. builtins_precendence .get() should be returning the right value so there shouldn't be this test or possibly there is some larger problem. |
In |
What I see is a bit different than just a missing parenthesis. The -1 should be used in a Rational[-1, 3]:
Given that the above shows something a bit different from the OutputForm output, I'd say that the problem is not (just) in And the bug with Power is also a bug is the same and not related to from_sympy. |
What do you mean? |
I mean you may have made a mistake in your sympy translation. Paste the exact sympy session like I did above and the poster of the original issue did. I thought we went over before the basics of reporting all input given and output shown. I am sorry, but I do not have the time right now to be able to answer all of your questions. Also, when I ask questions or ask for something, please answer them, before going off on more questions. |
Here there is a simpler example: The FullForm of this expression is
but in StandardForm, we get @rocky, I am going to try fixing this before the release. |
Fixed in #460 |
Using 4.0 on Linux, I get the following
Notice the
--1
output. This is an error. Mathematica saysPreDecrement::rvalue: 1 is not a variable with a value, so its value cannot be changed.
Btw, as a side issue, what is
hyper[
function above? There is no such function in Mathematica.But the main problem is generating
--1
The text was updated successfully, but these errors were encountered: