Unitful.jl
Unitful.jl copied to clipboard
Re-define Unitful's yr (year) unit to be 365.2425 days
Specify Unitful's year unit to be 365.2425 days.
This is the true average number of days in the Gregorian year, every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100, but these centurial years are leap years, if they are exactly divisible by 400.
See Dates.isleapyear and Dates.days(::Year).
This is a suggested change in the interest of correctness, but it likely doesn't make much of a difference to most people!
See also #288.
Apologies, I made a syntax error that I didn't catch. I've rectified it.
To me, 365.2425 days seems like the correct value. I don’t know why 365.25 was chosen. Maybe there is a scientific field where 365.25 days is commonly used? Anyway, I think this is a good change, but I consider it breaking, so it can only be changed in Unitful v2.0.
I do not know whether this is related, but the light year seems to be defined by the Julian year, so it might make sense to check whether UnitfulAstro is affected by this change.
@sostock whoops, I deleted the fork, didn't realise that would close the PR. Can this be reopened?
The PR can't be reopened without you restoring the fork with exactly the same content. But even with this PR not reopened the content is accessible.