OpenFisca-Core 44.7.1__tar.gz → 45.0.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.
Files changed (201) hide show
  1. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/CHANGELOG.md +15 -3
  2. {openfisca_core-44.7.1 → openfisca_core-45.0.1/OpenFisca_Core.egg-info}/PKG-INFO +1 -27
  3. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/OpenFisca_Core.egg-info/SOURCES.txt +0 -1
  4. {openfisca_core-44.7.1/OpenFisca_Core.egg-info → openfisca_core-45.0.1}/PKG-INFO +1 -27
  5. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/README.md +0 -26
  6. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/reforms/in_yaml_test_reform.py +1 -1
  7. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/setup.py +1 -2
  8. openfisca_core-44.7.1/openfisca_core/reforms/reform_excel.py +0 -235
  9. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/LICENSE +0 -0
  10. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/MANIFEST.in +0 -0
  11. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/OpenFisca_Core.egg-info/dependency_links.txt +0 -0
  12. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/OpenFisca_Core.egg-info/entry_points.txt +0 -0
  13. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/OpenFisca_Core.egg-info/requires.txt +0 -0
  14. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/OpenFisca_Core.egg-info/top_level.txt +0 -0
  15. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/__init__.py +0 -0
  16. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/commons/__init__.py +0 -0
  17. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/commons/dummy.py +0 -0
  18. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/commons/formulas.py +0 -0
  19. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/commons/misc.py +0 -0
  20. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/commons/py.typed +0 -0
  21. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/commons/rates.py +0 -0
  22. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/commons/tests/__init__.py +0 -0
  23. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/commons/tests/test_dummy.py +0 -0
  24. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/commons/tests/test_formulas.py +0 -0
  25. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/commons/tests/test_rates.py +0 -0
  26. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/data_storage/__init__.py +0 -0
  27. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/data_storage/in_memory_storage.py +0 -0
  28. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/data_storage/on_disk_storage.py +0 -0
  29. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/data_storage/types.py +0 -0
  30. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/entities/__init__.py +0 -0
  31. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/entities/_core_entity.py +0 -0
  32. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/entities/_description.py +0 -0
  33. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/entities/entity.py +0 -0
  34. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/entities/group_entity.py +0 -0
  35. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/entities/helpers.py +0 -0
  36. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/entities/py.typed +0 -0
  37. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/entities/role.py +0 -0
  38. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/entities/tests/__init__.py +0 -0
  39. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/entities/tests/test_entity.py +0 -0
  40. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/entities/tests/test_group_entity.py +0 -0
  41. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/entities/tests/test_role.py +0 -0
  42. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/entities/types.py +0 -0
  43. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/errors/__init__.py +0 -0
  44. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/errors/cycle_error.py +0 -0
  45. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/errors/empty_argument_error.py +0 -0
  46. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/errors/nan_creation_error.py +0 -0
  47. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/errors/parameter_not_found_error.py +0 -0
  48. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/errors/parameter_parsing_error.py +0 -0
  49. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/errors/period_mismatch_error.py +0 -0
  50. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/errors/situation_parsing_error.py +0 -0
  51. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/errors/spiral_error.py +0 -0
  52. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/errors/variable_name_config_error.py +0 -0
  53. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/errors/variable_not_found_error.py +0 -0
  54. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/experimental/__init__.py +0 -0
  55. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/experimental/_errors.py +0 -0
  56. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/experimental/_memory_config.py +0 -0
  57. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/formula_helpers.py +0 -0
  58. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/holders/__init__.py +0 -0
  59. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/holders/helpers.py +0 -0
  60. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/holders/holder.py +0 -0
  61. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/holders/tests/__init__.py +0 -0
  62. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/holders/tests/test_helpers.py +0 -0
  63. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/holders/types.py +0 -0
  64. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/indexed_enums/__init__.py +0 -0
  65. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/indexed_enums/_enum_type.py +0 -0
  66. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/indexed_enums/_errors.py +0 -0
  67. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/indexed_enums/_guards.py +0 -0
  68. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/indexed_enums/_utils.py +0 -0
  69. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/indexed_enums/config.py +0 -0
  70. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/indexed_enums/enum.py +0 -0
  71. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/indexed_enums/enum_array.py +0 -0
  72. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/indexed_enums/py.typed +0 -0
  73. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/indexed_enums/tests/__init__.py +0 -0
  74. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/indexed_enums/tests/test_enum.py +0 -0
  75. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/indexed_enums/tests/test_enum_array.py +0 -0
  76. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/indexed_enums/types.py +0 -0
  77. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/memory_config.py +0 -0
  78. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/model_api.py +0 -0
  79. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/parameters/__init__.py +0 -0
  80. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/parameters/at_instant_like.py +0 -0
  81. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/parameters/config.py +0 -0
  82. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/parameters/helpers.py +0 -0
  83. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/parameters/parameter.py +0 -0
  84. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/parameters/parameter_at_instant.py +0 -0
  85. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/parameters/parameter_node.py +0 -0
  86. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/parameters/parameter_node_at_instant.py +0 -0
  87. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/parameters/parameter_scale.py +0 -0
  88. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/parameters/parameter_scale_bracket.py +0 -0
  89. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/parameters/values_history.py +0 -0
  90. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/parameters/vectorial_parameter_node_at_instant.py +0 -0
  91. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/__init__.py +0 -0
  92. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/_errors.py +0 -0
  93. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/_parsers.py +0 -0
  94. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/config.py +0 -0
  95. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/date_unit.py +0 -0
  96. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/helpers.py +0 -0
  97. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/instant_.py +0 -0
  98. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/period_.py +0 -0
  99. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/py.typed +0 -0
  100. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/tests/__init__.py +0 -0
  101. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/tests/helpers/__init__.py +0 -0
  102. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/tests/helpers/test_helpers.py +0 -0
  103. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/tests/helpers/test_instant.py +0 -0
  104. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/tests/helpers/test_period.py +0 -0
  105. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/tests/test_instant.py +0 -0
  106. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/tests/test_parsers.py +0 -0
  107. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/periods/tests/test_period.py +0 -0
  108. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/populations/__init__.py +0 -0
  109. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/populations/_core_population.py +0 -0
  110. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/populations/_errors.py +0 -0
  111. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/populations/group_population.py +0 -0
  112. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/populations/population.py +0 -0
  113. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/populations/tests/__init__.py +0 -0
  114. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/populations/tests/test_members_position.py +0 -0
  115. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/populations/types.py +0 -0
  116. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/projectors/__init__.py +0 -0
  117. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/projectors/entity_to_person_projector.py +0 -0
  118. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/projectors/first_person_to_entity_projector.py +0 -0
  119. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/projectors/helpers.py +0 -0
  120. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/projectors/projector.py +0 -0
  121. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/projectors/typing.py +0 -0
  122. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/projectors/unique_role_to_entity_projector.py +0 -0
  123. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/rates.py +0 -0
  124. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/reforms/__init__.py +0 -0
  125. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/reforms/reform.py +0 -0
  126. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/__init__.py +0 -0
  127. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/assets/__init__.py +0 -0
  128. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/assets/index.html +0 -0
  129. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/find_placeholders.py +0 -0
  130. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/measure_numpy_condition_notations.py +0 -0
  131. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/measure_performances.py +0 -0
  132. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/measure_performances_fancy_indexing.py +0 -0
  133. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/migrations/__init__.py +0 -0
  134. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/migrations/v16_2_to_v17/__init__.py +0 -0
  135. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/migrations/v16_2_to_v17/legislation.xsd +0 -0
  136. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/migrations/v16_2_to_v17/xml_to_yaml_country_template.py +0 -0
  137. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/migrations/v16_2_to_v17/xml_to_yaml_extension_template.py +0 -0
  138. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/migrations/v24_to_25.py +0 -0
  139. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/openfisca_command.py +0 -0
  140. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/remove_fuzzy.py +0 -0
  141. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/run_test.py +0 -0
  142. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/scripts/simulation_generator.py +0 -0
  143. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/simulation_builder.py +0 -0
  144. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/simulations/__init__.py +0 -0
  145. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/simulations/_build_default_simulation.py +0 -0
  146. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/simulations/_build_from_variables.py +0 -0
  147. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/simulations/_type_guards.py +0 -0
  148. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/simulations/helpers.py +0 -0
  149. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/simulations/simulation.py +0 -0
  150. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/simulations/simulation_builder.py +0 -0
  151. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/simulations/typing.py +0 -0
  152. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/taxbenefitsystems/__init__.py +0 -0
  153. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/taxbenefitsystems/tax_benefit_system.py +0 -0
  154. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/taxscales/__init__.py +0 -0
  155. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/taxscales/abstract_rate_tax_scale.py +0 -0
  156. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/taxscales/abstract_tax_scale.py +0 -0
  157. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/taxscales/amount_tax_scale_like.py +0 -0
  158. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/taxscales/helpers.py +0 -0
  159. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/taxscales/linear_average_rate_tax_scale.py +0 -0
  160. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/taxscales/marginal_amount_tax_scale.py +0 -0
  161. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/taxscales/marginal_rate_tax_scale.py +0 -0
  162. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/taxscales/rate_tax_scale_like.py +0 -0
  163. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/taxscales/single_amount_tax_scale.py +0 -0
  164. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/taxscales/tax_scale_like.py +0 -0
  165. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/tools/__init__.py +0 -0
  166. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/tools/parallel_plugin.py +0 -0
  167. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/tools/simulation_dumper.py +0 -0
  168. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/tools/test_runner.py +0 -0
  169. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/tracers/__init__.py +0 -0
  170. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/tracers/computation_log.py +0 -0
  171. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/tracers/flat_trace.py +0 -0
  172. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/tracers/full_tracer.py +0 -0
  173. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/tracers/performance_log.py +0 -0
  174. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/tracers/simple_tracer.py +0 -0
  175. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/tracers/trace_node.py +0 -0
  176. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/tracers/tracing_parameter_node_at_instant.py +0 -0
  177. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/types.py +0 -0
  178. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/variables/__init__.py +0 -0
  179. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/variables/config.py +0 -0
  180. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/variables/helpers.py +0 -0
  181. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/variables/tests/__init__.py +0 -0
  182. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/variables/tests/test_definition_period.py +0 -0
  183. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/variables/variable.py +0 -0
  184. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/warnings/__init__.py +0 -0
  185. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/warnings/libyaml_warning.py +0 -0
  186. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_core/warnings/tempfile_warning.py +0 -0
  187. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_web_api/__init__.py +0 -0
  188. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_web_api/app.py +0 -0
  189. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_web_api/errors.py +0 -0
  190. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_web_api/handlers.py +0 -0
  191. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_web_api/loader/__init__.py +0 -0
  192. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_web_api/loader/entities.py +0 -0
  193. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_web_api/loader/parameters.py +0 -0
  194. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_web_api/loader/spec.py +0 -0
  195. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_web_api/loader/tax_benefit_system.py +0 -0
  196. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_web_api/loader/variables.py +0 -0
  197. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_web_api/openAPI.yml +0 -0
  198. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_web_api/scripts/__init__.py +0 -0
  199. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/openfisca_web_api/scripts/serve.py +0 -0
  200. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/pyproject.toml +0 -0
  201. {openfisca_core-44.7.1 → openfisca_core-45.0.1}/setup.cfg +0 -0
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ### 45.0.1 [#1393](https://github.com/openfisca/openfisca-core/pull/1393)
4
+
5
+ #### Technical changes
6
+
7
+ - Remove Conda support
8
+
9
+ # 45.0.0 [#1393](https://github.com/openfisca/openfisca-core/pull/1393)
10
+
11
+ #### Breaking changes
12
+
13
+ - Move `ReformExcel*` from OpenFisca-Core to `ExcelReform*` in a dedicated package [openfisca-excel-reform](https://pypi.org/project/openfisca-excel-reform/)
14
+
3
15
  ## 44.7.1 [#1383](https://github.com/openfisca/openfisca-core/pull/1383)
4
16
 
5
17
  #### Bug fixes
@@ -15,7 +27,7 @@
15
27
 
16
28
  - Manage list parameter in Excel reform
17
29
 
18
- ## 44.6.0
30
+ ## 44.6.0 [#1374](https://github.com/openfisca/openfisca-core/pull/1374)
19
31
 
20
32
  #### Technical changes
21
33
 
@@ -23,7 +35,7 @@
23
35
  - Mark versions `44.3.0`, `44.4.0`, `44.4.1`, and `44.5.0` as yanked.
24
36
  - Bump version to `44.6.0` to restore continuous deployment from this reverted baseline.
25
37
 
26
- ## 44.2.2
38
+ ## 44.2.2 [#1361](https://github.com/openfisca/openfisca-core/pull/1361)
27
39
 
28
40
  #### Bug fixes
29
41
 
@@ -35,7 +47,7 @@
35
47
 
36
48
  - Add a check for creating a simulation when building a test
37
49
 
38
- ## 44.2.0
50
+ ## 44.2.0 [#1358](https://github.com/openfisca/openfisca-core/pull/1358)
39
51
 
40
52
  #### New features
41
53
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: OpenFisca-Core
3
- Version: 44.7.1
3
+ Version: 45.0.1
4
4
  Summary: A versatile microsimulation free software
5
5
  Home-page: https://github.com/openfisca/openfisca-core
6
6
  Author: OpenFisca Team
@@ -83,8 +83,6 @@ Dynamic: summary
83
83
 
84
84
  [![PyPi Downloads](https://img.shields.io/pypi/dm/openfisca-core?label=pypi%2Fdownloads&style=for-the-badge)](https://pepy.tech/project/openfisca-core)
85
85
  [![PyPi Version](https://img.shields.io/pypi/v/openfisca-core.svg?label=pypi%2Fversion&style=for-the-badge)](https://pypi.python.org/pypi/openfisca-core)
86
- [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/openfisca-core?label=conda%2Fdownloads&style=for-the-badge)](https://anaconda.org/conda-forge/openfisca-core)
87
- [![Conda Version](https://img.shields.io/conda/vn/conda-forge/openfisca-core.svg?label=conda%2Fversion&style=for-the-badge)](https://anaconda.org/conda-forge/openfisca-core)
88
86
 
89
87
  [![Python](https://img.shields.io/pypi/pyversions/openfisca-core.svg?label=python&style=for-the-badge)](https://pypi.python.org/pypi/openfisca-core)
90
88
  [![Contributors](https://img.shields.io/github/contributors/openfisca/openfisca-core.svg?style=for-the-badge)](https://github.com/openfisca/openfisca-core/graphs/contributors)
@@ -108,7 +106,6 @@ OpenFisca also relies strongly on NumPy. The last four minor versions should wor
108
106
  If you're developing your own country package, you don't need to explicitly install OpenFisca-Core. It just needs to appear [in your package dependencies](https://github.com/openfisca/openfisca-france/blob/100.0.0/setup.py#L60).
109
107
  If you want to contribute to OpenFisca-Core itself, welcome!
110
108
  To install it locally you can use one of these two options:
111
- * [conda](https://docs.conda.io/en/latest/) package manager that we recommend for Windows operating system users,
112
109
  * or standard Python [pip](https://packaging.python.org/en/latest/key_projects/#pip) package manager.
113
110
 
114
111
  ### Installing `openfisca-core` with `pip`
@@ -125,29 +122,6 @@ source .venv/bin/activate
125
122
  make install-deps install-edit
126
123
  ```
127
124
 
128
- ### Installing `openfisca-core` with `conda`
129
-
130
- Since `openfisca-core` version [35.7.7](https://anaconda.org/conda-forge/openfisca-core), you could use `conda` to install OpenFisca-Core.
131
-
132
- Conda is the easiest way to use OpenFisca under Windows as by installing Anaconda you will get:
133
- - Python
134
- - The package manager [Anaconda.org](https://docs.anaconda.com/anacondaorg/user-guide/)
135
- - A virtual environment manager : [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
136
- - A GUI [Anaconda Navigator](https://docs.anaconda.com/anaconda/navigator/index.html) if you choose to install the full [Anaconda](https://www.anaconda.com/products/individual)
137
-
138
- If you are familiar with the command line you could use [Miniconda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/windows.html), which needs very much less disk space than Anaconda.
139
-
140
- After installing conda, run these commands in an `Anaconda Powershell Prompt`:
141
- - `conda create --name openfisca python=3.11` to create an `openfisca` environment.
142
- - `conda activate openfisca` to use your new environment.
143
-
144
- Then, choose one of the following options according to your use case:
145
- - `conda install -c conda-forge openfisca-core` for default dependencies,
146
- - or `conda install -c conda-forge openfisca-core-api` if you want the Web API part,
147
- - or `conda install -c conda-forge -c openfisca openfisca-core-dev` if you want all the dependencies needed to contribute to the project.
148
-
149
- For information on how we publish to conda-forge, see [openfisca-core-feedstock](https://github.com/openfisca/openfisca-core-feedstock/blob/master/recipe/README.md).
150
-
151
125
  ## Testing
152
126
 
153
127
  Install the test dependencies:
@@ -125,7 +125,6 @@ openfisca_core/projectors/unique_role_to_entity_projector.py
125
125
  openfisca_core/reforms/__init__.py
126
126
  openfisca_core/reforms/in_yaml_test_reform.py
127
127
  openfisca_core/reforms/reform.py
128
- openfisca_core/reforms/reform_excel.py
129
128
  openfisca_core/scripts/__init__.py
130
129
  openfisca_core/scripts/find_placeholders.py
131
130
  openfisca_core/scripts/measure_numpy_condition_notations.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: OpenFisca-Core
3
- Version: 44.7.1
3
+ Version: 45.0.1
4
4
  Summary: A versatile microsimulation free software
5
5
  Home-page: https://github.com/openfisca/openfisca-core
6
6
  Author: OpenFisca Team
@@ -83,8 +83,6 @@ Dynamic: summary
83
83
 
84
84
  [![PyPi Downloads](https://img.shields.io/pypi/dm/openfisca-core?label=pypi%2Fdownloads&style=for-the-badge)](https://pepy.tech/project/openfisca-core)
85
85
  [![PyPi Version](https://img.shields.io/pypi/v/openfisca-core.svg?label=pypi%2Fversion&style=for-the-badge)](https://pypi.python.org/pypi/openfisca-core)
86
- [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/openfisca-core?label=conda%2Fdownloads&style=for-the-badge)](https://anaconda.org/conda-forge/openfisca-core)
87
- [![Conda Version](https://img.shields.io/conda/vn/conda-forge/openfisca-core.svg?label=conda%2Fversion&style=for-the-badge)](https://anaconda.org/conda-forge/openfisca-core)
88
86
 
89
87
  [![Python](https://img.shields.io/pypi/pyversions/openfisca-core.svg?label=python&style=for-the-badge)](https://pypi.python.org/pypi/openfisca-core)
90
88
  [![Contributors](https://img.shields.io/github/contributors/openfisca/openfisca-core.svg?style=for-the-badge)](https://github.com/openfisca/openfisca-core/graphs/contributors)
@@ -108,7 +106,6 @@ OpenFisca also relies strongly on NumPy. The last four minor versions should wor
108
106
  If you're developing your own country package, you don't need to explicitly install OpenFisca-Core. It just needs to appear [in your package dependencies](https://github.com/openfisca/openfisca-france/blob/100.0.0/setup.py#L60).
109
107
  If you want to contribute to OpenFisca-Core itself, welcome!
110
108
  To install it locally you can use one of these two options:
111
- * [conda](https://docs.conda.io/en/latest/) package manager that we recommend for Windows operating system users,
112
109
  * or standard Python [pip](https://packaging.python.org/en/latest/key_projects/#pip) package manager.
113
110
 
114
111
  ### Installing `openfisca-core` with `pip`
@@ -125,29 +122,6 @@ source .venv/bin/activate
125
122
  make install-deps install-edit
126
123
  ```
127
124
 
128
- ### Installing `openfisca-core` with `conda`
129
-
130
- Since `openfisca-core` version [35.7.7](https://anaconda.org/conda-forge/openfisca-core), you could use `conda` to install OpenFisca-Core.
131
-
132
- Conda is the easiest way to use OpenFisca under Windows as by installing Anaconda you will get:
133
- - Python
134
- - The package manager [Anaconda.org](https://docs.anaconda.com/anacondaorg/user-guide/)
135
- - A virtual environment manager : [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
136
- - A GUI [Anaconda Navigator](https://docs.anaconda.com/anaconda/navigator/index.html) if you choose to install the full [Anaconda](https://www.anaconda.com/products/individual)
137
-
138
- If you are familiar with the command line you could use [Miniconda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/windows.html), which needs very much less disk space than Anaconda.
139
-
140
- After installing conda, run these commands in an `Anaconda Powershell Prompt`:
141
- - `conda create --name openfisca python=3.11` to create an `openfisca` environment.
142
- - `conda activate openfisca` to use your new environment.
143
-
144
- Then, choose one of the following options according to your use case:
145
- - `conda install -c conda-forge openfisca-core` for default dependencies,
146
- - or `conda install -c conda-forge openfisca-core-api` if you want the Web API part,
147
- - or `conda install -c conda-forge -c openfisca openfisca-core-dev` if you want all the dependencies needed to contribute to the project.
148
-
149
- For information on how we publish to conda-forge, see [openfisca-core-feedstock](https://github.com/openfisca/openfisca-core-feedstock/blob/master/recipe/README.md).
150
-
151
125
  ## Testing
152
126
 
153
127
  Install the test dependencies:
@@ -2,8 +2,6 @@
2
2
 
3
3
  [![PyPi Downloads](https://img.shields.io/pypi/dm/openfisca-core?label=pypi%2Fdownloads&style=for-the-badge)](https://pepy.tech/project/openfisca-core)
4
4
  [![PyPi Version](https://img.shields.io/pypi/v/openfisca-core.svg?label=pypi%2Fversion&style=for-the-badge)](https://pypi.python.org/pypi/openfisca-core)
5
- [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/openfisca-core?label=conda%2Fdownloads&style=for-the-badge)](https://anaconda.org/conda-forge/openfisca-core)
6
- [![Conda Version](https://img.shields.io/conda/vn/conda-forge/openfisca-core.svg?label=conda%2Fversion&style=for-the-badge)](https://anaconda.org/conda-forge/openfisca-core)
7
5
 
8
6
  [![Python](https://img.shields.io/pypi/pyversions/openfisca-core.svg?label=python&style=for-the-badge)](https://pypi.python.org/pypi/openfisca-core)
9
7
  [![Contributors](https://img.shields.io/github/contributors/openfisca/openfisca-core.svg?style=for-the-badge)](https://github.com/openfisca/openfisca-core/graphs/contributors)
@@ -27,7 +25,6 @@ OpenFisca also relies strongly on NumPy. The last four minor versions should wor
27
25
  If you're developing your own country package, you don't need to explicitly install OpenFisca-Core. It just needs to appear [in your package dependencies](https://github.com/openfisca/openfisca-france/blob/100.0.0/setup.py#L60).
28
26
  If you want to contribute to OpenFisca-Core itself, welcome!
29
27
  To install it locally you can use one of these two options:
30
- * [conda](https://docs.conda.io/en/latest/) package manager that we recommend for Windows operating system users,
31
28
  * or standard Python [pip](https://packaging.python.org/en/latest/key_projects/#pip) package manager.
32
29
 
33
30
  ### Installing `openfisca-core` with `pip`
@@ -44,29 +41,6 @@ source .venv/bin/activate
44
41
  make install-deps install-edit
45
42
  ```
46
43
 
47
- ### Installing `openfisca-core` with `conda`
48
-
49
- Since `openfisca-core` version [35.7.7](https://anaconda.org/conda-forge/openfisca-core), you could use `conda` to install OpenFisca-Core.
50
-
51
- Conda is the easiest way to use OpenFisca under Windows as by installing Anaconda you will get:
52
- - Python
53
- - The package manager [Anaconda.org](https://docs.anaconda.com/anacondaorg/user-guide/)
54
- - A virtual environment manager : [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
55
- - A GUI [Anaconda Navigator](https://docs.anaconda.com/anaconda/navigator/index.html) if you choose to install the full [Anaconda](https://www.anaconda.com/products/individual)
56
-
57
- If you are familiar with the command line you could use [Miniconda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/windows.html), which needs very much less disk space than Anaconda.
58
-
59
- After installing conda, run these commands in an `Anaconda Powershell Prompt`:
60
- - `conda create --name openfisca python=3.11` to create an `openfisca` environment.
61
- - `conda activate openfisca` to use your new environment.
62
-
63
- Then, choose one of the following options according to your use case:
64
- - `conda install -c conda-forge openfisca-core` for default dependencies,
65
- - or `conda install -c conda-forge openfisca-core-api` if you want the Web API part,
66
- - or `conda install -c conda-forge -c openfisca openfisca-core-dev` if you want all the dependencies needed to contribute to the project.
67
-
68
- For information on how we publish to conda-forge, see [openfisca-core-feedstock](https://github.com/openfisca/openfisca-core-feedstock/blob/master/recipe/README.md).
69
-
70
44
  ## Testing
71
45
 
72
46
  Install the test dependencies:
@@ -14,7 +14,7 @@ class InYamlTestReform(Reform):
14
14
  baseline: TaxBenefitSystem,
15
15
  reformed_parameters=dict,
16
16
  ) -> None:
17
- """Initialize the ReformExcel instance.
17
+ """Initialize the instance.
18
18
 
19
19
  :param baseline: Baseline TaxBenefitSystem.
20
20
  :param reformed_parameters: Yaml file `parameters` value similar to a parameter tree
@@ -25,7 +25,6 @@ long_description = (this_directory / "README.md").read_text()
25
25
 
26
26
  # Please make sure to cap all dependency versions, in order to avoid unwanted
27
27
  # functional and integration breaks caused by external code updates.
28
- # DO NOT add space between '>=' and version number as it break conda build.
29
28
  general_requirements = [
30
29
  "PyYAML >=6.0, <7.0",
31
30
  "StrEnum >=0.4.8, <0.5.0", # 3.11.x backport
@@ -84,7 +83,7 @@ dev_requirements = [
84
83
 
85
84
  setup(
86
85
  name="OpenFisca-Core",
87
- version="44.7.1",
86
+ version="45.0.1",
88
87
  author="OpenFisca Team",
89
88
  author_email="contact@openfisca.org",
90
89
  classifiers=[
@@ -1,235 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import IO, Iterator
4
-
5
- from openfisca_core.types import TaxBenefitSystem
6
-
7
- from datetime import date
8
- from pathlib import Path
9
-
10
- import openpyxl
11
-
12
- from openfisca_core.parameters.parameter_node import ParameterNode
13
- from openfisca_core.parameters.parameter_scale import ParameterScale
14
- from openfisca_core.parameters.parameter_scale_bracket import ParameterScaleBracket
15
- from openfisca_core.reforms import Reform
16
-
17
-
18
- def get_parameter_node(
19
- p: ParameterNode, segments: str | list[str]
20
- ) -> tuple[ParameterNode | ParameterScale | ParameterScaleBracket, list[str]]:
21
- if isinstance(segments, str):
22
- segments = segments.split(".")
23
- if segments:
24
- if hasattr(p, "children"):
25
- return get_parameter_node(p.children[segments[0]], segments[1:])
26
- else:
27
- return p, segments
28
- else:
29
- return p, []
30
-
31
-
32
- class ReformExcelBuilder:
33
- def __init__(
34
- self,
35
- baseline: type[TaxBenefitSystem],
36
- path_or_file: Path | str | IO[bytes],
37
- ) -> None:
38
- # data_only = True to get the value stored the last time Excel read the sheet
39
- self.wb = openpyxl.load_workbook(path_or_file, data_only=True)
40
- self.baseline = baseline
41
-
42
- @property
43
- def suffixes(self) -> list[str]:
44
- return [
45
- sheetname[len("Paramètres") :]
46
- for sheetname in self.wb.sheetnames
47
- if sheetname.startswith("Paramètres")
48
- ]
49
-
50
- @property
51
- def reforms(self) -> Iterator[ReformExcel]:
52
- for suffix in self.suffixes:
53
- yield self.build_reform(suffix)
54
-
55
- @property
56
- def root_name(self) -> str:
57
- assert self.wb["Config"]["A2"].value == "root"
58
- return self.wb["Config"]["B2"].value
59
-
60
- def get_parameters(self, suffix: str) -> list[tuple[str, float, date]]:
61
- sheet = self.wb[f"Paramètres{suffix}"]
62
- nom_col = [
63
- i for i, cell in enumerate(sheet.iter_cols()) if cell[0].value == "Nom"
64
- ]
65
- valeur_col = [
66
- i for i, cell in enumerate(sheet.iter_cols()) if cell[0].value == "Valeur"
67
- ]
68
- date_col = [
69
- i for i, cell in enumerate(sheet.iter_cols()) if cell[0].value == "Date"
70
- ]
71
-
72
- assert nom_col, "La colonne 'Nom' est manquante"
73
- assert valeur_col is not None, "La colonne 'Valeur' est manquante"
74
- assert date_col, "La colonne 'Date' est manquante"
75
-
76
- return [
77
- (
78
- row[nom_col[0]],
79
- row[valeur_col[0]],
80
- row[date_col[0]].date(),
81
- )
82
- for row in sheet.iter_rows(min_row=2, values_only=True)
83
- if row[date_col[0]]
84
- ]
85
-
86
- def build_reform(self, suffix: str) -> "ReformExcel":
87
- return ReformExcel(
88
- suffix,
89
- self.baseline,
90
- self.root_name,
91
- self.get_parameters(suffix),
92
- )
93
-
94
-
95
- class ReformExcelTemplateGenerator:
96
- def __init__(
97
- self, baseline: type[TaxBenefitSystem], root_name: str, period: date
98
- ) -> None:
99
- self.baseline = baseline
100
- self.root_name = root_name
101
- self.period = period
102
-
103
- def generate_parameter_tree_values(self, parameter) -> list[tuple[str, float]]:
104
- values = []
105
- if type(parameter) is ParameterNode:
106
- for child in parameter.children.values():
107
- values.extend(self.generate_parameter_tree_values(child))
108
- else:
109
- value = parameter.get_at_instant(self.period)
110
- name = parameter.name.removeprefix(self.root_name + ".")
111
- if type(parameter) is ParameterScale:
112
- threshold_values = (
113
- value.amounts
114
- if parameter.metadata.get("type") == "single_amount"
115
- else value.rates
116
- )
117
- for threshold, val in zip(value.thresholds, threshold_values):
118
- values.append((f"{name}.{threshold}", val))
119
- else:
120
- if isinstance(value, list):
121
- values.append((name, ", ".join(value)))
122
- else:
123
- values.append((name, value))
124
- return sorted(values, key=lambda v: v[0])
125
-
126
- def parameter_data(self) -> list[tuple[str, float]]:
127
- root_parameter, _ = get_parameter_node(self.baseline.parameters, self.root_name)
128
- return self.generate_parameter_tree_values(root_parameter)
129
-
130
- def save_template_xlsx(
131
- self,
132
- path_or_file: Path | str | IO[bytes],
133
- ) -> None:
134
- wb = openpyxl.Workbook()
135
- ws_config = wb.active
136
- ws_config.title = "Config"
137
- ws_config.append(["Parameter name", "Parameter value"])
138
- ws_config.append(["root", self.root_name])
139
-
140
- wb.create_sheet(title="Paramètres")
141
- ws_params = wb["Paramètres"]
142
- ws_params.append(["Nom", "Date", "Valeur"])
143
-
144
- for name, value in self.parameter_data():
145
- ws_params.append([name, self.period, value])
146
-
147
- # Heuristics to adjust to content
148
- ws_params.column_dimensions["A"].width = 70
149
- ws_params.column_dimensions["B"].width = 12
150
- ws_params.column_dimensions["C"].width = 12
151
- wb.active = ws_params
152
-
153
- wb.save(path_or_file)
154
-
155
-
156
- class ReformExcel(Reform):
157
- """A class representing a reform defined in an Excel file.
158
-
159
- This class extends the Reform class to provide functionality specific to reforms defined in Excel format.
160
- """
161
-
162
- def __init__(
163
- self,
164
- name: str,
165
- baseline: TaxBenefitSystem,
166
- root_name: str,
167
- reformed_parameters: list[tuple[str, str, date | None]] | None = None,
168
- ) -> None:
169
- """Initialize the ReformExcel instance.
170
-
171
- :param baseline: Baseline TaxBenefitSystem.
172
- :param path: Path to the Excel file defining the reform.
173
- :param suffix: Suffix to identify the relevant parameters sheet.
174
- """
175
- self.name = name
176
- self.root_name = root_name
177
- self.reformed_parameters = reformed_parameters or []
178
- super().__init__(baseline)
179
-
180
- def apply(self):
181
- def modify_parameters(local_parameters: ParameterNode) -> ParameterNode:
182
- # Go down the parameter tree to the parameter root of this Excel reform
183
- root, _ = get_parameter_node(local_parameters, self.root_name)
184
- # Dict to track scale-based multiline parameters
185
- params_with_thresholds: dict[
186
- str, tuple[ParameterScale, list[tuple[float, ParameterScaleBracket]]]
187
- ] = dict()
188
-
189
- for name, value, date_ in self.reformed_parameters:
190
- leaf, threshold = get_parameter_node(root, name)
191
- if type(leaf) is ParameterScale:
192
- threshold_value = float(".".join(threshold))
193
- prop_name = (
194
- "amount"
195
- if leaf.metadata.get("type") == "single_amount"
196
- else "rate"
197
- )
198
- stripped_name = ".".join(name.split(".")[:-1])
199
-
200
- bracket = ParameterScaleBracket(
201
- data={
202
- "threshold": {
203
- date_.isoformat(): {"value": threshold_value}
204
- },
205
- prop_name: {date_.isoformat(): {"value": value}},
206
- }
207
- )
208
-
209
- params_with_thresholds.setdefault(stripped_name, (leaf, list()))[
210
- 1
211
- ].append(
212
- (
213
- threshold_value,
214
- bracket,
215
- )
216
- )
217
- else:
218
- if "unit" in leaf.metadata and leaf.metadata["unit"] == "list":
219
- if value is None:
220
- leaf.update(start=date_, value=[])
221
- else:
222
- values = [
223
- p.replace(",", "").strip() for p in value.split(" ")
224
- ]
225
- leaf.update(start=date_, value=[v for v in values if v])
226
- else:
227
- leaf.update(start=date_, value=value)
228
-
229
- for leaf, threshold in params_with_thresholds.values():
230
- sorted_brackets = [v[1] for v in sorted(threshold, key=lambda x: x[0])]
231
- leaf.brackets = sorted_brackets
232
-
233
- return local_parameters
234
-
235
- self.modify_parameters(modifier_function=modify_parameters)
File without changes