laser.measles.biweekly package#

BaseScenario#

alias of BaseBiweeklyScenario

class BiweeklyModel(scenario, params, name='biweekly')[source]#

Bases: BaseLaserModel

A class to represent the biweekly model.

Parameters:
  • scenario (BaseScenario) – A scenario containing the scenario data, including population, latitude, and longitude.

  • params (BiweeklyParams) – A set of parameters for the model.

  • name (str, optional) – The name of the model. Defaults to “biweekly”.

Notes

This class initializes the model with the given scenario and parameters. The scenario must include the following columns:

  • id (string): The name of the patch or location.

  • pop (integer): The population count for the patch.

  • lat (float degrees): The latitude of the patches (e.g., from geographic or population centroid).

  • lon (float degrees): The longitude of the patches (e.g., from geographic or population centroid).

  • mcv1 (float): The MCV1 coverage for the patches.

scenario_wrapper_class#

alias of BaseBiweeklyScenario

patches: PatchLaserFrame#
infect(indices, num_infected)[source]#

Infects the given nodes with the given number of infected individuals.

Parameters:
  • indices (int | np.ndarray) – The indices of the nodes to infect.

  • num_infected (int | np.ndarray) – The number of infected individuals to infect.

Return type:

None

recover(indices, num_recovered)[source]#

Recovers the given nodes with the given number of recovered individuals. Moves individuals from Infected to Recovered compartment.

Parameters:
  • indices (int | np.ndarray) – The indices of the nodes to recover.

  • num_recovered (int | np.ndarray) – The number of recovered individuals.

Return type:

None

class BiweeklyParams(**data)[source]#

Bases: BaseModelParams

Parameters for the biweekly model.

property time_step_days: int#

Time step in days. Must be implemented by subclasses.

property states: list[str]#

List of model states. Must be implemented by subclasses.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

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

Model#

alias of BiweeklyModel

Params#

alias of BiweeklyParams

Subpackages#

Submodules#

laser.measles.biweekly.base module#

Basic classes for biweekly model.

class PatchLaserFrame(*args, **kwargs)[source]#

Bases: WrappedClass

class BaseScenarioSchema(**data)[source]#

Bases: Model

Schema for the scenario data.

pop: int#
lat: float#
lon: float#
id: str#
mcv1: float#
DataFrame#

alias of BaseScenarioSchemaDataFrame

LazyFrame#

alias of BaseScenarioSchemaLazyFrame

model_config: ClassVar[ConfigDict] = {}#

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

class BaseBiweeklyScenario(df)[source]#

Bases: BaseScenario

BaseScenario#

alias of BaseBiweeklyScenario

laser.measles.biweekly.model module#

A class to represent the biweekly model.

class BiweeklyModel(scenario, params, name='biweekly')[source]#

Bases: BaseLaserModel

A class to represent the biweekly model.

Parameters:
  • scenario (BaseScenario) – A scenario containing the scenario data, including population, latitude, and longitude.

  • params (BiweeklyParams) – A set of parameters for the model.

  • name (str, optional) – The name of the model. Defaults to “biweekly”.

Notes

This class initializes the model with the given scenario and parameters. The scenario must include the following columns:

  • id (string): The name of the patch or location.

  • pop (integer): The population count for the patch.

  • lat (float degrees): The latitude of the patches (e.g., from geographic or population centroid).

  • lon (float degrees): The longitude of the patches (e.g., from geographic or population centroid).

  • mcv1 (float): The MCV1 coverage for the patches.

scenario_wrapper_class#

alias of BaseBiweeklyScenario

patches: PatchLaserFrame#
infect(indices, num_infected)[source]#

Infects the given nodes with the given number of infected individuals.

Parameters:
  • indices (int | np.ndarray) – The indices of the nodes to infect.

  • num_infected (int | np.ndarray) – The number of infected individuals to infect.

Return type:

None

recover(indices, num_recovered)[source]#

Recovers the given nodes with the given number of recovered individuals. Moves individuals from Infected to Recovered compartment.

Parameters:
  • indices (int | np.ndarray) – The indices of the nodes to recover.

  • num_recovered (int | np.ndarray) – The number of recovered individuals.

Return type:

None

Model#

alias of BiweeklyModel

laser.measles.biweekly.params module#

Parameters for the biweekly model.

class BiweeklyParams(**data)[source]#

Bases: BaseModelParams

Parameters for the biweekly model.

property time_step_days: int#

Time step in days. Must be implemented by subclasses.

property states: list[str]#

List of model states. Must be implemented by subclasses.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

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

Params#

alias of BiweeklyParams