Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canada district structure #110

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from policyengine_canada.model_api import *


class District(Enum):
UNKNOWN = "Unknown"
Original file line number Diff line number Diff line change
@@ -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()