policyengine-core 3.34.10__tar.gz → 3.35.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/CHANGELOG.md +7 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/PKG-INFO +1 -1
- policyengine_core-3.35.0/docs/python_api/simulations.md +51 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/reforms/reform.py +16 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/simulations/simulation_builder.py +8 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/taxbenefitsystems/tax_benefit_system.py +22 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/pyproject.toml +1 -1
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_simulation_builder.py +177 -1
- policyengine_core-3.34.10/docs/python_api/simulations.md +0 -34
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/ISSUE_TEMPLATE.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/actionlint.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/bump_version.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/changelog_template.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/get-changelog-diff.sh +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/has-functional-changes.sh +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/is-version-number-acceptable.sh +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/publish-git-tag.sh +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/requirements/legacy-country-smoke.txt +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/workflows/pr.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/workflows/push.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.gitignore +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/.python-version +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/AGENTS.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/CLAUDE.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/CONTRIBUTING.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/LICENSE +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/MANIFEST.in +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/Makefile +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/README.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/_build/logs/myst.build.json +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/changelog.d/.gitkeep +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/_config.yml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/_static/style.css +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/_toc.yml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/add_plotly_to_book.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/contributing/intro.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/engineering/skills/README.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/engineering/skills/documentation_review.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/engineering/skills/github-prs.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/engineering/skills/testing.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/intro.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/logo.png +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/commons.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/country_template.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/data.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/data_storage.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/entities.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/enums.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/errors.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/experimental.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/extension_template.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/holders.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/parameters.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/periods.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/populations.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/projectors.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/reforms.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/scripts.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/taxbenefitsystems.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/taxscales.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/tools.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/tracers.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/types.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/variables.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/warnings.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/usage/branches.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/usage/country.ipynb +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/usage/datasets.ipynb +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/usage/parameters.md +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/usage/reforms.ipynb +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/usage/simulation.ipynb +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/mypy.ini +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/build_metadata.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/charts/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/charts/bar.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/charts/formatting.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/commons/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/commons/formulas.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/commons/misc.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/commons/rates.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/constants.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/data/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/data/datasets/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/data/datasets/country_template_dataset.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/entities.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/modelled_policies.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/parameters/benefits/basic_income.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/parameters/benefits/housing_allowance.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/parameters/benefits/index.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/parameters/benefits/parenting_allowance/amount.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/parameters/benefits/parenting_allowance/income_threshold.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/parameters/general/age_of_majority.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/parameters/general/age_of_retirement.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/parameters/taxes/housing_tax.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/parameters/taxes/income_tax_rate.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/parameters/taxes/social_security_contribution.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/reforms/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/reforms/add_dynamic_variable.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/reforms/add_new_tax.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/reforms/flat_social_security_contribution.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/reforms/modify_social_security_taxation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/reforms/removal_basic_income.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/situation_examples/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/situation_examples/couple.json +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/situation_examples/housing.json +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/situation_examples/single.json +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/tests/age.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/tests/basic_income.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/tests/disposable_income.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/tests/housing_allowance.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/tests/housing_tax.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/tests/income_tax.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/tests/reforms/add_dynamic_variable.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/tests/reforms/add_new_tax.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/tests/reforms/modify_social_security_taxation.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/tests/situations/income_tax.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/tests/situations/parenting_allowance.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/tests/social_security_contribution.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/tests/test_microsimulation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/variables/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/variables/benefits.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/variables/demographics.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/variables/housing.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/variables/ids.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/variables/income.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/variables/stats.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/country_template/variables/taxes.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/data/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/data/dataset.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/data_storage/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/data_storage/in_memory_storage.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/data_storage/on_disk_storage.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/data_storage/storage_directory.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/data_storage/storage_keys.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/data_storage/store_history.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/data_structures/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/data_structures/parameter_metadata.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/data_structures/parameter_node_metadata.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/data_structures/reference.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/data_structures/unit.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/entities/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/entities/entity.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/entities/group_entity.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/entities/helpers.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/entities/role.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/enums/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/enums/config.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/enums/enum.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/enums/enum_array.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/errors/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/errors/cycle_error.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/errors/empty_argument_error.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/errors/nan_creation_error.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/errors/non_deterministic_formula_error.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/errors/parameter_not_found_error.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/errors/parameter_parsing_error.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/errors/period_mismatch_error.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/errors/situation_parsing_error.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/errors/spiral_error.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/errors/variable_name_conflict_error.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/errors/variable_not_found_error.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/experimental/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/experimental/memory_config.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/extension_template/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/extension_template/local_benefit.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/extension_template/parameters/local_town/child_allowance/amount.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/extension_template/parameters/local_town/child_allowance/index.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/extension_template/parameters/local_town/index.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/extension_template/tests/local_benefit.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/holders/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/holders/helpers.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/holders/holder.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/model_api.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/at_instant_like.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/config.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/helpers.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/operations/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/operations/get_parameter.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/operations/homogenize_parameters.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/operations/interpolate_parameters.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/operations/propagate_parameter_metadata.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/operations/uprate_parameters.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/parameter.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/parameter_at_instant.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/parameter_node.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/parameter_node_at_instant.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/parameter_scale.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/parameter_scale_bracket.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/parameters/vectorial_parameter_node_at_instant.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/periods/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/periods/config.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/periods/helpers.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/periods/instant_.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/periods/period_.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/populations/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/populations/config.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/populations/group_population.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/populations/population.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/projectors/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/projectors/entity_to_person_projector.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/projectors/first_person_to_entity_projector.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/projectors/helpers.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/projectors/projector.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/projectors/unique_role_to_entity_projector.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/reforms/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/scripts/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/scripts/assets/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/scripts/assets/index.html +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/scripts/policyengine_command.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/scripts/run_data.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/scripts/run_test.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/scripts/simulation_generator.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/simulations/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/simulations/helpers.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/simulations/individual_sim.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/simulations/microsimulation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/simulations/simulation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/simulations/simulation_macro_cache.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/taxbenefitsystems/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/taxscales/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/taxscales/abstract_rate_tax_scale.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/taxscales/abstract_tax_scale.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/taxscales/amount_tax_scale_like.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/taxscales/helpers.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/taxscales/linear_average_rate_tax_scale.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/taxscales/marginal_amount_tax_scale.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/taxscales/marginal_rate_tax_scale.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/taxscales/rate_tax_scale_like.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/taxscales/single_amount_tax_scale.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/taxscales/tax_scale_like.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tools/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tools/google_cloud.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tools/hugging_face.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tools/simulation_dumper.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tools/test_from_situation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tools/test_runner.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tools/win_file_manager.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tracers/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tracers/computation_log.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tracers/flat_trace.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tracers/full_tracer.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tracers/performance_log.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tracers/simple_tracer.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tracers/trace_node.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tracers/tracing_parameter_node_at_instant.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/tracers/variable_graph.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/types/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/types/data_types/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/types/data_types/arrays.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/variables/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/variables/config.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/variables/defined_for.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/variables/formula_randomness.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/variables/helpers.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/variables/typing.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/variables/variable.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/warnings/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/warnings/libyaml_warning.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/warnings/memory_config_warning.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/warnings/parameter_key_warning.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/warnings/tempfile_warning.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/pytest.ini +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/conftest.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/commons/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/commons/test_between_function.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/commons/test_formulas.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/commons/test_is_in_function.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/commons/test_random_seed.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/commons/test_rates.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/data/test_dataset.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/enums/test_enum.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/model_api/test_index_.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/array_type.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/duplicate_key.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/filesystem_hierarchy/empty_index_file/index.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/filesystem_hierarchy/node1/param.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/indentation.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/missing_value.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/parameter_for_unit_propagation.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/test_parameter_clone.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/test_parameter_validation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/test_propagate_units.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/test_unknown_keys.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/unexpected_key_in_parameter.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/unexpected_key_in_scale.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/unexpected_key_in_value_at_instant.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/unexpected_key_in_value_history.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/unknown_key_beside_values.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/uprating_under_metadata.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/wrong_date.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/wrong_scale.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/wrong_type_in_bracket.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/wrong_type_in_brackets.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/wrong_type_in_parameter.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/wrong_type_in_scale.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/wrong_type_in_value_history.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/wrong_value.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameter_validation/yaml_hierarchy/node1.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters/operations/test_interpolation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters/operations/test_nesting.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters/operations/test_propagation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters/operations/test_scale_threshold_uprating.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters/operations/test_uprating.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters/test_numpy2_structured_arrays.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters/test_parameter_metadata_clone.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters/test_parameter_metadata_clone_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters/test_vectorial_parameter_node_copy.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters/test_vectorial_parameter_node_copy_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters_fancy_indexing/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters_fancy_indexing/bareme.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters_fancy_indexing/local_tax.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters_fancy_indexing/rate.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters_fancy_indexing/test_fancy_indexing.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/parameters_fancy_indexing/test_fancy_indexing_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/simulations/test_formula_randomness_concurrency.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tax_scales/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tax_scales/test_abstract_rate_tax_scale.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tax_scales/test_abstract_tax_scale.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tax_scales/test_linear_average_rate_tax_scale.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tax_scales/test_linear_average_rate_tax_scale_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tax_scales/test_marginal_amount_tax_scale.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tax_scales/test_marginal_rate_tax_scale.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tax_scales/test_rate_scale_conversion_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tax_scales/test_rate_tax_scale_like.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tax_scales/test_single_amount_tax_scale.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tax_scales/test_tax_scales_commons.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_apply_reform_holders.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_apply_reform_holders_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_apply_reform_invalidates_cache.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_apply_reform_preserves_user_inputs.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_assert_near_precision.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_axes.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_bincount_minlength.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_branch_helper_invalidation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_branch_input_fixed_point.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_branch_input_fixed_point_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_branch_input_invalidation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_branch_input_invalidation_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_branch_scoped_delete_arrays.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_branch_shared_arrays.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_branch_shared_arrays_differential.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_build_metadata.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_calculate_output.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_carry_over_order.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_carry_over_order_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_clone_invalidated_caches.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_clone_rebinding.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_clone_rebinding_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_clone_reform_baseline.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_clone_reform_baseline_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_countries.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_cycles.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_data_storage_dir.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_data_storage_dir_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_dataset_default_role.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_dataset_default_role_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_dataset_getattr.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_dataset_unknown_column_warning.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_default_simulation_count_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_disk_period_filenames.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_disk_storage_delete_contained_periods.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_disk_storage_delete_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_disk_storage_differential.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_disk_storage_ownership.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_docs_deployment.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_dump_restore.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_dump_restore_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_entities.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_eternity_subperiods.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_extensions.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_fast_cache.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_fast_cache_contained_periods.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_fast_cache_contained_periods_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_fast_cache_guards.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_formulas.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_group_population_empty.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_group_population_reductions_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_holder_branch_fallback.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_holder_write_fast_cache.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_holder_write_fast_cache_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_holders.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_input_tier_invalidation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_join_with_persons_identity.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_join_with_persons_identity_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_known_periods_branch_visibility.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_known_periods_branch_visibility_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_macro_cache_not_singleton.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_medium_fixes.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_microsimulation_person_accessor.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_microsimulation_weights.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_on_disk_storage_clones.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_opt_out_cache.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_option_result_cache.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_option_result_cache_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_option_result_input_provenance.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_own_period_input_overlapping_cache.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_pandas3_compatibility.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_parameter_security.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_parameters.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_periods.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_projectors.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_reform_baseline_system.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_reform_parameter_isolation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_reform_period_keys.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_reforms.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_registered_input_deletion.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_release_tagging.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_rerun_fixture_isolation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_restore_input_provenance.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_restore_input_registry.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_restore_input_registry_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_set_input_helper_order.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_set_input_helper_order_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_simulation_copy_pickle.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_simulation_copy_pickle_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_simulations.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_stable_hash_seed.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_stale_frame_cache.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_storage_anchored_periods.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_storage_delete_branch.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_storage_input_index.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_storage_shared_index.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_storage_shared_index_differential.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_baseline_branch.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_computed_values.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_computed_values_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_deleted_inputs.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_entity_weight_totals.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_inputs_only.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_inputs_only_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_invalidates_cache.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_membership_ids.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_restore_inputs.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_sampling_period.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_sampling_period_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_structural_ids.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_subsample_weight_fallback.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_tax_benefit_system_cache_identity.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_tracers.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_tracing_parameter_isolation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_tracing_parameter_isolation_properties.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_uprating_order.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_uprating_order_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_user_input_keys.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_user_input_keys_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_user_input_keys_soundness.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_variable_code_sharing.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_variable_code_sharing_property.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_yaml.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tools/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tools/test_assert_near.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tools/test_google_cloud.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tools/test_hugging_face.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tools/test_runner/test_gc_pause.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/tools/test_runner/test_yaml_runner.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/variables/test_adds.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/variables/test_annualize.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/variables/test_bounds.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/variables/test_defined_for.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/variables/test_formula_randomness.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/variables/test_non_numeric_uprating_and_defined_for.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/variables/test_subtracts.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/variables/test_subtracts_sign.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/variables/test_variable_clone.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/variables/test_variable_formula_determinism.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/variables/test_variable_uprating.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/variables/test_variables.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/appclient.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/branch_input_invalidation.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/branch_shared_arrays.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/carry_over.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/data_storage_dir.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/disk_storage.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/entities.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/fast_cache_contained_periods.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/option_caches.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/parameter_metadata_clones.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/reform_holders.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/set_input_helper_order.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/simulation_copy.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/simulations.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/subsample_inputs.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/taxbenefitsystems.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/tracing.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/uprated_inputs.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/uprating_order.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/variables.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/vectorial_parameter_nodes.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/__init__.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/directory/subdirectory/test_4.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/directory/test_1.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/directory/test_2.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/failing_test_absolute_error_margin.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/failing_test_relative_error_margin.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/test_absolute_error_margin.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/test_failure.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/test_name_filter.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/test_relative_error_margin.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/test_success.yml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/test_with_anchors.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/test_with_extension.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/test_with_reform.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/fixtures/yaml_tests/test_with_reform_2.yaml +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/smoke/test_country_init.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/smoke/test_us.py +0 -0
- {policyengine_core-3.34.10 → policyengine_core-3.35.0}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: policyengine-core
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.35.0
|
|
4
4
|
Summary: Core microsimulation engine enabling country-specific policy models.
|
|
5
5
|
Project-URL: Homepage, https://github.com/policyengine/policyengine-core
|
|
6
6
|
Author-email: PolicyEngine <hello@policyengine.org>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Simulations
|
|
2
|
+
|
|
3
|
+
The `policyengine_core.simulations` module contains the definition of `Simulation`, the singular most important class in the repo. `Simulations` combine the logic of a country package with data, and can use the country logic and parameters to calculate the values of unknown variables. The class `SimulationBuilder` can create `Simulation`s from a variety of inputs: JSON descriptions, or dataset arrays.
|
|
4
|
+
|
|
5
|
+
## Simulation
|
|
6
|
+
|
|
7
|
+
```{eval-rst}
|
|
8
|
+
.. autoclass:: policyengine_core.simulations.simulation.Simulation
|
|
9
|
+
:members:
|
|
10
|
+
:undoc-members:
|
|
11
|
+
:inherited-members:
|
|
12
|
+
:show-inheritance:
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Microsimulation
|
|
16
|
+
|
|
17
|
+
```{eval-rst}
|
|
18
|
+
.. autoclass:: policyengine_core.simulations.microsimulation.Microsimulation
|
|
19
|
+
:members:
|
|
20
|
+
:undoc-members:
|
|
21
|
+
:inherited-members:
|
|
22
|
+
:show-inheritance:
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## SimulationBuilder
|
|
26
|
+
|
|
27
|
+
Country models can override `TaxBenefitSystem.preprocess_situation(situation,
|
|
28
|
+
default_period)` to fill missing groups before an entity-form situation is
|
|
29
|
+
built. `SimulationBuilder.build_from_entities` passes it a deep copy of the
|
|
30
|
+
situation, with any `axes` still present, and it must return a dict for the
|
|
31
|
+
builder's normal validation. `default_period` is the builder's default period
|
|
32
|
+
as set, so it may be `None`, a string, an integer or a `Period`.
|
|
33
|
+
`Simulation(situation=...)` and the YAML runner reach it through
|
|
34
|
+
`build_from_dict`, which expands singular entity aliases first; a direct
|
|
35
|
+
`build_from_entities` call passes the caller's keys as given. The hook runs
|
|
36
|
+
before the builder validates entities, so it may receive a situation with no
|
|
37
|
+
persons. A `Reform` runs its country system's hook with the reform as the
|
|
38
|
+
system, so the hook sees reformed parameters and variables. Only the country
|
|
39
|
+
system's hook runs: a `Reform` subclass that overrides it is skipped when
|
|
40
|
+
another reform wraps it, and a hook set on the country system instance itself
|
|
41
|
+
stays bound to that instance and reads the baseline's values. Dataset and
|
|
42
|
+
variable-only construction do not call the hook. The default hook returns its
|
|
43
|
+
input unchanged.
|
|
44
|
+
|
|
45
|
+
```{eval-rst}
|
|
46
|
+
.. autoclass:: policyengine_core.simulations.simulation_builder.SimulationBuilder
|
|
47
|
+
:members:
|
|
48
|
+
:undoc-members:
|
|
49
|
+
:inherited-members:
|
|
50
|
+
:show-inheritance:
|
|
51
|
+
```
|
|
@@ -147,6 +147,22 @@ class Reform(TaxBenefitSystem):
|
|
|
147
147
|
def __getattr__(self, attribute):
|
|
148
148
|
return getattr(self.baseline, attribute)
|
|
149
149
|
|
|
150
|
+
def preprocess_situation(self, situation: dict, default_period=None) -> dict:
|
|
151
|
+
# TaxBenefitSystem defines a no-op hook, so ``__getattr__`` never
|
|
152
|
+
# reaches the country's override. Run the country system's hook with
|
|
153
|
+
# this reform as the system, so the hook reads the reformed parameters
|
|
154
|
+
# and variables. A hook set on the country system instance itself
|
|
155
|
+
# stays bound to that instance.
|
|
156
|
+
country_system = self.baseline
|
|
157
|
+
while isinstance(country_system, Reform):
|
|
158
|
+
country_system = country_system.baseline
|
|
159
|
+
instance_hook = vars(country_system).get("preprocess_situation")
|
|
160
|
+
if instance_hook is not None:
|
|
161
|
+
return instance_hook(situation, default_period)
|
|
162
|
+
return type(country_system).preprocess_situation(
|
|
163
|
+
self, situation, default_period
|
|
164
|
+
)
|
|
165
|
+
|
|
150
166
|
@property
|
|
151
167
|
def full_key(self) -> str:
|
|
152
168
|
key = self.key
|
|
@@ -226,6 +226,14 @@ class SimulationBuilder:
|
|
|
226
226
|
)
|
|
227
227
|
|
|
228
228
|
check_type(input_dict, dict, ["error"])
|
|
229
|
+
input_dict = tax_benefit_system.preprocess_situation(
|
|
230
|
+
input_dict, self.default_period
|
|
231
|
+
)
|
|
232
|
+
if not isinstance(input_dict, dict):
|
|
233
|
+
raise TypeError(
|
|
234
|
+
f"{type(tax_benefit_system).__name__}.preprocess_situation must "
|
|
235
|
+
f"return a dict, not {type(input_dict).__name__}."
|
|
236
|
+
)
|
|
229
237
|
axes = input_dict.pop("axes", None)
|
|
230
238
|
|
|
231
239
|
unexpected_entities = [
|
|
@@ -150,6 +150,28 @@ class TaxBenefitSystem:
|
|
|
150
150
|
_defined_for_checks_deferred: bool = False
|
|
151
151
|
"""Whether ``load_variable`` leaves ``defined_for`` checks to a later pass over every variable."""
|
|
152
152
|
|
|
153
|
+
def preprocess_situation(self, situation: dict, default_period=None) -> dict:
|
|
154
|
+
"""Normalize entity-form input before the builder creates populations.
|
|
155
|
+
|
|
156
|
+
Country models can override this to fill missing entity definitions.
|
|
157
|
+
``SimulationBuilder.build_from_entities`` passes a deep copy of the
|
|
158
|
+
caller's situation, with any ``axes`` still present, and its default
|
|
159
|
+
period as set (None, a string, an integer or a ``Period``). Through
|
|
160
|
+
``build_from_dict`` and ``Simulation(situation=...)``, singular entity
|
|
161
|
+
aliases are already expanded; a direct ``build_from_entities`` call
|
|
162
|
+
passes the caller's keys as given. The hook runs before the builder
|
|
163
|
+
validates entities, so it may receive a situation with no persons.
|
|
164
|
+
Return a dict holding an entity-form situation for the builder's usual
|
|
165
|
+
validation. A ``Reform`` runs its country system's hook with the
|
|
166
|
+
reform as the system, so the hook sees reformed parameters and
|
|
167
|
+
variables. Only the country system's hook runs: a ``Reform`` subclass
|
|
168
|
+
that overrides this method is skipped when another reform wraps it,
|
|
169
|
+
and a hook set on the country system instance itself stays bound to
|
|
170
|
+
that instance, so it reads the baseline's values. Dataset and
|
|
171
|
+
variable-only inputs do not use this hook.
|
|
172
|
+
"""
|
|
173
|
+
return situation
|
|
174
|
+
|
|
153
175
|
def __init__(self, entities: Sequence[Entity] = None, reform=None) -> None:
|
|
154
176
|
if entities is None:
|
|
155
177
|
entities = self.entities
|
{policyengine_core-3.34.10 → policyengine_core-3.35.0}/tests/core/test_simulation_builder.py
RENAMED
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import datetime
|
|
2
|
+
import copy
|
|
2
3
|
from decimal import Decimal
|
|
3
4
|
from fractions import Fraction
|
|
4
5
|
from typing import Iterable
|
|
5
6
|
|
|
6
7
|
import numpy as np
|
|
8
|
+
import pandas as pd
|
|
7
9
|
import pytest
|
|
8
10
|
|
|
9
11
|
from policyengine_core import periods, tools
|
|
10
|
-
from policyengine_core.country_template import
|
|
12
|
+
from policyengine_core.country_template import (
|
|
13
|
+
CountryTaxBenefitSystem,
|
|
14
|
+
entities,
|
|
15
|
+
situation_examples,
|
|
16
|
+
)
|
|
17
|
+
from policyengine_core.data import Dataset
|
|
11
18
|
from policyengine_core.enums import Enum
|
|
12
19
|
from policyengine_core.errors import SituationParsingError
|
|
13
20
|
from policyengine_core.populations import Population
|
|
21
|
+
from policyengine_core.reforms import Reform
|
|
14
22
|
from policyengine_core.simulations import Simulation, SimulationBuilder
|
|
15
23
|
from policyengine_core.tools import test_runner
|
|
24
|
+
from policyengine_core.tools.test_runner import _get_tax_benefit_system
|
|
16
25
|
from policyengine_core.variables import Variable
|
|
17
26
|
|
|
18
27
|
|
|
@@ -125,6 +134,173 @@ def test_explicit_singular_entities(tax_benefit_system):
|
|
|
125
134
|
}
|
|
126
135
|
|
|
127
136
|
|
|
137
|
+
def test_country_preprocessing_preserves_caller_input(tax_benefit_system, monkeypatch):
|
|
138
|
+
seen_periods = []
|
|
139
|
+
|
|
140
|
+
def preprocess(situation, default_period):
|
|
141
|
+
seen_periods.append(default_period)
|
|
142
|
+
situation.setdefault(
|
|
143
|
+
"households", {"inferred": {"parents": ["Alicia", "Javier"]}}
|
|
144
|
+
)
|
|
145
|
+
return situation
|
|
146
|
+
|
|
147
|
+
monkeypatch.setattr(tax_benefit_system, "preprocess_situation", preprocess)
|
|
148
|
+
situation = {"persons": {"Alicia": {}, "Javier": {}}}
|
|
149
|
+
original = copy.deepcopy(situation)
|
|
150
|
+
builder = SimulationBuilder()
|
|
151
|
+
builder.set_default_period("2024-01")
|
|
152
|
+
inferred = builder.build_from_dict(tax_benefit_system, situation)
|
|
153
|
+
assert list(inferred.household.ids) == ["inferred"]
|
|
154
|
+
assert situation == original
|
|
155
|
+
assert seen_periods == ["2024-01"]
|
|
156
|
+
|
|
157
|
+
# Singular aliases are expanded before the hook, so it sees the caller's
|
|
158
|
+
# household and keeps it.
|
|
159
|
+
explicit = builder.build_from_dict(
|
|
160
|
+
tax_benefit_system,
|
|
161
|
+
{**situation, "household": {"parents": ["Alicia", "Javier"]}},
|
|
162
|
+
)
|
|
163
|
+
assert list(explicit.household.ids) == ["household"]
|
|
164
|
+
|
|
165
|
+
# Variable-only construction does not run entity preprocessing.
|
|
166
|
+
calls = len(seen_periods)
|
|
167
|
+
builder.build_from_dict(tax_benefit_system, {"salary": {"2024-01": 100}})
|
|
168
|
+
assert len(seen_periods) == calls
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def test_country_preprocessing_receives_axes(tax_benefit_system, monkeypatch):
|
|
172
|
+
seen = []
|
|
173
|
+
|
|
174
|
+
def preprocess(situation, default_period):
|
|
175
|
+
seen.append(situation.get("axes"))
|
|
176
|
+
return situation
|
|
177
|
+
|
|
178
|
+
monkeypatch.setattr(tax_benefit_system, "preprocess_situation", preprocess)
|
|
179
|
+
axes = [
|
|
180
|
+
[{"name": "salary", "min": 0, "max": 2_000, "count": 3, "period": "2024-01"}]
|
|
181
|
+
]
|
|
182
|
+
simulation = SimulationBuilder().build_from_dict(
|
|
183
|
+
tax_benefit_system,
|
|
184
|
+
{
|
|
185
|
+
"persons": {"Alicia": {}},
|
|
186
|
+
"households": {"home": {"parents": ["Alicia"]}},
|
|
187
|
+
"axes": axes,
|
|
188
|
+
},
|
|
189
|
+
)
|
|
190
|
+
assert seen == [axes]
|
|
191
|
+
assert simulation.persons.count == 3
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def test_datasets_do_not_run_country_preprocessing(tax_benefit_system, monkeypatch):
|
|
195
|
+
calls = []
|
|
196
|
+
|
|
197
|
+
def preprocess(situation, default_period):
|
|
198
|
+
calls.append(situation)
|
|
199
|
+
return situation
|
|
200
|
+
|
|
201
|
+
monkeypatch.setattr(tax_benefit_system, "preprocess_situation", preprocess)
|
|
202
|
+
dataframe = pd.DataFrame({"person_id": [0, 1, 2], "household_id": [7, 7, 9]})
|
|
203
|
+
simulation = Simulation(
|
|
204
|
+
tax_benefit_system=tax_benefit_system,
|
|
205
|
+
dataset=Dataset.from_dataframe(dataframe, "2024"),
|
|
206
|
+
)
|
|
207
|
+
assert simulation.populations["household"].members_entity_id.tolist() == [
|
|
208
|
+
0,
|
|
209
|
+
0,
|
|
210
|
+
1,
|
|
211
|
+
]
|
|
212
|
+
assert calls == []
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def test_country_preprocessing_applies_to_simulation_api(
|
|
216
|
+
tax_benefit_system, monkeypatch
|
|
217
|
+
):
|
|
218
|
+
def preprocess(situation, default_period):
|
|
219
|
+
situation["households"] = {
|
|
220
|
+
name: {"parents": [name]} for name in situation["persons"]
|
|
221
|
+
}
|
|
222
|
+
return situation
|
|
223
|
+
|
|
224
|
+
monkeypatch.setattr(tax_benefit_system, "preprocess_situation", preprocess)
|
|
225
|
+
simulation = Simulation(
|
|
226
|
+
tax_benefit_system=tax_benefit_system,
|
|
227
|
+
situation={"persons": {"Alicia": {}, "Javier": {}}},
|
|
228
|
+
)
|
|
229
|
+
assert simulation.household.members_entity_id.tolist() == [0, 1]
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
class _PreprocessingTaxBenefitSystem(CountryTaxBenefitSystem):
|
|
233
|
+
def preprocess_situation(self, situation, default_period=None):
|
|
234
|
+
situation.setdefault("households", {"inferred": {"parents": ["Alicia"]}})
|
|
235
|
+
return situation
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
class _NoOpReform(Reform):
|
|
239
|
+
def apply(self):
|
|
240
|
+
pass
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def test_reforms_run_the_country_systems_hook():
|
|
244
|
+
# Reform inherits TaxBenefitSystem's no-op hook, so a reform, including
|
|
245
|
+
# the one the YAML runner builds for inline parameters, must run the
|
|
246
|
+
# country system's hook.
|
|
247
|
+
baseline = _PreprocessingTaxBenefitSystem()
|
|
248
|
+
for system in (
|
|
249
|
+
_NoOpReform(baseline),
|
|
250
|
+
_NoOpReform(_NoOpReform(baseline)),
|
|
251
|
+
_get_tax_benefit_system(baseline, [_NoOpReform], []),
|
|
252
|
+
):
|
|
253
|
+
simulation = SimulationBuilder().build_from_dict(
|
|
254
|
+
system, {"persons": {"Alicia": {}}}
|
|
255
|
+
)
|
|
256
|
+
assert list(simulation.household.ids) == ["inferred"]
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
class _RateReadingTaxBenefitSystem(CountryTaxBenefitSystem):
|
|
260
|
+
def preprocess_situation(self, situation, default_period=None):
|
|
261
|
+
rate = self.parameters("2024-01-01").taxes.income_tax_rate
|
|
262
|
+
situation.setdefault("households", {f"rate {rate}": {"parents": ["Alicia"]}})
|
|
263
|
+
return situation
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
class _RateReform(Reform):
|
|
267
|
+
def apply(self):
|
|
268
|
+
def modify(parameters):
|
|
269
|
+
parameters.taxes.income_tax_rate.update(
|
|
270
|
+
period=periods.period("year:2015:20"), value=0.99
|
|
271
|
+
)
|
|
272
|
+
return parameters
|
|
273
|
+
|
|
274
|
+
self.modify_parameters(modify)
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def test_reform_runs_the_country_hook_with_the_reformed_system():
|
|
278
|
+
# The hook reads parameters through the system it is given, so under a
|
|
279
|
+
# reform it sees the reform's value, not the baseline's 0.15.
|
|
280
|
+
baseline = _RateReadingTaxBenefitSystem()
|
|
281
|
+
for system, expected in (
|
|
282
|
+
(baseline, "rate 0.15"),
|
|
283
|
+
(_RateReform(baseline), "rate 0.99"),
|
|
284
|
+
(_get_tax_benefit_system(baseline, [_RateReform], []), "rate 0.99"),
|
|
285
|
+
):
|
|
286
|
+
simulation = SimulationBuilder().build_from_dict(
|
|
287
|
+
system, {"persons": {"Alicia": {}}}
|
|
288
|
+
)
|
|
289
|
+
assert list(simulation.household.ids) == [expected]
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
def test_country_preprocessing_must_return_a_dict(tax_benefit_system, monkeypatch):
|
|
293
|
+
monkeypatch.setattr(
|
|
294
|
+
tax_benefit_system,
|
|
295
|
+
"preprocess_situation",
|
|
296
|
+
lambda situation, default_period: None,
|
|
297
|
+
)
|
|
298
|
+
with pytest.raises(TypeError, match="preprocess_situation must return a dict"):
|
|
299
|
+
SimulationBuilder().build_from_dict(
|
|
300
|
+
tax_benefit_system, {"persons": {"Alicia": {}}}
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
|
|
128
304
|
def test_add_person_entity(persons):
|
|
129
305
|
persons_json = {"Alicia": {"salary": {}}, "Javier": {}}
|
|
130
306
|
simulation_builder = SimulationBuilder()
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Simulations
|
|
2
|
-
|
|
3
|
-
The `policyengine_core.simulations` module contains the definition of `Simulation`, the singular most important class in the repo. `Simulations` combine the logic of a country package with data, and can use the country logic and parameters to calculate the values of unknown variables. The class `SimulationBuilder` can create `Simulation`s from a variety of inputs: JSON descriptions, or dataset arrays.
|
|
4
|
-
|
|
5
|
-
## Simulation
|
|
6
|
-
|
|
7
|
-
```{eval-rst}
|
|
8
|
-
.. autoclass:: policyengine_core.simulations.simulation.Simulation
|
|
9
|
-
:members:
|
|
10
|
-
:undoc-members:
|
|
11
|
-
:inherited-members:
|
|
12
|
-
:show-inheritance:
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Microsimulation
|
|
16
|
-
|
|
17
|
-
```{eval-rst}
|
|
18
|
-
.. autoclass:: policyengine_core.simulations.microsimulation.Microsimulation
|
|
19
|
-
:members:
|
|
20
|
-
:undoc-members:
|
|
21
|
-
:inherited-members:
|
|
22
|
-
:show-inheritance:
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## SimulationBuilder
|
|
26
|
-
|
|
27
|
-
```{eval-rst}
|
|
28
|
-
.. autoclass:: policyengine_core.simulations.simulation_builder.SimulationBuilder
|
|
29
|
-
:members:
|
|
30
|
-
:undoc-members:
|
|
31
|
-
:inherited-members:
|
|
32
|
-
:show-inheritance:
|
|
33
|
-
```
|
|
34
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/is-version-number-acceptable.sh
RENAMED
|
File without changes
|
|
File without changes
|
{policyengine_core-3.34.10 → policyengine_core-3.35.0}/.github/requirements/legacy-country-smoke.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/engineering/skills/github-prs.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine_core-3.34.10 → policyengine_core-3.35.0}/docs/python_api/extension_template.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/charts/formatting.py
RENAMED
|
File without changes
|
{policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/commons/__init__.py
RENAMED
|
File without changes
|
{policyengine_core-3.34.10 → policyengine_core-3.35.0}/policyengine_core/commons/formulas.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|