Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions src/diffraxtra/_src/diffeq_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,6 @@ def __call__(

return soln

@dispatch(precedence=-1) # type: ignore[no-redef]
@partial(eqx.filter_jit)
def __call__(
self: "AbstractDiffEqSolver", terms: Any, /, **kwargs: Any
) -> dfx.Solution:
"""Solve a differential equation, with keyword arguments."""
t0 = kwargs.pop("t0")
t1 = kwargs.pop("t1")
dt0 = kwargs.pop("dt0")
y0 = kwargs.pop("y0")
args = kwargs.pop("args", None)
return self(terms, t0, t1, dt0, y0, args, **kwargs)

# -------------------------------------------

# TODO: a contextmanager for producing a temporary DiffEqSolver with
Expand All @@ -190,6 +177,22 @@ def from_(
# ==========================================================


@AbstractDiffEqSolver.__call__.dispatch # type: ignore[attr-defined,misc]
@partial(eqx.filter_jit)
def call(self: "AbstractDiffEqSolver", terms: Any, /, **kwargs: Any) -> dfx.Solution:
"""Solve a differential equation, with keyword arguments."""
t0 = kwargs.pop("t0")
t1 = kwargs.pop("t1")
dt0 = kwargs.pop("dt0")
y0 = kwargs.pop("y0")
args = kwargs.pop("args", None)
out: dfx.Solution = self(terms, t0, t1, dt0, y0, args, **kwargs) # type: ignore[assignment, call-arg]
return out


# ==========================================================


@AbstractDiffEqSolver.from_.dispatch
def from_(
cls: type[AbstractDiffEqSolver], obj: AbstractDiffEqSolver, /
Expand Down