Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods with and without extras #313

Merged
merged 13 commits into from
Jun 7, 2024
Merged

Methods with and without extras #313

merged 13 commits into from
Jun 7, 2024

Conversation

gdalle
Copy link
Owner

@gdalle gdalle commented Jun 7, 2024

DI source

For each operator, separate the method with extras and the method without. In other words,

function operator(f, b, x, extras::ExtrasType=prepare_operator(f, b, x))
   # do stuff
end

becomes

function operator(f, b, x, extras::DefaultExtrasType)
   # do stuff
end

function operator(f, b, x)
   return operator(f, b, x, prepare_operator(f, b, x)
end

This allows a more precise dispatch on DefaultExtrasType, and makes the errors more understandable to contributors when they fail to implement one of the 4 operator versions.

DI extensions

  • Fix method ambiguity in PolyesterForwardDiff for derivative

DIT source

  • Add correctness tests with and without extras (leads to significantly longer tests, especially for Tapir and symbolic backends)

@codecov-commenter
Copy link

codecov-commenter commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 83.84279% with 74 lines in your changes missing coverage. Please review.

Project coverage is 96.05%. Comparing base (0b7a2f9) to head (4c3bbb0).

Files Patch % Lines
...ferentiationInterfaceTest/src/tests/correctness.jl 77.50% 74 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #313      +/-   ##
==========================================
- Coverage   96.32%   96.05%   -0.27%     
==========================================
  Files          95       95              
  Lines        4294     4365      +71     
==========================================
+ Hits         4136     4193      +57     
- Misses        158      172      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gdalle gdalle merged commit 61c2741 into main Jun 7, 2024
50 checks passed
@gdalle gdalle deleted the gd/extras branch June 7, 2024 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants