-
Notifications
You must be signed in to change notification settings - Fork 157
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
fix: fix fast_substitute
folding array of symbolics
#1398
base: master
Are you sure you want to change the base?
fix: fix fast_substitute
folding array of symbolics
#1398
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #1398 +/- ##
=========================================
+ Coverage 3.95% 6.44% +2.48%
=========================================
Files 51 51
Lines 4824 4842 +18
=========================================
+ Hits 191 312 +121
+ Misses 4633 4530 -103 ☔ View full report in Codecov by Sentry. |
The NaNMath error is trivial. The others I can't seem to replicate outside of running tests. |
This will also fix MTK. |
src/num.jl
Outdated
@@ -25,6 +25,8 @@ SymbolicUtils.@number_methods( | |||
Num(f(value(a), value(b))), | |||
[conj, real, transpose] | |||
) | |||
|
|||
NaNMath.pow(x::Num, y::Integer) = wrap(NaNMath.pow(unwrap(x), y)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dont't want that. It should just fall back to ^
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not? @number_methods
above already defines NaNMath.pow
this way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because NaNMath.pow returns floats for integer arguments in NaNMath < 1.0.2 which breaks eg Catalyst (see the issue in SymbolicUtils) and NaNMath >= 1.0.2 just falls back to ^
if the second argument is an Integer
. So directly using ^
is the only way that works with all NaNMath versions and is what NaNMath does anyway in newer versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification, I just saw your comments on the SymbolicUtils PR.
4cdb222
to
1ea3df5
Compare
Required for SciML/ModelingToolkit.jl#3282