policyengine-core 3.37.0__tar.gz → 3.37.1__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.37.0 → policyengine_core-3.37.1}/CHANGELOG.md +7 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/PKG-INFO +1 -1
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/reforms/modify_social_security_taxation.py +5 -1
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/operations/homogenize_parameters.py +8 -4
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/parameter_node.py +104 -11
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/parameter_scale.py +1 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/pyproject.toml +1 -1
- policyengine_core-3.37.1/tests/core/parameters/operations/test_homogenization_parent_links.py +99 -0
- policyengine_core-3.37.1/tests/core/parameters/test_parameter_tree_parent_links.py +316 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/ISSUE_TEMPLATE.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/actionlint.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/bump_version.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/changelog_template.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/get-changelog-diff.sh +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/has-functional-changes.sh +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/is-version-number-acceptable.sh +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/publish-git-tag.sh +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/requirements/legacy-country-smoke.txt +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/workflows/pr.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/workflows/push.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.gitignore +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/.python-version +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/AGENTS.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/CLAUDE.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/CONTRIBUTING.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/LICENSE +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/MANIFEST.in +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/Makefile +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/README.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/_build/logs/myst.build.json +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/changelog.d/.gitkeep +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/_config.yml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/_static/style.css +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/_toc.yml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/add_plotly_to_book.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/contributing/intro.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/engineering/skills/README.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/engineering/skills/documentation_review.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/engineering/skills/github-prs.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/engineering/skills/testing.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/intro.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/logo.png +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/commons.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/country_template.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/data.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/data_storage.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/entities.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/enums.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/errors.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/experimental.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/extension_template.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/holders.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/parameters.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/periods.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/populations.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/projectors.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/reforms.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/scripts.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/simulations.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/taxbenefitsystems.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/taxscales.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/tools.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/tracers.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/types.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/variables.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/python_api/warnings.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/usage/branches.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/usage/country.ipynb +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/usage/datasets.ipynb +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/usage/parameters.md +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/usage/reforms.ipynb +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/docs/usage/simulation.ipynb +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/mypy.ini +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/build_metadata.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/charts/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/charts/bar.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/charts/formatting.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/commons/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/commons/formulas.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/commons/misc.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/commons/rates.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/constants.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/data/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/data/datasets/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/data/datasets/country_template_dataset.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/entities.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/modelled_policies.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/parameters/benefits/basic_income.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/parameters/benefits/housing_allowance.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/parameters/benefits/index.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/parameters/benefits/parenting_allowance/amount.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/parameters/benefits/parenting_allowance/income_threshold.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/parameters/general/age_of_majority.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/parameters/general/age_of_retirement.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/parameters/taxes/housing_tax.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/parameters/taxes/income_tax_rate.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/parameters/taxes/social_security_contribution.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/reforms/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/reforms/add_dynamic_variable.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/reforms/add_new_tax.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/reforms/flat_social_security_contribution.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/reforms/removal_basic_income.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/situation_examples/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/situation_examples/couple.json +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/situation_examples/housing.json +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/situation_examples/single.json +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/tests/age.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/tests/basic_income.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/tests/disposable_income.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/tests/housing_allowance.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/tests/housing_tax.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/tests/income_tax.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/tests/reforms/add_dynamic_variable.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/tests/reforms/add_new_tax.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/tests/reforms/modify_social_security_taxation.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/tests/situations/income_tax.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/tests/situations/parenting_allowance.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/tests/social_security_contribution.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/tests/test_microsimulation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/variables/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/variables/benefits.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/variables/demographics.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/variables/housing.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/variables/ids.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/variables/income.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/variables/stats.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/country_template/variables/taxes.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/data/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/data/dataset.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/data_storage/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/data_storage/in_memory_storage.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/data_storage/on_disk_storage.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/data_storage/storage_directory.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/data_storage/storage_keys.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/data_storage/store_history.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/data_structures/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/data_structures/parameter_metadata.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/data_structures/parameter_node_metadata.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/data_structures/reference.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/data_structures/unit.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/entities/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/entities/entity.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/entities/group_entity.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/entities/helpers.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/entities/role.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/enums/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/enums/config.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/enums/enum.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/enums/enum_array.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/errors/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/errors/cycle_error.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/errors/empty_argument_error.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/errors/nan_creation_error.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/errors/non_deterministic_formula_error.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/errors/parameter_not_found_error.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/errors/parameter_parsing_error.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/errors/period_mismatch_error.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/errors/situation_parsing_error.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/errors/spiral_error.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/errors/variable_name_conflict_error.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/errors/variable_not_found_error.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/experimental/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/experimental/memory_config.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/extension_template/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/extension_template/local_benefit.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/extension_template/parameters/local_town/child_allowance/amount.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/extension_template/parameters/local_town/child_allowance/index.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/extension_template/parameters/local_town/index.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/extension_template/tests/local_benefit.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/holders/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/holders/helpers.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/holders/holder.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/model_api.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/at_instant_like.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/config.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/helpers.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/operations/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/operations/get_parameter.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/operations/interpolate_parameters.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/operations/propagate_parameter_metadata.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/operations/uprate_parameters.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/parameter.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/parameter_at_instant.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/parameter_node_at_instant.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/parameter_scale_bracket.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/vectorial_parameter_node_at_instant.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/periods/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/periods/config.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/periods/helpers.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/periods/instant_.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/periods/period_.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/populations/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/populations/config.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/populations/group_population.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/populations/population.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/projectors/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/projectors/entity_to_person_projector.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/projectors/first_person_to_entity_projector.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/projectors/helpers.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/projectors/projector.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/projectors/unique_role_to_entity_projector.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/reforms/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/reforms/reform.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/scripts/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/scripts/assets/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/scripts/assets/index.html +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/scripts/policyengine_command.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/scripts/run_data.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/scripts/run_test.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/scripts/simulation_generator.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/simulations/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/simulations/helpers.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/simulations/individual_sim.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/simulations/microsimulation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/simulations/simulation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/simulations/simulation_builder.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/simulations/simulation_macro_cache.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/taxbenefitsystems/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/taxbenefitsystems/tax_benefit_system.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/taxscales/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/taxscales/abstract_rate_tax_scale.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/taxscales/abstract_tax_scale.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/taxscales/amount_tax_scale_like.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/taxscales/helpers.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/taxscales/linear_average_rate_tax_scale.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/taxscales/marginal_amount_tax_scale.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/taxscales/marginal_rate_tax_scale.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/taxscales/rate_tax_scale_like.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/taxscales/single_amount_tax_scale.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/taxscales/tax_scale_like.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tools/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tools/google_cloud.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tools/hugging_face.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tools/simulation_dumper.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tools/test_from_situation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tools/test_runner.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tools/win_file_manager.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tracers/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tracers/computation_log.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tracers/flat_trace.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tracers/full_tracer.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tracers/performance_log.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tracers/simple_tracer.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tracers/trace_node.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tracers/tracing_parameter_node_at_instant.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/tracers/variable_graph.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/types/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/types/data_types/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/types/data_types/arrays.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/variables/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/variables/config.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/variables/defined_for.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/variables/formula_randomness.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/variables/helpers.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/variables/typing.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/variables/variable.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/warnings/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/warnings/libyaml_warning.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/warnings/memory_config_warning.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/warnings/parameter_key_warning.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/warnings/tempfile_warning.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/pytest.ini +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/conftest.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/commons/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/commons/test_between_function.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/commons/test_formulas.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/commons/test_is_in_function.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/commons/test_random_seed.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/commons/test_rates.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/data/test_dataset.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/enums/test_enum.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/model_api/test_index_.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/array_type.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/duplicate_key.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/filesystem_hierarchy/empty_index_file/index.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/filesystem_hierarchy/node1/param.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/indentation.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/missing_value.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/parameter_for_unit_propagation.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/test_parameter_clone.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/test_parameter_validation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/test_propagate_units.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/test_unknown_keys.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/unexpected_key_in_parameter.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/unexpected_key_in_scale.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/unexpected_key_in_value_at_instant.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/unexpected_key_in_value_history.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/unknown_key_beside_values.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/uprating_under_metadata.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/wrong_date.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/wrong_scale.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/wrong_type_in_bracket.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/wrong_type_in_brackets.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/wrong_type_in_parameter.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/wrong_type_in_scale.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/wrong_type_in_value_history.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/wrong_value.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameter_validation/yaml_hierarchy/node1.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters/operations/test_base_uprating.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters/operations/test_base_uprating_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters/operations/test_interpolation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters/operations/test_nesting.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters/operations/test_propagation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters/operations/test_scale_threshold_uprating.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters/operations/test_uprating.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters/test_numpy2_structured_arrays.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters/test_parameter_metadata_clone.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters/test_parameter_metadata_clone_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters/test_vectorial_parameter_node_copy.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters/test_vectorial_parameter_node_copy_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters_fancy_indexing/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters_fancy_indexing/bareme.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters_fancy_indexing/local_tax.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters_fancy_indexing/rate.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters_fancy_indexing/test_fancy_indexing.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/parameters_fancy_indexing/test_fancy_indexing_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/simulations/test_formula_randomness_concurrency.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tax_scales/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tax_scales/test_abstract_rate_tax_scale.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tax_scales/test_abstract_tax_scale.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tax_scales/test_linear_average_rate_tax_scale.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tax_scales/test_linear_average_rate_tax_scale_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tax_scales/test_marginal_amount_tax_scale.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tax_scales/test_marginal_rate_tax_scale.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tax_scales/test_rate_scale_conversion_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tax_scales/test_rate_tax_scale_like.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tax_scales/test_single_amount_tax_scale.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tax_scales/test_tax_scales_commons.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_apply_reform_holders.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_apply_reform_holders_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_apply_reform_invalidates_cache.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_apply_reform_preserves_user_inputs.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_assert_near_precision.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_axes.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_bincount_minlength.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_branch_helper_invalidation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_branch_input_fixed_point.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_branch_input_fixed_point_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_branch_input_invalidation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_branch_input_invalidation_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_branch_scoped_delete_arrays.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_branch_shared_arrays.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_branch_shared_arrays_differential.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_build_metadata.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_calculate_output.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_carry_over_order.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_carry_over_order_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_clone_invalidated_caches.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_clone_rebinding.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_clone_rebinding_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_clone_reform_baseline.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_clone_reform_baseline_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_countries.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_cycles.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_data_storage_dir.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_data_storage_dir_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_dataset_default_role.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_dataset_default_role_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_dataset_getattr.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_dataset_unknown_column_warning.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_default_simulation_count_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_disk_period_filenames.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_disk_storage_delete_contained_periods.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_disk_storage_delete_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_disk_storage_differential.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_disk_storage_ownership.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_docs_deployment.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_dump_restore.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_dump_restore_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_entities.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_eternity_subperiods.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_extensions.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_fast_cache.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_fast_cache_contained_periods.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_fast_cache_contained_periods_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_fast_cache_guards.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_formulas.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_group_population_empty.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_group_population_reductions_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_holder_branch_fallback.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_holder_write_fast_cache.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_holder_write_fast_cache_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_holders.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_input_tier_invalidation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_join_with_persons_identity.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_join_with_persons_identity_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_known_periods_branch_visibility.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_known_periods_branch_visibility_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_macro_cache_not_singleton.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_medium_fixes.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_microsimulation_calculate_signatures.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_microsimulation_internal_calls.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_microsimulation_option_reads.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_microsimulation_option_reads_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_microsimulation_person_accessor.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_microsimulation_weights.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_on_disk_storage_clones.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_opt_out_cache.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_option_result_cache.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_option_result_cache_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_option_result_input_provenance.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_own_period_input_overlapping_cache.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_pandas3_compatibility.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_parameter_security.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_parameters.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_periods.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_projectors.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_reform_baseline_system.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_reform_parameter_isolation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_reform_period_keys.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_reforms.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_registered_input_deletion.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_release_tagging.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_rerun_fixture_isolation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_restore_input_provenance.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_restore_input_registry.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_restore_input_registry_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_set_input_helper_order.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_set_input_helper_order_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_simulation_builder.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_simulation_copy_pickle.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_simulation_copy_pickle_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_simulations.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_stable_hash_seed.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_stale_frame_cache.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_storage_anchored_periods.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_storage_delete_branch.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_storage_input_index.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_storage_shared_index.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_storage_shared_index_differential.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_baseline_branch.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_computed_values.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_computed_values_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_deleted_inputs.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_entity_weight_totals.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_inputs_only.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_inputs_only_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_invalidates_cache.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_membership_ids.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_restore_inputs.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_sampling_period.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_sampling_period_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_structural_ids.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_subsample_weight_fallback.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_tax_benefit_system_cache_identity.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_tracers.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_tracing_parameter_isolation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_tracing_parameter_isolation_properties.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_uprating_order.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_uprating_order_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_user_input_keys.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_user_input_keys_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_user_input_keys_soundness.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_variable_code_sharing.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_variable_code_sharing_property.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/test_yaml.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tools/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tools/test_assert_near.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tools/test_google_cloud.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tools/test_hugging_face.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tools/test_runner/test_gc_pause.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/tools/test_runner/test_yaml_runner.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/variables/test_adds.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/variables/test_annualize.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/variables/test_bounds.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/variables/test_defined_for.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/variables/test_formula_randomness.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/variables/test_non_numeric_uprating_and_defined_for.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/variables/test_subtracts.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/variables/test_subtracts_sign.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/variables/test_variable_clone.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/variables/test_variable_formula_determinism.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/variables/test_variable_uprating.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/core/variables/test_variables.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/appclient.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/branch_input_invalidation.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/branch_shared_arrays.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/carry_over.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/chained_uprating_reference.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/data_storage_dir.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/disk_storage.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/entities.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/fast_cache_contained_periods.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/microsimulation_internal_calls.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/microsimulation_option_reads.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/option_caches.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/parameter_metadata_clones.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/reform_holders.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/set_input_helper_order.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/simulation_copy.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/simulations.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/subsample_inputs.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/taxbenefitsystems.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/tracing.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/uprated_inputs.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/uprating_order.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/variables.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/vectorial_parameter_nodes.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/__init__.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/directory/subdirectory/test_4.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/directory/test_1.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/directory/test_2.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/failing_test_absolute_error_margin.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/failing_test_relative_error_margin.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/test_absolute_error_margin.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/test_failure.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/test_name_filter.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/test_relative_error_margin.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/test_success.yml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/test_with_anchors.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/test_with_extension.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/test_with_reform.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/fixtures/yaml_tests/test_with_reform_2.yaml +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/smoke/test_country_init.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/tests/smoke/test_us.py +0 -0
- {policyengine_core-3.37.0 → policyengine_core-3.37.1}/uv.lock +0 -0
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.37.1] - 2026-11-19
|
|
2
|
+
|
|
3
|
+
### Fixed
|
|
4
|
+
|
|
5
|
+
- Loaded parameter trees now link every scale bracket and every node built by breakdown homogenization to the node that holds it, as a cloned tree already did, so updating one clears cached ancestor values and marks ancestors as modified. The bracket that the country template reform appends is linked to its scale too. A child whose name matches a node's own attribute or method (such as `parent`, `children` or `modified`) is no longer set as an attribute, so it can no longer replace the node's own state. Reading a homogenized breakdown position as an attribute, such as `amount.B`, now returns the `ParameterNode` that homogenization built there instead of the placeholder `Parameter` it replaced, so calling it returns a node at that instant and calling `update` on it raises, while lookups at an instant, such as `amount("2021-01-01").B`, are unchanged.
|
|
6
|
+
|
|
7
|
+
|
|
1
8
|
## [3.37.0] - 2026-11-19
|
|
2
9
|
|
|
3
10
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: policyengine-core
|
|
3
|
-
Version: 3.37.
|
|
3
|
+
Version: 3.37.1
|
|
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>
|
|
@@ -35,7 +35,8 @@ class modify_social_security_taxation(Reform):
|
|
|
35
35
|
of the YAML parameters. It can be modified and must be returned.
|
|
36
36
|
"""
|
|
37
37
|
# Access the right parameter node:
|
|
38
|
-
|
|
38
|
+
scale = parameters.taxes.social_security_contribution
|
|
39
|
+
brackets = scale.brackets
|
|
39
40
|
|
|
40
41
|
# Add 0.1 to the rates of the second bracket, keeping the same thresholds:
|
|
41
42
|
for rate in brackets[1].rate.values_list:
|
|
@@ -52,6 +53,9 @@ class modify_social_security_taxation(Reform):
|
|
|
52
53
|
"threshold": {"2017-01-01": {"value": 40000}},
|
|
53
54
|
},
|
|
54
55
|
)
|
|
56
|
+
# Link the bracket to its scale, so that updates to it clear cached
|
|
57
|
+
# values and mark the scale and its ancestors as modified.
|
|
58
|
+
new_bracket.parent = scale
|
|
55
59
|
brackets.append(new_bracket)
|
|
56
60
|
|
|
57
61
|
return parameters
|
|
@@ -80,7 +80,7 @@ def homogenize_parameter_node(
|
|
|
80
80
|
possible_values = [True, False]
|
|
81
81
|
else:
|
|
82
82
|
possible_values = evaluate_dynamic_breakdown(first_breakdown)
|
|
83
|
-
if not
|
|
83
|
+
if not isinstance(node, ParameterNode):
|
|
84
84
|
node = ParameterNode(
|
|
85
85
|
node.name,
|
|
86
86
|
data={
|
|
@@ -120,11 +120,15 @@ def homogenize_parameter_node(
|
|
|
120
120
|
f"metadata references the correct variable and that all "
|
|
121
121
|
f"parameter keys are valid enum values."
|
|
122
122
|
)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
if further_breakdown:
|
|
124
|
+
for child in list(node.children):
|
|
125
|
+
homogenized_child = homogenize_parameter_node(
|
|
126
126
|
node.children[child], breakdown[1:], variables, default_value
|
|
127
127
|
)
|
|
128
|
+
if homogenized_child is not node.children[child]:
|
|
129
|
+
# A placeholder Parameter became a ParameterNode: link the
|
|
130
|
+
# replacement as add_child would.
|
|
131
|
+
node._replace_child(child, homogenized_child)
|
|
128
132
|
return node
|
|
129
133
|
|
|
130
134
|
|
{policyengine_core-3.37.0 → policyengine_core-3.37.1}/policyengine_core/parameters/parameter_node.py
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import copy
|
|
2
|
+
import functools
|
|
2
3
|
import os
|
|
3
4
|
import typing
|
|
4
5
|
from typing import Iterable, List, Type, Union
|
|
@@ -22,6 +23,56 @@ from .helpers import (
|
|
|
22
23
|
|
|
23
24
|
EXCLUDED_PARAMETER_CHILD_NAMES = ["reference", "__pycache__"]
|
|
24
25
|
|
|
26
|
+
# Attributes every ParameterNode sets on itself. A child with one of these
|
|
27
|
+
# names stays reachable through ``children`` and at-instant lookups, but is not
|
|
28
|
+
# set as an attribute, so it cannot replace the node's own state (for example a
|
|
29
|
+
# child named ``parent`` replacing the link to the holding node).
|
|
30
|
+
NODE_OWN_ATTRIBUTE_NAMES = frozenset(
|
|
31
|
+
{
|
|
32
|
+
"name",
|
|
33
|
+
"children",
|
|
34
|
+
"description",
|
|
35
|
+
"documentation",
|
|
36
|
+
"file_path",
|
|
37
|
+
"metadata",
|
|
38
|
+
"trace",
|
|
39
|
+
"tracer",
|
|
40
|
+
"branch_name",
|
|
41
|
+
"_at_instant_cache",
|
|
42
|
+
"parent",
|
|
43
|
+
"modified",
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@functools.lru_cache(maxsize=None)
|
|
49
|
+
def _names_blocked_as_child_attributes(node_class: type) -> frozenset:
|
|
50
|
+
# The node's own attributes, plus the methods and class attributes of its
|
|
51
|
+
# classes (including subclasses such as ParameterScaleBracket). Metaclass
|
|
52
|
+
# attributes such as ABCMeta.register or type.mro are not included: they
|
|
53
|
+
# are not reachable from an instance. Computed once per class.
|
|
54
|
+
names = set(NODE_OWN_ATTRIBUTE_NAMES)
|
|
55
|
+
for klass in node_class.__mro__:
|
|
56
|
+
names.update(klass.__dict__)
|
|
57
|
+
return frozenset(names)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def _can_expose_child_as_attribute(node: "ParameterNode", child_name: str) -> bool:
|
|
61
|
+
return child_name not in _names_blocked_as_child_attributes(type(node))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def _check_child_type(child) -> None:
|
|
65
|
+
if not (
|
|
66
|
+
isinstance(child, ParameterNode)
|
|
67
|
+
or isinstance(child, Parameter)
|
|
68
|
+
or isinstance(child, parameters.ParameterScale)
|
|
69
|
+
):
|
|
70
|
+
raise TypeError(
|
|
71
|
+
"child must be of type ParameterNode, Parameter, or Scale. Instead got {}".format(
|
|
72
|
+
type(child)
|
|
73
|
+
)
|
|
74
|
+
)
|
|
75
|
+
|
|
25
76
|
|
|
26
77
|
class ParameterNode(AtInstantLike):
|
|
27
78
|
"""
|
|
@@ -164,23 +215,64 @@ class ParameterNode(AtInstantLike):
|
|
|
164
215
|
"""
|
|
165
216
|
Add a new child to the node.
|
|
166
217
|
|
|
167
|
-
:param name: Name of the child that must be used to access that child. Should not contain anything that could interfere with the operator `.` (dot).
|
|
218
|
+
:param name: Name of the child that must be used to access that child. Should not contain anything that could interfere with the operator `.` (dot). The child is also set as an attribute of the node, unless the name matches one of the node's own attributes (such as ``parent`` or ``children``) or a method or class attribute of its class; it then stays reachable through ``children`` and at-instant lookups.
|
|
168
219
|
:param child: The new child, an instance of :class:`.ParameterScale` or :class:`.Parameter` or :class:`.ParameterNode`.
|
|
169
220
|
"""
|
|
170
221
|
if name in self.children:
|
|
171
222
|
raise ValueError("{} has already a child named {}".format(self.name, name))
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
223
|
+
_check_child_type(child)
|
|
224
|
+
self._link_child(name, child)
|
|
225
|
+
|
|
226
|
+
def _replace_child(
|
|
227
|
+
self,
|
|
228
|
+
name: str,
|
|
229
|
+
child: Union["ParameterNode", Parameter, "parameters.ParameterScale"],
|
|
230
|
+
) -> None:
|
|
231
|
+
"""
|
|
232
|
+
Replace an existing child and link the replacement to this node.
|
|
233
|
+
|
|
234
|
+
Internal: homogenization uses it to replace a placeholder Parameter
|
|
235
|
+
with the ParameterNode it builds for a further breakdown level.
|
|
236
|
+
|
|
237
|
+
Cached values of this node and its ancestors are cleared. The previous
|
|
238
|
+
child is left as it is, and nodes are not marked as modified. The tree
|
|
239
|
+
is left unchanged when an argument is rejected.
|
|
240
|
+
|
|
241
|
+
:param name: Name of the existing child.
|
|
242
|
+
:param child: The replacement, an instance of :class:`.ParameterScale`, :class:`.Parameter` or :class:`.ParameterNode`. It must not be this node or one of its ancestors.
|
|
243
|
+
"""
|
|
244
|
+
# Check every argument before changing anything, so a rejected call
|
|
245
|
+
# leaves the tree as it was.
|
|
246
|
+
if name not in self.children:
|
|
247
|
+
raise KeyError(
|
|
248
|
+
"{} has no child named {} to replace".format(self.name, name)
|
|
249
|
+
)
|
|
250
|
+
if not isinstance(name, str):
|
|
177
251
|
raise TypeError(
|
|
178
|
-
"
|
|
179
|
-
type(child)
|
|
180
|
-
)
|
|
252
|
+
"Child names must be strings. {} got {!r}".format(self.name, name)
|
|
181
253
|
)
|
|
254
|
+
_check_child_type(child)
|
|
255
|
+
node_or_ancestor = self
|
|
256
|
+
while node_or_ancestor is not None:
|
|
257
|
+
if node_or_ancestor is child:
|
|
258
|
+
raise ValueError(
|
|
259
|
+
"{} cannot hold itself or one of its ancestors ({}) as a "
|
|
260
|
+
"child".format(self.name, child.name)
|
|
261
|
+
)
|
|
262
|
+
node_or_ancestor = getattr(node_or_ancestor, "parent", None)
|
|
263
|
+
|
|
264
|
+
self._link_child(name, child)
|
|
265
|
+
# Cached at-instant nodes of this node and its ancestors still hold
|
|
266
|
+
# the previous child's values.
|
|
267
|
+
self.clear_parent_cache()
|
|
268
|
+
|
|
269
|
+
def _link_child(self, name: str, child) -> None:
|
|
270
|
+
# Store the child, expose it as an attribute when its name does not
|
|
271
|
+
# collide with one of the node's own attributes or methods, and link it
|
|
272
|
+
# upward so Parameter.update can clear caches and mark ancestors.
|
|
182
273
|
self.children[name] = child
|
|
183
|
-
|
|
274
|
+
if _can_expose_child_as_attribute(self, name):
|
|
275
|
+
setattr(self, name, child)
|
|
184
276
|
child.parent = self
|
|
185
277
|
|
|
186
278
|
def __repr__(self) -> str:
|
|
@@ -208,7 +300,8 @@ class ParameterNode(AtInstantLike):
|
|
|
208
300
|
clone.metadata = copy.copy(self.metadata)
|
|
209
301
|
clone.children = {key: child.clone() for key, child in self.children.items()}
|
|
210
302
|
for child_key, child in clone.children.items():
|
|
211
|
-
|
|
303
|
+
if _can_expose_child_as_attribute(clone, child_key):
|
|
304
|
+
setattr(clone, child_key, child)
|
|
212
305
|
child.parent = clone
|
|
213
306
|
clone._at_instant_cache = {}
|
|
214
307
|
|
|
@@ -53,6 +53,7 @@ class ParameterScale(AtInstantLike):
|
|
|
53
53
|
bracket = parameters.ParameterScaleBracket(
|
|
54
54
|
name=bracket_name, data=bracket_data, file_path=file_path
|
|
55
55
|
)
|
|
56
|
+
bracket.parent = self
|
|
56
57
|
brackets.append(bracket)
|
|
57
58
|
self.brackets: typing.List[parameters.ParameterScaleBracket] = brackets
|
|
58
59
|
self.propagate_uprating()
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"""Nodes that homogenization builds for further breakdown levels are linked.
|
|
2
|
+
|
|
3
|
+
``homogenize_parameter_node`` replaces a placeholder ``Parameter`` with a
|
|
4
|
+
``ParameterNode`` when a breakdown has more than one level. The replacement
|
|
5
|
+
must link to the node holding it, and that node's attribute must point at the
|
|
6
|
+
replacement rather than the placeholder. Placeholders that homogenization adds
|
|
7
|
+
for missing breakdown values must stay linked too.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from policyengine_core.parameters import Parameter, ParameterNode
|
|
11
|
+
from policyengine_core.parameters.operations.homogenize_parameters import (
|
|
12
|
+
homogenize_parameter_structures,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def build_two_level_tree(first_level_values) -> ParameterNode:
|
|
17
|
+
return ParameterNode(
|
|
18
|
+
data={
|
|
19
|
+
"program": {
|
|
20
|
+
"amount": {
|
|
21
|
+
str(first_level_values[0]): {
|
|
22
|
+
"1": {"2020-01-01": 10},
|
|
23
|
+
},
|
|
24
|
+
"metadata": {
|
|
25
|
+
"breakdown": [first_level_values, [1, 2]],
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def test_homogenized_replacements_link_to_their_holder():
|
|
34
|
+
root = build_two_level_tree(["A", "B"])
|
|
35
|
+
homogenize_parameter_structures(root, variables={})
|
|
36
|
+
amount = root.program.amount
|
|
37
|
+
|
|
38
|
+
for key in ("A", "B"):
|
|
39
|
+
replacement = amount.children[key]
|
|
40
|
+
assert isinstance(replacement, ParameterNode)
|
|
41
|
+
assert replacement.parent is amount
|
|
42
|
+
assert getattr(amount, key) is replacement
|
|
43
|
+
for leaf in replacement.children.values():
|
|
44
|
+
assert leaf.parent is replacement
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def test_update_under_homogenized_node_marks_every_ancestor_and_refreshes_cached_value():
|
|
48
|
+
root = build_two_level_tree(["A", "B"])
|
|
49
|
+
homogenize_parameter_structures(root, variables={})
|
|
50
|
+
|
|
51
|
+
before = root("2021-01-01").program.amount.B["2"]
|
|
52
|
+
assert before == 0
|
|
53
|
+
|
|
54
|
+
leaf = root.program.amount.children["B"].children["2"]
|
|
55
|
+
leaf.update(period="year:2021:1", value=7)
|
|
56
|
+
|
|
57
|
+
assert root.program.amount.children["B"].modified
|
|
58
|
+
assert root.program.amount.modified
|
|
59
|
+
assert root.program.modified
|
|
60
|
+
assert root.modified
|
|
61
|
+
assert root("2021-01-01").program.amount.B["2"] == 7
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def test_missing_breakdown_value_named_parent_keeps_the_parent_link():
|
|
65
|
+
# "parent" is a missing breakdown value, so homogenization adds it as a
|
|
66
|
+
# placeholder Parameter and then replaces it with a ParameterNode.
|
|
67
|
+
root = build_two_level_tree(["child", "parent"])
|
|
68
|
+
homogenize_parameter_structures(root, variables={})
|
|
69
|
+
program = root.children["program"]
|
|
70
|
+
amount = program.children["amount"]
|
|
71
|
+
|
|
72
|
+
assert amount.parent is program
|
|
73
|
+
replacement = amount.children["parent"]
|
|
74
|
+
assert isinstance(replacement, ParameterNode)
|
|
75
|
+
assert replacement.parent is amount
|
|
76
|
+
|
|
77
|
+
replacement.children["2"].update(period="year:2021:1", value=4)
|
|
78
|
+
assert amount.modified
|
|
79
|
+
assert program.modified
|
|
80
|
+
assert root.modified
|
|
81
|
+
assert root("2021-01-01").program.amount["parent"]["2"] == 4
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def test_single_level_homogenization_links_added_placeholders():
|
|
85
|
+
root = ParameterNode(
|
|
86
|
+
data={
|
|
87
|
+
"program": {
|
|
88
|
+
"A": {"2020-01-01": 1},
|
|
89
|
+
"metadata": {"breakdown": [["A", "B"]]},
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
homogenize_parameter_structures(root, variables={})
|
|
94
|
+
program = root.program
|
|
95
|
+
|
|
96
|
+
placeholder = program.children["B"]
|
|
97
|
+
assert isinstance(placeholder, Parameter)
|
|
98
|
+
assert placeholder.parent is program
|
|
99
|
+
assert program.B is placeholder
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
"""Every node in a loaded parameter tree links to the node that holds it.
|
|
2
|
+
|
|
3
|
+
``Parameter.update`` walks upward through ``parent`` to clear cached
|
|
4
|
+
at-instant nodes and to mark ancestors as modified, so a missing or wrong
|
|
5
|
+
``parent`` link leaves stale values and unmarked ancestors. A cloned tree links
|
|
6
|
+
every node, so a loaded tree and its clone must behave the same.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import numpy
|
|
10
|
+
import pytest
|
|
11
|
+
|
|
12
|
+
from policyengine_core.parameters import (
|
|
13
|
+
Parameter,
|
|
14
|
+
ParameterNode,
|
|
15
|
+
ParameterScale,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def build_tree_with_scale() -> ParameterNode:
|
|
20
|
+
return ParameterNode(
|
|
21
|
+
data={
|
|
22
|
+
"tax": {
|
|
23
|
+
"credit": {
|
|
24
|
+
"base": {
|
|
25
|
+
"brackets": [
|
|
26
|
+
{
|
|
27
|
+
"threshold": {"values": {"2020-01-01": 0}},
|
|
28
|
+
"amount": {"values": {"2020-01-01": 100}},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"threshold": {"values": {"2020-01-01": 10}},
|
|
32
|
+
"amount": {"values": {"2020-01-01": 50}},
|
|
33
|
+
},
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
"rate": {"values": {"2020-01-01": 0.2}},
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def iter_tree_with_holders(root):
|
|
44
|
+
"""Yield (holding node, child) for every link in the tree, brackets included."""
|
|
45
|
+
if isinstance(root, ParameterScale):
|
|
46
|
+
for bracket in root.brackets:
|
|
47
|
+
yield root, bracket
|
|
48
|
+
yield from iter_tree_with_holders(bracket)
|
|
49
|
+
elif isinstance(root, ParameterNode):
|
|
50
|
+
for child in root.children.values():
|
|
51
|
+
yield root, child
|
|
52
|
+
yield from iter_tree_with_holders(child)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def modified_names(root) -> set:
|
|
56
|
+
return {
|
|
57
|
+
child.name
|
|
58
|
+
for _, child in iter_tree_with_holders(root)
|
|
59
|
+
if getattr(child, "modified", False)
|
|
60
|
+
} | ({root.name} if getattr(root, "modified", False) else set())
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def test_scale_brackets_link_to_their_scale():
|
|
64
|
+
root = build_tree_with_scale()
|
|
65
|
+
scale = root.tax.credit.base
|
|
66
|
+
|
|
67
|
+
assert len(scale.brackets) == 2
|
|
68
|
+
for bracket in scale.brackets:
|
|
69
|
+
assert bracket.parent is scale
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def test_every_loaded_node_links_to_its_holder():
|
|
73
|
+
root = build_tree_with_scale()
|
|
74
|
+
|
|
75
|
+
for holder, child in iter_tree_with_holders(root):
|
|
76
|
+
assert child.parent is holder, child.name
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def test_bracket_update_marks_same_nodes_on_loaded_tree_and_clone():
|
|
80
|
+
loaded_root = build_tree_with_scale()
|
|
81
|
+
cloned_root = build_tree_with_scale().clone()
|
|
82
|
+
|
|
83
|
+
for root in (loaded_root, cloned_root):
|
|
84
|
+
root.tax.credit.base.brackets[0].amount.update(period="year:2021:1", value=200)
|
|
85
|
+
|
|
86
|
+
loaded_modified = modified_names(loaded_root)
|
|
87
|
+
assert loaded_modified == modified_names(cloned_root)
|
|
88
|
+
assert {
|
|
89
|
+
"tax.credit.base[0].amount",
|
|
90
|
+
"tax.credit.base[0]",
|
|
91
|
+
"tax.credit.base",
|
|
92
|
+
"tax.credit",
|
|
93
|
+
"tax",
|
|
94
|
+
} <= loaded_modified
|
|
95
|
+
assert "tax.rate" not in loaded_modified
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def test_bracket_update_clears_cached_ancestor_values():
|
|
99
|
+
root = build_tree_with_scale()
|
|
100
|
+
income = numpy.array([5])
|
|
101
|
+
before = root("2021-01-01").tax.credit.base.calc(income)
|
|
102
|
+
assert before[0] == 100
|
|
103
|
+
|
|
104
|
+
root.tax.credit.base.brackets[0].amount.update(period="year:2021:1", value=200)
|
|
105
|
+
|
|
106
|
+
assert root("2021-01-01").tax.credit.base.calc(income)[0] == 200
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def test_child_named_parent_does_not_replace_the_parent_link():
|
|
110
|
+
root = ParameterNode(
|
|
111
|
+
data={
|
|
112
|
+
"categories": {
|
|
113
|
+
"parent": {"values": {"2020-01-01": 1}},
|
|
114
|
+
"child": {"values": {"2020-01-01": 2}},
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
categories = root.children["categories"]
|
|
119
|
+
parent_category = categories.children["parent"]
|
|
120
|
+
|
|
121
|
+
assert categories.parent is root
|
|
122
|
+
assert parent_category.parent is categories
|
|
123
|
+
|
|
124
|
+
standalone = ParameterNode(data={"parent": {"values": {"2020-01-01": 1}}})
|
|
125
|
+
assert standalone.parent is None
|
|
126
|
+
assert standalone.children["parent"].parent is standalone
|
|
127
|
+
|
|
128
|
+
parent_category.update(period="year:2021:1", value=3)
|
|
129
|
+
assert root.modified
|
|
130
|
+
assert root("2021-01-01").categories.parent == 3
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
@pytest.mark.parametrize("reserved_name", ["children", "name", "modified", "parent"])
|
|
134
|
+
def test_child_name_cannot_overwrite_node_attributes(reserved_name):
|
|
135
|
+
# A root node and its clone. No holder re-assigns a root's ``parent``
|
|
136
|
+
# afterwards, so an overwrite of ``parent``, ``name`` or ``children`` stays
|
|
137
|
+
# visible on the root. ``__init__`` resets ``modified`` at its end, so
|
|
138
|
+
# only the clone shows an overwrite of that one.
|
|
139
|
+
root = ParameterNode("root", data={reserved_name: {"values": {"2020-01-01": 1}}})
|
|
140
|
+
|
|
141
|
+
for node in (root, root.clone()):
|
|
142
|
+
assert isinstance(node.children, dict)
|
|
143
|
+
assert node.name == "root"
|
|
144
|
+
assert node.parent is None
|
|
145
|
+
assert node.modified is False
|
|
146
|
+
assert node.children[reserved_name].parent is node
|
|
147
|
+
assert reserved_name not in vars(node) or not isinstance(
|
|
148
|
+
vars(node)[reserved_name], (Parameter, ParameterNode)
|
|
149
|
+
)
|
|
150
|
+
assert node("2021-01-01")[reserved_name] == 1
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def test_child_name_cannot_shadow_node_methods():
|
|
154
|
+
root = ParameterNode(data={"clone": {"values": {"2020-01-01": 1}}})
|
|
155
|
+
|
|
156
|
+
assert "clone" not in vars(root)
|
|
157
|
+
cloned = root.clone()
|
|
158
|
+
assert "clone" not in vars(cloned)
|
|
159
|
+
assert cloned.children["clone"].parent is cloned
|
|
160
|
+
assert cloned("2021-01-01").clone == 1
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def test_replace_child_links_the_replacement():
|
|
164
|
+
root = ParameterNode(data={"node": {"value": {"values": {"2020-01-01": 1}}}})
|
|
165
|
+
node = root.children["node"]
|
|
166
|
+
replacement = ParameterNode("node.value", data={"a": {"values": {"2020-01-01": 5}}})
|
|
167
|
+
|
|
168
|
+
node._replace_child("value", replacement)
|
|
169
|
+
|
|
170
|
+
assert node.children["value"] is replacement
|
|
171
|
+
assert node.value is replacement
|
|
172
|
+
assert replacement.parent is node
|
|
173
|
+
assert root("2021-01-01").node.value.a == 5
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def test_replace_child_requires_an_existing_child():
|
|
177
|
+
node = ParameterNode(data={"value": {"values": {"2020-01-01": 1}}})
|
|
178
|
+
|
|
179
|
+
with pytest.raises(KeyError):
|
|
180
|
+
node._replace_child("missing", Parameter("missing", {"2020-01-01": 1}))
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def test_bracket_appended_by_template_reform_links_to_its_scale():
|
|
184
|
+
from policyengine_core.country_template import CountryTaxBenefitSystem
|
|
185
|
+
from policyengine_core.country_template.reforms.modify_social_security_taxation import (
|
|
186
|
+
modify_social_security_taxation,
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
reformed = modify_social_security_taxation(CountryTaxBenefitSystem())
|
|
190
|
+
scale = reformed.parameters.taxes.social_security_contribution
|
|
191
|
+
|
|
192
|
+
for bracket in scale.brackets:
|
|
193
|
+
assert bracket.parent is scale, bracket.name
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def test_replace_child_clears_cached_values_and_marks_nothing_modified():
|
|
197
|
+
root = ParameterNode(data={"node": {"value": {"values": {"2020-01-01": 1}}}})
|
|
198
|
+
node = root.children["node"]
|
|
199
|
+
assert root("2021-01-01").node.value == 1
|
|
200
|
+
old_child = node.children["value"]
|
|
201
|
+
|
|
202
|
+
node._replace_child("value", Parameter("node.value", {"2020-01-01": 9}))
|
|
203
|
+
|
|
204
|
+
assert root("2021-01-01").node.value == 9
|
|
205
|
+
# The previous child is left as it is.
|
|
206
|
+
assert old_child.parent is node
|
|
207
|
+
assert not node.modified
|
|
208
|
+
assert not root.modified
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def test_clone_keeps_modified_flag_when_a_child_is_named_modified():
|
|
212
|
+
root = ParameterNode(data={"node": {"modified": {"values": {"2020-01-01": 1}}}})
|
|
213
|
+
|
|
214
|
+
cloned_node = root.clone().children["node"]
|
|
215
|
+
|
|
216
|
+
assert cloned_node.modified is False
|
|
217
|
+
assert cloned_node.children["modified"].parent is cloned_node
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def test_replace_child_keeps_link_of_previous_child_moved_elsewhere():
|
|
221
|
+
root = ParameterNode(data={"node": {"value": {"values": {"2020-01-01": 1}}}})
|
|
222
|
+
node = root.children["node"]
|
|
223
|
+
previous_child = node.children["value"]
|
|
224
|
+
wrapper = ParameterNode("node.value", data={})
|
|
225
|
+
wrapper.add_child("default", previous_child)
|
|
226
|
+
|
|
227
|
+
node._replace_child("value", wrapper)
|
|
228
|
+
|
|
229
|
+
assert previous_child.parent is wrapper
|
|
230
|
+
assert wrapper.parent is node
|
|
231
|
+
previous_child.update(period="year:2021:1", value=5)
|
|
232
|
+
assert root("2021-01-01").node.value.default == 5
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
@pytest.mark.parametrize("metaclass_attribute_name", ["register", "mro"])
|
|
236
|
+
def test_child_named_after_metaclass_attribute_is_an_attribute(
|
|
237
|
+
metaclass_attribute_name,
|
|
238
|
+
):
|
|
239
|
+
root = ParameterNode(data={metaclass_attribute_name: {"values": {"2020-01-01": 1}}})
|
|
240
|
+
child = root.children[metaclass_attribute_name]
|
|
241
|
+
|
|
242
|
+
assert getattr(root, metaclass_attribute_name) is child
|
|
243
|
+
assert getattr(root.clone(), metaclass_attribute_name).name == child.name
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
@pytest.mark.parametrize("previous_child_kind", ["parameter", "scale"])
|
|
247
|
+
def test_replace_child_accepts_previous_child_without_parent_attribute(
|
|
248
|
+
previous_child_kind,
|
|
249
|
+
):
|
|
250
|
+
# A Parameter or ParameterScale stored in ``children`` directly, without
|
|
251
|
+
# add_child, has no ``parent`` attribute at all.
|
|
252
|
+
root = ParameterNode(data={"node": {"other": {"values": {"2020-01-01": 0}}}})
|
|
253
|
+
node = root.children["node"]
|
|
254
|
+
if previous_child_kind == "parameter":
|
|
255
|
+
previous_child = Parameter("node.x", {"2020-01-01": 1})
|
|
256
|
+
else:
|
|
257
|
+
previous_child = ParameterScale(
|
|
258
|
+
"node.x",
|
|
259
|
+
{"brackets": [{"threshold": {"values": {"2020-01-01": 0}}}]},
|
|
260
|
+
None,
|
|
261
|
+
)
|
|
262
|
+
node.children["x"] = previous_child
|
|
263
|
+
assert not hasattr(previous_child, "parent")
|
|
264
|
+
root("2021-01-01")
|
|
265
|
+
|
|
266
|
+
node._replace_child("x", Parameter("node.x", {"2020-01-01": 2}))
|
|
267
|
+
|
|
268
|
+
assert node.children["x"].parent is node
|
|
269
|
+
assert root("2021-01-01").node.x == 2
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def test_replace_child_keeps_link_of_previous_child_still_held_under_another_name():
|
|
273
|
+
root = ParameterNode(data={"node": {"a": {"values": {"2020-01-01": 1}}}})
|
|
274
|
+
node = root.children["node"]
|
|
275
|
+
shared_child = node.children["a"]
|
|
276
|
+
node.children["b"] = shared_child
|
|
277
|
+
|
|
278
|
+
node._replace_child("a", Parameter("node.a", {"2020-01-01": 2}))
|
|
279
|
+
|
|
280
|
+
assert shared_child.parent is node
|
|
281
|
+
shared_child.update(period="year:2021:1", value=3)
|
|
282
|
+
assert root("2021-01-01").node["b"] == 3
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
@pytest.mark.parametrize("replacement_kind", ["holder", "ancestor"])
|
|
286
|
+
def test_replace_child_rejects_holder_or_ancestor_and_leaves_tree_unchanged(
|
|
287
|
+
replacement_kind,
|
|
288
|
+
):
|
|
289
|
+
root = ParameterNode(data={"node": {"a": {"values": {"2020-01-01": 1}}}})
|
|
290
|
+
node = root.children["node"]
|
|
291
|
+
previous_child = node.children["a"]
|
|
292
|
+
replacement = node if replacement_kind == "holder" else root
|
|
293
|
+
|
|
294
|
+
with pytest.raises(ValueError):
|
|
295
|
+
node._replace_child("a", replacement)
|
|
296
|
+
|
|
297
|
+
assert node.children["a"] is previous_child
|
|
298
|
+
assert previous_child.parent is node
|
|
299
|
+
assert node.parent is root
|
|
300
|
+
assert root.parent is None
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
def test_replace_child_rejects_non_string_name_and_leaves_tree_unchanged():
|
|
304
|
+
root = ParameterNode(data={"node": {"a": {"values": {"2020-01-01": 1}}}})
|
|
305
|
+
node = root.children["node"]
|
|
306
|
+
previous_child = Parameter("node.1", {"2020-01-01": 1})
|
|
307
|
+
node.children[1] = previous_child
|
|
308
|
+
previous_child.parent = node
|
|
309
|
+
replacement = Parameter("node.1", {"2020-01-01": 2})
|
|
310
|
+
|
|
311
|
+
with pytest.raises(TypeError):
|
|
312
|
+
node._replace_child(1, replacement)
|
|
313
|
+
|
|
314
|
+
assert node.children[1] is previous_child
|
|
315
|
+
assert previous_child.parent is node
|
|
316
|
+
assert not hasattr(replacement, "parent")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/is-version-number-acceptable.sh
RENAMED
|
File without changes
|
|
File without changes
|
{policyengine_core-3.37.0 → policyengine_core-3.37.1}/.github/requirements/legacy-country-smoke.txt
RENAMED
|
File without changes
|
|
File without changes
|