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 dep-div-indep hint #21588
refactor dep-div-indep hint #21588
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.
|
It's probably better just to refactor both at the same time. |
yes, I am on it. But for better code reviews I am making different PRs. |
It's actually easier to review if you do all the related solvers at once so I can see what the code looks like altogether. The more important part of this is not just moving the solvers into classes but thinking about how to reorganise them afterwards.
Can these not just all be combined? I don't think we need all these similar but slightly different methods. |
@oscarbenjamin should we keep |
Leading underscore names are not public. This should be moved to the class along with the rest of the code for this solver. The ODE docs list which are public "user" functions: |
@oscarbenjamin can you review this? |
doc/src/modules/solvers/ode.rst
Outdated
@@ -152,7 +154,7 @@ almost_linear | |||
|
|||
linear_coefficients | |||
^^^^^^^^^^^^^^^^^^^ | |||
.. autofunction:: sympy.solvers.ode.ode::ode_linear_coefficients | |||
.. autofunction:: sympy.solvers.ode.single::LinearCoefficients |
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.
Should this be autoclass
?
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.
yes, this should be autoclass. will rectify it
|
||
1st_homogeneous_coeff_subs_indep_div_dep | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
.. autofunction:: sympy.solvers.ode.ode::ode_1st_homogeneous_coeff_subs_indep_div_dep | ||
.. autoclass:: sympy.solvers.ode.single::HomogeneousCoeffSubsIndepDivDep | ||
:members: |
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 do some autoclass blocks have members but others not?
Is it useful to show the members?
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.
official documentation says if we keep the :members: block then it will include docstrings of member functions also. but in previous class like Factorable, initially it was not there but someone made commit stating 'expanding documentation', so I thought it is the practice to be followed.
@@ -1310,6 +1309,501 @@ def _get_match_object(self): | |||
m2 = {self.y: ycoeff, x: 1, 'coeff': 1} | |||
return m1, m2, x, x**self.r2['power']*fx | |||
|
|||
class HomogeneousCoeffSubsDepDivIndep(SinglePatternODESolver): |
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.
There should be two blank lines between top-level classes/functions
I think that this can definitely be cleaned up later. Really we can simplify all of this logic to just something like:
I think that the degenerate case where The code for matching |
For now this can be merged though so the refactoring can continue. |
References to other Issues or PRs
SEE #18348
Brief description of what is fixed or changed
Other comments
Release Notes
NO ENTRY