Skip to content

Commit

Permalink
refactored create_solver_function slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkraemer committed Aug 26, 2020
1 parent 1404223 commit aa7deb3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/probnum/diffeq/odefiltsmooth/odefiltsmooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,17 @@ def probsolve_ivp(
[0.97947631]
[0.98614541]]
"""
solver, firststep, stprl = _create_solver_object(
gfilt, firststep, stprl = _create_solver_inputs(
ivp, method, which_prior, tol, step, firststep, precond_step, **kwargs
)
solver = GaussianIVPFilter(ivp, gfilt)
solution = solver.solve(firststep=firststep, steprule=stprl, **kwargs)
if method in ["eks0", "eks1", "uks"]:
solution = solver.odesmooth(solution, **kwargs)
return solution


def _create_solver_object(
def _create_solver_inputs(
ivp, method, which_prior, tol, step, firststep, precond_step, **kwargs
):
"""Create the solver object that is used."""
Expand All @@ -251,7 +252,7 @@ def _create_solver_object(
stprl = steprule.ConstantSteps(step)
firststep = step
gfilt = _string2filter(ivp, _prior, method, **kwargs)
return GaussianIVPFilter(ivp, gfilt), firststep, stprl
return gfilt, firststep, stprl


def _check_step_tol(step, tol):
Expand Down

0 comments on commit aa7deb3

Please sign in to comment.