Skip to content

Commit

Permalink
Disable relative temperature scales and affine units
Browse files Browse the repository at this point in the history
Throw an error if encountered. See #7
  • Loading branch information
j-fu committed Feb 8, 2025
1 parent 983e19f commit f3d3ae2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/LessUnitful.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ julia> u"1cm" |> unitfactor |> u"cm"
unitfactor(u::Unitful.FreeUnits)=Unitful.float(Unitful.ustrip(Unitful.upreferred(1u)))
unitfactor(q::Unitful.AbstractQuantity) = Unitful.float(Unitful.ustrip(Unitful.upreferred(q)))
unitfactor(r::Real)=r
function unitfactor(t::Unitful.RelativeScaleTemperature)
error("Relative temperature scales are not supported by LessUnitful")
end

function unitfactor(u::Unitful.FreeUnits{N,D,A}) where {N,D,A<:Unitful.Affine}
error("Affine units are not supported by LessUnitful")
end

##################################################################################
"""
Expand Down

0 comments on commit f3d3ae2

Please sign in to comment.