Skip to content

laser.measles.biweekly.base

laser.measles.biweekly.base

Basic classes for biweekly model.

laser.measles.biweekly.base.BaseBiweeklyScenario(df)

Bases: BaseScenario

Scenario wrapper for the biweekly model.

Validates that the input DataFrame conforms to the BaseScenarioSchema (columns id, pop, lat, lon, mcv1) and makes the data available to model components.

Parameters:

Name Type Description Default
df DataFrame

Polars DataFrame with patch-level data.

required

Example:

1
2
3
4
5
```python
from laser.measles.scenarios.synthetic import single_patch_scenario

scenario = single_patch_scenario(population=100_000, mcv1_coverage=0.85)
```

laser.measles.biweekly.base.BaseScenarioSchema

Bases: Model

Schema for the scenario data.

Example:

1
2
3
4
5
6
```python
from laser.measles.scenarios.synthetic import single_patch_scenario

scenario = single_patch_scenario(population=100_000, mcv1_coverage=0.85)
# Validated automatically when passed to BiweeklyModel(scenario, params)
```

laser.measles.biweekly.base.PatchLaserFrame(capacity, initial_count=-1, **kwargs)

Bases: BasePatchLaserFrame

Patch-level LaserFrame for the biweekly model.

Example:

1
2
3
4
```python
model.patches.S  # susceptible counts, shape (nticks+1, num_patches)
model.patches.I  # infectious counts
```