add 'as' as arcsecond for alias with prefixes enabled #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It is extremely common in astronomy to use arcseconds. Very commonly, we work with quantities like "milliarcseconds" and "microarcseconds" for the super small angles on the night sky. We've run into this issue in (JuliaAstro/UnitfulAstro.jl#7). This PR adds a new unit
"as"
(ArcsecondShort
struct name) which has prefixes enabled. The following conversions are now trivial-I've also added
as
to the testing units, and have added extra tests to ensure the prefixes are accurate alongside what Unitful provides.Current Problems
There are two problems to address that I would like feedback on, if possible
u"as"
is technically valid as "attoseconds". I don't know a good workaround for this- if there was a way to disableu"as"
while still allowing, e.g.,u"mas"
that would be perfect, since it's easy enough to write outu"arcsecond"
if the prefix isn't needed.Arcsecond
with this newArcsecondShort
unit. I don't know if this is the appropriate way and I don't love it, since it seems very easy to get mixed up.One of the alternatives would be adding two bespoke units for millarcsecond and microarcsecond, but that feels very ad-hoc and adds more potential for bugs between the three Unitful libraries I've mentioned