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

Resolve Symbolics.Num - ForwardDiff.Dual ambiguities #1036

Conversation

asterycs
Copy link
Contributor

@asterycs asterycs commented Jan 7, 2024

This is a first attempt at resolving #1032.

The easiest way to resolve the issue seems to be to copy the relevant method definitions from ForwardDiff, which is what is done in this PR.

Unfortunately this introduces a lot of code duplication. An alternative approach would be to convert the method definition loops in https://github.com/JuliaDiff/ForwardDiff.jl/blob/master/src/dual.jl into functions that take a list of the ambiguous types as argument. However, this requires more changes to ForwardDiff in order to prevent existing methods from getting overwritten (e.g. here).

Let me know if you'd have any suggestions for this PR and I'll accommodate them.

@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2024

Codecov Report

Attention: 17 lines in your changes are missing coverage. Please review.

Comparison is base (abe8f56) 77.54% compared to head (18f1abf) 19.28%.

Files Patch % Lines
ext/SymbolicsForwardDiffExt.jl 71.18% 17 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1036       +/-   ##
===========================================
- Coverage   77.54%   19.28%   -58.26%     
===========================================
  Files          30       31        +1     
  Lines        3429     3427        -2     
===========================================
- Hits         2659      661     -1998     
- Misses        770     2766     +1996     

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

@ChrisRackauckas
Copy link
Member

@asterycs
Copy link
Contributor Author

asterycs commented Jan 8, 2024

Thanks @ChrisRackauckas for checking! I updated the tests, should work better now.

I also removed the fma method definitions which I thought I had already deleted.

@ChrisRackauckas ChrisRackauckas merged commit 493e276 into JuliaSymbolics:master Jan 8, 2024
8 of 17 checks passed
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.

3 participants