Use BaseType.base_numeric_type instead of Base.one to get base scalar type#92
Use BaseType.base_numeric_type instead of Base.one to get base scalar type#92MilesCranmer wants to merge 1 commit intoJuliaMath:masterfrom
Conversation
Isn't that violating the semantic of |
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #92 +/- ##
=======================================
Coverage 98.16% 98.16%
=======================================
Files 6 6
Lines 599 599
=======================================
Hits 588 588
Misses 11 11
☔ View full report in Codecov by Sentry. |
|
Unitful.Quantity yes, but DynamicQuantities.Quantity no. See the discussion in JuliaPhysics/DynamicQuantities.jl#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 |
|
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 #88, JuliaPhysics/Measurements.jl#155, JuliaPhysics/DynamicQuantities.jl#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., JuliaPhysics/Measurements.jl#155)