Unitful.jl
Unitful.jl copied to clipboard
Improve docs for extending Unitful
I'd wanted to extend Unitful with a couple of units in a package of mine but I realized I did not understand most of the discussion about it in the documentation here.
Then I thought I'd just copy the UnitfulUS.jl example but it seems that it is not passing CI, which deterred me back here to suggest to either
- improve Unitful's documentation here, or
- update UnitfulUS.jl so that it passes CI, or
- register a dedicated package, e.g.,
UnitfulExtensionExample.jl, with some conversion testing, that would contain something like:
module UnitfulExtensionExample
mandatory code # Don' touch this part
mandatory code # Don' touch this part
mandatory code # Don' touch this part
# my new units
# (I just copy-pasted the first 5 units
# from UnitfulUS.jl for the sake of this example.)
@unit sinch_us "inˢ" USSurveyInch (100//3937)*Unitful.m false
@unit sft_us "ftˢ" USSurveyFoot 12sinch_us false
@unit sli_us "liˢ" USSurveyLink (33//50)sft_us false
@unit syd_us "ydˢ" USSurveyYard 3sft_us false
@unit srd_us "rdˢ" USSurveyRod 25sli_us false
mandatory code # Don' touch this part
mandatory code # Don' touch this part
mandatory code # Don' touch this part
end
UnitfulUS.jl actually passes CI, the badge in the README just points to the CI for the old repository (UnitfulUS was transferred from ajkeller34 to PainterQubits a while ago).
Oh OK I see. I just submitted a PR to change that (for the badges to point to PainterQubits).