laser.measles.demographics.base
laser.measles.demographics.base
laser.measles.demographics.base.BaseShapefile
Bases: BaseModel
Pydantic base for shapefile wrappers.
Validates that the shapefile path exists on disk and provides a
get_dataframe method to read records into a Polars DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shapefile
|
Path to a |
required |
Example:
1 2 3 4 5 6 | |
laser.measles.demographics.base.BaseShapefile.add_dotname()
Add a DOTNAME field — subclasses override with real logic.
laser.measles.demographics.base.BaseShapefile.convert_to_path(v)
classmethod
Convert string paths to Path and verify existence.
laser.measles.demographics.base.BaseShapefile.get_dataframe()
Get a Polars DataFrame containing the shapefile data and fields.
Returns:
| Type | Description |
|---|---|
DataFrame
|
A Polars DataFrame. |
laser.measles.demographics.base.DemographicsGeneratorProtocol
Bases: Protocol
Protocol for demographic data generators.
Implementations provide population counts, birth rates, and mortality
rates for the prepare scenario stage of the researcher workflow.
See RasterPatchGenerator
for the primary implementation.
Example:
1 2 3 4 5 6 7 8 | |
laser.measles.demographics.base.DemographicsGeneratorProtocol.generate_birth_rates()
Generate birth-rate data for all patches.
laser.measles.demographics.base.DemographicsGeneratorProtocol.generate_mortality_rates()
Generate mortality-rate data for all patches.
laser.measles.demographics.base.DemographicsGeneratorProtocol.generate_population()
Generate a population DataFrame for all patches.
laser.measles.demographics.base.ShapefileProtocol
Bases: Protocol
Protocol for shapefile readers used by the demographics pipeline.
Example:
1 2 3 4 5 6 | |
laser.measles.demographics.base.ShapefileProtocol.add_dotname()
Add a DOTNAME field to the shapefile for hierarchical naming.
laser.measles.demographics.base.ShapefileProtocol.get_dataframe()
Return shapefile records as a Polars DataFrame.