policyengine-core 3.36.2__tar.gz → 3.37.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.36.2 → policyengine_core-3.37.0}/CHANGELOG.md +15 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/PKG-INFO +1 -1
- policyengine_core-3.37.0/policyengine_core/simulations/microsimulation.py +305 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/pyproject.toml +1 -1
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_microsimulation_calculate_signatures.py +10 -0
- policyengine_core-3.37.0/tests/core/test_microsimulation_internal_calls.py +567 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_microsimulation_option_reads.py +10 -12
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_microsimulation_option_reads_property.py +2 -3
- policyengine_core-3.37.0/tests/fixtures/microsimulation_internal_calls.py +374 -0
- policyengine_core-3.36.2/policyengine_core/simulations/microsimulation.py +0 -141
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.github/ISSUE_TEMPLATE.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.github/actionlint.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.github/bump_version.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.github/changelog_template.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.github/get-changelog-diff.sh +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.github/has-functional-changes.sh +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.github/is-version-number-acceptable.sh +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.github/publish-git-tag.sh +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.github/requirements/legacy-country-smoke.txt +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.github/workflows/pr.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.github/workflows/push.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.gitignore +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/.python-version +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/AGENTS.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/CLAUDE.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/CONTRIBUTING.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/LICENSE +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/MANIFEST.in +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/Makefile +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/README.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/_build/logs/myst.build.json +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/changelog.d/.gitkeep +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/_config.yml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/_static/style.css +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/_toc.yml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/add_plotly_to_book.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/contributing/intro.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/engineering/skills/README.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/engineering/skills/documentation_review.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/engineering/skills/github-prs.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/engineering/skills/testing.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/intro.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/logo.png +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/commons.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/country_template.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/data.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/data_storage.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/entities.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/enums.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/errors.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/experimental.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/extension_template.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/holders.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/parameters.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/periods.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/populations.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/projectors.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/reforms.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/scripts.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/simulations.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/taxbenefitsystems.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/taxscales.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/tools.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/tracers.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/types.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/variables.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/python_api/warnings.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/usage/branches.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/usage/country.ipynb +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/usage/datasets.ipynb +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/usage/parameters.md +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/usage/reforms.ipynb +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/docs/usage/simulation.ipynb +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/mypy.ini +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/build_metadata.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/charts/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/charts/bar.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/charts/formatting.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/commons/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/commons/formulas.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/commons/misc.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/commons/rates.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/constants.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/data/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/data/datasets/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/data/datasets/country_template_dataset.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/entities.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/modelled_policies.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/parameters/benefits/basic_income.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/parameters/benefits/housing_allowance.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/parameters/benefits/index.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/parameters/benefits/parenting_allowance/amount.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/parameters/benefits/parenting_allowance/income_threshold.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/parameters/general/age_of_majority.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/parameters/general/age_of_retirement.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/parameters/taxes/housing_tax.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/parameters/taxes/income_tax_rate.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/parameters/taxes/social_security_contribution.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/reforms/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/reforms/add_dynamic_variable.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/reforms/add_new_tax.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/reforms/flat_social_security_contribution.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/reforms/modify_social_security_taxation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/reforms/removal_basic_income.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/situation_examples/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/situation_examples/couple.json +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/situation_examples/housing.json +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/situation_examples/single.json +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/tests/age.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/tests/basic_income.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/tests/disposable_income.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/tests/housing_allowance.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/tests/housing_tax.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/tests/income_tax.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/tests/reforms/add_dynamic_variable.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/tests/reforms/add_new_tax.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/tests/reforms/modify_social_security_taxation.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/tests/situations/income_tax.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/tests/situations/parenting_allowance.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/tests/social_security_contribution.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/tests/test_microsimulation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/variables/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/variables/benefits.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/variables/demographics.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/variables/housing.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/variables/ids.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/variables/income.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/variables/stats.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/country_template/variables/taxes.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/data/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/data/dataset.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/data_storage/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/data_storage/in_memory_storage.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/data_storage/on_disk_storage.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/data_storage/storage_directory.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/data_storage/storage_keys.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/data_storage/store_history.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/data_structures/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/data_structures/parameter_metadata.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/data_structures/parameter_node_metadata.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/data_structures/reference.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/data_structures/unit.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/entities/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/entities/entity.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/entities/group_entity.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/entities/helpers.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/entities/role.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/enums/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/enums/config.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/enums/enum.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/enums/enum_array.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/errors/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/errors/cycle_error.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/errors/empty_argument_error.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/errors/nan_creation_error.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/errors/non_deterministic_formula_error.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/errors/parameter_not_found_error.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/errors/parameter_parsing_error.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/errors/period_mismatch_error.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/errors/situation_parsing_error.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/errors/spiral_error.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/errors/variable_name_conflict_error.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/errors/variable_not_found_error.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/experimental/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/experimental/memory_config.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/extension_template/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/extension_template/local_benefit.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/extension_template/parameters/local_town/child_allowance/amount.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/extension_template/parameters/local_town/child_allowance/index.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/extension_template/parameters/local_town/index.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/extension_template/tests/local_benefit.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/holders/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/holders/helpers.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/holders/holder.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/model_api.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/at_instant_like.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/config.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/helpers.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/operations/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/operations/get_parameter.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/operations/homogenize_parameters.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/operations/interpolate_parameters.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/operations/propagate_parameter_metadata.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/operations/uprate_parameters.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/parameter.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/parameter_at_instant.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/parameter_node.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/parameter_node_at_instant.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/parameter_scale.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/parameter_scale_bracket.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/parameters/vectorial_parameter_node_at_instant.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/periods/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/periods/config.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/periods/helpers.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/periods/instant_.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/periods/period_.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/populations/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/populations/config.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/populations/group_population.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/populations/population.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/projectors/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/projectors/entity_to_person_projector.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/projectors/first_person_to_entity_projector.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/projectors/helpers.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/projectors/projector.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/projectors/unique_role_to_entity_projector.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/reforms/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/reforms/reform.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/scripts/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/scripts/assets/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/scripts/assets/index.html +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/scripts/policyengine_command.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/scripts/run_data.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/scripts/run_test.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/scripts/simulation_generator.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/simulations/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/simulations/helpers.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/simulations/individual_sim.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/simulations/simulation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/simulations/simulation_builder.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/simulations/simulation_macro_cache.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/taxbenefitsystems/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/taxbenefitsystems/tax_benefit_system.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/taxscales/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/taxscales/abstract_rate_tax_scale.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/taxscales/abstract_tax_scale.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/taxscales/amount_tax_scale_like.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/taxscales/helpers.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/taxscales/linear_average_rate_tax_scale.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/taxscales/marginal_amount_tax_scale.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/taxscales/marginal_rate_tax_scale.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/taxscales/rate_tax_scale_like.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/taxscales/single_amount_tax_scale.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/taxscales/tax_scale_like.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tools/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tools/google_cloud.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tools/hugging_face.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tools/simulation_dumper.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tools/test_from_situation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tools/test_runner.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tools/win_file_manager.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tracers/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tracers/computation_log.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tracers/flat_trace.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tracers/full_tracer.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tracers/performance_log.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tracers/simple_tracer.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tracers/trace_node.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tracers/tracing_parameter_node_at_instant.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/tracers/variable_graph.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/types/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/types/data_types/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/types/data_types/arrays.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/variables/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/variables/config.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/variables/defined_for.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/variables/formula_randomness.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/variables/helpers.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/variables/typing.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/variables/variable.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/warnings/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/warnings/libyaml_warning.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/warnings/memory_config_warning.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/warnings/parameter_key_warning.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/policyengine_core/warnings/tempfile_warning.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/pytest.ini +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/conftest.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/commons/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/commons/test_between_function.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/commons/test_formulas.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/commons/test_is_in_function.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/commons/test_random_seed.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/commons/test_rates.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/data/test_dataset.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/enums/test_enum.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/model_api/test_index_.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/array_type.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/duplicate_key.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/filesystem_hierarchy/empty_index_file/index.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/filesystem_hierarchy/node1/param.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/indentation.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/missing_value.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/parameter_for_unit_propagation.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/test_parameter_clone.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/test_parameter_validation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/test_propagate_units.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/test_unknown_keys.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/unexpected_key_in_parameter.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/unexpected_key_in_scale.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/unexpected_key_in_value_at_instant.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/unexpected_key_in_value_history.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/unknown_key_beside_values.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/uprating_under_metadata.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/wrong_date.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/wrong_scale.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/wrong_type_in_bracket.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/wrong_type_in_brackets.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/wrong_type_in_parameter.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/wrong_type_in_scale.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/wrong_type_in_value_history.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/wrong_value.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameter_validation/yaml_hierarchy/node1.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters/operations/test_base_uprating.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters/operations/test_base_uprating_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters/operations/test_interpolation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters/operations/test_nesting.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters/operations/test_propagation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters/operations/test_scale_threshold_uprating.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters/operations/test_uprating.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters/test_numpy2_structured_arrays.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters/test_parameter_metadata_clone.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters/test_parameter_metadata_clone_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters/test_vectorial_parameter_node_copy.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters/test_vectorial_parameter_node_copy_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters_fancy_indexing/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters_fancy_indexing/bareme.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters_fancy_indexing/local_tax.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters_fancy_indexing/rate.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters_fancy_indexing/test_fancy_indexing.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/parameters_fancy_indexing/test_fancy_indexing_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/simulations/test_formula_randomness_concurrency.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tax_scales/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tax_scales/test_abstract_rate_tax_scale.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tax_scales/test_abstract_tax_scale.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tax_scales/test_linear_average_rate_tax_scale.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tax_scales/test_linear_average_rate_tax_scale_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tax_scales/test_marginal_amount_tax_scale.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tax_scales/test_marginal_rate_tax_scale.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tax_scales/test_rate_scale_conversion_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tax_scales/test_rate_tax_scale_like.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tax_scales/test_single_amount_tax_scale.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tax_scales/test_tax_scales_commons.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_apply_reform_holders.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_apply_reform_holders_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_apply_reform_invalidates_cache.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_apply_reform_preserves_user_inputs.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_assert_near_precision.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_axes.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_bincount_minlength.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_branch_helper_invalidation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_branch_input_fixed_point.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_branch_input_fixed_point_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_branch_input_invalidation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_branch_input_invalidation_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_branch_scoped_delete_arrays.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_branch_shared_arrays.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_branch_shared_arrays_differential.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_build_metadata.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_calculate_output.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_carry_over_order.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_carry_over_order_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_clone_invalidated_caches.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_clone_rebinding.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_clone_rebinding_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_clone_reform_baseline.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_clone_reform_baseline_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_countries.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_cycles.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_data_storage_dir.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_data_storage_dir_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_dataset_default_role.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_dataset_default_role_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_dataset_getattr.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_dataset_unknown_column_warning.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_default_simulation_count_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_disk_period_filenames.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_disk_storage_delete_contained_periods.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_disk_storage_delete_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_disk_storage_differential.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_disk_storage_ownership.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_docs_deployment.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_dump_restore.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_dump_restore_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_entities.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_eternity_subperiods.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_extensions.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_fast_cache.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_fast_cache_contained_periods.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_fast_cache_contained_periods_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_fast_cache_guards.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_formulas.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_group_population_empty.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_group_population_reductions_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_holder_branch_fallback.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_holder_write_fast_cache.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_holder_write_fast_cache_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_holders.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_input_tier_invalidation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_join_with_persons_identity.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_join_with_persons_identity_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_known_periods_branch_visibility.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_known_periods_branch_visibility_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_macro_cache_not_singleton.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_medium_fixes.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_microsimulation_person_accessor.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_microsimulation_weights.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_on_disk_storage_clones.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_opt_out_cache.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_option_result_cache.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_option_result_cache_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_option_result_input_provenance.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_own_period_input_overlapping_cache.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_pandas3_compatibility.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_parameter_security.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_parameters.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_periods.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_projectors.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_reform_baseline_system.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_reform_parameter_isolation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_reform_period_keys.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_reforms.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_registered_input_deletion.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_release_tagging.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_rerun_fixture_isolation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_restore_input_provenance.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_restore_input_registry.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_restore_input_registry_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_set_input_helper_order.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_set_input_helper_order_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_simulation_builder.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_simulation_copy_pickle.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_simulation_copy_pickle_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_simulations.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_stable_hash_seed.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_stale_frame_cache.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_storage_anchored_periods.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_storage_delete_branch.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_storage_input_index.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_storage_shared_index.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_storage_shared_index_differential.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_baseline_branch.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_computed_values.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_computed_values_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_deleted_inputs.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_entity_weight_totals.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_inputs_only.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_inputs_only_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_invalidates_cache.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_membership_ids.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_restore_inputs.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_sampling_period.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_sampling_period_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_structural_ids.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_subsample_weight_fallback.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_tax_benefit_system_cache_identity.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_tracers.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_tracing_parameter_isolation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_tracing_parameter_isolation_properties.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_uprating_order.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_uprating_order_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_user_input_keys.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_user_input_keys_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_user_input_keys_soundness.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_variable_code_sharing.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_variable_code_sharing_property.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/test_yaml.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tools/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tools/test_assert_near.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tools/test_google_cloud.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tools/test_hugging_face.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tools/test_runner/test_gc_pause.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/tools/test_runner/test_yaml_runner.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/variables/test_adds.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/variables/test_annualize.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/variables/test_bounds.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/variables/test_defined_for.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/variables/test_formula_randomness.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/variables/test_non_numeric_uprating_and_defined_for.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/variables/test_subtracts.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/variables/test_subtracts_sign.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/variables/test_variable_clone.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/variables/test_variable_formula_determinism.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/variables/test_variable_uprating.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/core/variables/test_variables.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/appclient.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/branch_input_invalidation.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/branch_shared_arrays.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/carry_over.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/chained_uprating_reference.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/data_storage_dir.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/disk_storage.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/entities.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/fast_cache_contained_periods.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/microsimulation_option_reads.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/option_caches.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/parameter_metadata_clones.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/reform_holders.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/set_input_helper_order.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/simulation_copy.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/simulations.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/subsample_inputs.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/taxbenefitsystems.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/tracing.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/uprated_inputs.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/uprating_order.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/variables.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/vectorial_parameter_nodes.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/__init__.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/directory/subdirectory/test_4.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/directory/test_1.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/directory/test_2.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/failing_test_absolute_error_margin.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/failing_test_relative_error_margin.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/test_absolute_error_margin.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/test_failure.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/test_name_filter.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/test_relative_error_margin.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/test_success.yml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/test_with_anchors.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/test_with_extension.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/test_with_reform.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/fixtures/yaml_tests/test_with_reform_2.yaml +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/smoke/test_country_init.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/tests/smoke/test_us.py +0 -0
- {policyengine_core-3.36.2 → policyengine_core-3.37.0}/uv.lock +0 -0
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [3.37.0] - 2026-11-19
|
|
2
|
+
|
|
3
|
+
### Added
|
|
4
|
+
|
|
5
|
+
- `use_weights=None` and `decode_enums=None`, now the defaults of `Microsimulation.calculate`, `calculate_add` and `calculate_divide`, choose by caller instead of meaning `False`: weights (and, in `calculate`, enum names) outside a calculation, neither inside one.
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- `Microsimulation.calculate`, `calculate_add` and `calculate_divide` no longer build weights for core's internal reads. Formula code that calls these methods directly now gets a NumPy array with enum codes instead of a weighted `MicroSeries`; calls from outside a calculation stay weighted, and `calculate_dataframe` returns the same frame everywhere, building weights once.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- In a `Microsimulation`, enum reads with ADD or DIVIDE now match a `Simulation`, so a top-level `calculate_divide` of an Enum over a year returns codes unless `decode_enums=True` (#658), and `use_weights=False` without `map_to` now returns a plain array from `calculate_add`, `calculate_divide` and a `calculate` of a FLOW variable over a period of another length, which returned a weighted `MicroSeries` before.
|
|
14
|
+
|
|
15
|
+
|
|
1
16
|
## [3.36.2] - 2026-11-19
|
|
2
17
|
|
|
3
18
|
### Fixed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: policyengine-core
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.37.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,305 @@
|
|
|
1
|
+
from contextvars import ContextVar, Token
|
|
2
|
+
from typing import Dict, Optional, Tuple, Type
|
|
3
|
+
|
|
4
|
+
from microdf import MicroDataFrame, MicroSeries
|
|
5
|
+
import numpy as np
|
|
6
|
+
import pandas as pd
|
|
7
|
+
from policyengine_core.data.dataset import Dataset
|
|
8
|
+
from policyengine_core.enums import EnumArray
|
|
9
|
+
from policyengine_core.periods import Period
|
|
10
|
+
from policyengine_core.periods import period as get_period
|
|
11
|
+
from policyengine_core.periods.config import MONTH, YEAR
|
|
12
|
+
from policyengine_core.simulations.simulation import Simulation
|
|
13
|
+
from policyengine_core.types import ArrayLike
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class _RunningCall:
|
|
17
|
+
"""A ``Microsimulation`` calculate call, running until ``running`` is false.
|
|
18
|
+
|
|
19
|
+
``enclosing`` is the record of the call that was running in the context
|
|
20
|
+
when this one started, if any.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
__slots__ = ("running", "enclosing")
|
|
24
|
+
|
|
25
|
+
def __init__(self, enclosing: Optional["_RunningCall"]):
|
|
26
|
+
self.running = True
|
|
27
|
+
self.enclosing = enclosing
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# The innermost ``Microsimulation`` ``calculate``, ``calculate_add`` or
|
|
31
|
+
# ``calculate_divide`` call running in this context. Core reads variables for
|
|
32
|
+
# its own use through those same methods (the terms of ``adds``, a
|
|
33
|
+
# ``defined_for`` mask, each month of a monthly variable read over a year, the
|
|
34
|
+
# terms of ADD and DIVIDE), as do formulas. A call that arrives while one is
|
|
35
|
+
# running comes from inside a calculation, and its defaults give a plain array
|
|
36
|
+
# with enum codes.
|
|
37
|
+
#
|
|
38
|
+
# A context copied while a call runs (for a worker thread, say) holds that
|
|
39
|
+
# call's record, and sees each call end when its ``running`` turns false; it
|
|
40
|
+
# is inside while that call or one enclosing it runs. A call made in the copy
|
|
41
|
+
# records itself there, so what it reads stays inside while it runs. A thread
|
|
42
|
+
# starts with an empty context, so its calls come from outside, unless Python
|
|
43
|
+
# gives new threads a copy of the starting thread's context
|
|
44
|
+
# (``-X thread_inherit_context=1``, the default on free-threaded builds).
|
|
45
|
+
_running_call: ContextVar[Optional[_RunningCall]] = ContextVar(
|
|
46
|
+
"_microsimulation_running_call", default=None
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _inside_a_calculation() -> bool:
|
|
51
|
+
call = _running_call.get()
|
|
52
|
+
# In the context where the calls run, the innermost is running. Only a
|
|
53
|
+
# copied context can hold a call that has ended.
|
|
54
|
+
while call is not None and not call.running:
|
|
55
|
+
call = call.enclosing
|
|
56
|
+
return call is not None
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def _start_call() -> Tuple[_RunningCall, Token]:
|
|
60
|
+
"""Record a call as running; return what ``_end_call`` needs."""
|
|
61
|
+
call = _RunningCall(_running_call.get())
|
|
62
|
+
return call, _running_call.set(call)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _end_call(started: Tuple[_RunningCall, Token]) -> None:
|
|
66
|
+
call, token = started
|
|
67
|
+
call.running = False
|
|
68
|
+
_running_call.reset(token)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _decode(values: ArrayLike) -> ArrayLike:
|
|
72
|
+
"""Decode enum codes to member names.
|
|
73
|
+
|
|
74
|
+
The twelfth of a code that ``calculate_divide`` returns over a month names
|
|
75
|
+
no member, so it is returned as it is, as a ``Simulation`` returns it.
|
|
76
|
+
"""
|
|
77
|
+
if isinstance(values, EnumArray) and np.issubdtype(values.dtype, np.integer):
|
|
78
|
+
return values.decode_to_str()
|
|
79
|
+
return values
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class Microsimulation(Simulation):
|
|
83
|
+
"""A `Simulation` whose entities use weights to represent larger populations.
|
|
84
|
+
|
|
85
|
+
``calculate``, ``calculate_add`` and ``calculate_divide`` return a
|
|
86
|
+
weighted ``MicroSeries`` to a caller outside a calculation, and
|
|
87
|
+
``calculate`` decodes enums to member names for it. A call made while
|
|
88
|
+
another of these calls runs (by core, or by a formula) returns a plain
|
|
89
|
+
array, with enums left as codes, as a ``Simulation`` does: core and
|
|
90
|
+
formulas use the values, not the weights. Passing ``use_weights`` or
|
|
91
|
+
``decode_enums`` overrides either default. ``calculate_dataframe`` returns
|
|
92
|
+
the same frame wherever it is called from.
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
def get_weights(
|
|
96
|
+
self, variable_name: str, period: Period, map_to: str = None
|
|
97
|
+
) -> ArrayLike:
|
|
98
|
+
"""Return weights for a variable's entity from ``household_weight``."""
|
|
99
|
+
time_period = get_period(period)
|
|
100
|
+
variable = self.tax_benefit_system.get_variable(
|
|
101
|
+
variable_name, check_existence=True
|
|
102
|
+
)
|
|
103
|
+
entity_key = map_to or variable.entity.key
|
|
104
|
+
weight_variable = self.tax_benefit_system.get_variable(
|
|
105
|
+
"household_weight", check_existence=True
|
|
106
|
+
)
|
|
107
|
+
weight_period = None
|
|
108
|
+
|
|
109
|
+
if time_period.unit == weight_variable.definition_period:
|
|
110
|
+
weight_period = time_period
|
|
111
|
+
elif (time_period.unit == MONTH) and (
|
|
112
|
+
weight_variable.definition_period == YEAR
|
|
113
|
+
):
|
|
114
|
+
# Common use-case. To-do: implement others if needed.
|
|
115
|
+
weight_period = time_period.this_year
|
|
116
|
+
|
|
117
|
+
if weight_period is None:
|
|
118
|
+
return None
|
|
119
|
+
|
|
120
|
+
household_weights = self.calculate(
|
|
121
|
+
"household_weight",
|
|
122
|
+
weight_period,
|
|
123
|
+
use_weights=False,
|
|
124
|
+
decode_enums=False,
|
|
125
|
+
)
|
|
126
|
+
return self._project_household_weights(household_weights, entity_key)
|
|
127
|
+
|
|
128
|
+
def _project_household_weights(
|
|
129
|
+
self,
|
|
130
|
+
household_weights: ArrayLike,
|
|
131
|
+
entity_key: str,
|
|
132
|
+
) -> ArrayLike:
|
|
133
|
+
household_entity = self.tax_benefit_system.get_variable(
|
|
134
|
+
"household_weight", check_existence=True
|
|
135
|
+
).entity.key
|
|
136
|
+
if entity_key == household_entity:
|
|
137
|
+
return household_weights
|
|
138
|
+
|
|
139
|
+
household_population = self.populations[household_entity]
|
|
140
|
+
person_weights = household_population.project(household_weights)
|
|
141
|
+
if entity_key == self.tax_benefit_system.person_entity.key:
|
|
142
|
+
return person_weights
|
|
143
|
+
|
|
144
|
+
return self.populations[entity_key].value_from_first_person(person_weights)
|
|
145
|
+
|
|
146
|
+
def calculate(
|
|
147
|
+
self,
|
|
148
|
+
variable_name: str,
|
|
149
|
+
period: Period = None,
|
|
150
|
+
map_to: str = None,
|
|
151
|
+
use_weights: Optional[bool] = None,
|
|
152
|
+
decode_enums: Optional[bool] = None,
|
|
153
|
+
) -> MicroSeries:
|
|
154
|
+
"""Calculate ``variable_name`` for ``period``.
|
|
155
|
+
|
|
156
|
+
``use_weights`` and ``decode_enums`` default to ``True`` for a call
|
|
157
|
+
from outside a calculation and to ``False`` for a call made inside one
|
|
158
|
+
(see ``Microsimulation``).
|
|
159
|
+
"""
|
|
160
|
+
if use_weights is None or decode_enums is None:
|
|
161
|
+
outside = not _inside_a_calculation()
|
|
162
|
+
if use_weights is None:
|
|
163
|
+
use_weights = outside
|
|
164
|
+
if decode_enums is None:
|
|
165
|
+
decode_enums = outside
|
|
166
|
+
if period is not None and not isinstance(period, Period):
|
|
167
|
+
period = get_period(period)
|
|
168
|
+
elif period is None and self.default_calculation_period is not None:
|
|
169
|
+
period = get_period(self.default_calculation_period)
|
|
170
|
+
started = _start_call()
|
|
171
|
+
try:
|
|
172
|
+
values = super().calculate(variable_name, period, map_to, decode_enums)
|
|
173
|
+
finally:
|
|
174
|
+
_end_call(started)
|
|
175
|
+
if not use_weights:
|
|
176
|
+
return values
|
|
177
|
+
weights = self.get_weights(variable_name, period, map_to)
|
|
178
|
+
return MicroSeries(np.array(values), weights=weights)
|
|
179
|
+
|
|
180
|
+
def calculate_add(
|
|
181
|
+
self,
|
|
182
|
+
variable_name: str,
|
|
183
|
+
period: Period = None,
|
|
184
|
+
map_to: str = None,
|
|
185
|
+
use_weights: Optional[bool] = None,
|
|
186
|
+
decode_enums: Optional[bool] = None,
|
|
187
|
+
) -> MicroSeries:
|
|
188
|
+
"""Sum ``variable_name`` over the subperiods of ``period``.
|
|
189
|
+
|
|
190
|
+
``use_weights`` defaults to ``True`` for a call from outside a
|
|
191
|
+
calculation and to ``False`` for a call made inside one (see
|
|
192
|
+
``Microsimulation``). ``decode_enums`` defaults to ``False``.
|
|
193
|
+
"""
|
|
194
|
+
if use_weights is None:
|
|
195
|
+
use_weights = not _inside_a_calculation()
|
|
196
|
+
if decode_enums is None:
|
|
197
|
+
decode_enums = False
|
|
198
|
+
# ``Population.__call__`` passes ``decode_enums`` with every ADD or
|
|
199
|
+
# DIVIDE read in a formula. The terms are read inside this call, so
|
|
200
|
+
# they are enum codes; the sum is decoded once, here.
|
|
201
|
+
started = _start_call()
|
|
202
|
+
try:
|
|
203
|
+
values = super().calculate_add(
|
|
204
|
+
variable_name, period, decode_enums=decode_enums
|
|
205
|
+
)
|
|
206
|
+
finally:
|
|
207
|
+
_end_call(started)
|
|
208
|
+
if decode_enums:
|
|
209
|
+
values = _decode(values)
|
|
210
|
+
if map_to is not None:
|
|
211
|
+
source_entity = self.tax_benefit_system.get_variable(
|
|
212
|
+
variable_name, check_existence=True
|
|
213
|
+
).entity.key
|
|
214
|
+
values = self.map_result(np.array(values), source_entity, map_to)
|
|
215
|
+
if not use_weights:
|
|
216
|
+
return values
|
|
217
|
+
weights = self.get_weights(variable_name, period, map_to)
|
|
218
|
+
return MicroSeries(np.array(values), weights=weights)
|
|
219
|
+
|
|
220
|
+
def calculate_divide(
|
|
221
|
+
self,
|
|
222
|
+
variable_name: str,
|
|
223
|
+
period: Period = None,
|
|
224
|
+
map_to: str = None,
|
|
225
|
+
use_weights: Optional[bool] = None,
|
|
226
|
+
decode_enums: Optional[bool] = None,
|
|
227
|
+
) -> MicroSeries:
|
|
228
|
+
"""Divide the yearly value of ``variable_name`` to match ``period``.
|
|
229
|
+
|
|
230
|
+
``use_weights`` defaults to ``True`` for a call from outside a
|
|
231
|
+
calculation and to ``False`` for a call made inside one (see
|
|
232
|
+
``Microsimulation``). ``decode_enums`` defaults to ``False``.
|
|
233
|
+
"""
|
|
234
|
+
if use_weights is None:
|
|
235
|
+
use_weights = not _inside_a_calculation()
|
|
236
|
+
if decode_enums is None:
|
|
237
|
+
decode_enums = False
|
|
238
|
+
# Over a year, ``Simulation.calculate_divide`` reads the variable with
|
|
239
|
+
# ``self.calculate``, inside this call, so it gets enum codes; the
|
|
240
|
+
# result is decoded once, here.
|
|
241
|
+
started = _start_call()
|
|
242
|
+
try:
|
|
243
|
+
values = super().calculate_divide(
|
|
244
|
+
variable_name, period, decode_enums=decode_enums
|
|
245
|
+
)
|
|
246
|
+
finally:
|
|
247
|
+
_end_call(started)
|
|
248
|
+
if decode_enums:
|
|
249
|
+
values = _decode(values)
|
|
250
|
+
if map_to is not None:
|
|
251
|
+
source_entity = self.tax_benefit_system.get_variable(
|
|
252
|
+
variable_name, check_existence=True
|
|
253
|
+
).entity.key
|
|
254
|
+
values = self.map_result(np.array(values), source_entity, map_to)
|
|
255
|
+
if not use_weights:
|
|
256
|
+
return values
|
|
257
|
+
weights = self.get_weights(variable_name, period, map_to)
|
|
258
|
+
return MicroSeries(np.array(values), weights=weights)
|
|
259
|
+
|
|
260
|
+
def calculate_dataframe(
|
|
261
|
+
self,
|
|
262
|
+
variable_names: list,
|
|
263
|
+
period: Period = None,
|
|
264
|
+
map_to: str = None,
|
|
265
|
+
use_weights: bool = True,
|
|
266
|
+
) -> MicroDataFrame:
|
|
267
|
+
"""Calculate ``variable_names`` for ``period`` as a data frame.
|
|
268
|
+
|
|
269
|
+
Inside a calculation or not, columns hold enum member names, and a
|
|
270
|
+
frame with ``use_weights`` carries the weights of the first variable's
|
|
271
|
+
entity (or of ``map_to``). Columns of other entities are mapped to it.
|
|
272
|
+
"""
|
|
273
|
+
if period is not None and not isinstance(period, Period):
|
|
274
|
+
period = get_period(period)
|
|
275
|
+
elif period is None and self.default_calculation_period is not None:
|
|
276
|
+
period = get_period(self.default_calculation_period)
|
|
277
|
+
|
|
278
|
+
for variable_name in variable_names:
|
|
279
|
+
if variable_name not in self.tax_benefit_system.variables:
|
|
280
|
+
raise ValueError(f"Variable {variable_name} does not exist.")
|
|
281
|
+
entities = [
|
|
282
|
+
self.tax_benefit_system.get_variable(variable_name).entity.key
|
|
283
|
+
for variable_name in variable_names
|
|
284
|
+
]
|
|
285
|
+
frame_entity = map_to or entities[0]
|
|
286
|
+
column_map_to = map_to
|
|
287
|
+
if any(entity != frame_entity for entity in entities):
|
|
288
|
+
column_map_to = frame_entity
|
|
289
|
+
|
|
290
|
+
# ``Simulation.calculate_dataframe`` reads each column with the default
|
|
291
|
+
# arguments, which would build weights for every column here and give
|
|
292
|
+
# enum codes inside a calculation.
|
|
293
|
+
values = pd.DataFrame()
|
|
294
|
+
for variable_name in variable_names:
|
|
295
|
+
values[variable_name] = self.calculate(
|
|
296
|
+
variable_name,
|
|
297
|
+
period,
|
|
298
|
+
column_map_to,
|
|
299
|
+
use_weights=False,
|
|
300
|
+
decode_enums=True,
|
|
301
|
+
)
|
|
302
|
+
if not use_weights:
|
|
303
|
+
return values
|
|
304
|
+
weights = self.get_weights(variable_names[0], period, map_to)
|
|
305
|
+
return MicroDataFrame(values, weights=weights)
|
|
@@ -84,3 +84,13 @@ def test_keyword_call_to_a_simulation_method_binds_to_the_override(name, argumen
|
|
|
84
84
|
f"takes: {error}",
|
|
85
85
|
pytrace=False,
|
|
86
86
|
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
@pytest.mark.parametrize("name", ["calculate", "calculate_add", "calculate_divide"])
|
|
90
|
+
def test_weights_and_enum_decoding_default_to_none(name):
|
|
91
|
+
# ``None`` lets the method choose by caller: a plain array with enum codes
|
|
92
|
+
# for a call made inside a calculation, weighted values otherwise.
|
|
93
|
+
parameters = inspect.signature(getattr(Microsimulation, name)).parameters
|
|
94
|
+
|
|
95
|
+
assert parameters["use_weights"].default is None
|
|
96
|
+
assert parameters["decode_enums"].default is None
|