ForwardDiff.jl icon indicating copy to clipboard operation
ForwardDiff.jl copied to clipboard

Add flexibility in dispatch for `iszero_tuple`

Open timholy opened this issue 2 years ago • 1 comments

IntervalArithmetic.jl may abandon support for == among intervals (https://github.com/JuliaIntervals/IntervalArithmetic.jl/pull/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.

This doesn't pass tests locally, but neither does master, and the failures look identical.

timholy avatar Sep 28 '23 13:09 timholy

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (d300209) 89.65% compared to head (a0d23e7) 86.54%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #667      +/-   ##
==========================================
- Coverage   89.65%   86.54%   -3.12%     
==========================================
  Files          11       10       -1     
  Lines         967      899      -68     
==========================================
- Hits          867      778      -89     
- Misses        100      121      +21     
Files Coverage Δ
src/dual.jl 78.28% <100.00%> (-3.87%) :arrow_down:
src/partials.jl 84.21% <100.00%> (ø)

... and 8 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 28 '23 14:09 codecov[bot]