Open MilesCranmer opened 11 months ago
And this allows me to keep
Base.one(::Quantity) -> Quantity
.
Isn't that violating the semantic of Base.one
?
Patch and project coverage have no change.
Comparison is base (
10bc1a1
) 98.16% compared to head (bdd31ec
) 98.16%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Unitful.Quantity yes, but DynamicQuantities.Quantity no.
See the discussion in https://github.com/SymbolicML/DynamicQuantities.jl/issues/40 for details.
@stevengj wondering if you could look at merging this? It is completely compatible with existing types and also adds support for DualNumbers and DynamicQuantities (for which one
is used for something different)
FYI @mikeingold once this PR merges, you will be able to use DynamicQuantities for QuadGK.
FYI @stevengj this is now in Measurements.jl as an extension, and also compatible with DualNumbers, Unitful, and DynamicQuantities (as well as a nested combination of any of those)
x-ref https://github.com/JuliaMath/QuadGK.jl/issues/88, https://github.com/JuliaPhysics/Measurements.jl/pull/155, https://github.com/SymbolicML/DynamicQuantities.jl/issues/40
I've confirmed that with this change as well as the intended change to make
AbstractQuantity <: Number
, DynamicQuantities.jl is now compatible with QuadGK.jl. And this allows me to keepBase.one(::Quantity) -> Quantity
.BaseType.jl should already work for all types I can think of due to the default behavior, but feel free to wait until more interfaces are explicitly declared (e.g., https://github.com/JuliaPhysics/Measurements.jl/pull/155)