polaris.analyze.geo_mapping.GeoMappingStrategy#

class polaris.analyze.geo_mapping.GeoMappingStrategy#

Bases: ABC

Strategy for mapping households to popsyn and survey regions.

Enables PopsynComparator to work with different geographic hierarchies (e.g., US Census tracts→PUMAs, Australian SA1→SA3, etc.).

Subclasses must define:

popsyn_region_col: column name for popsyn region (e.g., ‘popsyn_region’, ‘sa1_zone’) survey_region_col: column name for survey region (e.g., ‘puma_id’, ‘sa3_zone’) get_popsyn_region(households) -> Series of popsyn regions get_survey_region(households) -> Series of survey regions (households must have popsyn_region_col)

__init__()#

Methods

__init__()

get_popsyn_region(households)

Map households (with 'location' column) to popsyn regions.

get_survey_region(households_with_popsyn)

Map popsyn regions to survey regions.

Attributes

popsyn_region_col: str#
survey_region_col: str#
abstractmethod get_popsyn_region(households: DataFrame) Series#

Map households (with ‘location’ column) to popsyn regions.

abstractmethod get_survey_region(households_with_popsyn: DataFrame) Series#

Map popsyn regions to survey regions. Input must have popsyn_region_col.