You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unicode and console unit representations sometimes include an extraneous space #14409
As noted in #14407, for units typset in unicode or console format, a space is included in front, unlike for regular units, yet it is sometimes omitted if a unit scale factor is present.
Expected behavior
unit.to_string(format) should never start with a space, independent of format.
importastropy.unitsasuprint(f'{(u.m**-1):unicode}')
1
─
mf"{(u.eV*u.s**2).decompose()}"# space between scale and unit'1.60218e-19 kg m2'f"{(u.eV*u.s**2).decompose():unicode}"# no space between scale and unit'1.6021766×10⁻¹⁹m² kg'f"{(1*u.eV*u.s**2).decompose()}"# space between value and unit'1.602176634e-19 kg m2'f"{(1*u.eV*u.s**2).decompose():unicode}"# space between value and unit'1.602176634e-19 m² kg'
Activity