policyengine-core 2.3.0__tar.gz → 2.5.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-2.3.0/policyengine_core.egg-info → policyengine-core-2.5.0}/PKG-INFO +1 -1
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/charts/__init__.py +3 -3
- policyengine-core-2.5.0/policyengine_core/charts/bar.py +133 -0
- policyengine-core-2.5.0/policyengine_core/charts/formatting.py +80 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0/policyengine_core.egg-info}/PKG-INFO +1 -1
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core.egg-info/SOURCES.txt +1 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/setup.py +1 -1
- policyengine-core-2.3.0/policyengine_core/charts/formatting.py +0 -42
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/LICENSE +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/MANIFEST.in +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/README.md +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/commons/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/commons/formulas.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/commons/misc.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/commons/rates.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/constants.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/data/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/data/datasets/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/data/datasets/country_template_dataset.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/entities.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/modelled_policies.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/parameters/benefits/basic_income.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/parameters/benefits/housing_allowance.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/parameters/benefits/index.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/parameters/benefits/parenting_allowance/amount.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/parameters/benefits/parenting_allowance/income_threshold.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/parameters/general/age_of_majority.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/parameters/general/age_of_retirement.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/parameters/taxes/housing_tax.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/parameters/taxes/income_tax_rate.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/parameters/taxes/social_security_contribution.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/reforms/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/reforms/add_dynamic_variable.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/reforms/add_new_tax.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/reforms/flat_social_security_contribution.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/reforms/modify_social_security_taxation.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/reforms/removal_basic_income.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/situation_examples/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/situation_examples/couple.json +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/situation_examples/housing.json +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/situation_examples/single.json +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/tests/age.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/tests/basic_income.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/tests/disposable_income.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/tests/housing_allowance.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/tests/housing_tax.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/tests/income_tax.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/tests/reforms/add_dynamic_variable.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/tests/reforms/add_new_tax.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/tests/reforms/modify_social_security_taxation.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/tests/situations/income_tax.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/tests/situations/parenting_allowance.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/tests/social_security_contribution.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/tests/test_microsimulation.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/variables/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/variables/benefits.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/variables/demographics.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/variables/housing.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/variables/ids.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/variables/income.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/variables/stats.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/variables/taxes.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data/dataset.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data_storage/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data_storage/in_memory_storage.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data_storage/on_disk_storage.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data_structures/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data_structures/parameter_metadata.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data_structures/parameter_node_metadata.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data_structures/reference.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data_structures/unit.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/entities/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/entities/entity.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/entities/group_entity.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/entities/helpers.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/entities/role.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/enums/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/enums/config.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/enums/enum.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/enums/enum_array.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/cycle_error.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/empty_argument_error.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/nan_creation_error.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/parameter_not_found_error.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/parameter_parsing_error.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/period_mismatch_error.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/situation_parsing_error.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/spiral_error.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/variable_name_conflict_error.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/variable_not_found_error.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/experimental/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/experimental/memory_config.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/extension_template/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/extension_template/local_benefit.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/extension_template/parameters/local_town/child_allowance/amount.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/extension_template/parameters/local_town/child_allowance/index.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/extension_template/parameters/local_town/index.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/extension_template/tests/local_benefit.yaml +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/holders/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/holders/helpers.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/holders/holder.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/model_api.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/at_instant_like.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/config.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/helpers.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/operations/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/operations/get_parameter.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/operations/homogenize_parameters.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/operations/interpolate_parameters.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/operations/propagate_parameter_metadata.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/operations/uprate_parameters.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/parameter.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/parameter_at_instant.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/parameter_node.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/parameter_node_at_instant.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/parameter_scale.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/parameter_scale_bracket.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/vectorial_parameter_node_at_instant.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/periods/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/periods/config.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/periods/helpers.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/periods/instant_.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/periods/period_.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/populations/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/populations/config.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/populations/group_population.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/populations/population.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/projectors/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/projectors/entity_to_person_projector.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/projectors/first_person_to_entity_projector.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/projectors/helpers.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/projectors/projector.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/projectors/unique_role_to_entity_projector.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/reforms/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/reforms/reform.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/scripts/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/scripts/assets/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/scripts/assets/index.html +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/scripts/policyengine_command.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/scripts/run_data.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/scripts/run_test.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/scripts/simulation_generator.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/simulations/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/simulations/helpers.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/simulations/individual_sim.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/simulations/microsimulation.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/simulations/simulation.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/simulations/simulation_builder.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxbenefitsystems/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxbenefitsystems/tax_benefit_system.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxscales/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxscales/abstract_rate_tax_scale.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxscales/abstract_tax_scale.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxscales/amount_tax_scale_like.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxscales/helpers.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxscales/linear_average_rate_tax_scale.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxscales/marginal_amount_tax_scale.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxscales/marginal_rate_tax_scale.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxscales/rate_tax_scale_like.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxscales/single_amount_tax_scale.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxscales/tax_scale_like.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tools/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tools/simulation_dumper.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tools/test_runner.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tracers/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tracers/computation_log.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tracers/flat_trace.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tracers/full_tracer.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tracers/performance_log.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tracers/simple_tracer.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tracers/trace_node.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tracers/tracing_parameter_node_at_instant.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/types/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/types/data_types/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/types/data_types/arrays.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/variables/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/variables/config.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/variables/defined_for.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/variables/helpers.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/variables/typing.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/variables/variable.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/warnings/__init__.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/warnings/libyaml_warning.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/warnings/memory_config_warning.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/warnings/tempfile_warning.py +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core.egg-info/dependency_links.txt +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core.egg-info/entry_points.txt +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core.egg-info/requires.txt +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core.egg-info/top_level.txt +0 -0
- {policyengine-core-2.3.0 → policyengine-core-2.5.0}/setup.cfg +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
from .formatting import *
|
|
3
|
+
import plotly.express as px
|
|
4
|
+
from microdf import MicroSeries
|
|
5
|
+
from typing import Callable
|
|
6
|
+
import numpy as np
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def bar_chart(
|
|
10
|
+
data: pd.Series,
|
|
11
|
+
showlegend: bool = False,
|
|
12
|
+
remove_zero_index: bool = True,
|
|
13
|
+
text_format: str = "+.1%",
|
|
14
|
+
positive_colour: str = BLUE,
|
|
15
|
+
negative_colour: str = DARK_GRAY,
|
|
16
|
+
hover_text_function: Callable = None,
|
|
17
|
+
**kwargs,
|
|
18
|
+
):
|
|
19
|
+
"""Create a PolicyEngine bar chart.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
data (pd.Series): A pandas series.
|
|
23
|
+
showlegend (bool, optional): Whether to show the legend. Defaults to False.
|
|
24
|
+
remove_zero_index (bool, optional): Whether to remove the zero index. Defaults to True.
|
|
25
|
+
text_format (str, optional): The format of the text. Defaults to "+.1%".
|
|
26
|
+
positive_colour (str, optional): The colour of positive values. Defaults to BLUE.
|
|
27
|
+
negative_colour (str, optional): The colour of negative values. Defaults to DARK_GRAY.
|
|
28
|
+
hover_text_labels (list, optional): The hover text labels. Defaults to None.
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
go.Figure: A plotly figure.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
hover_text_labels = [
|
|
35
|
+
hover_text_function(index, value)
|
|
36
|
+
if hover_text_function is not None
|
|
37
|
+
else None
|
|
38
|
+
for index, value in data.items()
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
fig = (
|
|
42
|
+
px.bar(
|
|
43
|
+
data,
|
|
44
|
+
text=data.apply(lambda x: f"{x:{text_format}}"),
|
|
45
|
+
custom_data=[hover_text_labels] if hover_text_labels else None,
|
|
46
|
+
)
|
|
47
|
+
.update_layout(
|
|
48
|
+
showlegend=showlegend,
|
|
49
|
+
uniformtext=dict(
|
|
50
|
+
mode="hide",
|
|
51
|
+
minsize=12,
|
|
52
|
+
),
|
|
53
|
+
**kwargs,
|
|
54
|
+
)
|
|
55
|
+
.update_traces(
|
|
56
|
+
marker_color=[
|
|
57
|
+
positive_colour if v > 0 else negative_colour
|
|
58
|
+
for v in data.values
|
|
59
|
+
],
|
|
60
|
+
hovertemplate="%{customdata[0]}<extra></extra>"
|
|
61
|
+
if hover_text_labels is not None
|
|
62
|
+
else None,
|
|
63
|
+
)
|
|
64
|
+
)
|
|
65
|
+
return format_fig(fig)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def cross_section_bar_chart(
|
|
69
|
+
data: MicroSeries,
|
|
70
|
+
cross_section: MicroSeries,
|
|
71
|
+
slices: list = [-0.05, -0.01, 0.01, 0.05],
|
|
72
|
+
add_infinities: bool = True,
|
|
73
|
+
text_format: str = ".1%",
|
|
74
|
+
hover_text_function: Callable = None,
|
|
75
|
+
category_names=None,
|
|
76
|
+
color_discrete_map: dict = None,
|
|
77
|
+
**kwargs,
|
|
78
|
+
):
|
|
79
|
+
df = pd.DataFrame()
|
|
80
|
+
slices = [-np.inf, *slices, np.inf] if add_infinities else slices
|
|
81
|
+
for i, lower, upper in zip(range(len(slices)), slices[:-1], slices[1:]):
|
|
82
|
+
for cross_section_value in cross_section.unique():
|
|
83
|
+
in_slice = (data >= lower) * (data < upper)
|
|
84
|
+
value = (
|
|
85
|
+
data[cross_section == cross_section_value][in_slice].count()
|
|
86
|
+
/ data[cross_section == cross_section_value].count()
|
|
87
|
+
)
|
|
88
|
+
category = (
|
|
89
|
+
category_names[i]
|
|
90
|
+
if category_names is not None
|
|
91
|
+
else f"{lower:.0%} to {upper:.0%}"
|
|
92
|
+
)
|
|
93
|
+
row = {
|
|
94
|
+
"Category": category,
|
|
95
|
+
"Cross section": cross_section_value,
|
|
96
|
+
"Value": value,
|
|
97
|
+
"Hover text": hover_text_function(
|
|
98
|
+
cross_section_value, category, value
|
|
99
|
+
)
|
|
100
|
+
if hover_text_function is not None
|
|
101
|
+
else None,
|
|
102
|
+
}
|
|
103
|
+
df = df.append(row, ignore_index=True)
|
|
104
|
+
|
|
105
|
+
fig = (
|
|
106
|
+
px.bar(
|
|
107
|
+
df,
|
|
108
|
+
x="Value",
|
|
109
|
+
y="Cross section",
|
|
110
|
+
color="Category",
|
|
111
|
+
barmode="stack",
|
|
112
|
+
orientation="h",
|
|
113
|
+
text=df["Value"].apply(lambda x: f"{x:{text_format}}"),
|
|
114
|
+
color_discrete_map=color_discrete_map,
|
|
115
|
+
custom_data=["Hover text"],
|
|
116
|
+
)
|
|
117
|
+
.update_layout(
|
|
118
|
+
xaxis=dict(
|
|
119
|
+
tickformat="%",
|
|
120
|
+
title="Fraction of observations",
|
|
121
|
+
),
|
|
122
|
+
yaxis=dict(tickvals=list(range(1, 11))),
|
|
123
|
+
uniformtext=dict(
|
|
124
|
+
mode="hide",
|
|
125
|
+
minsize=12,
|
|
126
|
+
),
|
|
127
|
+
**kwargs,
|
|
128
|
+
)
|
|
129
|
+
.update_traces(
|
|
130
|
+
hovertemplate="%{customdata[0]}<extra></extra>",
|
|
131
|
+
)
|
|
132
|
+
)
|
|
133
|
+
return format_fig(fig)
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import plotly.graph_objects as go
|
|
2
|
+
from IPython.display import HTML
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
WHITE = "#FFF"
|
|
6
|
+
BLUE = "#2C6496"
|
|
7
|
+
GRAY = "#BDBDBD"
|
|
8
|
+
MEDIUM_DARK_GRAY = "#D2D2D2"
|
|
9
|
+
DARK_GRAY = "#616161"
|
|
10
|
+
GREEN = "#29d40f"
|
|
11
|
+
LIGHT_GRAY = "#F2F2F2"
|
|
12
|
+
LIGHT_GREEN = "#C5E1A5"
|
|
13
|
+
DARK_GREEN = "#558B2F"
|
|
14
|
+
BLACK = "#000"
|
|
15
|
+
|
|
16
|
+
BLUE_COLOR_SCALE = [BLUE, "#265782", "#20496E", "#1A3C5A"]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def format_fig(fig: go.Figure) -> go.Figure:
|
|
20
|
+
"""Format a plotly figure to match the PolicyEngine style guide.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
fig (go.Figure): A plotly figure.
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
go.Figure: A plotly figure with the PolicyEngine style guide applied.
|
|
27
|
+
"""
|
|
28
|
+
fig.update_layout(
|
|
29
|
+
font=dict(
|
|
30
|
+
family="Roboto Serif",
|
|
31
|
+
color="black",
|
|
32
|
+
)
|
|
33
|
+
)
|
|
34
|
+
fig.add_layout_image(
|
|
35
|
+
dict(
|
|
36
|
+
source="https://raw.githubusercontent.com/PolicyEngine/policyengine-app/master/src/images/logos/policyengine/blue.png",
|
|
37
|
+
xref="paper",
|
|
38
|
+
yref="paper",
|
|
39
|
+
x=1,
|
|
40
|
+
y=-0.15,
|
|
41
|
+
sizex=0.2,
|
|
42
|
+
sizey=0.2,
|
|
43
|
+
xanchor="right",
|
|
44
|
+
yanchor="bottom",
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# set template
|
|
49
|
+
fig.update_layout(
|
|
50
|
+
template="plotly_white",
|
|
51
|
+
height=600,
|
|
52
|
+
width=800,
|
|
53
|
+
)
|
|
54
|
+
# don't show modebar
|
|
55
|
+
fig.update_layout(
|
|
56
|
+
modebar=dict(
|
|
57
|
+
bgcolor="rgba(0,0,0,0)",
|
|
58
|
+
color="rgba(0,0,0,0)",
|
|
59
|
+
)
|
|
60
|
+
)
|
|
61
|
+
return fig
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def display_fig(fig: go.Figure) -> HTML:
|
|
65
|
+
return HTML(
|
|
66
|
+
format_fig(fig).to_html(full_html=False, include_plotlyjs="cdn")
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def cardinal(n: int) -> int:
|
|
71
|
+
"""Convert an integer to a cardinal string."""
|
|
72
|
+
ending_number = n % 10
|
|
73
|
+
if ending_number == 1:
|
|
74
|
+
return f"{n}st"
|
|
75
|
+
elif ending_number == 2:
|
|
76
|
+
return f"{n}nd"
|
|
77
|
+
elif ending_number == 3:
|
|
78
|
+
return f"{n}rd"
|
|
79
|
+
else:
|
|
80
|
+
return f"{n}th"
|
|
@@ -11,6 +11,7 @@ policyengine_core.egg-info/entry_points.txt
|
|
|
11
11
|
policyengine_core.egg-info/requires.txt
|
|
12
12
|
policyengine_core.egg-info/top_level.txt
|
|
13
13
|
policyengine_core/charts/__init__.py
|
|
14
|
+
policyengine_core/charts/bar.py
|
|
14
15
|
policyengine_core/charts/formatting.py
|
|
15
16
|
policyengine_core/commons/__init__.py
|
|
16
17
|
policyengine_core/commons/formulas.py
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import plotly.graph_objects as go
|
|
2
|
-
from IPython.display import HTML
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
WHITE = "#FFF"
|
|
6
|
-
LIGHTER_BLUE = "#ABCEEB" # Blue 100.
|
|
7
|
-
LIGHT_BLUE = "#49A6E2" # Blue 500.
|
|
8
|
-
BLUE = "#1976D2" # Blue 700.
|
|
9
|
-
DARK_BLUE = "#0F4AA1" # Blue 900.
|
|
10
|
-
GRAY = "#BDBDBD"
|
|
11
|
-
DARK_GRAY = "#616161"
|
|
12
|
-
LIGHT_GRAY = "#F5F5F5"
|
|
13
|
-
LIGHT_GREEN = "#C5E1A5"
|
|
14
|
-
DARK_GREEN = "#558B2F"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def format_fig(fig: go.Figure) -> dict:
|
|
18
|
-
"""Formats figure with styling and returns as JSON.
|
|
19
|
-
:param fig: Plotly figure.
|
|
20
|
-
:type fig: go.Figure
|
|
21
|
-
:return: Formatted plotly figure as a JSON dict.
|
|
22
|
-
:rtype: dict
|
|
23
|
-
"""
|
|
24
|
-
fig.update_xaxes(
|
|
25
|
-
title_font=dict(size=16, color="black"), tickfont={"size": 14}
|
|
26
|
-
)
|
|
27
|
-
fig.update_yaxes(
|
|
28
|
-
title_font=dict(size=16, color="black"), tickfont={"size": 14}
|
|
29
|
-
)
|
|
30
|
-
return fig.update_layout(
|
|
31
|
-
hoverlabel_align="right",
|
|
32
|
-
font_family="Arial, sans-serif",
|
|
33
|
-
font_color="Black",
|
|
34
|
-
title_font_size=20,
|
|
35
|
-
plot_bgcolor="white",
|
|
36
|
-
paper_bgcolor="white",
|
|
37
|
-
hoverlabel=dict(font_family="Arial, sans-serif"),
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def display_fig(fig: go.Figure) -> HTML:
|
|
42
|
-
return HTML(fig.to_html(full_html=False, include_plotlyjs="cdn"))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/__init__.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/constants.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/country_template/entities.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data_storage/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data_structures/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data_structures/reference.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/data_structures/unit.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/entities/group_entity.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/empty_argument_error.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/nan_creation_error.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/errors/spiral_error.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/experimental/__init__.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/experimental/memory_config.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/extension_template/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/__init__.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/at_instant_like.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/parameter.py
RENAMED
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/parameter_node.py
RENAMED
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/parameters/parameter_scale.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/populations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/populations/population.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/projectors/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/projectors/projector.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/scripts/assets/__init__.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/scripts/assets/index.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/simulations/__init__.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/simulations/helpers.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/simulations/individual_sim.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/simulations/microsimulation.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/simulations/simulation.py
RENAMED
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxbenefitsystems/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/taxscales/tax_scale_like.py
RENAMED
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tools/simulation_dumper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tracers/computation_log.py
RENAMED
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tracers/full_tracer.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tracers/performance_log.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/tracers/simple_tracer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/types/data_types/__init__.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/types/data_types/arrays.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/variables/defined_for.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/warnings/libyaml_warning.py
RENAMED
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core/warnings/tempfile_warning.py
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
{policyengine-core-2.3.0 → policyengine-core-2.5.0}/policyengine_core.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|