-
Notifications
You must be signed in to change notification settings - Fork 156
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
New section in solver documentation (Expressions we can not solve) and updated symbolic_solve docstring #1258
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #1258 +/- ##
===========================================
+ Coverage 8.30% 80.34% +72.03%
===========================================
Files 46 47 +1
Lines 4549 4640 +91
===========================================
+ Hits 378 3728 +3350
+ Misses 4171 912 -3259 ☔ View full report in Codecov by Sentry. |
src/solver/main.jl
Outdated
1-element Vector{SymbolicUtils.BasicSymbolic{Real}}: | ||
(-slog(2) - log(complex(-1)) + 3slog(5)) / (slog(2) - slog(5)) | ||
|
||
julia> eval.(Symbolics.toexpr.(roots)) |
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 should not recommend eval for this. Instead, subtitute?
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.
symbolics_to_float
?
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.
substitute
works, symbolic_to_float
doesnt though.
julia> roots
1-element Vector{SymbolicUtils.BasicSymbolic{Real}}:
(-slog(2) - log(complex(-1)) + 3slog(5)) / (slog(2) - slog(5))
julia> Symbolics.substitute(roots[1], Dict())
-4.512941594732059759689023145584186058252768936052415430071569066192919491762214 + 3.428598090438030380369414618548038962770087500755160535832807433942464545729382im
julia> Symbolics.symbolic_to_float.(roots)
ERROR: UndefVarError: `_x` not defined
Also, using eval.(Symbolics.toexpr.(roots))
has never failed for me, why should we not use it?
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.
You never want to use eval if you don't have to. It's a call out to the compiler. It has some odd behavior, such as for example, if you put it inside of a function it will have different behavior than in a function (since then it's no longer in a dynamic scope)
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.
Aha, got it. Well, till symbolic_to_float is fixed id guess ill keep it like this.
Also one point: i guess the user doesnt care if it has odd behavior when used in code or not since most likely itll be used in the REPL. Right?
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.
Try it again now that #1267 is in.
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.
works nice
No description provided.