Add flexibility in dispatch for iszero_tuple - #667
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #667 +/- ##
==========================================
+ Coverage 90.68% 90.71% +0.02%
==========================================
Files 11 11
Lines 1052 1055 +3
==========================================
+ Hits 954 957 +3
Misses 98 98 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Is there someone specific we can ping to revive this PR? EDIT: after looking at it, this PR should be updated to include other zero checks, such as Lines 566 to 575 in 090ddbb |
|
Not sure who to ping about the internal of ForwardDiff.. @devmotion , @KristofferC , would you consider merging a PR creating a helper function Side note: maybe in this repo a |
IntervalArithmetic.jl may abandon support for `==` among intervals (JuliaIntervals/IntervalArithmetic.jl#571). To support specialization for specific Number subtypes, this makes `iszero_tuple` into a "trait"-dispatched function, first unwrapping all the way down to the elementary numeric type and then jointly dispatching on that type and the actual tuple. This makes it possible to create an extension in IntervalArithmetic that specializes the implementation to use the new comparison operator `≛`. The use of recursive unwrapping enables support for higher-order derivatives.
a0d23e7 to
d01e00a
Compare
The test defines a scalar type whose `==` throws, so the tests pass only if the `_iszero_tuple` specialization is reached, both directly and through nested `Dual`s. Assisted-by: Claude Opus 5 <noreply@anthropic.com>
IntervalArithmetic.jl may abandon support for
==among intervals (JuliaIntervals/IntervalArithmetic.jl#571). To support specialization for specific Number subtypes, this makesiszero_tupleinto a "trait"-dispatched function, first unwrapping all the way down to the elementary numeric type and then jointly dispatching on that type and the actual tuple. This makes it possible to create an extension in IntervalArithmetic that specializes the implementation to use the new comparison operator≛. The use of recursive unwrapping enables support for higher-order derivatives.This doesn't pass tests locally, but neither does
master, and the failures look identical.