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
Currently, Angle.to_string doesn't include a space between the value and unit:
In [30]: fromastropy.coordinatesimportAngleIn [31]: a=Angle(3, 'deg')
In [32]: a.to_string(unit='mas')
Out[32]: '1.08e+07mas'
I think there are cases where it would make sense to allow a space to be included, so this is a feature request to add a boolean keyword argument to optionally add a space.
Note that Quantity does include a space by default so maybe actually we should just change the default and not add an option?
@astrofrog I think we should use a space by default (probably the most common use case), and then add a boolean keyword argument to optionally not include a space (e.g. 3.4").
Activity
Cadair commentedon May 11, 2018
isn't it good form to always have a space between the value and the unit?
pllim commentedon May 11, 2018
👍 for consistency between Quantity and Angle (by having space as default).
However, if you worry about backward compatibility, maybe instead add an option for "old style" (without space), but would that be useful for anyone?
astrofrog commentedon May 11, 2018
Well the one place where we don't want a space is when using a symbol, e.g.
3.4"pllim commentedon May 11, 2018
Re: symbol -- Nothing some
regexwouldn't fix... 😉 (show self to door)larrybradley commentedon Jun 20, 2018
@astrofrog I think we should use a space by default (probably the most common use case), and then add a boolean keyword argument to optionally not include a space (e.g.
3.4").astrofrog commentedon Jun 20, 2018
I agree!
daspartho commentedon Aug 15, 2022
can i work on this
Telomelonia commentedon Dec 24, 2022
@pllim I have implemented your idea in the PR attached; please see to it.