-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Composite units with strange unicode symbols do not work #17010
Copy link
Copy link
Closed
Description
Description
One can use units like "M⊙" work but "M⊙/yr" does not. The problem is special-casing of non-composite units (which does work), but in composite units it appears the solar symbol is not recognized as being part of the M.
Expected behavior
I'd expect composite units to work as well.
How to Reproduce
import astropy.units as u
u.Unit("M⊙/yr")
ValueError: 'M⊙/yr' did not parse as unit: At col 0, M is not a valid unit. Did you mean m? If this is meant to be a custom unit, define it with 'u.def_unit'. To have it recognized inside a file reader or other code, enable it with 'u.add_enabled_units'. For details, see https://docs.astropy.org/en/latest/units/combining_and_defining.htmlReactions are currently unavailable