policyengine-core 3.2.0__tar.gz → 3.3.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.
Files changed (199) hide show
  1. {policyengine_core-3.2.0/policyengine_core.egg-info → policyengine_core-3.3.0}/PKG-INFO +1 -3
  2. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/charts/bar.py +1 -1
  3. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/data/dataset.py +3 -4
  4. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/enums/enum.py +3 -2
  5. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/parameter.py +9 -0
  6. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/populations/group_population.py +16 -0
  7. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/populations/population.py +3 -0
  8. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/simulations/microsimulation.py +1 -1
  9. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/simulations/simulation.py +29 -14
  10. {policyengine_core-3.2.0 → policyengine_core-3.3.0/policyengine_core.egg-info}/PKG-INFO +1 -3
  11. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core.egg-info/requires.txt +0 -2
  12. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/setup.py +1 -3
  13. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/LICENSE +0 -0
  14. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/MANIFEST.in +0 -0
  15. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/README.md +0 -0
  16. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/__init__.py +0 -0
  17. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/charts/__init__.py +0 -0
  18. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/charts/api.py +0 -0
  19. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/charts/formatting.py +0 -0
  20. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/commons/__init__.py +0 -0
  21. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/commons/formulas.py +0 -0
  22. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/commons/misc.py +0 -0
  23. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/commons/rates.py +0 -0
  24. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/__init__.py +0 -0
  25. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/constants.py +0 -0
  26. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/data/__init__.py +0 -0
  27. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/data/datasets/__init__.py +0 -0
  28. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/data/datasets/country_template_dataset.py +0 -0
  29. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/entities.py +0 -0
  30. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/modelled_policies.yaml +0 -0
  31. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/parameters/benefits/basic_income.yaml +0 -0
  32. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/parameters/benefits/housing_allowance.yaml +0 -0
  33. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/parameters/benefits/index.yaml +0 -0
  34. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/parameters/benefits/parenting_allowance/amount.yaml +0 -0
  35. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/parameters/benefits/parenting_allowance/income_threshold.yaml +0 -0
  36. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/parameters/general/age_of_majority.yaml +0 -0
  37. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/parameters/general/age_of_retirement.yaml +0 -0
  38. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/parameters/taxes/housing_tax.yaml +0 -0
  39. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/parameters/taxes/income_tax_rate.yaml +0 -0
  40. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/parameters/taxes/social_security_contribution.yaml +0 -0
  41. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/reforms/__init__.py +0 -0
  42. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/reforms/add_dynamic_variable.py +0 -0
  43. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/reforms/add_new_tax.py +0 -0
  44. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/reforms/flat_social_security_contribution.py +0 -0
  45. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/reforms/modify_social_security_taxation.py +0 -0
  46. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/reforms/removal_basic_income.py +0 -0
  47. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/situation_examples/__init__.py +0 -0
  48. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/situation_examples/couple.json +0 -0
  49. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/situation_examples/housing.json +0 -0
  50. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/situation_examples/single.json +0 -0
  51. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/tests/age.yaml +0 -0
  52. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/tests/basic_income.yaml +0 -0
  53. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/tests/disposable_income.yaml +0 -0
  54. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/tests/housing_allowance.yaml +0 -0
  55. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/tests/housing_tax.yaml +0 -0
  56. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/tests/income_tax.yaml +0 -0
  57. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/tests/reforms/add_dynamic_variable.yaml +0 -0
  58. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/tests/reforms/add_new_tax.yaml +0 -0
  59. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/tests/reforms/modify_social_security_taxation.yaml +0 -0
  60. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/tests/situations/income_tax.yaml +0 -0
  61. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/tests/situations/parenting_allowance.yaml +0 -0
  62. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/tests/social_security_contribution.yaml +0 -0
  63. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/tests/test_microsimulation.py +0 -0
  64. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/variables/__init__.py +0 -0
  65. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/variables/benefits.py +0 -0
  66. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/variables/demographics.py +0 -0
  67. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/variables/housing.py +0 -0
  68. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/variables/ids.py +0 -0
  69. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/variables/income.py +0 -0
  70. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/variables/stats.py +0 -0
  71. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/country_template/variables/taxes.py +0 -0
  72. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/data/__init__.py +0 -0
  73. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/data_storage/__init__.py +0 -0
  74. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/data_storage/in_memory_storage.py +0 -0
  75. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/data_storage/on_disk_storage.py +0 -0
  76. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/data_structures/__init__.py +0 -0
  77. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/data_structures/parameter_metadata.py +0 -0
  78. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/data_structures/parameter_node_metadata.py +0 -0
  79. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/data_structures/reference.py +0 -0
  80. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/data_structures/unit.py +0 -0
  81. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/entities/__init__.py +0 -0
  82. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/entities/entity.py +0 -0
  83. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/entities/group_entity.py +0 -0
  84. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/entities/helpers.py +0 -0
  85. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/entities/role.py +0 -0
  86. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/enums/__init__.py +0 -0
  87. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/enums/config.py +0 -0
  88. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/enums/enum_array.py +0 -0
  89. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/errors/__init__.py +0 -0
  90. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/errors/cycle_error.py +0 -0
  91. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/errors/empty_argument_error.py +0 -0
  92. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/errors/nan_creation_error.py +0 -0
  93. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/errors/parameter_not_found_error.py +0 -0
  94. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/errors/parameter_parsing_error.py +0 -0
  95. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/errors/period_mismatch_error.py +0 -0
  96. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/errors/situation_parsing_error.py +0 -0
  97. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/errors/spiral_error.py +0 -0
  98. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/errors/variable_name_conflict_error.py +0 -0
  99. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/errors/variable_not_found_error.py +0 -0
  100. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/experimental/__init__.py +0 -0
  101. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/experimental/memory_config.py +0 -0
  102. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/extension_template/__init__.py +0 -0
  103. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/extension_template/local_benefit.py +0 -0
  104. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/extension_template/parameters/local_town/child_allowance/amount.yaml +0 -0
  105. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/extension_template/parameters/local_town/child_allowance/index.yaml +0 -0
  106. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/extension_template/parameters/local_town/index.yaml +0 -0
  107. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/extension_template/tests/local_benefit.yaml +0 -0
  108. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/holders/__init__.py +0 -0
  109. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/holders/helpers.py +0 -0
  110. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/holders/holder.py +0 -0
  111. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/model_api.py +0 -0
  112. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/__init__.py +0 -0
  113. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/at_instant_like.py +0 -0
  114. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/config.py +0 -0
  115. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/helpers.py +0 -0
  116. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/operations/__init__.py +0 -0
  117. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/operations/get_parameter.py +0 -0
  118. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/operations/homogenize_parameters.py +0 -0
  119. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/operations/interpolate_parameters.py +0 -0
  120. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/operations/propagate_parameter_metadata.py +0 -0
  121. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/operations/uprate_parameters.py +0 -0
  122. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/parameter_at_instant.py +0 -0
  123. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/parameter_node.py +0 -0
  124. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/parameter_node_at_instant.py +0 -0
  125. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/parameter_scale.py +0 -0
  126. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/parameter_scale_bracket.py +0 -0
  127. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/parameters/vectorial_parameter_node_at_instant.py +0 -0
  128. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/periods/__init__.py +0 -0
  129. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/periods/config.py +0 -0
  130. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/periods/helpers.py +0 -0
  131. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/periods/instant_.py +0 -0
  132. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/periods/period_.py +0 -0
  133. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/populations/__init__.py +0 -0
  134. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/populations/config.py +0 -0
  135. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/projectors/__init__.py +0 -0
  136. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/projectors/entity_to_person_projector.py +0 -0
  137. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/projectors/first_person_to_entity_projector.py +0 -0
  138. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/projectors/helpers.py +0 -0
  139. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/projectors/projector.py +0 -0
  140. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/projectors/unique_role_to_entity_projector.py +0 -0
  141. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/reforms/__init__.py +0 -0
  142. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/reforms/reform.py +0 -0
  143. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/scripts/__init__.py +0 -0
  144. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/scripts/assets/__init__.py +0 -0
  145. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/scripts/assets/index.html +0 -0
  146. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/scripts/policyengine_command.py +0 -0
  147. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/scripts/run_data.py +0 -0
  148. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/scripts/run_test.py +0 -0
  149. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/scripts/simulation_generator.py +0 -0
  150. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/simulations/__init__.py +0 -0
  151. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/simulations/helpers.py +0 -0
  152. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/simulations/individual_sim.py +0 -0
  153. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/simulations/simulation_builder.py +0 -0
  154. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/taxbenefitsystems/__init__.py +0 -0
  155. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/taxbenefitsystems/tax_benefit_system.py +0 -0
  156. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/taxscales/__init__.py +0 -0
  157. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/taxscales/abstract_rate_tax_scale.py +0 -0
  158. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/taxscales/abstract_tax_scale.py +0 -0
  159. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/taxscales/amount_tax_scale_like.py +0 -0
  160. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/taxscales/helpers.py +0 -0
  161. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/taxscales/linear_average_rate_tax_scale.py +0 -0
  162. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/taxscales/marginal_amount_tax_scale.py +0 -0
  163. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/taxscales/marginal_rate_tax_scale.py +0 -0
  164. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/taxscales/rate_tax_scale_like.py +0 -0
  165. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/taxscales/single_amount_tax_scale.py +0 -0
  166. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/taxscales/tax_scale_like.py +0 -0
  167. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/tools/__init__.py +0 -0
  168. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/tools/simulation_dumper.py +0 -0
  169. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/tools/test_from_situation.py +0 -0
  170. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/tools/test_runner.py +0 -0
  171. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/tracers/__init__.py +0 -0
  172. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/tracers/computation_log.py +0 -0
  173. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/tracers/flat_trace.py +0 -0
  174. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/tracers/full_tracer.py +0 -0
  175. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/tracers/performance_log.py +0 -0
  176. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/tracers/simple_tracer.py +0 -0
  177. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/tracers/trace_node.py +0 -0
  178. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/tracers/tracing_parameter_node_at_instant.py +0 -0
  179. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/tracers/variable_graph.py +0 -0
  180. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/types/__init__.py +0 -0
  181. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/types/data_types/__init__.py +0 -0
  182. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/types/data_types/arrays.py +0 -0
  183. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/variables/__init__.py +0 -0
  184. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/variables/config.py +0 -0
  185. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/variables/defined_for.py +0 -0
  186. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/variables/helpers.py +0 -0
  187. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/variables/typing.py +0 -0
  188. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/variables/variable.py +0 -0
  189. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/warnings/__init__.py +0 -0
  190. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/warnings/libyaml_warning.py +0 -0
  191. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/warnings/memory_config_warning.py +0 -0
  192. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/warnings/tempfile_warning.py +0 -0
  193. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/weighting/__init__.py +0 -0
  194. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core/weighting/microdf.py +0 -0
  195. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core.egg-info/SOURCES.txt +0 -0
  196. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core.egg-info/dependency_links.txt +0 -0
  197. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core.egg-info/entry_points.txt +0 -0
  198. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/policyengine_core.egg-info/top_level.txt +0 -0
  199. {policyengine_core-3.2.0 → policyengine_core-3.3.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: policyengine-core
3
- Version: 3.2.0
3
+ Version: 3.3.0
4
4
  Summary: Core microsimulation engine enabling country-specific policy models.
5
5
  Home-page: https://github.com/policyengine/policyengine-core
6
6
  Author: PolicyEngine
@@ -32,8 +32,6 @@ Requires-Dist: nptyping<2
32
32
  Requires-Dist: psutil<6
33
33
  Requires-Dist: wheel<1
34
34
  Requires-Dist: h5py<4,>=3
35
- Requires-Dist: microdf_python<1,>=0.3.0
36
- Requires-Dist: tqdm<5,>=4.46.0
37
35
  Requires-Dist: requests<3,>=2.27.1
38
36
  Requires-Dist: pandas>=1
39
37
  Requires-Dist: plotly<6,>=5.6.0
@@ -1,7 +1,7 @@
1
1
  import pandas as pd
2
2
  from .formatting import *
3
3
  import plotly.express as px
4
- from microdf import MicroSeries
4
+ from policyengine_core.weighting import MicroSeries
5
5
  from typing import Callable
6
6
  import numpy as np
7
7
 
@@ -371,17 +371,16 @@ class Dataset:
371
371
  Returns:
372
372
  Dataset: The dataset.
373
373
  """
374
- file_path = Path(file_path)
375
374
  dataset = type(
376
375
  "Dataset",
377
376
  (Dataset,),
378
377
  {
379
- "name": file_path.stem,
380
- "label": file_path.stem,
378
+ "name": "dataframe",
379
+ "label": "DataFrame",
381
380
  "data_format": Dataset.FLAT_FILE,
382
381
  "file_path": "dataframe",
383
382
  "time_period": time_period,
384
- "load": lambda: dataframe,
383
+ "load": lambda self: dataframe,
385
384
  },
386
385
  )()
387
386
 
@@ -53,10 +53,11 @@ class Enum(enum.Enum):
53
53
  # Confusingly, Numpy uses "S" to refer to byte-string arrays
54
54
  # and "U" to refer to Unicode-string arrays, which are also
55
55
  # referred to as the "str" type
56
- if array.dtype.kind == "S":
56
+ if isinstance(array[0], Enum):
57
+ array = np.array([item.name for item in array])
58
+ if array.dtype.kind == "S" or array.dtype == object:
57
59
  # Convert boolean array to string array
58
60
  array = array.astype(str)
59
-
60
61
  if isinstance(array, np.ndarray) and array.dtype.kind in {"U", "S"}:
61
62
  # String array
62
63
  indices = np.select(
@@ -224,3 +224,12 @@ class Parameter(AtInstantLike):
224
224
  if value_at_instant.instant_str <= instant:
225
225
  return value_at_instant.value
226
226
  return None
227
+
228
+ def relative_change(self, start_instant, end_instant):
229
+ start_instant = str(start_instant)
230
+ end_instant = str(end_instant)
231
+ end_value = self._get_at_instant(end_instant)
232
+ start_value = self._get_at_instant(start_instant)
233
+ if end_value is None or start_value is None:
234
+ return None
235
+ return end_value / start_value - 1
@@ -7,6 +7,8 @@ from policyengine_core import projectors
7
7
  from policyengine_core.entities import Entity, Role
8
8
  from policyengine_core.enums import EnumArray
9
9
  from policyengine_core.populations.population import Population
10
+ from policyengine_core.periods.period_ import Period
11
+ from typing import Optional, Container
10
12
 
11
13
  if TYPE_CHECKING:
12
14
  from policyengine_core.simulations import Simulation
@@ -21,6 +23,20 @@ class GroupPopulation(Population):
21
23
  self._members_position: ArrayLike = None
22
24
  self._ordered_members_map = None
23
25
 
26
+ def __call__(
27
+ self,
28
+ variable_name: str,
29
+ period: Period = None,
30
+ options: Optional[Container[str]] = None,
31
+ ):
32
+ variable = self.simulation.tax_benefit_system.variables.get(
33
+ variable_name
34
+ )
35
+ if variable.entity.is_person:
36
+ return self.sum(self.members(variable_name, period, options))
37
+ else:
38
+ return super().__call__(variable_name, period, options)
39
+
24
40
  def clone(
25
41
  self, simulation: "Simulation", members: Population
26
42
  ) -> "GroupPopulation":
@@ -34,6 +34,9 @@ class Population:
34
34
  result.ids = self.ids
35
35
  return result
36
36
 
37
+ def has_any_input(self, variable_name: str) -> bool:
38
+ return len(self.get_holder(variable_name).get_known_periods()) > 0
39
+
37
40
  def empty_array(self) -> numpy.ndarray:
38
41
  return numpy.zeros(self.count)
39
42
 
@@ -1,6 +1,6 @@
1
1
  from typing import Dict, Type
2
2
 
3
- from microdf import MicroDataFrame, MicroSeries
3
+ from policyengine_core.weighting import MicroDataFrame, MicroSeries
4
4
  import numpy as np
5
5
  from policyengine_core.data.dataset import Dataset
6
6
  from policyengine_core.periods import Period
@@ -76,6 +76,9 @@ class Simulation:
76
76
  macro_cache_write: bool = True
77
77
  """Whether to write to the macro cache."""
78
78
 
79
+ start_instant: str = None
80
+ """The earliest data input instant of the simulation."""
81
+
79
82
  def __init__(
80
83
  self,
81
84
  tax_benefit_system: "TaxBenefitSystem" = None,
@@ -155,6 +158,10 @@ class Simulation:
155
158
  )
156
159
  if isinstance(dataset, type):
157
160
  self.dataset: Dataset = dataset(require=True)
161
+ elif isinstance(dataset, pd.DataFrame):
162
+ self.dataset = Dataset.from_dataframe(
163
+ dataset, self.default_input_period
164
+ )
158
165
  else:
159
166
  self.dataset = dataset
160
167
  self.build_from_dataset()
@@ -242,6 +249,9 @@ class Simulation:
242
249
  + "Make sure you have downloaded or built it using the `policyengine-core data` command."
243
250
  ) from e
244
251
 
252
+ if self.dataset.data_format == Dataset.FLAT_FILE:
253
+ data = {col: data[col].values for col in data.columns}
254
+
245
255
  person_entity = self.tax_benefit_system.person_entity
246
256
  entity_id_field = f"{person_entity.key}_id"
247
257
  if self.dataset.data_format != Dataset.FLAT_FILE:
@@ -250,14 +260,11 @@ class Simulation:
250
260
  ), f"Missing {entity_id_field} column in the dataset. Each person entity must have an ID array defined for ETERNITY."
251
261
  elif entity_id_field not in data:
252
262
  data[entity_id_field] = np.arange(len(data))
253
- if self.dataset.data_format != Dataset.FLAT_FILE:
254
- get_eternity_array = lambda ds: (
255
- ds[list(ds.keys())[0]]
256
- if self.dataset.data_format == Dataset.TIME_PERIOD_ARRAYS
257
- else ds
258
- )
259
- else:
260
- get_eternity_array = lambda ds: ds
263
+ get_eternity_array = lambda ds: (
264
+ ds[list(ds.keys())[0]]
265
+ if self.dataset.data_format == Dataset.TIME_PERIOD_ARRAYS
266
+ else ds
267
+ )
261
268
  entity_ids = get_eternity_array(data[entity_id_field])
262
269
  builder.declare_person_entity(person_entity.key, entity_ids)
263
270
 
@@ -268,7 +275,12 @@ class Simulation:
268
275
  entity_id_field in data
269
276
  ), f"Missing {entity_id_field} column in the dataset. Each group entity must have an ID array defined for ETERNITY."
270
277
  elif entity_id_field not in data:
271
- data[entity_id_field] = np.arange(len(data))
278
+ if f"person_{group_entity.key}_id" in data:
279
+ data[entity_id_field] = np.arange(
280
+ len(np.unique(data[f"person_{group_entity.key}_id"]))
281
+ )
282
+ else:
283
+ data[entity_id_field] = np.arange(len(data))
272
284
 
273
285
  entity_ids = get_eternity_array(data[entity_id_field])
274
286
  builder.declare_entity(group_entity.key, entity_ids)
@@ -333,9 +345,6 @@ class Simulation:
333
345
  )
334
346
 
335
347
  if variable_name not in self.tax_benefit_system.variables:
336
- logging.warn(
337
- f"Variable {variable_name} not found. Skipping."
338
- )
339
348
  continue
340
349
 
341
350
  variable_meta = self.tax_benefit_system.get_variable(
@@ -355,7 +364,9 @@ class Simulation:
355
364
 
356
365
  self.set_input(variable, time_period, entity_level_data)
357
366
 
358
- self.default_calculation_period = self.dataset.time_period
367
+ self.default_calculation_period = (
368
+ self.dataset.time_period or self.default_calculation_period
369
+ )
359
370
 
360
371
  self.tax_benefit_system.data_modified = False
361
372
 
@@ -684,6 +695,8 @@ class Simulation:
684
695
  ):
685
696
  # Variables with a calculate-output property specify
686
697
  last_known_period = sorted(known_periods)[-1]
698
+ if last_known_period.start > period.start:
699
+ return holder.default_array()
687
700
  array = holder.get_array(last_known_period)
688
701
  else:
689
702
  array = holder.default_array()
@@ -1139,10 +1152,12 @@ class Simulation:
1139
1152
 
1140
1153
  If a ``set_input`` property has been set for the variable, this method may accept inputs for periods not matching the ``definition_period`` of the variable. To read more about this, check the `documentation <https://openfisca.org/doc/coding-the-legislation/35_periods.html#automatically-process-variable-inputs-defined-for-periods-not-matching-the-definitionperiod>`_.
1141
1154
  """
1155
+ period = periods.period(period)
1156
+ if self.start_instant is None or self.start_instant > period.start:
1157
+ self.start_instant = period.start
1142
1158
  variable = self.tax_benefit_system.get_variable(
1143
1159
  variable_name, check_existence=True
1144
1160
  )
1145
- period = periods.period(period)
1146
1161
  if (variable.end is not None) and (period.start.date > variable.end):
1147
1162
  return
1148
1163
  self.get_holder(variable_name).set_input(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: policyengine-core
3
- Version: 3.2.0
3
+ Version: 3.3.0
4
4
  Summary: Core microsimulation engine enabling country-specific policy models.
5
5
  Home-page: https://github.com/policyengine/policyengine-core
6
6
  Author: PolicyEngine
@@ -32,8 +32,6 @@ Requires-Dist: nptyping<2
32
32
  Requires-Dist: psutil<6
33
33
  Requires-Dist: wheel<1
34
34
  Requires-Dist: h5py<4,>=3
35
- Requires-Dist: microdf_python<1,>=0.3.0
36
- Requires-Dist: tqdm<5,>=4.46.0
37
35
  Requires-Dist: requests<3,>=2.27.1
38
36
  Requires-Dist: pandas>=1
39
37
  Requires-Dist: plotly<6,>=5.6.0
@@ -11,8 +11,6 @@ nptyping<2
11
11
  psutil<6
12
12
  wheel<1
13
13
  h5py<4,>=3
14
- microdf_python<1,>=0.3.0
15
- tqdm<5,>=4.46.0
16
14
  requests<3,>=2.27.1
17
15
  pandas>=1
18
16
  plotly<6,>=5.6.0
@@ -23,8 +23,6 @@ general_requirements = [
23
23
  "psutil<6",
24
24
  "wheel<1",
25
25
  "h5py>=3,<4",
26
- "microdf_python>=0.3.0,<1",
27
- "tqdm>=4.46.0,<5",
28
26
  "requests>=2.27.1,<3",
29
27
  "pandas>=1",
30
28
  "plotly>=5.6.0,<6",
@@ -50,7 +48,7 @@ dev_requirements = [
50
48
 
51
49
  setup(
52
50
  name="policyengine-core",
53
- version="3.2.0",
51
+ version="3.3.0",
54
52
  author="PolicyEngine",
55
53
  author_email="hello@policyengine.org",
56
54
  classifiers=[