PolicyEngine / openfisca-tools

Python tools for enhancing OpenFisca country packages.
1 stars 1 forks source link

Combine entities into required groups automatically #47

Closed nikhilwoodruff closed 2 years ago

nikhilwoodruff commented 2 years ago

Fixes #46 (by making it redundant) Fixes #25

Essentially, country packages should specify the required group entities, and the default roles that should be assigned when grouping "orphan" entities into groups. For OpenFisca-US, this looks like:

class IndividualSim(GeneralIndividualSim):
    tax_benefit_system = CountryTaxBenefitSystem
    entities = {entity.key: entity for entity in entities}
    default_dataset = CPS

    # New code below
    required_entities = ["household", "spm_unit", "family", "tax_unit"]
    default_roles = {
        "household": "member",
        "spm_unit": "member",
        "family": "member",
        "tax_unit": "member",
    }