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
sympify "N" (newton) error #26422
Comments
You can use |
if the resulting expression is "10*newton", would this be good? |
The point is: if you input "10*N" (short form) you'll get an error and not the resulting expression you wrote. |
Can you give me some test inputs and the expected output for them after passing to sympify()? |
For sure.
Right answer using "newton" instead of "N":
Right answer if the use of "N" was ok inside sympify:
Error happening nowadays;
I hope this helps. |
When trying to sympify an expression with newton unit abreviated ("N"), it raises an exception because it considered "N" as an expression and not as a unit, as you can see below:
This probably happens because sympify module imports "N function" in the line 61:
And again in the line 270:
I could figured out only 3 possible solutions:
Despite the fact I consider the third one the worst option, since people working with physics and mathematicians expressions usually use newton force as "N", I'm adopting this option as a workaround because I hope the solution 1, 2, or other better comes fast.
INFORMATION
Ubuntu 22.04.4 LTS 64 bits
Python 3.10.12 [GCC 11.4.0]
sympy==1.9
The text was updated successfully, but these errors were encountered: