diff --git a/policyengine_canada/variables/household/demographic/geographic/district/district.py b/policyengine_canada/variables/household/demographic/geographic/district/district.py new file mode 100644 index 000000000..b2793763a --- /dev/null +++ b/policyengine_canada/variables/household/demographic/geographic/district/district.py @@ -0,0 +1,15 @@ +from policyengine_canada.model_api import * +from policyengine_canada.variables.household.demographic.geographic.district.district_enum import ( + District, +) + +import numpy as np + + +class county(Variable): + value_type = Enum + possible_values = District + default_value = District.UNKNOWN + entity = Household + label = "District" + definition_period = ETERNITY diff --git a/policyengine_canada/variables/household/demographic/geographic/district/district_enum.py b/policyengine_canada/variables/household/demographic/geographic/district/district_enum.py new file mode 100644 index 000000000..631ac9021 --- /dev/null +++ b/policyengine_canada/variables/household/demographic/geographic/district/district_enum.py @@ -0,0 +1,5 @@ +from policyengine_canada.model_api import * + + +class District(Enum): + UNKNOWN = "Unknown" diff --git a/policyengine_canada/variables/household/demographic/geographic/district/district_str.py b/policyengine_canada/variables/household/demographic/geographic/district/district_str.py new file mode 100644 index 000000000..5ddffa99e --- /dev/null +++ b/policyengine_canada/variables/household/demographic/geographic/district/district_str.py @@ -0,0 +1,12 @@ +from policyengine_canada.model_api import * + + +class district_str(Variable): + value_type = str + entity = Household + label = "Dsitrict (string)" + documentation = "District variable, stored as a string" + definition_period = ETERNITY + + def formula(household, period, parameters): + return household("district", period).decode_to_str()