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? |
| linear_coefficients | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| .. autofunction:: sympy.solvers.ode.ode::ode_linear_coefficients | ||
| .. autofunction:: sympy.solvers.ode.single::LinearCoefficients |
There was a problem hiding this comment.
Should this be autoclass?
There was a problem hiding this comment.
yes, this should be autoclass. will rectify it
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| .. 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.
Why do some autoclass blocks have members but others not?
Is it useful to show the members?
There was a problem hiding this comment.
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.
| 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.
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