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
Refactor liouville solver #21555
Refactor liouville solver #21555
Conversation
✅ Hi, I am the SymPy bot (v161). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.
Click here to see the pull request description that was parsed.
|
sympy/solvers/ode/single.py
Outdated
x = self.ode_problem.sym | ||
y = Dummy('y') | ||
g = simplify(e/d).subs(fx, y) | ||
h = simplify(k/d).subs(fx, 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 shouldn't call simplify
twice. This was already calculated in _verify
.
d510c86
to
72a2ecc
Compare
return False | ||
return True | ||
|
||
def _get_general_solution(self, *, simplify_flag: bool = True): | ||
def _get_general_solution(self, *, simplify: bool = True): |
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.
What does simplify: bool=True
mean? And how is it used (whatever the name) in this function? Perhaps it should just be dropped.
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.
I guess this was used to simplify the solution, not sure though. @oscarbenjamin can you please explain a little?
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.
I don't see the simplify
flag being used anywhere. Not sure what it means. Maybe it should be dropped. In dsolve
simplification is controlled elsewhere...
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.
How do you read that syntax? what is 'simplify: bool=True'?
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.
Oh, static type-check reads as "simplify is a bool and its value is True by default". Let's drop this arg -- there is no simplification being requested or done by any of these functions.
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.
It might be needed for some solvers so I suggest to finish the refactoring before deciding about that. These classes and methods are all internal so it should be safe to delete the argument later.
This looks good to me. Thanks! |
@Mohitbalwani26 can you edit the OP to refer to the main issue about refactoring the ODE solvers? |
Yeah sure, done. |
References to other Issues or PRs
SEE #18348
Brief description of what is fixed or changed
Refactored liouville hint.
Other comments
Release Notes
NO ENTRY