-
Notifications
You must be signed in to change notification settings - Fork 31
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
More informative Solver.__repr__
#1928
Conversation
Closes #1926 Output of `print(amici.CVodeSolver())`: ``` <Swig Object of type 'amici::CVodeSolver *' at 0x7f988f70f090 reporting_mode: <RDataReporting.full: 0> sens_meth: <SensitivityMethod.forward: 1> sens_order: <SensitivityOrder.none: 0> sens_order: <SensitivityMethod.forward: 1> maxsteps: 10000 maxtime: 1.7976931348623157e+308s abs_tol: 1e-16 rel_tol: 1e-08 abs_tol_b: 1e-16 rel_tol_b: 1e-08 abs_tol_fsa: 1e-16 rel_tol_fsa: 1e-08 abs_tol_quad: 1e-12 rel_tol_quad: 1e-08 abs_tol_ss: 1e-14 rel_tol_ss: 1e-06 abs_tol_sss: 1e-14 rel_tol_sss: 1e-06 int_sens_meth: <InternalSensitivityMethod.simultaneous: 1> int_type: <InterpolationType.hermite: 1> linsol: <LinearSolver.KLU: 9> lmm: <LinearMultistepMethod.BDF: 2> newton_damp_mode: <NewtonDampingFactorMode.on: 1> newton_damp_lb: 1e-08 newton_maxsteps: 0 newton_ss_check: False sens_ss_check: True interpolation_type: <InterpolationType.hermite: 1> ism: <InternalSensitivityMethod.simultaneous: 1> nlsol_iter: <NonlinearSolverIteration.newton: 2> stability_limit: True state_ordering: 0 > ```
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #1928 +/- ##
===========================================
- Coverage 76.01% 76.01% -0.01%
===========================================
Files 76 76
Lines 12967 12969 +2
===========================================
+ Hits 9857 9858 +1
- Misses 3110 3111 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
👍 neat, does this also work for SolverPtr out of the box? |
python/tests/test_swig_interface.py
Outdated
|
||
def test_solver_repr_doesnt_raise(): | ||
print(amici.CVodeSolver()) | ||
print(repr(amici.CVodeSolver())) |
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.
isn't the default __repr__
set by swig anyways (as for self.this
anyway), so this wouldn't have raised even before these changes?
Good point. Now it does.
That's correct. It was mostly intended to check that no non-existing ReturnData fields are accessed. Now it also checks that it is not just the default |
Kudos, SonarCloud Quality Gate passed! |
Closes #1926
Output of
print(amici.CVodeSolver())
: