Initializer#

class dynode.config.initializer.Initializer(*, description: str, initialize_date: date, population_size: Annotated[int, Gt(gt=0)])#

Bases: BaseModel

Initalize compartment state of an ODE model.

__init__(**data: Any) None#

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Methods

get_initial_state(**kwargs)

Fill in compartments with values summing to population_size.

Attributes

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

description

initialize_date

population_size

description: str#
initialize_date: date#
population_size: Annotated[int, Gt(gt=0)]#
get_initial_state(**kwargs) Tuple[Array, ...]#

Fill in compartments with values summing to population_size.

Parameters#

kwargs

Any parameters needed by the specific initializer.

Returns#

list[Compartment]

input compartments with values filled in with compartments at initialize_date.

Raises#

NotImplementedError

Each initializer must implement their own get_initial_state() based on the available data streams on the initialize_date

_abc_impl = <_abc._abc_data object>#
model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].