This appears to be related to known issues. Please your add observations to the bug report so that those working on the units package may have as much information as possible.

See: https://github.com/sympy/sympy/issues/18368

A work around that involves more work on your part, but does not behave oddly is to define unit symbols as positive and real SymPy variables (e.g. `var('J kg m s', positive=True, real=True)`). They will behave as you expect. You can convert units by using syntax such as `.subs({J:kg*m**2/s**2})`, which would convert J to the SI base units.

Jonathan

On 10/26/20 5:39 PM, [email protected] wrote:
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

I have noticed in the unit systems module I get odd behavior trying to convert to a unit that does not match the expression. For example after importing

>>> from sympy.physics.units import *

and executing

>>> convert_to(5*V, ohm)
I get
5*10**(1/3)*ohm**(8/9)

but other times it behaves as I would expect,  such as

>>> convert_to(5*joule, m)
5*joule

Any ideas why this is occurring?
--
You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/92a0cf64-b163-49a3-a76d-89ddc467ad44n%40googlegroups.com <https://groups.google.com/d/msgid/sympy/92a0cf64-b163-49a3-a76d-89ddc467ad44n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/03d87f69-4c19-3644-fd29-3c088775a832%40uwosh.edu.

Reply via email to