Skip to content

Commit

Permalink
pydocstyle mechanistic_runner.py
Browse files Browse the repository at this point in the history
  • Loading branch information
arik-shurygin committed Jan 14, 2025
1 parent 4b48f9b commit 629b65b
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/dynode/mechanistic_runner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""
The following is a class which runs a series of ODE equations, and returns Solution objects for analysis or fitting.
"""
"""Run a series of ODE equations, and return Solution object."""

import datetime
from collections.abc import Callable
Expand Down Expand Up @@ -28,8 +26,7 @@


class MechanisticRunner:
"""A class responsible for solving Ordinary Differential Equations (ODEs)
given some initial state, parameters, and the equations themselves"""
"""Solves ODEs using Diffrax and produces Solution objects."""

def __init__(
self,
Expand All @@ -38,6 +35,14 @@ def __init__(
SEIC_Compartments,
],
):
"""Initialize MechanisticRunner for solving Ordinary Differential Equations.
Parameters
----------
model : Callable[[jax.typing.ArrayLike, PyTree, dict], SEIC_Compartments]
Set of ODEs, taking time, initial state, and dictionary of
parameters.
"""
self.model = model

def run(
Expand All @@ -46,11 +51,9 @@ def run(
args: dict,
tf: Union[int, datetime.date] = 100,
) -> Solution:
"""
solves ODEs for `tf` days using `initial_state` as y@t=0 and
parameters provided by the `args` dictionary.
"""Solve ODEs for `tf` days using `initial_state` and `args` parameters.
uses diffrax.Tsit5() solver.
Uses diffrax.Tsit5() solver.
Parameters
Expand Down

0 comments on commit 629b65b

Please sign in to comment.