OpenFisca-Core-test 46.0.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 (243) hide show
  1. openfisca_core_test-46.0.0/CHANGELOG.md +4209 -0
  2. openfisca_core_test-46.0.0/LICENSE +661 -0
  3. openfisca_core_test-46.0.0/MANIFEST.in +2 -0
  4. openfisca_core_test-46.0.0/OpenFisca_Core_test.egg-info/PKG-INFO +194 -0
  5. openfisca_core_test-46.0.0/OpenFisca_Core_test.egg-info/SOURCES.txt +242 -0
  6. openfisca_core_test-46.0.0/OpenFisca_Core_test.egg-info/dependency_links.txt +1 -0
  7. openfisca_core_test-46.0.0/OpenFisca_Core_test.egg-info/entry_points.txt +3 -0
  8. openfisca_core_test-46.0.0/OpenFisca_Core_test.egg-info/requires.txt +28 -0
  9. openfisca_core_test-46.0.0/OpenFisca_Core_test.egg-info/top_level.txt +2 -0
  10. openfisca_core_test-46.0.0/PKG-INFO +194 -0
  11. openfisca_core_test-46.0.0/README.md +152 -0
  12. openfisca_core_test-46.0.0/openfisca_core/__init__.py +0 -0
  13. openfisca_core_test-46.0.0/openfisca_core/commons/__init__.py +18 -0
  14. openfisca_core_test-46.0.0/openfisca_core/commons/dummy.py +25 -0
  15. openfisca_core_test-46.0.0/openfisca_core/commons/formulas.py +121 -0
  16. openfisca_core_test-46.0.0/openfisca_core/commons/misc.py +109 -0
  17. openfisca_core_test-46.0.0/openfisca_core/commons/py.typed +0 -0
  18. openfisca_core_test-46.0.0/openfisca_core/commons/rates.py +114 -0
  19. openfisca_core_test-46.0.0/openfisca_core/commons/tests/__init__.py +0 -0
  20. openfisca_core_test-46.0.0/openfisca_core/commons/tests/test_dummy.py +9 -0
  21. openfisca_core_test-46.0.0/openfisca_core/commons/tests/test_formulas.py +75 -0
  22. openfisca_core_test-46.0.0/openfisca_core/commons/tests/test_rates.py +26 -0
  23. openfisca_core_test-46.0.0/openfisca_core/data_storage/__init__.py +7 -0
  24. openfisca_core_test-46.0.0/openfisca_core/data_storage/in_memory_storage.py +198 -0
  25. openfisca_core_test-46.0.0/openfisca_core/data_storage/on_disk_storage.py +307 -0
  26. openfisca_core_test-46.0.0/openfisca_core/data_storage/types.py +14 -0
  27. openfisca_core_test-46.0.0/openfisca_core/entities/__init__.py +23 -0
  28. openfisca_core_test-46.0.0/openfisca_core/entities/_core_entity.py +217 -0
  29. openfisca_core_test-46.0.0/openfisca_core/entities/_description.py +55 -0
  30. openfisca_core_test-46.0.0/openfisca_core/entities/entity.py +60 -0
  31. openfisca_core_test-46.0.0/openfisca_core/entities/group_entity.py +123 -0
  32. openfisca_core_test-46.0.0/openfisca_core/entities/helpers.py +165 -0
  33. openfisca_core_test-46.0.0/openfisca_core/entities/py.typed +0 -0
  34. openfisca_core_test-46.0.0/openfisca_core/entities/role.py +92 -0
  35. openfisca_core_test-46.0.0/openfisca_core/entities/tests/__init__.py +0 -0
  36. openfisca_core_test-46.0.0/openfisca_core/entities/tests/test_entity.py +10 -0
  37. openfisca_core_test-46.0.0/openfisca_core/entities/tests/test_group_entity.py +70 -0
  38. openfisca_core_test-46.0.0/openfisca_core/entities/tests/test_role.py +11 -0
  39. openfisca_core_test-46.0.0/openfisca_core/entities/types.py +44 -0
  40. openfisca_core_test-46.0.0/openfisca_core/errors/__init__.py +64 -0
  41. openfisca_core_test-46.0.0/openfisca_core/errors/cycle_error.py +2 -0
  42. openfisca_core_test-46.0.0/openfisca_core/errors/empty_argument_error.py +39 -0
  43. openfisca_core_test-46.0.0/openfisca_core/errors/nan_creation_error.py +2 -0
  44. openfisca_core_test-46.0.0/openfisca_core/errors/parameter_not_found_error.py +16 -0
  45. openfisca_core_test-46.0.0/openfisca_core/errors/parameter_parsing_error.py +18 -0
  46. openfisca_core_test-46.0.0/openfisca_core/errors/period_mismatch_error.py +9 -0
  47. openfisca_core_test-46.0.0/openfisca_core/errors/situation_parsing_error.py +26 -0
  48. openfisca_core_test-46.0.0/openfisca_core/errors/spiral_error.py +2 -0
  49. openfisca_core_test-46.0.0/openfisca_core/errors/variable_name_config_error.py +2 -0
  50. openfisca_core_test-46.0.0/openfisca_core/errors/variable_not_found_error.py +29 -0
  51. openfisca_core_test-46.0.0/openfisca_core/experimental/__init__.py +9 -0
  52. openfisca_core_test-46.0.0/openfisca_core/experimental/_errors.py +5 -0
  53. openfisca_core_test-46.0.0/openfisca_core/experimental/_memory_config.py +41 -0
  54. openfisca_core_test-46.0.0/openfisca_core/formula_helpers.py +9 -0
  55. openfisca_core_test-46.0.0/openfisca_core/holders/__init__.py +33 -0
  56. openfisca_core_test-46.0.0/openfisca_core/holders/helpers.py +93 -0
  57. openfisca_core_test-46.0.0/openfisca_core/holders/holder.py +328 -0
  58. openfisca_core_test-46.0.0/openfisca_core/holders/tests/__init__.py +0 -0
  59. openfisca_core_test-46.0.0/openfisca_core/holders/tests/test_helpers.py +134 -0
  60. openfisca_core_test-46.0.0/openfisca_core/holders/types.py +3 -0
  61. openfisca_core_test-46.0.0/openfisca_core/indexed_enums/__init__.py +18 -0
  62. openfisca_core_test-46.0.0/openfisca_core/indexed_enums/_enum_type.py +79 -0
  63. openfisca_core_test-46.0.0/openfisca_core/indexed_enums/_errors.py +35 -0
  64. openfisca_core_test-46.0.0/openfisca_core/indexed_enums/_guards.py +209 -0
  65. openfisca_core_test-46.0.0/openfisca_core/indexed_enums/_utils.py +180 -0
  66. openfisca_core_test-46.0.0/openfisca_core/indexed_enums/config.py +6 -0
  67. openfisca_core_test-46.0.0/openfisca_core/indexed_enums/enum.py +218 -0
  68. openfisca_core_test-46.0.0/openfisca_core/indexed_enums/enum_array.py +316 -0
  69. openfisca_core_test-46.0.0/openfisca_core/indexed_enums/py.typed +0 -0
  70. openfisca_core_test-46.0.0/openfisca_core/indexed_enums/tests/__init__.py +0 -0
  71. openfisca_core_test-46.0.0/openfisca_core/indexed_enums/tests/test_enum.py +135 -0
  72. openfisca_core_test-46.0.0/openfisca_core/indexed_enums/tests/test_enum_array.py +30 -0
  73. openfisca_core_test-46.0.0/openfisca_core/indexed_enums/types.py +49 -0
  74. openfisca_core_test-46.0.0/openfisca_core/memory_config.py +9 -0
  75. openfisca_core_test-46.0.0/openfisca_core/model_api.py +71 -0
  76. openfisca_core_test-46.0.0/openfisca_core/parameters/__init__.py +71 -0
  77. openfisca_core_test-46.0.0/openfisca_core/parameters/at_instant_like.py +17 -0
  78. openfisca_core_test-46.0.0/openfisca_core/parameters/config.py +55 -0
  79. openfisca_core_test-46.0.0/openfisca_core/parameters/helpers.py +106 -0
  80. openfisca_core_test-46.0.0/openfisca_core/parameters/parameter.py +217 -0
  81. openfisca_core_test-46.0.0/openfisca_core/parameters/parameter_at_instant.py +75 -0
  82. openfisca_core_test-46.0.0/openfisca_core/parameters/parameter_node.py +176 -0
  83. openfisca_core_test-46.0.0/openfisca_core/parameters/parameter_node_at_instant.py +57 -0
  84. openfisca_core_test-46.0.0/openfisca_core/parameters/parameter_scale.py +121 -0
  85. openfisca_core_test-46.0.0/openfisca_core/parameters/parameter_scale_bracket.py +7 -0
  86. openfisca_core_test-46.0.0/openfisca_core/parameters/values_history.py +5 -0
  87. openfisca_core_test-46.0.0/openfisca_core/parameters/vectorial_parameter_node_at_instant.py +179 -0
  88. openfisca_core_test-46.0.0/openfisca_core/periods/__init__.py +77 -0
  89. openfisca_core_test-46.0.0/openfisca_core/periods/_errors.py +28 -0
  90. openfisca_core_test-46.0.0/openfisca_core/periods/_parsers.py +122 -0
  91. openfisca_core_test-46.0.0/openfisca_core/periods/config.py +20 -0
  92. openfisca_core_test-46.0.0/openfisca_core/periods/date_unit.py +110 -0
  93. openfisca_core_test-46.0.0/openfisca_core/periods/helpers.py +314 -0
  94. openfisca_core_test-46.0.0/openfisca_core/periods/instant_.py +226 -0
  95. openfisca_core_test-46.0.0/openfisca_core/periods/period_.py +919 -0
  96. openfisca_core_test-46.0.0/openfisca_core/periods/py.typed +0 -0
  97. openfisca_core_test-46.0.0/openfisca_core/periods/tests/__init__.py +0 -0
  98. openfisca_core_test-46.0.0/openfisca_core/periods/tests/helpers/__init__.py +0 -0
  99. openfisca_core_test-46.0.0/openfisca_core/periods/tests/helpers/test_helpers.py +65 -0
  100. openfisca_core_test-46.0.0/openfisca_core/periods/tests/helpers/test_instant.py +73 -0
  101. openfisca_core_test-46.0.0/openfisca_core/periods/tests/helpers/test_period.py +134 -0
  102. openfisca_core_test-46.0.0/openfisca_core/periods/tests/test_instant.py +32 -0
  103. openfisca_core_test-46.0.0/openfisca_core/periods/tests/test_parsers.py +129 -0
  104. openfisca_core_test-46.0.0/openfisca_core/periods/tests/test_period.py +283 -0
  105. openfisca_core_test-46.0.0/openfisca_core/populations/__init__.py +64 -0
  106. openfisca_core_test-46.0.0/openfisca_core/populations/_core_population.py +454 -0
  107. openfisca_core_test-46.0.0/openfisca_core/populations/_errors.py +65 -0
  108. openfisca_core_test-46.0.0/openfisca_core/populations/group_population.py +326 -0
  109. openfisca_core_test-46.0.0/openfisca_core/populations/population.py +142 -0
  110. openfisca_core_test-46.0.0/openfisca_core/populations/tests/__init__.py +0 -0
  111. openfisca_core_test-46.0.0/openfisca_core/populations/tests/test_members_position.py +116 -0
  112. openfisca_core_test-46.0.0/openfisca_core/populations/types.py +110 -0
  113. openfisca_core_test-46.0.0/openfisca_core/projectors/__init__.py +39 -0
  114. openfisca_core_test-46.0.0/openfisca_core/projectors/entity_to_person_projector.py +12 -0
  115. openfisca_core_test-46.0.0/openfisca_core/projectors/first_person_to_entity_projector.py +13 -0
  116. openfisca_core_test-46.0.0/openfisca_core/projectors/helpers.py +139 -0
  117. openfisca_core_test-46.0.0/openfisca_core/projectors/projector.py +38 -0
  118. openfisca_core_test-46.0.0/openfisca_core/projectors/typing.py +27 -0
  119. openfisca_core_test-46.0.0/openfisca_core/projectors/unique_role_to_entity_projector.py +14 -0
  120. openfisca_core_test-46.0.0/openfisca_core/rates.py +9 -0
  121. openfisca_core_test-46.0.0/openfisca_core/reforms/__init__.py +24 -0
  122. openfisca_core_test-46.0.0/openfisca_core/reforms/in_yaml_test_reform.py +28 -0
  123. openfisca_core_test-46.0.0/openfisca_core/reforms/reform.py +86 -0
  124. openfisca_core_test-46.0.0/openfisca_core/scripts/__init__.py +106 -0
  125. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/__init__.cpython-310-pytest-8.3.3.pyc +0 -0
  126. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/__init__.cpython-310-pytest-8.4.2.pyc +0 -0
  127. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/__init__.cpython-310.pyc +0 -0
  128. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/__init__.cpython-311-pytest-8.3.3.pyc +0 -0
  129. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/__init__.cpython-311-pytest-8.4.2.pyc +0 -0
  130. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
  131. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/__init__.cpython-312-pytest-8.4.2.pyc +0 -0
  132. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/__init__.cpython-312.pyc +0 -0
  133. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/__init__.cpython-313-pytest-8.3.3.pyc +0 -0
  134. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/__init__.cpython-313-pytest-8.4.2.pyc +0 -0
  135. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
  136. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/find_placeholders.cpython-311.pyc +0 -0
  137. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/find_placeholders.cpython-313.pyc +0 -0
  138. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/measure_numpy_condition_notations.cpython-311.pyc +0 -0
  139. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/measure_numpy_condition_notations.cpython-313.pyc +0 -0
  140. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/measure_performances.cpython-311.pyc +0 -0
  141. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/measure_performances.cpython-313.pyc +0 -0
  142. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/measure_performances_fancy_indexing.cpython-311.pyc +0 -0
  143. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/measure_performances_fancy_indexing.cpython-313.pyc +0 -0
  144. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/openfisca_command.cpython-310.pyc +0 -0
  145. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/openfisca_command.cpython-311.pyc +0 -0
  146. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/openfisca_command.cpython-312.pyc +0 -0
  147. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/openfisca_command.cpython-313.pyc +0 -0
  148. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/remove_fuzzy.cpython-311.pyc +0 -0
  149. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/remove_fuzzy.cpython-313.pyc +0 -0
  150. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/run_test.cpython-310.pyc +0 -0
  151. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/run_test.cpython-311.pyc +0 -0
  152. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/run_test.cpython-312.pyc +0 -0
  153. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/run_test.cpython-313.pyc +0 -0
  154. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/simulation_generator.cpython-311.pyc +0 -0
  155. openfisca_core_test-46.0.0/openfisca_core/scripts/__pycache__/simulation_generator.cpython-313.pyc +0 -0
  156. openfisca_core_test-46.0.0/openfisca_core/scripts/assets/__init__.py +0 -0
  157. openfisca_core_test-46.0.0/openfisca_core/scripts/assets/__pycache__/__init__.cpython-311.pyc +0 -0
  158. openfisca_core_test-46.0.0/openfisca_core/scripts/assets/__pycache__/__init__.cpython-313.pyc +0 -0
  159. openfisca_core_test-46.0.0/openfisca_core/scripts/assets/index.html +140 -0
  160. openfisca_core_test-46.0.0/openfisca_core/scripts/find_placeholders.py +51 -0
  161. openfisca_core_test-46.0.0/openfisca_core/scripts/measure_numpy_condition_notations.py +137 -0
  162. openfisca_core_test-46.0.0/openfisca_core/scripts/measure_performances.py +291 -0
  163. openfisca_core_test-46.0.0/openfisca_core/scripts/measure_performances_fancy_indexing.py +89 -0
  164. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/__init__.py +0 -0
  165. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/__pycache__/__init__.cpython-311.pyc +0 -0
  166. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/__pycache__/__init__.cpython-313.pyc +0 -0
  167. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/__pycache__/v24_to_25.cpython-311.pyc +0 -0
  168. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/__pycache__/v24_to_25.cpython-313.pyc +0 -0
  169. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/v16_2_to_v17/__init__.py +0 -0
  170. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/v16_2_to_v17/__pycache__/__init__.cpython-311.pyc +0 -0
  171. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/v16_2_to_v17/__pycache__/__init__.cpython-313.pyc +0 -0
  172. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/v16_2_to_v17/__pycache__/xml_to_yaml_country_template.cpython-311.pyc +0 -0
  173. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/v16_2_to_v17/__pycache__/xml_to_yaml_country_template.cpython-313.pyc +0 -0
  174. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/v16_2_to_v17/__pycache__/xml_to_yaml_extension_template.cpython-311.pyc +0 -0
  175. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/v16_2_to_v17/__pycache__/xml_to_yaml_extension_template.cpython-313.pyc +0 -0
  176. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/v16_2_to_v17/legislation.xsd +102 -0
  177. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/v16_2_to_v17/xml_to_yaml_country_template.py +30 -0
  178. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/v16_2_to_v17/xml_to_yaml_extension_template.py +26 -0
  179. openfisca_core_test-46.0.0/openfisca_core/scripts/migrations/v24_to_25.py +156 -0
  180. openfisca_core_test-46.0.0/openfisca_core/scripts/openfisca_command.py +192 -0
  181. openfisca_core_test-46.0.0/openfisca_core/scripts/remove_fuzzy.py +213 -0
  182. openfisca_core_test-46.0.0/openfisca_core/scripts/run_test.py +51 -0
  183. openfisca_core_test-46.0.0/openfisca_core/scripts/simulation_generator.py +90 -0
  184. openfisca_core_test-46.0.0/openfisca_core/simulation_builder.py +16 -0
  185. openfisca_core_test-46.0.0/openfisca_core/simulations/__init__.py +45 -0
  186. openfisca_core_test-46.0.0/openfisca_core/simulations/_build_default_simulation.py +158 -0
  187. openfisca_core_test-46.0.0/openfisca_core/simulations/_build_from_variables.py +230 -0
  188. openfisca_core_test-46.0.0/openfisca_core/simulations/_type_guards.py +298 -0
  189. openfisca_core_test-46.0.0/openfisca_core/simulations/helpers.py +111 -0
  190. openfisca_core_test-46.0.0/openfisca_core/simulations/simulation.py +618 -0
  191. openfisca_core_test-46.0.0/openfisca_core/simulations/simulation_builder.py +855 -0
  192. openfisca_core_test-46.0.0/openfisca_core/simulations/typing.py +203 -0
  193. openfisca_core_test-46.0.0/openfisca_core/taxbenefitsystems/__init__.py +26 -0
  194. openfisca_core_test-46.0.0/openfisca_core/taxbenefitsystems/tax_benefit_system.py +584 -0
  195. openfisca_core_test-46.0.0/openfisca_core/taxscales/__init__.py +35 -0
  196. openfisca_core_test-46.0.0/openfisca_core/taxscales/abstract_rate_tax_scale.py +41 -0
  197. openfisca_core_test-46.0.0/openfisca_core/taxscales/abstract_tax_scale.py +53 -0
  198. openfisca_core_test-46.0.0/openfisca_core/taxscales/amount_tax_scale_like.py +55 -0
  199. openfisca_core_test-46.0.0/openfisca_core/taxscales/helpers.py +44 -0
  200. openfisca_core_test-46.0.0/openfisca_core/taxscales/linear_average_rate_tax_scale.py +76 -0
  201. openfisca_core_test-46.0.0/openfisca_core/taxscales/marginal_amount_tax_scale.py +34 -0
  202. openfisca_core_test-46.0.0/openfisca_core/taxscales/marginal_rate_tax_scale.py +286 -0
  203. openfisca_core_test-46.0.0/openfisca_core/taxscales/rate_tax_scale_like.py +214 -0
  204. openfisca_core_test-46.0.0/openfisca_core/taxscales/single_amount_tax_scale.py +32 -0
  205. openfisca_core_test-46.0.0/openfisca_core/taxscales/tax_scale_like.py +65 -0
  206. openfisca_core_test-46.0.0/openfisca_core/tools/__init__.py +94 -0
  207. openfisca_core_test-46.0.0/openfisca_core/tools/parallel_plugin.py +55 -0
  208. openfisca_core_test-46.0.0/openfisca_core/tools/simulation_dumper.py +137 -0
  209. openfisca_core_test-46.0.0/openfisca_core/tools/test_runner.py +802 -0
  210. openfisca_core_test-46.0.0/openfisca_core/tracers/__init__.py +40 -0
  211. openfisca_core_test-46.0.0/openfisca_core/tracers/computation_log.py +196 -0
  212. openfisca_core_test-46.0.0/openfisca_core/tracers/flat_trace.py +87 -0
  213. openfisca_core_test-46.0.0/openfisca_core/tracers/full_tracer.py +172 -0
  214. openfisca_core_test-46.0.0/openfisca_core/tracers/performance_log.py +133 -0
  215. openfisca_core_test-46.0.0/openfisca_core/tracers/simple_tracer.py +64 -0
  216. openfisca_core_test-46.0.0/openfisca_core/tracers/trace_node.py +121 -0
  217. openfisca_core_test-46.0.0/openfisca_core/tracers/tracing_parameter_node_at_instant.py +81 -0
  218. openfisca_core_test-46.0.0/openfisca_core/types.py +548 -0
  219. openfisca_core_test-46.0.0/openfisca_core/variables/__init__.py +26 -0
  220. openfisca_core_test-46.0.0/openfisca_core/variables/config.py +53 -0
  221. openfisca_core_test-46.0.0/openfisca_core/variables/helpers.py +67 -0
  222. openfisca_core_test-46.0.0/openfisca_core/variables/tests/__init__.py +0 -0
  223. openfisca_core_test-46.0.0/openfisca_core/variables/tests/test_definition_period.py +43 -0
  224. openfisca_core_test-46.0.0/openfisca_core/variables/variable.py +474 -0
  225. openfisca_core_test-46.0.0/openfisca_core/warnings/__init__.py +25 -0
  226. openfisca_core_test-46.0.0/openfisca_core/warnings/libyaml_warning.py +2 -0
  227. openfisca_core_test-46.0.0/openfisca_core/warnings/tempfile_warning.py +2 -0
  228. openfisca_core_test-46.0.0/openfisca_web_api/__init__.py +0 -0
  229. openfisca_core_test-46.0.0/openfisca_web_api/app.py +226 -0
  230. openfisca_core_test-46.0.0/openfisca_web_api/errors.py +11 -0
  231. openfisca_core_test-46.0.0/openfisca_web_api/handlers.py +90 -0
  232. openfisca_core_test-46.0.0/openfisca_web_api/loader/__init__.py +22 -0
  233. openfisca_core_test-46.0.0/openfisca_web_api/loader/entities.py +28 -0
  234. openfisca_core_test-46.0.0/openfisca_web_api/loader/parameters.py +122 -0
  235. openfisca_core_test-46.0.0/openfisca_web_api/loader/spec.py +168 -0
  236. openfisca_core_test-46.0.0/openfisca_web_api/loader/tax_benefit_system.py +27 -0
  237. openfisca_core_test-46.0.0/openfisca_web_api/loader/variables.py +121 -0
  238. openfisca_core_test-46.0.0/openfisca_web_api/openAPI.yml +434 -0
  239. openfisca_core_test-46.0.0/openfisca_web_api/scripts/__init__.py +0 -0
  240. openfisca_core_test-46.0.0/openfisca_web_api/scripts/serve.py +99 -0
  241. openfisca_core_test-46.0.0/pyproject.toml +115 -0
  242. openfisca_core_test-46.0.0/setup.cfg +32 -0
  243. openfisca_core_test-46.0.0/setup.py +29 -0
@@ -0,0 +1,4209 @@
1
+ # Changelog
2
+
3
+ # 46.0.0 [#1396](https://github.com/openfisca/openfisca-core/pull/1396)
4
+
5
+ #### Breaking changes
6
+
7
+ - Remove Python 3.10 support
8
+
9
+ #### Technical changes
10
+
11
+ - Move from `pip` to `uv` for package management
12
+ - Reduce Makefile tasks, CI and CD complexity
13
+ - Rely on `uv` `--resolution=[highest, lowest-direct]` in CI to ensure a large test coverage on multiple `numpy` versions
14
+
15
+ ### 45.0.5 [#1387](https://github.com/openfisca/openfisca-core/pull/1387)
16
+
17
+ #### Bug fixes
18
+
19
+ - Fix `restore_simulation` rebuilding entity counts from the members mapping instead of the dumped ids.
20
+ - A group entity with no member was silently dropped from the restored simulation's `count` (while still listed in `ids`), so subsequent calculations returned arrays with missing entities — or failed with a `ValueError` when a value had been stored for the group entity.
21
+ - Restoring a simulation whose tax and benefit system has no group entity raised an `UnboundLocalError`.
22
+ - Each entity's `count` is now restored from its dumped `ids`.
23
+
24
+ ### 45.0.4 [#1397](https://github.com/openfisca/openfisca-core/pull/1397)
25
+
26
+ #### Technical changes
27
+
28
+ - Replace black, isort, flake8 by ruff
29
+
30
+ ### 45.0.3 [#1395](https://github.com/openfisca/openfisca-core/pull/1395)
31
+
32
+ #### Technical changes
33
+
34
+ - Migrate from a master branch to a main branch
35
+
36
+ ### 45.0.2 [#1394](https://github.com/openfisca/openfisca-core/pull/1394)
37
+
38
+ #### Technical changes
39
+
40
+ - Fix git tag push and in cascade missing Windows test on published version
41
+
42
+ ### 45.0.1 [#1393](https://github.com/openfisca/openfisca-core/pull/1393)
43
+
44
+ #### Technical changes
45
+
46
+ - Remove Conda support
47
+
48
+ # 45.0.0 [#1393](https://github.com/openfisca/openfisca-core/pull/1393)
49
+
50
+ #### Breaking changes
51
+
52
+ - Move `ReformExcel*` from OpenFisca-Core to `ExcelReform*` in a dedicated package [openfisca-excel-reform](https://pypi.org/project/openfisca-excel-reform/)
53
+
54
+ ## 44.7.1 [#1383](https://github.com/openfisca/openfisca-core/pull/1383)
55
+
56
+ #### Bug fixes
57
+
58
+ - Fix `TypeError: metaclass conflict` on `import openfisca_core` with NumPy >= 2.5.
59
+ - NumPy 2.5 redefined `numpy.typing.NDArray` as a [PEP 695](https://peps.python.org/pep-0695/) `typing.TypeAliasType`, which cannot be used as a runtime base class.
60
+ - `types.EnumArray` now derives from `numpy.ndarray` directly, preserving its `dtype` parametrisation.
61
+ - Add NumPy 2.5 to the test matrix, which previously stopped at 2.3.0 while `setup.py` allows up to 3.
62
+
63
+ ## 44.7.0 [#1357](https://github.com/openfisca/openfisca-core/pull/1357)
64
+
65
+ #### New features
66
+
67
+ - Manage list parameter in Excel reform
68
+
69
+ ## 44.6.0 [#1374](https://github.com/openfisca/openfisca-core/pull/1374)
70
+
71
+ #### Technical changes
72
+
73
+ - Revert the codebase to commit `8d26af3` to align the repository with the currently published `44.2.2` baseline on PyPI.
74
+ - Mark versions `44.3.0`, `44.4.0`, `44.4.1`, and `44.5.0` as yanked.
75
+ - Bump version to `44.6.0` to restore continuous deployment from this reverted baseline.
76
+
77
+ ## 44.2.2 [#1361](https://github.com/openfisca/openfisca-core/pull/1361)
78
+
79
+ #### Bug fixes
80
+
81
+ - Fix enum index overflow for enums with more than 256 members (e.g. NAF). Index arrays were encoded as `uint8` (0-255), causing indices > 255 to be truncated and wrong values in simulations. Encoding now uses `int16` (`ENUM_ARRAY_DTYPE`) consistently.
82
+
83
+ ## 44.2.1 [#1341](https://github.com/openfisca/openfisca-core/pull/1341)
84
+
85
+ #### Technical changes
86
+
87
+ - Add a check for creating a simulation when building a test
88
+
89
+ ## 44.2.0 [#1358](https://github.com/openfisca/openfisca-core/pull/1358)
90
+
91
+ #### New features
92
+
93
+ - Add `--ignore-default` option to `openfisca test` command
94
+ - When used with `--verbose`, filters out variables that have their default value from the computation log output
95
+ - When a variable with its default value is hidden, its children are also hidden, even if they have non-default values
96
+ - This makes the computation log more readable by focusing on variables with meaningful values
97
+
98
+ ## 44.1.0 [#1355](https://github.com/openfisca/openfisca-core/pull/1355)
99
+
100
+ #### New features
101
+
102
+ - Yaml tests can have a `parameters` parameter that replace the parameter tree. It allows tests with parameter overrides.
103
+
104
+ ### 44.0.4 [#1354](https://github.com/openfisca/openfisca-core/pull/1354)
105
+
106
+ #### Technical changes
107
+
108
+ - Add missing unit test in CI
109
+ - Specify the default value in a compatible type in numpy.select for Numpy 2.x.
110
+
111
+ ### 44.0.3 [#1352](https://github.com/openfisca/openfisca-core/pull/1352)
112
+
113
+ #### Technical changes
114
+
115
+ - Fix `setup.py` syntax to restore publishing to PyPI.
116
+
117
+ ### 44.0.2 [#1351](https://github.com/openfisca/openfisca-core/pull/1351)
118
+
119
+ #### Technical changes
120
+
121
+ - Fix cache name mismatch in CI due to conditional Python version dependency #1346
122
+
123
+ ### 44.0.1 [#1349](https://github.com/openfisca/openfisca-core/pull/1349)
124
+
125
+ #### Technical changes
126
+
127
+ - Add parallel execution of tests to `openfisca test` command line.
128
+
129
+ # 44.0.0 [#1346](https://github.com/openfisca/openfisca-core/pull/1346)
130
+
131
+ #### Technical changes
132
+
133
+ - Conditional dependency on Numpy, based on Python version.
134
+ - Add support for Python 3.13.
135
+ - Remove support of deprecated Python version 3.9. It still works, but is not tested anymore.
136
+
137
+ ## 43.5.0 [#1344](https://github.com/openfisca/openfisca-core/pull/1344)
138
+
139
+ #### New features
140
+
141
+ - Add `ReformExcel*` classes to build reform from excel files. Check the last test in `tests/core/reforms/test_excel.py` for more.
142
+
143
+ ### 43.4.4 [#1343](https://github.com/openfisca/openfisca-core/pull/1343)
144
+
145
+ #### Technical changes
146
+
147
+ - Allow Flask < 4.0.0
148
+
149
+ ### 43.4.3 [#1340](https://github.com/openfisca/openfisca-core/pull/1340)
150
+
151
+ #### Technical changes
152
+
153
+ - Improve fancy indexing performance on long vectors.
154
+
155
+ ### 43.4.2 [#1336](https://github.com/openfisca/openfisca-core/pull/1336)
156
+
157
+ #### Technical changes
158
+
159
+ - Fix various vectorial parameter access and add unit tests
160
+
161
+ ### 43.4.1 [#1337](https://github.com/openfisca/openfisca-core/pull/1337)
162
+
163
+ #### Technical changes
164
+
165
+ - Allow strings with spaces in yaml files
166
+
167
+ ## 43.4.0 [#1334](https://github.com/openfisca/openfisca-core/pull/1334)
168
+
169
+ #### New features
170
+
171
+ - Allow parameters to be string values
172
+
173
+ #### Technical changes
174
+
175
+ - Simplify fancing index logic (to allow string value subnodes)
176
+
177
+ ### 43.3.11 [#1335](https://github.com/openfisca/openfisca-core/pull/1335)
178
+
179
+ #### Technical changes
180
+
181
+ - Ensure correct CI builds of openfisca-extension-template and openfisca-country-template
182
+
183
+ ### 43.3.10 [#1333](https://github.com/openfisca/openfisca-core/pull/1333)
184
+
185
+ #### Technical changes
186
+
187
+ - Applying make format to the codebase
188
+ - This is a follow-up of the previous PR, which was not applied correctly.
189
+ - The codebase is now formatted with `black` and `isort`.
190
+
191
+ ### 43.3.9 [#1332](https://github.com/openfisca/openfisca-core/pull/1332)
192
+
193
+ #### New features
194
+
195
+ - Fix a `return` instead of a `raise`.
196
+
197
+ ### 43.3.8 [#1329](https://github.com/openfisca/openfisca-core/pull/1329)
198
+
199
+ #### New features
200
+
201
+ - Add a parameter `start_computation_period` in simulation : if this parameter is not None, the simulation return the default value for all variable calculate before this period. The aim is to avoid computation of variables for period before the input variables period.
202
+
203
+ ### 43.3.7 [#1328](https://github.com/openfisca/openfisca-core/pull/1328)
204
+
205
+ #### Technical changes
206
+
207
+ - Bump the Twine version to fix the PyPi upload issue.
208
+
209
+ ### 43.3.6 [#1289](https://github.com/openfisca/openfisca-core/pull/1289)
210
+
211
+ #### Technical changes
212
+
213
+ - Change Github Action matrix test to support Python 3.12.
214
+
215
+ ### 43.3.5 [#1325](https://github.com/openfisca/openfisca-core/pull/1325)
216
+
217
+ #### Documentation
218
+
219
+ - Remove ambiguous documentation references.
220
+
221
+ ### 43.3.4 [#1302](https://github.com/openfisca/openfisca-core/pull/1302)
222
+
223
+ #### Technical changes
224
+
225
+ - Move types from `openfisca_core.periods` to `openfisca_core`
226
+
227
+ ### 43.3.3 [#1301](https://github.com/openfisca/openfisca-core/pull/1301)
228
+
229
+ #### Technical changes
230
+
231
+ - Move types from `openfisca_core.tracers` to `openfisca_core`
232
+
233
+ ### 43.3.2 [#1300](https://github.com/openfisca/openfisca-core/pull/1300)
234
+
235
+ #### Technical changes
236
+
237
+ - Move types from `openfisca_core.commons` to `openfisca_core`
238
+
239
+ ### 43.3.1 [#1323](https://github.com/openfisca/openfisca-core/pull/1323)
240
+
241
+ #### Technical changes
242
+
243
+ - Adapt tests to `country-template` 8.0.0.
244
+
245
+ ## 43.3.0 [#1319](https://github.com/openfisca/openfisca-core/pull/1319)
246
+
247
+ #### Technical change
248
+
249
+ - Use a deepcopy of variables in tax and benefit system cloning instead of a copy.
250
+
251
+ ### 43.2.9 [#1304](https://github.com/openfisca/openfisca-core/pull/1304)
252
+
253
+ #### Bugfix
254
+
255
+ - Fix `computation_log`.
256
+
257
+ ### 43.2.8 [#1322](https://github.com/openfisca/openfisca-core/pull/1322)
258
+
259
+ #### Technical changes
260
+
261
+ - Use appropriate `numpy` version with `conda`
262
+
263
+ ### 43.2.7 [#1307](https://github.com/openfisca/openfisca-core/pull/1307)
264
+
265
+ #### Performance
266
+
267
+ - Fix enum's module performance issues
268
+ - `43.0.0` fixed impending bugs in `indexed_enums` and improved `EnumArray`
269
+ performance
270
+ - However, `Enun.__eq__` and `Enum.encode` suffered from performance
271
+ degradation on large datasets
272
+ - This changeset aims at correcting these while keeping the bugfixes provided
273
+ by the aforesaid published version
274
+
275
+ #### Note
276
+
277
+ Some of the spectacular performances of `Enum.encode` came from the fact that
278
+ it didn't actually work, leaving buggy behaviour unseen (see for example
279
+ https://github.com/openfisca/openfisca-france/pull/2357/commits/84e41a5007f8bc23ec74ee3a693bc21e4c20df73).
280
+
281
+ This PR introduces `O(n)` and `O(1)` use of fancy indexing, vector masking, and
282
+ `numpy.searchsorted`, that scales nicely with large datasets (10k+).
283
+
284
+ However, as we need to validate data at enum encoding time, the encoding of
285
+ `int` and `str` sequences can't be faster than the pre-43.0.0 just because
286
+ data has to be copied over.
287
+
288
+ If ever this becomes problematic for very large datasets (50M+), we can workout
289
+ a feature flag to disable fancy indexing and trusting data has been properly
290
+ validated priorly by the user disabling run-time data validation, and so to
291
+ gain from the performance of using a memory view instead of copying data over
292
+ (that is, not using neither fancy indexing nor binary search).
293
+
294
+ However, it seems the least surprising for every user that the data be
295
+ validated before encoding (out of bounds indices and wrong `str` values not
296
+ present in an `Enum`).
297
+
298
+ ### 43.2.6 [#1297](https://github.com/openfisca/openfisca-core/pull/1297)
299
+
300
+ #### Bugfix
301
+
302
+ - Add `int` default to `max_depth` in `openfisca test`
303
+
304
+ ### 43.2.5 [#1296](https://github.com/openfisca/openfisca-core/pull/1296)
305
+
306
+ #### Bugfix
307
+
308
+ - Use new `extension-template` tests' path
309
+
310
+ ### 43.2.4 [#1294](https://github.com/openfisca/openfisca-core/pull/1294)
311
+
312
+ #### Technical changes
313
+
314
+ - Upgrade dpath minimal version (dpath.utils deprecated)
315
+
316
+ ### 43.2.3 [#1292](https://github.com/openfisca/openfisca-core/pull/1292)
317
+
318
+ #### Technical changes
319
+
320
+ - Improve the way Enum arrays are loaded and saved in dumps
321
+
322
+ ### 43.2.2 [#1280](https://github.com/openfisca/openfisca-core/pull/1280)
323
+
324
+ #### Documentation
325
+
326
+ - Add types to common tracers (`SimpleTracer`, `FlatTracer`, etc.)
327
+
328
+ ### 43.2.1 [#1283](https://github.com/openfisca/openfisca-core/pull/1283)
329
+
330
+ #### Technical changes
331
+
332
+ - Remove `coveralls`
333
+
334
+ ## 43.2.0 [#1279](https://github.com/openfisca/openfisca-core/pull/1279)
335
+
336
+ #### New features
337
+
338
+ - Introduce `populations.CorePopulation`
339
+ - Allows for testing and better subclassing custom populations
340
+
341
+ ### 43.1.2 [#1274](https://github.com/openfisca/openfisca-core/pull/1275)
342
+
343
+ #### Documentation
344
+
345
+ - Add docs to experimental
346
+
347
+ ### 43.1.1 [#1282](https://github.com/openfisca/openfisca-core/pull/1282)
348
+
349
+ #### Technical changes
350
+
351
+ - Add check to spot common spelling mistakes
352
+
353
+ ## 43.1.0 [#1255](https://github.com/openfisca/openfisca-core/pull/1255)
354
+
355
+ - Make `CoreEntity` public
356
+ - Allows for more easily creating customised entities.
357
+
358
+ #### Technical changes
359
+
360
+ - Add missing doctests.
361
+
362
+ # 43.0.0 [#1224](https://github.com/openfisca/openfisca-core/pull/1224)
363
+
364
+ #### Technical changes
365
+
366
+ - Add documentation to the `indexed_enums` module
367
+ - Fix type definitions in the enums module
368
+ - Fix doctests
369
+ - Fix bug in `Enum.encode` when passing a scalar
370
+ - Fix bug in `Enum.encode` when encoding values not present in the enum
371
+
372
+ #### New features
373
+
374
+ - Introduce `indexed_enums.EnumType`
375
+ - Allows for actually fancy indexing `indexed_enums.Enum`
376
+
377
+ #### Note
378
+
379
+ This changeset has not breaking changes to the `indexed_enums` public API.
380
+ However, as a conservative measure concerning data preparation for large
381
+ population simulations, it has been marked as a major release.
382
+
383
+ ##### Before
384
+
385
+ ```python
386
+ from openfisca_core import indexed_enums as enum
387
+
388
+
389
+ class TestEnum(enum.Enum):
390
+ ONE = "one"
391
+ TWO = "two"
392
+
393
+
394
+ TestEnum.encode([2])
395
+ # EnumArray([0])
396
+ ```
397
+
398
+ ##### After
399
+
400
+ ```python
401
+ from openfisca_core import indexed_enums as enum
402
+
403
+
404
+ class TestEnum(enum.Enum):
405
+ ONE = "one"
406
+ TWO = "two"
407
+
408
+
409
+ TestEnum.encode([2])
410
+ # EnumArray([])
411
+
412
+ TestEnum.encode([0, 1, 2, 5])
413
+ # EnumArray([<TestEnum.ONE: 'one'> <TestEnum.TWO: 'two'>])
414
+ ```
415
+
416
+ ### 42.0.7 [#1264](https://github.com/openfisca/openfisca-core/pull/1264)
417
+
418
+ #### Technical changes
419
+
420
+ - Add typing to `data_storage` module
421
+
422
+ ### 42.0.6 [#1263](https://github.com/openfisca/openfisca-core/pull/1263)
423
+
424
+ #### Documentation
425
+
426
+ - Fix docs of the `data_storage` module
427
+
428
+ ### 42.0.5 [#1261](https://github.com/openfisca/openfisca-core/pull/1261)
429
+
430
+ #### Technical changes
431
+
432
+ - Fix doctests of `data_storage` module
433
+
434
+ ### 42.0.4 [#1257](https://github.com/openfisca/openfisca-core/pull/1257)
435
+
436
+ #### Technical changes
437
+
438
+ - Fix conda test and publish
439
+ - Add matrix testing to CI
440
+ - Now it tests lower and upper bounds of python and numpy versions
441
+
442
+ ### 42.0.3 [#1234](https://github.com/openfisca/openfisca-core/pull/1234)
443
+
444
+ #### Technical changes
445
+
446
+ - Add matrix testing to CI
447
+ - Now it tests lower and upper bounds of python and numpy versions
448
+
449
+ > Note: Version `42.0.3` has been unpublished as was deployed by mistake.
450
+ > Please use versions `42.0.4` and subsequents.
451
+
452
+ ### 42.0.2 [#1256](https://github.com/openfisca/openfisca-core/pull/1256)
453
+
454
+ #### Documentation
455
+
456
+ - Fix bad indent
457
+
458
+ ### 42.0.1 [#1253](https://github.com/openfisca/openfisca-core/pull/1253)
459
+
460
+ #### Documentation
461
+
462
+ - Fix documentation of `entities`
463
+
464
+ # 42.0.0 [#1223](https://github.com/openfisca/openfisca-core/pull/1223)
465
+
466
+ #### Breaking changes
467
+
468
+ - Changes to `eternity` instants and periods
469
+ - Eternity instants are now `<Instant(-1, -1, -1)>` instead of
470
+ `<Instant(inf, inf, inf)>`
471
+ - Eternity periods are now `<Period(('eternity', <Instant(-1, -1, -1)>, -1))>`
472
+ instead of `<Period(('eternity', <Instant(inf, inf, inf)>, inf))>`
473
+ - The reason is to avoid mixing data types: `inf` is a float, periods and
474
+ instants are integers. Mixed data types make memory optimisations impossible.
475
+ - Migration should be straightforward. If you have a test that checks for
476
+ `inf`, you should update it to check for `-1` or use the `is_eternal` method.
477
+ - `periods.instant` no longer returns `None`
478
+ - Now, it raises `periods.InstantError`
479
+
480
+ #### New features
481
+
482
+ - Introduce `Instant.eternity()`
483
+ - This behaviour was duplicated across
484
+ - Now it is encapsulated in a single method
485
+ - Introduce `Instant.is_eternal` and `Period.is_eternal`
486
+ - These methods check if the instant or period are eternity (`bool`).
487
+ - Now `periods.instant` parses also ISO calendar strings (weeks)
488
+ - For instance, `2022-W01` is now a valid input
489
+
490
+ #### Technical changes
491
+
492
+ - Update `pendulum`
493
+ - Reduce code complexity
494
+ - Remove run-time type-checks
495
+ - Add typing to the periods module
496
+
497
+ ### 41.5.7 [#1225](https://github.com/openfisca/openfisca-core/pull/1225)
498
+
499
+ #### Technical changes
500
+
501
+ - Refactor & test `eval_expression`
502
+
503
+ ### 41.5.6 [#1185](https://github.com/openfisca/openfisca-core/pull/1185)
504
+
505
+ #### Technical changes
506
+
507
+ - Remove pre Python 3.9 syntax.
508
+
509
+ ### 41.5.5 [#1220](https://github.com/openfisca/openfisca-core/pull/1220)
510
+
511
+ #### Technical changes
512
+
513
+ - Fix doc & type definitions in the entities module
514
+
515
+ ### 41.5.4 [#1219](https://github.com/openfisca/openfisca-core/pull/1219)
516
+
517
+ #### Technical changes
518
+
519
+ - Fix doc & type definitions in the commons module
520
+
521
+ ### 41.5.3 [#1218](https://github.com/openfisca/openfisca-core/pull/1218)
522
+
523
+ #### Technical changes
524
+
525
+ - Fix `flake8` doc linting:
526
+ - Add format "google"
527
+ - Fix per-file skips
528
+ - Fix failing lints
529
+
530
+ ### 41.5.2 [#1217](https://github.com/openfisca/openfisca-core/pull/1217)
531
+
532
+ #### Technical changes
533
+
534
+ - Fix styles by applying `isort`.
535
+ - Add a `isort` dry-run check to `make lint`
536
+
537
+ ### 41.5.1 [#1216](https://github.com/openfisca/openfisca-core/pull/1216)
538
+
539
+ #### Technical changes
540
+
541
+ - Fix styles by applying `black`.
542
+ - Add a `black` dry-run check to `make lint`
543
+
544
+ ## 41.5.0 [#1212](https://github.com/openfisca/openfisca-core/pull/1212)
545
+
546
+ #### New features
547
+
548
+ - Introduce `VectorialAsofDateParameterNodeAtInstant`
549
+ - It is a parameter node of the legislation at a given instant which has been vectorized along some date.
550
+ - Vectorized parameters allow requests such as parameters.housing_benefit[date], where date is a `numpy.datetime64` vector
551
+
552
+ ### 41.4.7 [#1211](https://github.com/openfisca/openfisca-core/pull/1211)
553
+
554
+ #### Technical changes
555
+
556
+ - Update documentation continuous deployment method to reflect OpenFisca-Doc [process updates](https://github.com/openfisca/openfisca-doc/pull/308)
557
+
558
+ ### 41.4.6 [#1210](https://github.com/openfisca/openfisca-core/pull/1210)
559
+
560
+ #### Technical changes
561
+
562
+ - Abide by OpenAPI v3.0.0 instead of v3.1.0
563
+ - Drop support for `propertyNames` in `Values` definition
564
+
565
+ ### 41.4.5 [#1209](https://github.com/openfisca/openfisca-core/pull/1209)
566
+
567
+ #### Technical changes
568
+
569
+ - Support loading metadata from both `setup.py` and `pyproject.toml` package description files.
570
+
571
+ ### ~41.4.4~ [#1208](https://github.com/openfisca/openfisca-core/pull/1208)
572
+
573
+ _Unpublished due to introduced backwards incompatibilities._
574
+
575
+ #### Technical changes
576
+
577
+ - Adapt testing pipeline to Country Template [v7](https://github.com/openfisca/country-template/pull/139).
578
+
579
+ ### 41.4.3 [#1206](https://github.com/openfisca/openfisca-core/pull/1206)
580
+
581
+ #### Technical changes
582
+
583
+ - Increase spiral and cycle tests robustness.
584
+ - The current test is ambiguous, as it hides a failure at the first spiral
585
+ occurrence (from 2017 to 2016).
586
+
587
+ ### 41.4.2 [#1203](https://github.com/openfisca/openfisca-core/pull/1203)
588
+
589
+ #### Technical changes
590
+
591
+ - Changes the Pypi's deployment authentication way to use token API following Pypi's 2FA enforcement starting 2024/01/01.
592
+
593
+ ### 41.4.1 [#1202](https://github.com/openfisca/openfisca-core/pull/1202)
594
+
595
+ #### Technical changes
596
+
597
+ - Check that entities are fully specified when expanding over axes.
598
+
599
+ ## 41.4.0 [#1197](https://github.com/openfisca/openfisca-core/pull/1197)
600
+
601
+ #### New features
602
+
603
+ - Add `entities.find_role()` to find roles by key and `max`.
604
+
605
+ #### Technical changes
606
+
607
+ - Document `projectors.get_projector_from_shortcut()`.
608
+
609
+ ## 41.3.0 [#1200](https://github.com/openfisca/openfisca-core/pull/1200)
610
+
611
+ > As `TracingParameterNodeAtInstant` is a wrapper for `ParameterNodeAtInstant`
612
+ > which allows iteration and the use of `contains`, it was not possible
613
+ > to use those on a `TracingParameterNodeAtInstant`
614
+
615
+ #### New features
616
+
617
+ - Allows iterations on `TracingParameterNodeAtInstant`
618
+ - Allows keyword `contains` on `TracingParameterNodeAtInstant`
619
+
620
+ ## 41.2.0 [#1199](https://github.com/openfisca/openfisca-core/pull/1199)
621
+
622
+ #### Technical changes
623
+
624
+ - Fix `openfisca-core` Web API error triggered by `Gunicorn` < 22.0.
625
+ - Bump `Gunicorn` major revision to fix error on Web API.
626
+ Source: https://github.com/benoitc/gunicorn/issues/2564
627
+
628
+ ### 41.1.2 [#1192](https://github.com/openfisca/openfisca-core/pull/1192)
629
+
630
+ #### Technical changes
631
+
632
+ - Add tests to `entities`.
633
+
634
+ ### 41.1.1 [#1186](https://github.com/openfisca/openfisca-core/pull/1186)
635
+
636
+ #### Technical changes
637
+
638
+ - Skip type-checking tasks
639
+ - Before their definition was commented out but still run with `make test`
640
+ - Now they're skipped but not commented, which is needed to fix the
641
+ underlying issues
642
+
643
+ ## 41.1.0 [#1195](https://github.com/openfisca/openfisca-core/pull/1195)
644
+
645
+ #### Technical changes
646
+
647
+ - Make `Role` explicitly hashable.
648
+ - Details:
649
+ - By introducing `__eq__`, naturally `Role` became unhashable, because
650
+ equality was calculated based on a property of `Role`
651
+ (`role.key == another_role.key`), and no longer structurally
652
+ (`"1" == "1"`).
653
+ - This changeset removes `__eq__`, as `Role` is being used downstream as a
654
+ hashable object, and adds a test to ensure `Role`'s hashability.
655
+
656
+ ### 41.0.2 [#1194](https://github.com/openfisca/openfisca-core/pull/1194)
657
+
658
+ #### Technical changes
659
+
660
+ - Add `__hash__` method to `Role`.
661
+
662
+ ### 41.0.1 [#1187](https://github.com/openfisca/openfisca-core/pull/1187)
663
+
664
+ #### Technical changes
665
+
666
+ - Document `Role`.
667
+
668
+ # 41.0.0 [#1189](https://github.com/openfisca/openfisca-core/pull/1189)
669
+
670
+ #### Breaking changes
671
+
672
+ - `Variable.get_introspection_data` no longer has parameters nor calling functions
673
+
674
+ The Web API was very prone to crashing, timeouting at startup because of the time consuming python file parsing to generate documentation displayed for instance in the Legislation Explorer.
675
+
676
+ ## 40.1.0 [#1174](https://github.com/openfisca/openfisca-core/pull/1174)
677
+
678
+ #### New Features
679
+
680
+ - Allows for dispatching and dividing inputs over a broader range.
681
+ - For example, divide a monthly variable by week.
682
+
683
+ ### 40.0.1 [#1184](https://github.com/openfisca/openfisca-core/pull/1184)
684
+
685
+ #### Technical changes
686
+
687
+ - Require numpy < 1.25 because of memory leak detected in OpenFisca-France.
688
+
689
+ # 40.0.0 [#1181](https://github.com/openfisca/openfisca-core/pull/1181)
690
+
691
+ #### Breaking changes
692
+
693
+ - Upgrade every dependencies to its latest version.
694
+ - Upgrade to Python >= 3.9
695
+
696
+ Note: Checks on mypy typings are disabled, because they cause generate of errors that we were not able to fix easily.
697
+
698
+ # 39.0.0 [#1181](https://github.com/openfisca/openfisca-core/pull/1181)
699
+
700
+ #### Breaking changes
701
+
702
+ - Upgrade every dependencies to their latest versions.
703
+ - Upgrade to Python >= 3.9
704
+
705
+ Main changes, that may require some code changes in country packages:
706
+ - numpy
707
+ - pytest
708
+ - Flask
709
+
710
+ ### 38.0.4 [#1182](https://github.com/openfisca/openfisca-core/pull/1182)
711
+
712
+ #### Technical changes
713
+
714
+ - Method `_get_tax_benefit_system()` of class `YamlItem` in file `openfisca_core/tools/test_runner.py` will now clone the TBS when applying reforms to avoid running tests with previously reformed TBS.
715
+
716
+ ### 38.0.3 [#1179](https://github.com/openfisca/openfisca-core/pull/1179)
717
+
718
+ #### Bug fix
719
+
720
+ - Do not install dependencies outside the `setup.py`
721
+ - Dependencies installed outside the `setup.py` are not taken into account by
722
+ `pip`'s dependency resolver.
723
+ - In case of conflicting transient dependencies, the last library installed
724
+ will "impose" its dependency version.
725
+ - This makes the installation and build of the library non-deterministic and
726
+ prone to unforeseen bugs caused by external changes in dependencies'
727
+ versions.
728
+
729
+ #### Note
730
+
731
+ A definite way to solve this issue is to clearly separate library dependencies
732
+ (with a `virtualenv`) and a universal dependency installer for CI requirements
733
+ (like `pipx`), taking care of:
734
+
735
+ - Always running tests inside the `virtualenv` (for example with `nox`).
736
+ - Always building outside of the `virtualenv` (for example with `poetry`
737
+ installed by `pipx`).
738
+
739
+ Moreover, it is indeed even better to have a lock file for dependencies,
740
+ using `pip freeze`) or with tools providing such features (`pipenv`, etc.).
741
+
742
+ ### 38.0.2 [#1178](https://github.com/openfisca/openfisca-core/pull/1178)
743
+
744
+ #### Technical changes
745
+
746
+ - Remove use of `importlib_metadata`.
747
+
748
+ ### 38.0.1 -
749
+
750
+ > Note: Version `38.0.1` has been unpublished as was deployed by mistake.
751
+ > Please use versions `38.0.2` and subsequents.
752
+
753
+
754
+ # 38.0.0 [#989](https://github.com/openfisca/openfisca-core/pull/989)
755
+
756
+ > Note: Version `38.0.0` has been unpublished as `35.11.1` introduced a bug
757
+ > preventing users to load a tax-benefit system. Please use versions `38.0.2`
758
+ > and subsequents.
759
+
760
+ #### New Features
761
+
762
+ - Upgrade OpenAPI specification of the API to v3 from Swagger v2.
763
+ - Continuously validate OpenAPI specification.
764
+
765
+ #### Breaking changes
766
+
767
+ - Drop support for OpenAPI specification v2 and prior.
768
+ - Users relying on OpenAPI v2 can use [Swagger Converter](https://converter.swagger.io/api/convert?url=OAS2_YAML_OR_JSON_URL) to migrate ([example](https://web.archive.org/web/20221103230822/https://converter.swagger.io/api/convert?url=https://api.demo.openfisca.org/latest/spec)).
769
+
770
+ ### 37.0.2 [#1170](https://github.com/openfisca/openfisca-core/pull/1170)
771
+
772
+ > Note: Version `37.0.2` has been unpublished as `35.11.1` introduced a bug
773
+ > preventing users to load a tax-benefit system. Please use versions `38.0.2`
774
+ > and subsequents.
775
+
776
+ #### Technical changes
777
+
778
+ - Always import numpy
779
+
780
+ ### 37.0.1 [#1169](https://github.com/openfisca/openfisca-core/pull/1169)
781
+
782
+ > Note: Version `37.0.1` has been unpublished as `35.11.1` introduced a bug
783
+ > preventing users to load a tax-benefit system. Please use versions `38.0.2`
784
+ > and subsequents.
785
+
786
+ #### Technical changes
787
+
788
+ - Unify casing of NumPy.
789
+
790
+ # 37.0.0 [#1142](https://github.com/openfisca/openfisca-core/pull/1142)
791
+
792
+ > Note: Version `37.0.0` has been unpublished as `35.11.1` introduced a bug
793
+ > preventing users to load a tax-benefit system. Please use versions `38.0.2`
794
+ > and subsequents.
795
+
796
+ #### Deprecations
797
+
798
+ - In _periods.Instant_:
799
+ - Remove `period`, method used to build a `Period` from an `Instant`.
800
+ - This method created an upward circular dependency between `Instant` and `Period` causing lots of trouble.
801
+ - The functionality is still provided by `periods.period` and the `Period` constructor.
802
+
803
+ #### Migration details
804
+
805
+ - Replace `some_period.start.period` and similar methods with `Period((unit, some_period.start, 1))`.
806
+
807
+ # 36.0.0 [#1149](https://github.com/openfisca/openfisca-core/pull/1162)
808
+
809
+ > Note: Version `36.0.0` has been unpublished as `35.11.1` introduced a bug
810
+ > preventing users to load a tax-benefit system. Please use versions `38.0.2`
811
+ > and subsequents.
812
+
813
+ #### Breaking changes
814
+
815
+ - In `ParameterScaleBracket`:
816
+ - Remove the `base` attribute
817
+ - The attribute's usage was unclear and it was only being used by some French social security variables
818
+
819
+ ## 35.12.0 [#1160](https://github.com/openfisca/openfisca-core/pull/1160)
820
+
821
+ > Note: Version `35.12.0` has been unpublished as `35.11.1` introduced a bug
822
+ > preventing users to load a tax-benefit system. Please use versions `38.0.2`
823
+ > and subsequents.
824
+
825
+ #### New Features
826
+
827
+ - Lighter install by removing test packages from systematic install.
828
+
829
+ ### 35.11.2 [#1166](https://github.com/openfisca/openfisca-core/pull/1166)
830
+
831
+ > Note: Version `35.11.2` has been unpublished as `35.11.1` introduced a bug
832
+ > preventing users to load a tax-benefit system. Please use versions `38.0.2`
833
+ > and subsequents.
834
+
835
+ #### Technical changes
836
+
837
+ - Fix Holder's doctests.
838
+
839
+ ### 35.11.1 [#1165](https://github.com/openfisca/openfisca-core/pull/1165)
840
+
841
+ > Note: Version `35.11.1` has been unpublished as it introduced a bug
842
+ > preventing users to load a tax-benefit system. Please use versions `38.0.2`
843
+ > and subsequents.
844
+
845
+ #### Bug fix
846
+
847
+ - Fix documentation
848
+ - Suppression of some modules broke the documentation build
849
+
850
+ ## 35.11.0 [#1149](https://github.com/openfisca/openfisca-core/pull/1149)
851
+
852
+ #### New Features
853
+
854
+ - Introduce variable dependent error margins in YAML tests.
855
+
856
+ ### 35.10.1 [#1143](https://github.com/openfisca/openfisca-core/pull/1143)
857
+
858
+ #### Bug fix
859
+
860
+ - Reintroduce support for the ``day`` date unit in `holders.set_input_dispatch_by_period` and `holders.
861
+ set_input_divide_by_period`
862
+ - Allows for dispatching values per day, for example, to provide a daily (week, fortnight) to an yearly variable.
863
+ - Inversely, allows for calculating the daily (week, fortnight) value of a yearly input.
864
+
865
+ ## 35.10.0 [#1151](https://github.com/openfisca/openfisca-core/pull/1151)
866
+
867
+ #### New features
868
+
869
+ - Add type hints for all instances of `variable_name` in function declarations.
870
+ - Add type hints for some `Simulation` and `Population` properties.
871
+
872
+ ## 35.9.0 [#1150](https://github.com/openfisca/openfisca-core/pull/1150)
873
+
874
+ #### New Features
875
+
876
+ - Introduce a maximal depth for computation logs
877
+ - Allows for limiting the depth of the computation log chain
878
+
879
+ ### 35.8.6 [#1145](https://github.com/openfisca/openfisca-core/pull/1145)
880
+
881
+ #### Technical changes
882
+
883
+ - Removes the automatic documentation build check
884
+ - It has been proven difficult to maintain, specifically due _dependency hell_ and a very contrived build workflow.
885
+
886
+ ### 35.8.5 [#1137](https://github.com/openfisca/openfisca-core/pull/1137)
887
+
888
+ #### Technical changes
889
+
890
+ - Fix pylint dependency in fresh editable installations
891
+ - Ignore pytest requirement, used to collect test cases, if it is not yet installed.
892
+
893
+ ### 35.8.4 [#1131](https://github.com/openfisca/openfisca-core/pull/1131)
894
+
895
+ #### Technical changes
896
+
897
+ - Correct some type hints and docstrings.
898
+
899
+ ### 35.8.3 [#1127](https://github.com/openfisca/openfisca-core/pull/1127)
900
+
901
+ #### Technical changes
902
+
903
+ - Fix the build for Anaconda in CI. The conda build failed on master because of a replacement in a comment string.
904
+ - The _ were removed in the comment to avoid a replace.
905
+
906
+ ### 35.8.2 [#1128](https://github.com/openfisca/openfisca-core/pull/1128)
907
+
908
+ #### Technical changes
909
+
910
+ - Remove ambiguous links in docstrings.
911
+
912
+ ### 35.8.1 [#1105](https://github.com/openfisca/openfisca-core/pull/1105)
913
+
914
+ #### Technical changes
915
+
916
+ - Add publish to Anaconda in CI. See file .conda/README.md.
917
+
918
+ ## 35.8.0 [#1114](https://github.com/openfisca/openfisca-core/pull/1114)
919
+
920
+ #### New Features
921
+
922
+ - Introduce `rate_from_bracket_indice` method on `RateTaxScaleLike` class
923
+ - Allows for the determination of the tax rate based on the tax bracket indice
924
+
925
+ - Introduce `rate_from_tax_base` method on `RateTaxScaleLike` class
926
+ - Allows for the determination of the tax rate based on the tax base
927
+
928
+ - Introduce `threshold_from_tax_base` method on `RateTaxScaleLike` class
929
+ - Allows for the determination of the lower threshold based on the tax base
930
+
931
+ - Add publish openfisca-core library to Anaconda in CI. See file .conda/README.md.
932
+
933
+ ### 35.7.8 [#1086](https://github.com/openfisca/openfisca-core/pull/1086)
934
+
935
+ #### Technical changes
936
+
937
+ ### 35.7.7 [#1109](https://github.com/openfisca/openfisca-core/pull/1109)
938
+
939
+ #### Technical changes
940
+
941
+ - Fix `openfisca-core` Web API error triggered by `Flask` dependencies updates
942
+ - Bump `Flask` patch revision to fix `cannot import name 'json' from 'itsdangerous'` on Web API.
943
+ - Then, fix `MarkupSafe` revision to avoid `cannot import name 'soft_unicode' from 'markupsafe'` error on Web API.
944
+
945
+ ### 35.7.6 [#1065](https://github.com/openfisca/openfisca-core/pull/1065)
946
+
947
+ #### Technical changes
948
+
949
+ - Made code compatible with dpath versions >=1.5.0,<3.0.0, instead of >=1.5.0,<2.0.0
950
+
951
+ ### 35.7.5 [#1090](https://github.com/openfisca/openfisca-core/pull/1090)
952
+
953
+ #### Technical changes
954
+
955
+ - Remove calls to deprecated imp module
956
+
957
+ ### 35.7.4 [#1083](https://github.com/openfisca/openfisca-core/pull/1083)
958
+
959
+ #### Technical changes
960
+
961
+ - Add GitHub `pull-request` event as a trigger to GitHub Actions workflow
962
+
963
+ ### 35.7.3 [#1081](https://github.com/openfisca/openfisca-core/pull/1081)
964
+
965
+ - Correct error message in case of mis-sized population
966
+
967
+ ### 35.7.2 [#1057](https://github.com/openfisca/openfisca-core/pull/1057)
968
+
969
+ #### Technical changes
970
+
971
+ - Switch CI provider from CircleCI to GitHub Actions
972
+
973
+ ### 35.7.1 [#1075](https://github.com/openfisca/openfisca-core/pull/1075)
974
+
975
+ #### Bug fix
976
+
977
+ - Fix the collection of OpenFisca-Core tests coverage data
978
+ - Tests within `openfisca_core/*` were not run
979
+
980
+ ## 35.7.0 [#1070](https://github.com/openfisca/openfisca-core/pulls/1070)
981
+
982
+ #### New Features
983
+
984
+ - Add group population shortcut to containing groups entities
985
+
986
+ ## 35.6.0 [#1054](https://github.com/openfisca/openfisca-core/pull/1054)
987
+
988
+ #### New Features
989
+
990
+ - Introduce `openfisca_core.types`
991
+
992
+ #### Documentation
993
+
994
+ - Complete typing of the commons module
995
+
996
+ #### Dependencies
997
+
998
+ - `nptyping`
999
+ - To add backport-support for numpy typing
1000
+ - Can be removed once lower-bound numpy version is 1.21+
1001
+
1002
+ - `typing_extensions`
1003
+ - To add backport-support for `typing.Protocol` and `typing.Literal`
1004
+ - Can be removed once lower-bound python version is 3.8+
1005
+
1006
+ ### 35.5.5 [#1055](https://github.com/openfisca/openfisca-core/pull/1055)
1007
+
1008
+ #### Documentation
1009
+
1010
+ - Complete the documentation of the commons module
1011
+
1012
+ ### 35.5.4 [#1033](https://github.com/openfisca/openfisca-core/pull/1033)
1013
+
1014
+ #### Bug Fixes
1015
+
1016
+ - Fix doctests of the commons module
1017
+
1018
+ #### Dependencies
1019
+
1020
+ - `darglint`, `flake8-docstrings`, & `pylint`
1021
+ - For automatic docstring linting & validation.
1022
+
1023
+ ### 35.5.3 [#1020](https://github.com/openfisca/openfisca-core/pull/1020)
1024
+
1025
+ #### Technical changes
1026
+
1027
+ - Run openfisca-core & country/extension template tests systematically
1028
+
1029
+ ### 35.5.2 [#1048](https://github.com/openfisca/openfisca-core/pull/1048)
1030
+
1031
+ #### Bug fix
1032
+
1033
+ - In _test_yaml.py_:
1034
+ - Fix yaml tests loading —required for testing against the built version.
1035
+
1036
+ ### 35.5.1 [#1046](https://github.com/openfisca/openfisca-core/pull/1046)
1037
+
1038
+ #### Non-technical changes
1039
+
1040
+ - Reorganise `Makefile` into context files (install, test, publish…)
1041
+ - Colorise `make` tasks and improve messages printed to the user
1042
+
1043
+ ## 35.5.0 [#1038](https://github.com/openfisca/openfisca-core/pull/1038)
1044
+
1045
+ #### New Features
1046
+
1047
+ - Introduce `openfisca_core.variables.typing`
1048
+ - Documents the signature of formulas
1049
+ - Note: as formulas are generated dynamically, documenting them is tricky
1050
+
1051
+ #### Bug Fixes
1052
+
1053
+ - Fix the official doc
1054
+ - Corrects malformed docstrings
1055
+ - Fix missing and/ou outdated references
1056
+
1057
+ #### Technical Changes
1058
+
1059
+ - Add tasks to automatically validate that changes do not break the documentation
1060
+
1061
+ #### Documentation
1062
+
1063
+ - Add steps to follow in case the documentation is broken
1064
+ - Add general documenting guidelines in CONTRIBUTING.md
1065
+
1066
+ ### 35.4.2 [#1026](https://github.com/openfisca/openfisca-core/pull/1026)
1067
+
1068
+ #### Bug fix
1069
+
1070
+ - [Web API] Handle a period mismatch error
1071
+ - Period mismatch error was not being handled by the API
1072
+ - Since it's caused by the user, a 400 (bad request error) is to be expected
1073
+ - However, since it was not being handled, a 500 (internal server error) was being given instead
1074
+
1075
+ ### 35.4.1 [#1007](https://github.com/openfisca/openfisca-core/pull/1007)
1076
+
1077
+ #### Bug fix
1078
+
1079
+ - Properly check for date validity in parameters.
1080
+ - Date validity was being checked only partially, allowing parameters with illegal dates such as "2015-13-32".
1081
+ - The changes introduced fix this error and prevent the user when a parameter date is illegal.
1082
+
1083
+ ## 35.4.0 [#1010](https://github.com/openfisca/openfisca-core/pull/1010)
1084
+
1085
+ #### Technical changes
1086
+
1087
+ - Update dependencies (_as in 35.3.7_).
1088
+ - Extend NumPy compatibility to v1.20 to support M1 processors.
1089
+
1090
+ - Make NumPy's type-checking compatible with 1.17.0+
1091
+ - NumPy introduced their `typing` module since 1.20.0
1092
+ - Previous type hints relying on `annotations` will henceforward no longer work
1093
+ - This changes ensure that type hints are always legal for the last four minor NumPy versions
1094
+
1095
+ ### 35.3.8 [#1014](https://github.com/openfisca/openfisca-core/pull/1014)
1096
+
1097
+ #### Bug fix
1098
+
1099
+ - Drop latest NumPy supported version to 1.18.x
1100
+ - OpenFisca relies on MyPy for optional duck & static type checking
1101
+ - When libraries do not implement their own types, MyPy provides stubs, or type sheds
1102
+ - Thanks to `__future__.annotations`, those stubs or type sheds are casted to `typing.Any`
1103
+ - Since 1.20.x, NumPy now provides their own type definitions
1104
+ - The introduction of NumPy 1.20.x in #990 caused one major problem:
1105
+ - It is general practice to do not import at runtime modules only used for typing purposes, thanks to the `typing.TYPE_CHEKING` variable
1106
+ - The new `numpy.typing` module was being imported at runtime, rendering OpenFisca unusable to all users depending on previous versions of NumPy (1.20.x-)
1107
+ - These changes revert #990 and solve #1009 and #1012
1108
+
1109
+ ### 35.3.7 [#990](https://github.com/openfisca/openfisca-core/pull/990)
1110
+
1111
+ _Note: this version has been unpublished due to an issue introduced by NumPy upgrade. Please use 34.3.8 or a more recent version._
1112
+
1113
+ #### Technical changes
1114
+
1115
+ - Update dependencies.
1116
+ - Extend NumPy compatibility to v1.20 to support M1 processors.
1117
+
1118
+ ### 35.3.6 [#984](https://github.com/openfisca/openfisca-core/pull/984)
1119
+
1120
+ #### Technical changes
1121
+
1122
+ - In web_api tests, extract `test_client` to a fixture reusable by all the tests in the test suite.
1123
+ - To mitigate possible performance issues, by default the fixture is initialised once per test module.
1124
+ - This follows the same approach as [#997](https://github.com/openfisca/openfisca-core/pull/997)
1125
+
1126
+
1127
+ ### 35.3.5 [#997](https://github.com/openfisca/openfisca-core/pull/997)
1128
+
1129
+ #### Technical changes
1130
+
1131
+ - In tests, extract `CountryTaxBenefitSystem` to a fixture reusable by all the tests in the test suite.
1132
+ - It allows for a better reusability of test scenarios available to new contributors.
1133
+ - To mitigate possible performance issues, by default the fixture is initialised once per test module.
1134
+
1135
+ ### 35.3.4 [#999](https://github.com/openfisca/openfisca-core/pull/999)
1136
+
1137
+ #### Technical improvements
1138
+
1139
+ - Change logging.warning to warnings.warn to allow users of the package to hide them.
1140
+
1141
+ ### 35.3.3 [#994](https://github.com/openfisca/openfisca-core/pull/994)
1142
+
1143
+ #### Bug fix
1144
+
1145
+ - Repair expansion of axes on a variable given as input
1146
+ - When expanding axes, the expected behaviour is to override any input value for the requested variable and period
1147
+ - As longs as we passed some input for a variable on a period, it was not being overrode, creating a NumPy's error (boradcasting)
1148
+ - By additionally checking that an input was given, now we make that the array has the correct shape by constructing it with NumPy's tile with a shape equal to the number of the axis expansion count requested.
1149
+
1150
+ ### 35.3.2 [#992](https://github.com/openfisca/openfisca-core/pull/992)
1151
+
1152
+ #### Technical improvements
1153
+
1154
+ - Render all OpenFisca Core components modular and sandboxed
1155
+ - Allows for simpler contribution
1156
+ - Allows for better unit testing
1157
+ - Allows for dealing with circular dependencies
1158
+ - Allows for more explicit contracts between components
1159
+
1160
+ #### Future deprecations
1161
+
1162
+ - Reorganise `formula_helpers`, `memory_config`, `rates`, `simulation_builder`.
1163
+ - Their functionalities are still there, just moved around
1164
+ - Transitional `__init__.py` files added to make transition smooth
1165
+
1166
+ - Rename of some errors for consistency
1167
+ - Added the suffix `Error` to all errors
1168
+ - They're still exposed publicly as they were before
1169
+
1170
+ ### 35.3.1 [#993](https://github.com/openfisca/openfisca-core/pull/993)
1171
+
1172
+ #### Bug fix
1173
+
1174
+ - [Web API] Gracefully handle unexpected errors
1175
+ - The exception signature expected by the internal server error handler was not the good one
1176
+ - Henceforth no response was being given to the user, when a 500 with an explanation was expected
1177
+
1178
+ ## 35.3.0 [#985](https://github.com/openfisca/openfisca-core/pull/985)
1179
+
1180
+ #### New features
1181
+
1182
+ - Introduce max_spiral_loops option in YAML test files
1183
+ - Allows for control of spiral depth for every test
1184
+
1185
+ ## 35.2.0 [#982](https://github.com/openfisca/openfisca-core/pull/982)
1186
+
1187
+ #### Technical changes
1188
+
1189
+ - Allow parameters to be arrays.
1190
+
1191
+ ### 35.1.1 [#981](https://github.com/openfisca/openfisca-core/pull/981)
1192
+
1193
+ #### Technical changes
1194
+
1195
+ - Fix false negative web API test following an update in the country template used for testing.
1196
+
1197
+ ## 35.1.0 [#973](https://github.com/openfisca/openfisca-core/pull/973)
1198
+
1199
+ #### Technical changes
1200
+
1201
+ - Extend assert_near so it is able to compare dates.
1202
+
1203
+ ### 35.0.5 [#974](https://github.com/openfisca/openfisca-core/pull/974)
1204
+
1205
+ #### Technical changes
1206
+
1207
+ - Fix web api test for a parameter node request with `/parameter` endpoint.
1208
+ - Details:
1209
+ - Untie the test from `OpenFisca-Country-Template` parameters list.
1210
+
1211
+ ### 35.0.4 [#965](https://github.com/openfisca/openfisca-core/pull/965)
1212
+
1213
+ #### Technical changes
1214
+
1215
+ - Improve error message when loading parameters file to detect the problematic file
1216
+
1217
+ ### 35.0.3 [#961](https://github.com/openfisca/openfisca-core/pull/961)
1218
+
1219
+ #### Technical changes
1220
+
1221
+ - Merge `flake8` and `pep8` configurations as they are redundant.
1222
+ - Details:
1223
+ - Use `flake8` configuration for `flake8` and `autopep8` dependencies.
1224
+
1225
+ ### 35.0.2 [#967](https://github.com/openfisca/openfisca-core/pull/967)
1226
+
1227
+ #### Technical changes
1228
+
1229
+ - Update dependency: `flask-cors` (`Flask` extension for Cross Origin Resource Sharing)
1230
+
1231
+ ### 35.0.1 [#968](https://github.com/openfisca/openfisca-core/pull/968)
1232
+
1233
+ #### Technical changes
1234
+
1235
+ - Fix a bug when using axes with an integer year period
1236
+ - Always index periods by their string representation in the memory of known input values of a simulation
1237
+
1238
+ # 35.0.0 [#954](https://github.com/openfisca/openfisca-core/pull/954)
1239
+
1240
+ #### Breaking changes
1241
+
1242
+ - Update NumPy version's upper bound to 1.18
1243
+ - NumPy 1.18 [expires a list of old deprecations](https://numpy.org/devdocs/release/1.18.0-notes.html#expired-deprecations) that might be used in openfisca country models.
1244
+
1245
+ #### Migration details
1246
+
1247
+ You might need to change your code if any of the [NumPy expired deprecations](https://numpy.org/devdocs/release/1.18.0-notes.html#expired-deprecations) is used in your model formulas.
1248
+
1249
+ Here is a subset of the deprecations that you might find in your model with some checks and migration steps (where `np` stands for `numpy`):
1250
+
1251
+ * `Removed deprecated support for boolean and empty condition lists in numpy.select.`
1252
+ * Before `numpy.select([], [])` result was `0` (for a `default` argument value set to `0`).
1253
+ * Now, we have to check for empty conditions and, return `0` or the defined default argument value when we want to keep the same behavior.
1254
+ * Before, integer conditions where transformed to booleans.
1255
+ * For example, `numpy.select([0, 1, 0], ['a', 'b', 'c'])` result was `array('b', dtype='<U21')`. Now, we have to update such code to: `numpy.select(numpy.array([0, 1, 0]).astype(bool), ['a', 'b', 'c'])`.
1256
+ * `numpy.linspace parameter num must be an integer.`
1257
+ * No surprise here, update the `num` parameter in [numpy.linspace](https://numpy.org/doc/1.18/reference/generated/numpy.linspace.html) in order to get an integer.
1258
+ * `Array order only accepts ‘C’, ‘F’, ‘A’, and ‘K’.`
1259
+ * Check that [numpy.array](https://numpy.org/doc/1.18/reference/generated/numpy.array.html) `order` argument gets one of the allowed values listed above.
1260
+ * `UFuncs with multiple outputs must use a tuple for the out kwarg.`
1261
+ * Update the output type of any used [universal function](https://numpy.org/doc/1.18/reference/ufuncs.html) to get a tuple.
1262
+
1263
+ ### 34.7.7 [#951](https://github.com/openfisca/openfisca-core/pull/951)
1264
+
1265
+ #### Technical changes
1266
+
1267
+ - Avoid Web API failure with _dynamic_ variable generation
1268
+ - Using reforms to create _dynamic_ variables can lead to a failure to start the API because introspection is failing to get a `source code` section
1269
+
1270
+ ### 34.7.6 [#957](https://github.com/openfisca/openfisca-core/pull/957)
1271
+
1272
+ #### Technical changes
1273
+
1274
+ - Update dependencies: `sortedcontainers`
1275
+
1276
+ ### 34.7.5 [#958](https://github.com/openfisca/openfisca-core/pull/958)
1277
+
1278
+ #### Technical changes
1279
+
1280
+ - Fix `PytestDeprecationWarning` on `openfisca test` command
1281
+
1282
+ ### 34.7.4 [#955](https://github.com/openfisca/openfisca-core/pull/955)
1283
+
1284
+ #### Technical changes
1285
+
1286
+ - Update dependencies: flake8 (style consistency enforcement)
1287
+
1288
+ ### 34.7.3 [#953](https://github.com/openfisca/openfisca-core/pull/953)
1289
+
1290
+ #### Technical changes
1291
+
1292
+ - Update dependencies: flask
1293
+
1294
+ ### 34.7.2 [#948](https://github.com/openfisca/openfisca-core/pull/948)
1295
+
1296
+ #### Technical changes
1297
+
1298
+ - Revert `dpath` dependency bump introduced by [#940](https://github.com/openfisca/openfisca-core/pull/940)
1299
+ - Fix bug in period interpretation by Web API ([openfisca-france#1413](https://github.com/openfisca/openfisca-france/issues/1413))
1300
+
1301
+ ### 34.7.1 [#940](https://github.com/openfisca/openfisca-core/pull/940)
1302
+
1303
+ _Note: this version has been unpublished due to an issue introduced by dpath upgrade. Please use 34.7.2 or a more recent version._
1304
+
1305
+ #### Technical changes
1306
+
1307
+ - Update dependencies: dpath, autopep8
1308
+
1309
+ ## 34.7.0 [#943](https://github.com/openfisca/openfisca-core/pull/943)
1310
+
1311
+ #### Deprecations
1312
+
1313
+ - Deprecate `Dummy`.
1314
+ - The functionality is now directly provided by `empty_clone`.
1315
+
1316
+ #### Technical changes
1317
+
1318
+ - Refactor abstract scales to use Python's `abc` lib.
1319
+ - This allows for consistent inheritance, which wasn't the case before.
1320
+
1321
+ ### 34.6.11 [#945](https://github.com/openfisca/openfisca-core/pull/945)
1322
+
1323
+ #### Technical changes
1324
+
1325
+ - Fixes web api loading to match latest `Werkzeug` dependency revision (`1.0.0`)
1326
+ - Details:
1327
+ - Preserve not merging double slashes by default.
1328
+ - Update `ProxyFix` module loading and initialising arguments.
1329
+
1330
+ ### 34.6.10 [#946](https://github.com/openfisca/openfisca-core/pull/946)
1331
+
1332
+ #### Technical changes
1333
+
1334
+ - Fix `Werkzeug` library version
1335
+ - Temporarily fix Web API loading disturbed by some `Werkzeug` deprecations
1336
+
1337
+ ### 34.6.9 [#925](https://github.com/openfisca/openfisca-core/pull/925)
1338
+
1339
+ #### Documentation
1340
+
1341
+ - Annotates the expected type of the axis count in `SimulationBuilder`.
1342
+
1343
+ ### 34.6.8 [#936](https://github.com/openfisca/openfisca-core/pull/936)
1344
+
1345
+ #### Technical change
1346
+
1347
+ - Update dependency: numexpr
1348
+
1349
+ ### 34.6.7 [#932](https://github.com/openfisca/openfisca-core/pull/932)
1350
+
1351
+ #### Documentation
1352
+
1353
+ - Add typing to `indexed_enums.py`.
1354
+ - Details:
1355
+ - Type-annotate `ndarray` types to help contributors know the actual methods signatures.
1356
+
1357
+ ### 34.6.6 [#931](https://github.com/openfisca/openfisca-core/pull/931)
1358
+
1359
+ #### Technical changes
1360
+
1361
+ - Improve `indexed_enums.py` code style.
1362
+ - Remove useless encoding declaration.
1363
+ - Use more explicit imports.
1364
+ - Improve indentation.
1365
+ - Use f-style string interpolation.
1366
+
1367
+ ### 34.6.5 [#930](https://github.com/openfisca/openfisca-core/pull/930)
1368
+
1369
+ #### Documentation
1370
+
1371
+ - Improve `indexed_enums.py` documentation.
1372
+ - Reduce line length.
1373
+ - Fix code examples.
1374
+ - Fix indentation.
1375
+
1376
+ ### 34.6.4 [#929](https://github.com/openfisca/openfisca-core/pull/929)
1377
+
1378
+ #### Documentation
1379
+
1380
+ - Add more explicit typing annotations for `ndarrays`.
1381
+
1382
+ ### 34.6.3 [#928](https://github.com/openfisca/openfisca-core/pull/928)
1383
+
1384
+ #### Technical changes
1385
+
1386
+ - Use `asarray` in `taxscales.py` when we know the argument is a `ndarray`.
1387
+ - Details:
1388
+ - It prevents `numpy` to copy the array if the `dtype` is compatible.
1389
+
1390
+ ### 34.6.2 [#927](https://github.com/openfisca/openfisca-core/pull/927)
1391
+
1392
+ #### Documentation
1393
+
1394
+ - Improve `taxscales.py` documentation.
1395
+ - Details:
1396
+ - Specify the types of the arguments.
1397
+ - Follow the same style as other parts of the documentation.
1398
+
1399
+ ### 34.6.1 [#926](https://github.com/openfisca/openfisca-core/pull/926)
1400
+
1401
+ #### Technical change
1402
+
1403
+ - Downgrade numpy version's upper bound to 1.17
1404
+ - Details:
1405
+ - NumPy 1.18 deprecates the use of several of its methods.
1406
+ - Changes in `numpy.select` have impacted other packages depending on OpenFisca Core.
1407
+
1408
+ ## 34.6.0 [#920](https://github.com/openfisca/openfisca-core/pull/920)
1409
+
1410
+ _Note: this version has been unpublished due to an issue introduced by 34.5.4. Please use 34.6.1 or a more recent version._
1411
+
1412
+ #### New features
1413
+
1414
+ - Introduce `AbstractTaxRateScale.bracket_indices`.
1415
+ - Introduce `MarginalTaxScale.marginal_rates`.
1416
+ - Details:
1417
+ - This new methods allow users to:
1418
+ - Compute the bracket indices relevant for any tax base.
1419
+ - Compute the marginal rates relevant for any tax base.
1420
+
1421
+ #### Usage notes
1422
+
1423
+ 1. To use `AbstractTaxRateScale.bracket_indices`:
1424
+
1425
+ ```py
1426
+ from numpy import array
1427
+
1428
+ from openfisca_core.taxscales import AbstractRateTaxScale
1429
+
1430
+ tax_scale = AbstractRateTaxScale()
1431
+ tax_scale.add_bracket(0, 0)
1432
+ tax_scale.add_bracket(100, 0.1)
1433
+ tax_base = array([0, 150])
1434
+ tax_scale.bracket_indices(tax_base) # [0, 1]
1435
+ ```
1436
+
1437
+ 2. To use `MarginalTaxScale.marginal_rates`:
1438
+
1439
+ ```py
1440
+ from numpy import array
1441
+
1442
+ from openfisca_core.taxscales import MarginalRateTaxScale
1443
+
1444
+ tax_scale = MarginalRateTaxScale()
1445
+ tax_scale.add_bracket(0, 0)
1446
+ tax_scale.add_bracket(100, 0.1)
1447
+ tax_base = array([0, 150])
1448
+ tax_scale.marginal_rates(tax_base) # [0.0, 0.1]
1449
+ ```
1450
+
1451
+ ### 34.5.4 [#919](https://github.com/openfisca/openfisca-core/pull/919)
1452
+
1453
+ #### Technical change
1454
+
1455
+ _Note: this version has been unpublished due to an issue introduced by it. Please use 34.6.1 or a more recent version._
1456
+
1457
+ - Update numpy version's upper bound to 1.18
1458
+
1459
+ ### 34.5.3 [#915](https://github.com/openfisca/openfisca-core/pull/915)
1460
+
1461
+ - Rename deprecated doc reference `openfisca-run-test` to `openfisca_test`.
1462
+
1463
+ ### 34.5.2 [#914](https://github.com/openfisca/openfisca-core/pull/914)
1464
+
1465
+ - Refactor the use of the now-deprecated `gunicorn.six` module.
1466
+ - In versions < 20, [gunicorn](http://docs.gunicorn.org/en/19.3/custom.html) provided the `gunicorn.six` module.
1467
+ - In version >= 20, this [gunicorn](http://docs.gunicorn.org/en/stable/custom.html) module has been deprecated.
1468
+ - Adapt `openfisca serve` code to the new gunicorn API.
1469
+
1470
+ ### 34.5.1 [#911](https://github.com/openfisca/openfisca-core/pull/911)
1471
+
1472
+ - Remove the library `enum34` from requirements
1473
+ - The library `enum34` provides a backport of >= 3.4 `enum` to >= 2.7, < 3.4 Python environments.
1474
+ - The standard `enum` and `enum34` are hence incompatible as installed under the same path.
1475
+ - Since we dropped support for <= 3.6, that library is no longer needed.
1476
+
1477
+ ## 34.5.0 [#909](https://github.com/openfisca/openfisca-core/pull/909)
1478
+
1479
+ - Introduce `tax_benefit_system.annualize_variable(variable_name, period)` method
1480
+ - Used in reform, this method allows to speed up variable calculations when a month-to-month calculation is not relevant, for instance if the input data are annual.
1481
+
1482
+ ### 34.4.5 [#906](https://github.com/openfisca/openfisca-core/pull/906)
1483
+
1484
+ - Make the tracer generate CSV tables containing details about calculation times
1485
+ - Make `tracer.get_flat_trace` scale for large populations
1486
+
1487
+ ### 34.4.4 [#908](https://github.com/openfisca/openfisca-core/pull/908)
1488
+
1489
+ - Make parameter cloning return clones that are truly independent from their source
1490
+ - Before this PR, editing the clone of a parameter tree would change the initial tree
1491
+ - Only impacts reforms that edit parameters tree
1492
+
1493
+ ### 34.4.3 [#907](https://github.com/openfisca/openfisca-core/pull/907)
1494
+
1495
+ - Fix documentation on v.21.2.0
1496
+
1497
+ ### 34.4.2 [#905](https://github.com/openfisca/openfisca-core/pull/905)
1498
+
1499
+ - Fix minor errors that result in operations being uselessly repeated over and over.
1500
+
1501
+ ### 34.4.1 [#904](https://github.com/openfisca/openfisca-core/pull/904)
1502
+
1503
+ - Improve performance graph introduced in 34.4.0
1504
+ - Sort frames by calculation time
1505
+ - Increase graph precision
1506
+ - Make the HTML graph self-supported: it can now be open with a simple browser, without starting a local server
1507
+
1508
+ ## 34.4.0 [#895](https://github.com/openfisca/openfisca-core/pull/895)
1509
+
1510
+ #### New features
1511
+
1512
+ - Introduce the time performance flame graph
1513
+ - Generates a flame graph in a web page to view the time taken by every calculation in a simulation
1514
+ - Introduces `--performance` option to `openfisca test` command to generate a YAML test graph
1515
+
1516
+ #### Usage notes
1517
+
1518
+ 1. To generate the flame graph:
1519
+ * For a Python simulation:
1520
+
1521
+ ```py
1522
+ tax_benefit_system = CountryTaxBenefitSystem()
1523
+ simulation = SimulationBuilder().build_default_simulation(tax_benefit_system)
1524
+
1525
+ simulation.trace = True # set the full tracer
1526
+ [... simulation.calculate(...) ...]
1527
+ simulation.tracer.performance_log.generate_graph(".") # generate graph in chosen directory
1528
+ ```
1529
+
1530
+ * For a YAML test, execute the test with the `--performance` option.
1531
+
1532
+ For example, to run the `irpp.yaml` test in `openfisca-france/` run:
1533
+ ```sh
1534
+ openfisca test tests/formulas/irpp.yaml --performance -c openfisca_france
1535
+ ```
1536
+ This generates an `index.html` file in the current directory.
1537
+
1538
+ 2. From the current directory, run a Python web server (here on port `5000`):
1539
+
1540
+ `python -m http.server 5000`
1541
+
1542
+ 3. See the flame graph result in your browser at `http://localhost:5000`.
1543
+ This interprets the generated `index.html`.
1544
+
1545
+ When your yaml file contains multiple tests, only the last one is displayed in the flame chart.
1546
+ You can use [openfisca test --name_filter option](https://openfisca.org/doc/openfisca-python-api/openfisca-run-test.html) to choose a specific test case.
1547
+
1548
+ ### 34.3.3 [#902](https://github.com/openfisca/openfisca-core/pull/902)
1549
+
1550
+ #### Technical change
1551
+
1552
+ - Update dependency: numexpr
1553
+
1554
+ ### 34.3.2 [#901](https://github.com/openfisca/openfisca-core/pull/901)
1555
+
1556
+ #### Technical change
1557
+
1558
+ - Update dependency: numpy
1559
+
1560
+ ### 34.3.1 [#900](https://github.com/openfisca/openfisca-core/pull/900)
1561
+
1562
+ #### Bug fix
1563
+
1564
+ - Fix serialisation error introduced in [34.2.9](https://github.com/openfisca/openfisca-core/tree/34.2.9) in route `/trace` (Web API)
1565
+ - This was causing an Internal Server Error
1566
+ - Notably, `numpy` arrays were not being parsed correctly as not JSON serialisable
1567
+
1568
+ ### 34.3.0 [#894](https://github.com/openfisca/openfisca-core/pull/894)
1569
+
1570
+ _Note: this version has been unpublished due to an issue introduced by 34.2.9 in the Web API. Please use 34.3.1 or a more recent version._
1571
+
1572
+ - Update pytest version's upper bound to 6.0.0
1573
+
1574
+ ### 34.2.9 [#884](https://github.com/openfisca/openfisca-core/pull/884)
1575
+
1576
+ _Note: this version has been unpublished due to an issue introduced by 34.2.9 in the Web API. Please use 34.3.1 or a more recent version._
1577
+
1578
+ - Refactor simulation tracer implementation
1579
+ - These changes should be transparent for users
1580
+ - They should enable more precise performance measures, to come in a later version.
1581
+
1582
+ ### 34.2.8 [#892](https://github.com/openfisca/openfisca-core/pull/892)
1583
+
1584
+ #### Documentation
1585
+
1586
+ - Update links to the doc in the API
1587
+
1588
+ ### 34.2.7 [#886](https://github.com/openfisca/openfisca-core/pull/885)
1589
+
1590
+ #### Minor change
1591
+
1592
+ - Enforce type checking in tests and Continuous Integration
1593
+
1594
+ ### 34.2.6 [#886](https://github.com/openfisca/openfisca-core/pull/886)
1595
+
1596
+ #### Minor change
1597
+
1598
+ - Remove remaining of extra-parameters handling, since that feature was removed in 28.0
1599
+
1600
+ ### 34.2.5 [#888](https://github.com/openfisca/openfisca-core/pull/888)
1601
+
1602
+ #### Technical changes
1603
+
1604
+ - Define a trim option for average rate function.
1605
+ - Convert a dict_values to a list (left-over by the python 3 migration)
1606
+ - Use a less stric version dependency for psutils. Problem arising with psutils are mainly due to freeze at install. Use `pip` option `--no-cache-dir` if you face troubles at install.
1607
+
1608
+ ### 34.2.4 [#870](https://github.com/openfisca/openfisca-core/pull/870)
1609
+
1610
+ #### Bug fix
1611
+
1612
+ - Avoid column-wrapping array values in debug strings
1613
+
1614
+ ### 34.2.3 [#883](https://github.com/openfisca/openfisca-core/pull/883)
1615
+
1616
+ #### Technical changes
1617
+
1618
+ - Update dependency: psutil
1619
+
1620
+ ### 34.2.2 [#873](https://github.com/openfisca/openfisca-core/pull/873)
1621
+
1622
+ #### Bug fixes
1623
+
1624
+ - Fix incomplete initialization of group entities provided by default when not supplied in YAML tests
1625
+
1626
+ ### 34.2.1 [#882](https://github.com/openfisca/openfisca-core/pull/882)
1627
+
1628
+ #### Technical changes
1629
+
1630
+ - Update dependencies: NumPy, Flask, dpath, numexpr
1631
+
1632
+ ## 34.2.0 [#872](https://github.com/openfisca/openfisca-core/pull/872)
1633
+
1634
+ #### New features
1635
+
1636
+ - Allow formulas to return scalar values; broadcast these values to population-sized arrays
1637
+
1638
+ ## 34.1.0 [#876](https://github.com/openfisca/openfisca-core/pull/876)
1639
+
1640
+ #### New features
1641
+
1642
+ - Support role indices in SimulationBuilder.join_with_persons
1643
+ - This broadens the range of input data we can handle, at some risk of misattributing roles
1644
+
1645
+ ### 34.0.1 [#868](https://github.com/openfisca/openfisca-core/pull/868)
1646
+
1647
+ #### Bug fix
1648
+
1649
+ - Allow both `*.yaml` and `*.yml` extensions for YAML tests
1650
+
1651
+ # 34.0.0 [#867](https://github.com/openfisca/openfisca-core/pull/867)
1652
+
1653
+ #### Technical changes
1654
+
1655
+ - Use pytest instead of nose in `openfica test`
1656
+
1657
+ ### Breaking changes
1658
+
1659
+ - Remove `generate_tests` function from `openfisca_core.tools.test_runner`:
1660
+ - While this function was public and documented, its purpose was primarily internal and is unlikely to have been directly used by users.
1661
+
1662
+ ### 33.0.1 [#865](https://github.com/openfisca/openfisca-core/pull/865)
1663
+
1664
+ - Improve error message when too many persons are given a role with a `max` attribute
1665
+ - This error typically happens when 3 parents are declared in a family, while the entity declaration specifies there can be at most 2.
1666
+
1667
+ # 33.0.0 [#866](https://github.com/openfisca/openfisca-core/pull/866)
1668
+
1669
+ ### Breaking changes
1670
+
1671
+ - Duplicate keys in YAML parameter files now raise an error
1672
+ - Before, only one of the two values declared was taking into account, while the other was silently ignored
1673
+
1674
+ ### 32.1.1 [#864](https://github.com/openfisca/openfisca-core/pull/864)
1675
+
1676
+ - Fix host in the `/spec` route of the Web API
1677
+ - The host should not include the HTTP scheme (http or https)
1678
+
1679
+ ## 32.1.0 [#863](https://github.com/openfisca/openfisca-core/pull/863)
1680
+
1681
+ - Display symbolic values of Enums in /trace and print_computation_log
1682
+
1683
+ # 32.0.0 [#857](https://github.com/openfisca/openfisca-core/pull/857)
1684
+
1685
+ ### Breaking changes
1686
+
1687
+ - Split the "Entity" class hierarchy (Entity, PersonEntity, GroupEntity) into two parallel hierarchies, representing respectively the abstract, model-level information (classes named Entity etc.) and the population-level information (classes named Population and GroupPopulation)
1688
+ - As a result, the first parameter passed to a formula is now a Population instance
1689
+ - Much more detail (and class diagrams) in the PR description
1690
+ - Remove support from the syntax `some_entity.SOME_ROLE` to access roles (where `some_entity` is the entity passed to a formula).
1691
+
1692
+ #### Migration details
1693
+
1694
+ - Use the standard SomeEntity.SOME_ROLE instead. (Where SomeEntity is the capitalized entity or instance, Household.PARENT.)
1695
+ - Code that relied excessively on internal implementation details of Entity may break, and should be updated to access methods of Entity/Population instead.
1696
+
1697
+ # 31.0.1 [#840](https://github.com/openfisca/openfisca-core/pull/840)
1698
+
1699
+ - Improve usability of Enum values:
1700
+ - Details:
1701
+ - Allow the use of Enum values in comparisons: instead of using `<Enum class>.possible_values` you can simply `import` the Enum class
1702
+ - Accept Enum values via set_input (same result as the previous point)
1703
+
1704
+ # 31.0.0 [#813](https://github.com/openfisca/openfisca-core/pull/813)
1705
+
1706
+ #### Breaking changes
1707
+
1708
+ - Require clients to make explicit when input variables cover a range of dates, rather than allowing inputs to be derived from past or future values; also removes the `missing_value` base function
1709
+
1710
+ #### Migration notes
1711
+
1712
+ You might need to change your code if any of the following applies:
1713
+ - you are a model author, and there are variables in your model that use a `base_function` attribute
1714
+ - your model **or application** uses any non-numeric variables (boolean, date, string or Enum) used in, for which the period on which you define **inputs** does not match the period for which you are requesting **outputs**
1715
+
1716
+ Detailed instructions are provided in the [PR description](https://github.com/openfisca/openfisca-core/pull/813).
1717
+
1718
+ ### 30.0.3 [#859](https://github.com/openfisca/openfisca-core/pull/859)
1719
+
1720
+ - Raise an error instead of silently ignoring the input when a user tries to set an input for a variable for several months (or several years), but the variable has no `set_input` declared.
1721
+
1722
+ ### 30.0.2 [#860](https://github.com/openfisca/openfisca-core/pull/860)
1723
+
1724
+ - Apply `flake8-bugbear` recommendations and enforce same in continuous integration.
1725
+
1726
+ ### 30.0.1 [#855](https://github.com/openfisca/openfisca-core/pull/855)
1727
+
1728
+ - Remove Python 2 compatibility code.
1729
+
1730
+ # 30.0.0 [#817](https://github.com/openfisca/openfisca-core/pull/817)
1731
+
1732
+ #### Breaking changes
1733
+
1734
+ - Improve cycle and spiral detection, giving consistent results more systematically
1735
+
1736
+ #### Migration notes
1737
+
1738
+ - Remove all optional parameters `max_nb_cycles`
1739
+ - Avoid relying on cached values of a computation
1740
+
1741
+ For additional details, see the PR's [description](https://github.com/openfisca/openfisca-core/pull/817).
1742
+
1743
+ ### 29.0.2 [#858](https://github.com/openfisca/openfisca-core/pull/858)
1744
+
1745
+ #### Bug fix
1746
+
1747
+ - Fix error on simulation debug attribute at simulation clone
1748
+ - Details:
1749
+ - Fixes `AttributeError: 'Simulation' object has no attribute 'debug'` introduced by Core v.`29.0.0`.
1750
+
1751
+ ### 29.0.1 [#851](https://github.com/openfisca/openfisca-core/pull/851)
1752
+
1753
+ - Remove print statements from `simulations.py`, add linting options to detect stray print statements
1754
+
1755
+ # 29.0.0 [#843](https://github.com/openfisca/openfisca-core/pull/843)
1756
+
1757
+ #### Breaking changes
1758
+
1759
+ - Remove argument `simulation_json` of `Simulation` constructor, which was deprecated as of Core 25
1760
+ - Remove keyword arguments from Simulation constructor, which should be called only from SimulationBuilder; introduce a property for `trace`
1761
+ - Remove `period` attribute of Simulation
1762
+
1763
+ #### Migration notes
1764
+
1765
+ - As of Core 25, the preferred way of constructing new Simulation instances is via SimulationBuilder, any remaining uses of scenarios should be migrated to that API first.
1766
+ - Any period attribute of the Simulation was coming from the simulation data (test case or JSON structure), use that instead of the attribute in the Simulation instance.
1767
+ - Any keyword arguments of Simulation that you were using (or passing to Simulation-constructing methods) can now be accessed directly or as properties, `trace` being the most widely used. Example below:
1768
+
1769
+ **Before**
1770
+
1771
+ ```Python
1772
+ simulation = SimulationBuilder().build_from_entities(
1773
+ tax_benefit_system, input_data, trace=True
1774
+ )
1775
+ ```
1776
+
1777
+ **After**
1778
+
1779
+ ```Python
1780
+ simulation = SimulationBuilder().build_from_entities(tax_benefit_system, input_data)
1781
+ simulation.trace = True
1782
+ ```
1783
+
1784
+ ### 28.0.1 [#845](https://github.com/openfisca/openfisca-core/pull/845)
1785
+
1786
+ - Consistently use the safe approach to YAML loading, fixing [this deprecation warning](https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation) introduced in PyYAML 5.1
1787
+
1788
+ # 28.0.0 [#847](https://github.com/openfisca/openfisca-core/pull/847)
1789
+
1790
+ #### Breaking changes
1791
+
1792
+ Remove extra_params altogether from Core. This puts all formulas on an equal footing and simplifies
1793
+ simulation and data storage code.
1794
+
1795
+ #### Migration notes
1796
+
1797
+ For almost all users, no migration is needed.
1798
+
1799
+ You may be impacted only if you were computing (for instance in a notebook) one of the two variables from France that used this non-standard extension to the `calculate(variable, period)` API: `rsa_fictif` or `ppa_fictive`. In that case you had to supply the additional parameter `mois_demande`. Use `rsa` or `ppa` directly, and go back to the standard API.
1800
+
1801
+ ### 27.0.2 [#844](https://github.com/openfisca/openfisca-core/pull/844)
1802
+
1803
+ > Note: Versions `27.0.0` and `27.0.1` have been unpublished as the former accidentally introduced a bug affecting test inputs. Please use version `27.0.2` or more recent.
1804
+
1805
+ - Fix a bug introduced in 27.0.0, affecting YAML tests; because of an incorrect date comparison, input variables would be ignored if they had an end date.
1806
+
1807
+ ### 27.0.1 [#839](https://github.com/openfisca/openfisca-core/pull/839)
1808
+
1809
+ #### Technical changes
1810
+
1811
+ - Provide three levels of information when running tests depending on context:
1812
+ - when running `pytest`, all failures are reported, coverage is omitted
1813
+ - when running `make test`, all failures are reported, with coverage also reported
1814
+ - in continuous integration, exit on first failure, but report coverage always
1815
+
1816
+ # 27.0.0 [#826](https://github.com/openfisca/openfisca-core/pull/826)
1817
+
1818
+ #### Breaking changes
1819
+
1820
+ - No longer honor calls to `set_input` for variables which have an end date and for periods after that date.
1821
+
1822
+ #### Migration guide
1823
+
1824
+ This change is not expected to actually break much reusing code (if any), as it is unlikely that one would deliberately specify an end date for a variable and use it in computations for periods past that date. However, nothing has previously ruled out relying on that behaviour and it may have been introduced by accident. In particular, it can happen that a variable with a formula and an end date is also, in some applications, used as an input.
1825
+
1826
+ ## 26.2.0 [#833](https://github.com/openfisca/openfisca-core/pull/833)
1827
+
1828
+ - Introduce a way to build a simulation for tabular inputs
1829
+
1830
+ #### New features
1831
+
1832
+ - Allow to create a simulation step by step:
1833
+ 1. Create entities with `SimulationBuilder.create_entities(...)`
1834
+ 2. Declare your population
1835
+ with `SimulationBuilder.declare_person_entity(...)` and `SimulationBuilder.declare_entity(...)`
1836
+ 3. Link between persons in population definition with `SimulationBuilder.join_with_persons(...)`
1837
+ 4. Build a simulation with `SimulationBuilder.build(...)`
1838
+ 5. Set variable values with the already existing `Simulation.set_input(...)` method
1839
+
1840
+ ## 26.1.0 [#835](https://github.com/openfisca/openfisca-core/pull/835)
1841
+
1842
+ - No longer raise an error when a group entity is not specified in a test case, or partially specified.
1843
+ - Instead, each person is by default allocated to a group of which they are the sole member, with the default role in that group.
1844
+
1845
+ ### 26.0.6 [#836](https://github.com/openfisca/openfisca-core/pull/836)
1846
+
1847
+ - Convert tests that were incompatible with Pytest 4.0+ and reported "xfail" when run with that version
1848
+
1849
+ ### 26.0.5 [#829](https://github.com/openfisca/openfisca-core/pull/829)
1850
+
1851
+ - Update autopep8 and flake8, which in particular now enforce rules W504 and W605
1852
+ - W504 goes against house style, so we add it to ignored rules
1853
+ - W605 may seem like an [overreach](https://github.com/PyCQA/pycodestyle/issues/755) but does make sense (additional details in PR description), so we upgrade a few regexes to raw strings
1854
+
1855
+ ### 26.0.4 [#825](https://github.com/openfisca/openfisca-core/pull/825)
1856
+
1857
+ - Fixes regression introduced by Core v25 when running YAML tests with reforms or extensions
1858
+
1859
+ ### 26.0.3 [828](https://github.com/openfisca/openfisca-core/pull/828)
1860
+
1861
+ - Remove `__future__` statements
1862
+ - As Python 2 support has been dropped, they are not needed anymore.
1863
+
1864
+ ### 26.0.2 [830](https://github.com/openfisca/openfisca-core/pull/830)
1865
+
1866
+ - Collect and publish measurements of which lines of codes are exercised (or not) by our tests
1867
+
1868
+ ### 26.0.1 [831](https://github.com/openfisca/openfisca-core/pull/831)
1869
+
1870
+ - Greet visitors to our Github repo with badges providing contact and code information
1871
+
1872
+ # 26.0.0 [#790](https://github.com/openfisca/openfisca-core/pull/790)
1873
+
1874
+ #### What this PR brings
1875
+
1876
+ An exciting but under-documented feature, "axes", now has much better test coverage and thus long-term maintainability (the documentation is still lacking, but see https://github.com/openfisca/tutorial for demos)
1877
+
1878
+ #### Breaking changes
1879
+
1880
+ This PR deprecates the `new_scenario` approach to constructing Simulation objects. This will impact you if:
1881
+ - your notebooks or scripts or other Python code rely on the France model and use the old form of creating a Simulation object (see below)
1882
+ - **or** your country package defines a Scenario class and injects it [the way France does](https://github.com/openfisca/openfisca-france/blob/11b18985ce4decc31b5666114b2525dddf42652b/openfisca_france/france_taxbenefitsystem.py#L29)
1883
+
1884
+ **To migrate to this version**, if you are in the first case, the minimum required change is this:
1885
+
1886
+ *The old way:*
1887
+ ```
1888
+ simulation = tax_benefit_system.new_scenario().init_single_entity(...some data...).new_simulation()
1889
+ ```
1890
+ *The new way:*
1891
+ ```
1892
+ # At the top of your file
1893
+ from openfisca_france.scenarios import init_single_entity
1894
+ # Below
1895
+ simulation = init_single_entity(tax_benefit_system.new_scenario(), ...some data...).new_simulation()
1896
+ ```
1897
+
1898
+ If you are in the latter case, you must also transform your `init_single_entity` from a Scenario method to a regular function at global scope, and change your tests and reuses as described above.
1899
+
1900
+ ### 25.3.4 [827](https://github.com/openfisca/openfisca-core/pull/827)
1901
+
1902
+ - Optimize `set_input_dispatch_by_period` so that it doesn't create duplicate vectors in memory
1903
+
1904
+ ### 25.3.3 [821](https://github.com/openfisca/openfisca-core/pull/821)
1905
+
1906
+ - Bring up the debugger on integration test failures with `openfisca test --pdb` optional argument
1907
+
1908
+ ### 25.3.2 [824](https://github.com/openfisca/openfisca-core/pull/824)
1909
+
1910
+ - Rename LICENSE.AGPL.txt to LICENSE to let github recognize it
1911
+
1912
+ ### 25.3.1 [#820](https://github.com/openfisca/openfisca-core/pull/820)
1913
+
1914
+ - Outputs a more helpful message when a variable checked in a test doesn't exist
1915
+ - Introduces unit tests for the test runner
1916
+
1917
+ ## 25.3.0 [#811](https://github.com/openfisca/openfisca-core/pull/811)
1918
+
1919
+ #### Technical changes
1920
+
1921
+ - Allow France to model "Chèque Energie" in a cleaner way:
1922
+ - Introduce SingleAmountTaxScale (SATS), a simpler form of MarginalAmountTaxScale (MATS)
1923
+ - whereas MATS sums the values in brackets, up to the amount subject to the scale, SATS only "looks up" the appropriate value for the amount subject to the scale, and is thus the simpler mechanism
1924
+ - use `numpy.digitize`, allowing callers to specify right or left intervals
1925
+ - introduce a `type` tag in `brackets` object, thus far with only `single_amount` allowed
1926
+ - Rename AmountTaxScale to MarginalAmountTaxScale and make it inherit from SATS
1927
+
1928
+ This is non-breaking, as there are no direct clients of these classes outside of Core.
1929
+
1930
+ ### 25.2.9 [#814](https://github.com/openfisca/openfisca-core/pull/814)
1931
+
1932
+ - When a YAML test fails, display the correct period for wrong output variable
1933
+
1934
+ ### 25.2.8 [#815](https://github.com/openfisca/openfisca-core/pull/815)
1935
+
1936
+ - Quell a warning in the build of openfisca-doc by moving a docstring to the right place
1937
+
1938
+ ### 25.2.7 [#803](https://github.com/openfisca/openfisca-core/pull/803)
1939
+
1940
+ - Allow country package users to run `openfisca test` without installing the `web_api` dependency
1941
+ - Alias `openfisca-run-test` to `openfisca test`
1942
+
1943
+ ### 25.2.6 [#797](https://github.com/openfisca/openfisca-core/pull/797)
1944
+
1945
+ - Improve `print_computation_log` and make it a tested, thus supported call
1946
+
1947
+ ### 25.2.5 [#802](https://github.com/openfisca/openfisca-core/pull/802)
1948
+
1949
+ - Load extensions more reliably, by removing dead code in load_extension
1950
+
1951
+ ### 25.2.4 [#806](https://github.com/openfisca/openfisca-core/pull/806)
1952
+
1953
+ - Supply a missing default parameter in `Simulation.delete_arrays` method.
1954
+
1955
+ ### 25.2.3 [#800](https://github.com/openfisca/openfisca-core/pull/800)
1956
+
1957
+ - Fix an exception on yaml import in test runner
1958
+
1959
+ ### 25.2.2 [#798](https://github.com/openfisca/openfisca-core/pull/798)
1960
+
1961
+ - Fix a regression in the YAML test runner. If you have changed any YAML tests since 25.0.0, please rerun them.
1962
+
1963
+ ### 25.2.1 [#796](https://github.com/openfisca/openfisca-core/pull/796)
1964
+
1965
+ - Update documentation URL in the API welcome message
1966
+
1967
+ ### 25.2.0 [#766](https://github.com/openfisca/openfisca-core/pull/766)
1968
+
1969
+ - Support DAY periods
1970
+
1971
+ ### 25.1.1 [#794](https://github.com/openfisca/openfisca-core/pull/794)
1972
+
1973
+ - Explicit test runner dependencies in Python 2.7
1974
+ - Using an older version of `ruamel` caused a `'CommentedSeq' object has no attribute 'get'` error.
1975
+
1976
+ ## 25.1.0 [#787](https://github.com/openfisca/openfisca-core/pull/787)
1977
+
1978
+ - Don't sort JSON keys in the Web API
1979
+ - By default, `flask` sorts JSON _object_ keys alphabetically
1980
+ - This is useful for reusing http caches for example, at the cost of some performance overhead
1981
+ - But the [JSON specification](https://www.json.org/) doesn’t require to keep an order, as _objects_ are defined as "an unordered set of name/value pairs"
1982
+
1983
+ # 25.0.0 [#781](https://github.com/openfisca/openfisca-core/pull/781)
1984
+
1985
+ #### Breaking changes
1986
+
1987
+ - Change the syntax of OpenFisca YAML tests
1988
+
1989
+ For instance, a test that was using the `input_variables` keyword like:
1990
+
1991
+ ```yaml
1992
+ - name: Basic income
1993
+ period: 2016-12
1994
+ input_variables:
1995
+ salary: 1200
1996
+ output_variables:
1997
+ basic_income: 600
1998
+ ```
1999
+
2000
+ becomes:
2001
+
2002
+ ```yaml
2003
+ - name: Basic income
2004
+ period: 2016-12
2005
+ input:
2006
+ salary: 1200
2007
+ output:
2008
+ basic_income: 600
2009
+ ```
2010
+
2011
+ A test that was fully specifying its entities like:
2012
+
2013
+ ```yaml
2014
+ name: Housing tax
2015
+ period: 2017-01
2016
+ households:
2017
+ - parents: [ Alicia ]
2018
+ children: [ Michael ]
2019
+ persons:
2020
+ - id: Alicia
2021
+ birth: 1961-01-15
2022
+ - id: Michael
2023
+ birth: 2002-01-15
2024
+ output_variables:
2025
+ housing_tax:
2026
+ 2017: 1000
2027
+ ```
2028
+
2029
+ becomes:
2030
+
2031
+ ```yaml
2032
+ name: Housing tax
2033
+ period: 2017-01
2034
+ input:
2035
+ household:
2036
+ parents: [ Alicia ]
2037
+ children: [ Michael ]
2038
+ persons:
2039
+ Alicia:
2040
+ birth: 1961-01-15
2041
+ Michael:
2042
+ birth: 2002-01-15
2043
+ output:
2044
+ housing_tax:
2045
+ 2017: 1000
2046
+ ```
2047
+
2048
+ A **migration script** is available to automatically convert tests:
2049
+
2050
+ ```sh
2051
+ python openfisca_core/scripts/migrations/v24_to_25.py /path/to/tests/
2052
+ ```
2053
+
2054
+ > Note for country packages using Scenarios (e.g. France, Tunisia):
2055
+ > Tests are not using scenarios anymore. Therefore, tests cannot partially specify entities anymore. Tests using entities inference may need manual adaptation in addition to the script.
2056
+
2057
+ - The `Entity` constructor (usually not directly called by users) does not accept an `entities_json` parameter anymore.
2058
+
2059
+
2060
+ #### Deprecation
2061
+
2062
+ - Deprecate `openfisca-run-test`
2063
+ - `openfisca test` should be used instead.
2064
+
2065
+ - Deprecate the use of the `simulation_json` parameter in the `Simulation` constructor.
2066
+ - `SimulationBuilder(tax_benefit_system).build_from_entities(simulation_json)` should be used instead
2067
+
2068
+
2069
+ #### New features
2070
+
2071
+ - In YAML tests, allow to define expected output for a specific entity
2072
+
2073
+ For instance:
2074
+
2075
+ ```yaml
2076
+ name: Housing tax
2077
+ period: 2017-01
2078
+ input:
2079
+ ...
2080
+ output:
2081
+ persons:
2082
+ Alicia:
2083
+ salary: 3000
2084
+ ```
2085
+
2086
+ - In YAML tests, allow to specify an extension to use to run the test:
2087
+ - See [example](https://github.com/openfisca/openfisca-core/blob/25.0.0/tests/core/yaml_tests/test_with_extension.yaml)
2088
+
2089
+ - In YAML tests, allow the use of YAML anchors:
2090
+ - See [example](https://github.com/openfisca/openfisca-core/blob/25.0.0/tests/core/yaml_tests/test_with_anchors.yaml)
2091
+
2092
+ - Introduce [`EnumArray.decode_to_str`](https://openfisca.org/doc/openfisca-python-api/enum_array.html#openfisca_core.indexed_enums.EnumArray.decode_to_str)
2093
+
2094
+
2095
+ #### Architecture changes
2096
+
2097
+ - Move the complex initialisation logics (for JSON-like inputs) to `SimulationBuilder`, away from the `Simulation` and `Entity` classes
2098
+
2099
+ ## 24.11.0 [#791](https://github.com/openfisca/openfisca-core/pull/791)
2100
+
2101
+ - In Python, simplify getting known periods for variable in a simulation:
2102
+
2103
+ Before:
2104
+
2105
+ ```py
2106
+ simulation = ...
2107
+ holder = simulation.persons.get_holder("salary")
2108
+ holder.get_known_periods()
2109
+ ```
2110
+
2111
+ After:
2112
+
2113
+ ```py
2114
+ simulation = ...
2115
+ simulation.get_known_periods("salary")
2116
+ ```
2117
+
2118
+ ## 24.10.0 [#784](https://github.com/openfisca/openfisca-core/pull/784)
2119
+
2120
+ - In Python, simplify simulation array deletion:
2121
+
2122
+ Before:
2123
+
2124
+ ```py
2125
+ simulation = ...
2126
+ holder = simulation.persons.get_holder("salary")
2127
+ holder.delete_arrays("2018-08")
2128
+ ```
2129
+
2130
+ After:
2131
+
2132
+ ```py
2133
+ simulation = ...
2134
+ simulation.delete_arrays("salary", "2018-08")
2135
+ ```
2136
+
2137
+ ### 24.9.9 [#786](https://github.com/openfisca/openfisca-core/pull/786)
2138
+
2139
+ - Set a 120s default timeout in `openfisca serve`
2140
+ - Otherwise, they regularly restart with an anxiety-provoking "[CRITICAL] WORKER TIMEOUT (pid:2137)" message in log
2141
+
2142
+ ### 24.9.8 [#780](https://github.com/openfisca/openfisca-core/pull/780)
2143
+
2144
+ - Allow non-integral inputs to int variables
2145
+
2146
+ ### 24.9.7 [#769](https://github.com/openfisca/openfisca-core/pull/769)
2147
+
2148
+ - Ensure `path.to.parameter` syntax works consistently across country and extension
2149
+
2150
+ ### 24.9.6 [#771](https://github.com/openfisca/openfisca-core/pull/771)
2151
+
2152
+ - Improve serve command by documenting the bind option
2153
+ - Avoid crashing when no arguments are supplied
2154
+
2155
+ ### 24.9.5 [#774](https://github.com/openfisca/openfisca-core/pull/774)
2156
+
2157
+ - Clarify the error message when assigning a value larger than MaxInt32 to an 'int' variable
2158
+
2159
+ ### 24.9.4 [#777](https://github.com/openfisca/openfisca-core/pull/777)
2160
+
2161
+ - Allow OpenFisca-Core users to define their own level of log
2162
+
2163
+ ### 24.9.3 [#778](https://github.com/openfisca/openfisca-core/pull/778)
2164
+
2165
+ - Remove the reference doc source, as it's been moved to https://github.com/openfisca/openfisca-doc.
2166
+ - Rebuild the doc when the Core codebase changes
2167
+
2168
+ ### 24.9.2 [#776](https://github.com/openfisca/openfisca-core/pull/776)
2169
+
2170
+ - Allow `ParameterNode` children to have a numeric keys
2171
+ - Before, an incorrect id would be set for these children, resulting to inconsistencies in the Web API.
2172
+
2173
+ ### 24.9.1 [#770](https://github.com/openfisca/openfisca-core/pull/770)
2174
+
2175
+ - Fix a bug that prevented amount scale parameters from being accessed in a formula
2176
+
2177
+ ## 24.9.0 [#767](https://github.com/openfisca/openfisca-core/pull/767)
2178
+
2179
+ - Introduce `ParameterNode.get_descendants`
2180
+ - This method returns a generator containing all the parameters and nodes recursively contained in the `ParameterNode`
2181
+
2182
+ ### 24.8.2 [#773](https://github.com/openfisca/openfisca-core/pull/773)
2183
+
2184
+ - Make sure to cap all dependency versions, in order to avoid unwanted functional and integration breaks caused by external code updates
2185
+ - For example [#772](https://github.com/openfisca/openfisca-core/pull/772)
2186
+
2187
+ ### 24.8.1 [#772](https://github.com/openfisca/openfisca-core/pull/772)
2188
+
2189
+ - Limits the range of PyTest versions to < 4.0 to avoid CI crashes caused by 4.0.
2190
+
2191
+ ## 24.8.0 [#765](https://github.com/openfisca/openfisca-core/pull/765)
2192
+
2193
+ - Adds called parameters to Web API `/trace` endpoint
2194
+ - For a calculated variable, add `parameters` item next to `dependencies` in `/trace` response
2195
+ - For example:
2196
+ ```JSON
2197
+ {
2198
+ "income_tax<2017-01>": {
2199
+ "dependencies": [
2200
+ "salary<2017-01>"
2201
+ ],
2202
+ "parameters": {
2203
+ "taxes.income_tax_rate<2017-01-01>": 0.15
2204
+ },
2205
+ "value": [150]
2206
+ }
2207
+ }
2208
+ ```
2209
+ - Scale parameters are also traced:
2210
+ ```json
2211
+ "parameters": {
2212
+ "taxes.social_security_contribution<2017-01-01>": {
2213
+ "0.0": 0.02,
2214
+ "12400.0": 0.12,
2215
+ "6000.0": 0.06
2216
+ }
2217
+ },
2218
+ ```
2219
+
2220
+ ### 24.7.0 [#756](https://github.com/openfisca/openfisca-core/pull/756)
2221
+
2222
+ - Exposes `amount` scales through the Web API
2223
+ - Allows for [AmountTaxScale](https://github.com/openfisca/openfisca-core/blob/2b76b2ae5f684832411694c7c763b2d84c521c3c/openfisca_core/taxscales.py#L119) parameters to be consumed through the Web API
2224
+ - See for an example this [parameter in openfisca-tunisia](https://github.com/openfisca/openfisca-tunisia/blob/10a15168e0aab5000f6850ad2f7779eba5da0fe0/openfisca_tunisia/parameters/impot_revenu/contribution_budget_etat.yaml)
2225
+
2226
+ ### 24.6.8 [#753](https://github.com/openfisca/openfisca-core/pull/753)
2227
+
2228
+ - Always allow `documentation` property for `ParameterNode`
2229
+ - Due to a bug, this field was accepted in an `index.yaml` file, but not in a `ParameterNode` located in a single YAML file
2230
+
2231
+ ### 24.6.7 [#760](https://github.com/openfisca/openfisca-core/pull/760)
2232
+
2233
+ - Tests the computation of the average tax rate of a targeted net income, according to the varying gross income.
2234
+
2235
+ ### 24.6.6 [#758](https://github.com/openfisca/openfisca-core/pull/758)
2236
+
2237
+ - Updates the requirements on [numpy](http://www.numpy.org) to permit version 1.16
2238
+
2239
+ ### 24.6.5 [#751](https://github.com/openfisca/openfisca-core/pull/751)
2240
+
2241
+ - Fix unproper `entity.count` restoration of a dumped simulation
2242
+ - Use more previsible value for average rate even when a division by zero is present
2243
+
2244
+ ### 24.6.4 [#752](https://github.com/openfisca/openfisca-core/pull/752)
2245
+
2246
+ - Improve the warning message incentivizing users to install `libyaml`
2247
+ - `pyyaml` needs to be fully reinstalled to use `libyaml`
2248
+
2249
+ ### 24.6.3 [#746](https://github.com/openfisca/openfisca-core/pull/746)
2250
+
2251
+ - Use `pytest` to run tests, as `nose` and `nose2` are not in active development anymore
2252
+ - Declare `nose` as a dependency so dependee libraries like `openfisca-france`can use `openfisca-run-test` without having to add `nose` as a dependency
2253
+
2254
+ _Note: `openfisca-run-test` still depends on `nose`._
2255
+
2256
+
2257
+ ### 24.6.2 [#735](https://github.com/openfisca/openfisca-core/pull/735)
2258
+
2259
+ - Apply W504 enforcement (Knuth's style)
2260
+ - Removes version cap on linting libraries
2261
+
2262
+ ## 24.6.1 [#745](https://github.com/openfisca/openfisca-core/pull/745)
2263
+
2264
+ - Fix `host` property in the OpenAPI `/spec`
2265
+ - It should not contain the scheme (e.g. `http`)
2266
+ - Infer scheme from request
2267
+ - Before, we would assume `https`, which is not always accurate
2268
+
2269
+ ## 24.6.0 [#744](https://github.com/openfisca/openfisca-core/pull/744)
2270
+
2271
+ - Allow TaxBenefitSystem to define the examples to use in the `/spec` route.
2272
+ - See [docs](https://openfisca.org/doc/openfisca-web-api/config-openapi.html).
2273
+
2274
+ ### 24.5.6 [#743](https://github.com/openfisca/openfisca-core/pull/743)
2275
+
2276
+ - When there is an empty `index.yaml` in the parameters, ignore it instead of raising an error.
2277
+
2278
+ ### 24.5.5 [#742](https://github.com/openfisca/openfisca-core/pull/742)
2279
+
2280
+ - Fix the internal server error that appeared for the `/trace` and (less frequently) `/calculate` route of the Web API
2281
+ - This error appeared when a simulation output was a variable of type string
2282
+
2283
+
2284
+ > Note: Versions `24.5.3` and `24.5.4` have been unpublished as they accidentally introduced a breaking change. Please use version `24.5.5` or more recent.
2285
+
2286
+
2287
+ ### 24.5.2 [#734](https://github.com/openfisca/openfisca-core/pull/734)
2288
+
2289
+ - Ignore W503 to enforce Knuth's style (W504)
2290
+ - Fix failing entities test
2291
+ - Household description was outdated
2292
+
2293
+ ### 24.5.1 [#732](https://github.com/openfisca/openfisca-core/pull/732)
2294
+
2295
+ - Further adopt simplified simulation initialisation
2296
+ - See [#729](https://github.com/openfisca/openfisca-core/pull/729)
2297
+
2298
+ ## 24.5.0 [#729](https://github.com/openfisca/openfisca-core/pull/729)
2299
+
2300
+ - In Python, simplify simulation initialisation:
2301
+
2302
+ Before:
2303
+
2304
+ ```py
2305
+ simulation = ...
2306
+ holder = simulation.persons.get_holder("salary")
2307
+ holder.set_input("2018-08", [4000])
2308
+ ```
2309
+
2310
+ After:
2311
+
2312
+ ```py
2313
+ simulation = ...
2314
+ simulation.set_input("salary", "2018-08", [4000])
2315
+ ```
2316
+
2317
+ ## 24.4.0 [#717](https://github.com/openfisca/openfisca-core/pull/717)
2318
+
2319
+ - In Python, allow multiline documentation on parameters and variables
2320
+ - Introduce `documentation` attribute on `ParameterNode`, `Parameter` and `Variable` classes
2321
+
2322
+ - In the Web API, expose this documentation as a `documentation` property for parameters, variables and variables' formulas
2323
+ - on `/parameter` nodes as `/parameter/benefits`
2324
+ > = python `ParameterNode.documentation`
2325
+ > = YAML parameter node (`index.yaml`) `documentation` string attribute
2326
+ - on `/parameter` leafs as `/parameter/benefits/housing_allowance`
2327
+ > = python `Parameter.documentation`
2328
+ > = YAML parameter `documentation` string attribute
2329
+ - on `/variable` as `/variable/housing_allowance`
2330
+ > = python `Variable.documentation`
2331
+ - on every `/variable` leaf formula
2332
+ > = python `Variable` formula **docstring**
2333
+
2334
+ ### 24.3.2 [#727](https://github.com/openfisca/openfisca-core/pull/727)
2335
+
2336
+ - Add a style formatter that follows community code conventions
2337
+ - Auto-fix code formatting
2338
+
2339
+ ### 24.3.1 [#723](https://github.com/openfisca/openfisca-core/pull/723)
2340
+
2341
+ - Fix small issues in the `/spec` route of the Web API
2342
+ - Use proper JSON Schema type to describe input types
2343
+ - Fix property name in the description of `/parameters` and `/variables`
2344
+
2345
+ ### 24.3.0 [#714](https://github.com/openfisca/openfisca-core/pull/714)
2346
+
2347
+ - Introduce the `/entities` endpoint for the Web API.
2348
+ - Expose information about the country package's entities, and their roles.
2349
+ ```json
2350
+ {
2351
+ "description": "Household",
2352
+ "documentation": "Household is an example of a group entity. A group entity contains one or more individual·s.[...]",
2353
+ "plural": "households",
2354
+ "roles": {
2355
+ "parent": {
2356
+ "description": "The one or two adults in charge of the household.",
2357
+ "max": 2,
2358
+ "plural": "parents"
2359
+ },
2360
+ "child": {
2361
+ "description": "Other individuals living in the household.",
2362
+ "plural": "children"
2363
+ }
2364
+ }
2365
+ }
2366
+ ```
2367
+
2368
+ ## 24.2.0 [#712](https://github.com/openfisca/openfisca-core/pull/712)
2369
+
2370
+ - Allow to dump and restore a simulation in a directory
2371
+
2372
+ Dump:
2373
+
2374
+ ```py
2375
+ from openfisca_core.tools.simulation_dumper import dump_simulation
2376
+
2377
+ dump_simulation(simulation, "/path/to/directory")
2378
+ ```
2379
+
2380
+ Restore:
2381
+
2382
+ ```py
2383
+ from openfisca_core.tools.simulation_dumper import restore_simulation
2384
+
2385
+ simulation = restore_simulation("/path/to/directory", tax_benefit_system)
2386
+ ```
2387
+
2388
+ ### 24.1.0 [#713](https://github.com/openfisca/openfisca-core/pull/713)
2389
+
2390
+ - Enhance navigation within the Openfisca Web API.
2391
+ - Provides a direct link to individual parameters and variables from the `/parameters` and `/variables` routes.
2392
+
2393
+ The former `/parameters` route of the Web API:
2394
+
2395
+ ```json
2396
+ "benefits.basic_income": {
2397
+ "description": "Amount of the basic income",
2398
+ },
2399
+ "benefits.housing_allowance": {
2400
+ "description":"Housing allowance amount (as a fraction of the rent)",
2401
+ },
2402
+ ...
2403
+ ```
2404
+
2405
+ becomes:
2406
+
2407
+ ```json
2408
+ "benefits.basic_income": {
2409
+ "description": "Amount of the basic income",
2410
+ "href":"http://localhost:5000/parameter/benefits.basic_income"
2411
+ },
2412
+ "benefits.housing_allowance": {
2413
+ "description":"Housing allowance amount (as a fraction of the rent)",
2414
+ "href":"http://localhost:5000/parameter/benefits.housing_allowance"
2415
+ },
2416
+ ...
2417
+ ```
2418
+
2419
+ ### 24.0.1 [#711](https://github.com/openfisca/openfisca-core/pull/711)
2420
+
2421
+ - Fix spelling in warning about libyaml
2422
+
2423
+ # 24.0.0 [#703](https://github.com/openfisca/openfisca-core/pull/703)
2424
+
2425
+ #### Breaking changes
2426
+
2427
+ ##### Only install the Web API dependencies as an opt-in:
2428
+
2429
+ - `pip install OpenFisca-Core` will _not_ install the Web API anymore.
2430
+ - `pip install OpenFisca-Core[web-api]` will.
2431
+
2432
+ Country package maintainers who still want to provide the Web API by default with their package (**recommended**) should update their `setup.py`:
2433
+ - In the `install_requires` section, replace `'OpenFisca-Core >= 23.3, < 24.0'` by `'OpenFisca-Core[api] >= 24.0, < 25.0'`
2434
+ - See [example](https://github.com/openfisca/country-template/commit/b75eea97d8d22091a3f13a580118ce45b16f4294)
2435
+
2436
+ ##### Change default Web API port to 5000:
2437
+
2438
+ - `openfisca serve` will now serve by default on the `5000` port instead of `6000` (blocked by Chrome).
2439
+
2440
+ ##### Rename OpenFisca Web Api package to `openfisca_web_api`:
2441
+
2442
+ - Transparent for users of the `openfisca serve` command.
2443
+ - Users who used to manually import `openfisca_web_api_preview` must know import `openfisca_web_api`.
2444
+
2445
+ ##### Rename development dependencies from `test` to `dev`:
2446
+
2447
+ - Developers should now run `pip install --editable .[dev]` instead of `pip install --editable .[test]` to install them.
2448
+
2449
+ #### New features
2450
+
2451
+ - In the `/spec` route:
2452
+ - Indicate the served country package version as API version (instead of `0.1.0`).
2453
+ - Infer the host URL from the requests, instead of relying on the undocumented `SERVER_NAME` environment variable.
2454
+ - The use of the `SERVER_NAME` environment variable is therefore deprecated and without effect.
2455
+
2456
+ ### 23.5.2 [#710](https://github.com/openfisca/openfisca-core/pull/710)
2457
+
2458
+ - Revert the undesired side effects of `23.4.0` on the `parameters/` overview route of the Web API
2459
+ - This route now behaves the exact same way than before `23.4.0`
2460
+ - The keys of the `/parameters` JSON object are back to using the `.` notation
2461
+ - Parameter nodes are for now not exposed in the `parameters/` overview (but each of them is exposed in `/parameter/path/to/node`)
2462
+
2463
+ ### 23.5.1 [#708](https://github.com/openfisca/openfisca-core/pull/708)
2464
+ _Note: this version has been unpublished due to an issue introduced by 23.4.0 in the Web API. Please use 23.5.2 or a more recent version._
2465
+
2466
+ - Remove the irrelevant decimals that were added at the end of `float` results in the Web API and the test runner.
2467
+ - These decimals were added while converting a NumPy `float32` to a regular 64-bits Python `float`.
2468
+
2469
+ For instance, the former Web API response extract:
2470
+
2471
+ ```json
2472
+ "tax_incentive": {
2473
+ "2017-01": 333.3333435058594
2474
+ }
2475
+ ```
2476
+
2477
+ becomes:
2478
+
2479
+ ```json
2480
+ "tax_incentive": {
2481
+ "2017-01": 333.33334
2482
+ }
2483
+ ```
2484
+
2485
+ ## 23.5.0 [#705](https://github.com/openfisca/openfisca-core/pull/705)
2486
+ _Note: this version has been unpublished due to an issue introduced by 23.4.0 in the Web API. Please use 23.5.2 or a more recent version._
2487
+
2488
+ * On the Web API, expose a welcome message (with a 300 code) on `/` instead of a 404 error.
2489
+
2490
+ For instance, `curl -i localhost:5000` gives:
2491
+
2492
+ ```
2493
+ HTTP/1.1 300 MULTIPLE CHOICES
2494
+ (...)
2495
+
2496
+ {
2497
+ "welcome": "This is the root of an OpenFisca Web API. To learn how to use it, check the general documentation (https://openfisca.org/doc/api) and the OpenAPI specification of this instance (http://localhost:5000/spec)."
2498
+ }
2499
+ ```
2500
+
2501
+ * This message can be customized:
2502
+
2503
+ If the Web API is started with `openfisca serve -p 3000 --welcome-message "Welcome to the OpenFisca-France Web API. To learn how to use it, check our interactive swagger documentation: https://fr.openfisca.org/legislation/swagger."`
2504
+
2505
+ Then `curl -i localhost:5000` gives:
2506
+
2507
+ ```
2508
+ HTTP/1.1 300 MULTIPLE CHOICES
2509
+ (...)
2510
+
2511
+ {
2512
+ "welcome": "Welcome to the OpenFisca-France Web API. To learn how to use it, check our interactive swagger documentation: https://fr.openfisca.org/legislation/swagger"
2513
+ }
2514
+ ```
2515
+
2516
+ (Like other configuration variables, this custom message can also be defined in a configuration file. Check the [openfisca serve documentation](https://openfisca.readthedocs.io/en/latest/openfisca_serve.html))
2517
+
2518
+
2519
+ ### 23.4.1 [#700](https://github.com/openfisca/openfisca-core/pull/700)
2520
+ _Note: this version has been unpublished due to an issue introduced by 23.4.0 in the Web API. Please use 23.5.2 or a more recent version._
2521
+
2522
+ * Fix API source IP detection through proxies.
2523
+
2524
+ ## 23.4.0 [#694](https://github.com/openfisca/openfisca-core/pull/694)
2525
+ _Note: this version has been unpublished as it introduced an issue in the Web API. Please use 23.5.2 or a more recent version._
2526
+
2527
+ * Use `/` rather than `.` in the path to access a parameter:
2528
+ - For instance `/parameter/benefits.basic_income` becomes `/parameter/benefits/basic_income`
2529
+ - Using `.` is for now still supported, but is considered deprecated and will be turned to a 301 redirection in the next major version.
2530
+
2531
+ * Expose parameters `metadata` and `source` in the Web API and:
2532
+
2533
+ For instance, `/parameter/benefits/basic_income` contains:
2534
+
2535
+ ```JSON
2536
+ {
2537
+ "description": "Amount of the basic income",
2538
+ "id": "benefits.basic_income",
2539
+ "metadata": {
2540
+ "reference": "https://law.gov.example/basic-income/amount",
2541
+ "unit": "currency-EUR"
2542
+ },
2543
+ "source": "https://github.com/openfisca/country-template/blob/3.2.2/openfisca_country_template/parameters/benefits/basic_income.yaml",
2544
+ "values": {
2545
+ "2015-12-01": 600.0
2546
+ }
2547
+ }
2548
+ ```
2549
+
2550
+ * Expose parameters nodes in the Web API
2551
+ - For instance, `/parameter/benefits` now exists and contains:
2552
+
2553
+ ```JSON
2554
+ {
2555
+ "description": "Social benefits",
2556
+ "id": "benefits",
2557
+ "metadata": {},
2558
+ "source": "https://github.com/openfisca/country-template/blob/3.2.2/openfisca_country_template/parameters/benefits",
2559
+ "subparams": {
2560
+ "basic_income": {
2561
+ "description": "Amount of the basic income"
2562
+ },
2563
+ "housing_allowance": {
2564
+ "description": "Housing allowance amount (as a fraction of the rent)"
2565
+ }
2566
+ }
2567
+ }
2568
+ ```
2569
+
2570
+ Note that this route doesn't _recursively_ explore the node, and only exposes its direct children name and description.
2571
+
2572
+
2573
+ ### 23.3.2 [#702](https://github.com/openfisca/openfisca-core/pull/702)
2574
+
2575
+ Minor Change without any impact for country package developers and users:
2576
+ - Make code more Python3-like by backporting unicode literals.
2577
+ - With this backport, all strings are by default unicodes.
2578
+ - The `u` prefix for strings should *not* be used anymore.
2579
+ - Each new module must start by `from __future__ import unicode_literals` for the backport to be effective.
2580
+
2581
+ ### 23.3.1 [#682](https://github.com/openfisca/openfisca-core/pull/682)
2582
+
2583
+ * Send reference of the country-package and its version to the tracker so it will appear in the tracking statistics.
2584
+
2585
+ ## 23.3.0 [#681](https://github.com/openfisca/openfisca-core/pull/681)
2586
+
2587
+ * Change the way metadata are declared for Parameter.
2588
+
2589
+ Before:
2590
+ ```YAML
2591
+ description: Age of retirement
2592
+ reference: https://wikipedia.org/wiki/retirement
2593
+ unit: year
2594
+ values: (...)
2595
+ ```
2596
+
2597
+ After:
2598
+ ```YAML
2599
+ description: Age of retirement
2600
+ metadata:
2601
+ reference: https://wikipedia.org/wiki/retirement
2602
+ unit: year
2603
+ values: (...)
2604
+ ```
2605
+
2606
+ _Setting `unit` and `reference` out of `metadata` is considered deprecated, but still works for backward compatibility._
2607
+
2608
+ * Allow legislation coders to define their own medatada
2609
+
2610
+ * Expose in the Python API
2611
+ - Parameters metadata:
2612
+ - e.g. `parameters.taxes.rate.metadata['unit']`
2613
+ - Parameter value metadata:
2614
+ - e.g. `parameters.taxes.rate.values_list[0].metadata['unit']`
2615
+ - Parameter node description and metadata:
2616
+ - e.g. `parameters.taxes.metadata['reference']`, `parameters.taxes.description`
2617
+ - Note: Parameter descriptions (e.g. `parameters.taxes.rate.description`) were already exposed
2618
+
2619
+ ## 23.2.0 [#689](https://github.com/openfisca/openfisca-core/pull/689)
2620
+
2621
+ * Introduce `TaxBenefitSystem.replace_variable`
2622
+ - Unlike `update_variable`, this method does _not_ keep any of the replaced variable in the new one.
2623
+ - See [reference documentation](https://openfisca.org/doc/openfisca-python-api/tax-benefit-system.html#openfisca_core.taxbenefitsystems.TaxBenefitSystem.replace_variable).
2624
+
2625
+ ### 23.1.7 [#686](https://github.com/openfisca/openfisca-core/pull/686)
2626
+
2627
+ * Fix installation on Windows with Python 3.7
2628
+ - Require `psutil` version `5.4.6`, as `5.4.2` is incompatible with that environment.
2629
+
2630
+ ### 23.1.6 [#688](https://github.com/openfisca/openfisca-core/pull/688)
2631
+
2632
+ * In the error message sent to a user trying to set a variable without specifying for which period, add an example for a variable defined for `ETERNITY`.
2633
+
2634
+ ### 23.1.5 [#687](https://github.com/openfisca/openfisca-core/pull/687)
2635
+
2636
+ * Allow to set uncached variables when using a `memory_config`
2637
+ - Previously, trying to set variables listed in `variables_to_drop` of the `memory_config` had no effect.
2638
+ - Now this variables are still not cached, but they can be set by the user.
2639
+
2640
+ ### 23.1.4 [#679](https://github.com/openfisca/openfisca-core/pull/679)
2641
+
2642
+ * Use C binding to load and dump Yaml (`CLoader` and `CDumper`)
2643
+ - For countries with several Yaml tests, they can take some time to run
2644
+ - Using the C bindings provided by `libyaml` adds a little performance boost
2645
+
2646
+ ### 23.1.3 [#680](https://github.com/openfisca/openfisca-core/pull/680)
2647
+
2648
+ Fix test that was failing due to migration to HTTPS
2649
+
2650
+ ### 23.1.2 [#671](https://github.com/openfisca/openfisca-core/pull/671)
2651
+
2652
+ - Minor technical improvement
2653
+ - Publish both Python 2 and Python 3 version on Pypi in CircleCI
2654
+
2655
+ ### 23.1.1 [#661](https://github.com/openfisca/openfisca-core/pull/661)
2656
+
2657
+ - Fixup Python 3 compatibility
2658
+
2659
+ ### 23.1.0 [#660](https://github.com/openfisca/openfisca-core/pull/660)
2660
+
2661
+ Make package compatible with Python 3
2662
+
2663
+ ### 23.0.2 [#645](https://github.com/openfisca/openfisca-core/pull/645)
2664
+
2665
+ Start adapting OpenFisca to Python 3
2666
+ - Imports are now all absolute imports
2667
+ - `unicode_type` and `basestring_type` are now used for compatible type checking.
2668
+ - All calls for sorted() use the key parameter
2669
+ - Iteration on dict now uses dict.items()
2670
+
2671
+ ### 23.0.1 [656](https://github.com/openfisca/openfisca-core/pull/656)
2672
+
2673
+ * Re-accept `int` values for `instant` in `tax_benefit_system.get_parameter_at_instant(instant)`
2674
+ * `int` values were accidentally rejected since v23
2675
+
2676
+ # 23.0.0 [643](https://github.com/openfisca/openfisca-core/pull/643)
2677
+
2678
+ This changeset aims at simplifying the OpenFisca Core architecture.
2679
+
2680
+ Changes should be transparent for legislation modeling and web API usage.
2681
+
2682
+ It can impact users using the Python API (see Breaking changes part)
2683
+
2684
+ General architecture principles:
2685
+ - `Simulation` is the class in charge of running the calculations
2686
+ - `Holder` is the class in charge of keeping input and previously calculated values
2687
+
2688
+ #### Breaking changes
2689
+
2690
+ - Remove two (already deprecated) possible values for the variable attribute `base_function`:
2691
+ - `permanent_default_value`
2692
+ - `requested_period_added_value`
2693
+
2694
+ In `Holder`:
2695
+ - Remove deprecated constructor `Holder(simulation, variable)`
2696
+ - Use `Holder(entity, variable)` instead
2697
+ - Remove attributes:
2698
+ - `formula` and `real_formula`
2699
+ - Use `variable.formulas` instead (see more further down)
2700
+ - `array`
2701
+ - Use `get_array(period)` instead
2702
+ - Remove methods:
2703
+ - `calculate` and `compute`
2704
+ - Use `simulation.calculate` instead
2705
+ - `calculate_output`
2706
+ - Use `simulation.calculate_output` instead
2707
+ - `compute_add`
2708
+ - Use `simulation.calculate_add` instead
2709
+ - `compute_divide`
2710
+ - Use `simulation.calculate_divide` instead
2711
+ - `get_from_cache`
2712
+ - Use `get_array` instead
2713
+ - `graph`
2714
+ - Methods `set_input` and `put_in_cache` don't return anything anymore.
2715
+
2716
+ In `Simulation`:
2717
+ - Reorder constructor arguments
2718
+ - `tax_benefit_system` is now the first (mandatory) argument, and `simulation_json` the second (optional) one.
2719
+ - Remove attributes:
2720
+ - `holder_by_name`
2721
+ - Use `simulation.get_holder(...)` or `entity.get_holder(...)` instead
2722
+ - Remove methods:
2723
+ - `compute`
2724
+ - Use `calculate` instead
2725
+ - `compute_add`
2726
+ - Use `calculate_add` instead
2727
+ - `compute_divide`
2728
+ - Use `calculate_divide` instead
2729
+ - `parameters_at`
2730
+ - Use `simulation.tax_benefit_sytem.get_parameters_at_instant` instead
2731
+ - `graph`
2732
+ - `to_input_variables_json`
2733
+ - Undeprecate, but slightly change the behaviour of the `get_holder(variable)` method:
2734
+ - Optional second argument `default` is not accepted anymore
2735
+ - If no holder has yet been created for the variable, no error is raised, and a new holder is created and returned.
2736
+
2737
+ #### New features
2738
+
2739
+ - Introduce `variable.formulas`, a sorted dict containing all the formulas of a variable:
2740
+
2741
+ ```py
2742
+ tax_benefit_system.get_variable('basic_income').formulas
2743
+ >>> SortedDict({
2744
+ '2015-12-01': <function formula_2015_12 at 0x1079aa500>,
2745
+ '2016-12-01': <function formula_2016_12 at 0x1079aa488>
2746
+ })
2747
+ ```
2748
+
2749
+ Each value is a simple python function.
2750
+
2751
+ - Make `holder.set_input` more flexible
2752
+ - It now accepts a string as `period`
2753
+ - It now accepts a list as `array`
2754
+
2755
+ #### Technical changes
2756
+
2757
+ - Remove module `formulas` and class `Formula`
2758
+ - Variables's formulas are now simple functions.
2759
+ - Remove class `DatedHolder`
2760
+ - All calculation methods now return a simple numpy array
2761
+ - Variables don't necessary have a base function anymore
2762
+ - Without a base function, the default behavior is to return the default value if there is no formula.
2763
+
2764
+ ## 22.1.0 [#648](https://github.com/openfisca/openfisca-core/pull/648)
2765
+
2766
+ * Allow two variable file to have the same name in a tax and benefit system
2767
+ - A [collision](https://github.com/openfisca/openfisca-core/issues/642) between module names made it impossible so far.
2768
+
2769
+ ### 22.0.10 [#654](https://github.com/openfisca/openfisca-core/pull/654)
2770
+
2771
+ * Fix `dtype` attribute for `EnumArray`s (returned when calculating a variable of `value_type` `Enum`):
2772
+ - It was the type `numpy.int16` and not the dtype instance `numpy.dtype(numpy.int16)`
2773
+ - This caused issue when trying to export an `EnumArray` with `pandas`
2774
+
2775
+ ### 22.0.9 [#650](https://github.com/openfisca/openfisca-core/pull/5O)
2776
+
2777
+ * Fix operators such as `household.first_parent`, `foyer_fiscal.declarant_principal` for multi-entities simulations.
2778
+ - This issue was not affecting simulations with several persons in a _single_ entity
2779
+ - The underlying `entity.value_from_person` operator was not working as expected in case the persons of the simulation were not sorted by entity id in the persons vector (see example in 22.0.8 right below).
2780
+
2781
+ ### 22.0.8 [#646](https://github.com/openfisca/openfisca-core/pull/639)
2782
+
2783
+ * Fix `entity.max`, `entity.min`, `entity.all` and `entity.reduce` for multi-entities simulations.
2784
+ - This issue was not affecting simulations with several persons in a _single_ entity
2785
+ - These operators were not working as expected in case the persons of the simulation were not sorted by entity id in the persons vector. For instance:
2786
+ - First household: [Alice, Bob]
2787
+ - Second household: [Cesar]
2788
+ - Persons vector: [Alice, Cesar, Bob]
2789
+
2790
+ ### 22.0.7 [#639](https://github.com/openfisca/openfisca-core/pull/639)
2791
+
2792
+ * Update CircleCI configuration to its v2
2793
+
2794
+ ### 22.0.6 [#642](https://github.com/openfisca/openfisca-core/pull/642)
2795
+
2796
+ * Improve parameters performances
2797
+
2798
+ ### 22.0.5 [#639](https://github.com/openfisca/openfisca-core/pull/639)
2799
+
2800
+ * Update country-template dependency to >= 3.0.0, < 4.0.0
2801
+
2802
+ ### 22.0.4 [#624](https://github.com/openfisca/openfisca-core/pull/624)
2803
+
2804
+ * Technical improvement:
2805
+ * Details:
2806
+ - Make sure ParameterNode:__repr__ generates a valid YAML representation
2807
+
2808
+ ### 22.0.3 [#635](https://github.com/openfisca/openfisca-core/pull/635)
2809
+
2810
+ * Update numpy dependency
2811
+ * Details:
2812
+ - Previously, openfisca-core used features removed on numpy 1.13
2813
+
2814
+ ### 22.0.2 [#627](https://github.com/openfisca/openfisca-core/pull/627) [#593](https://github.com/openfisca/openfisca-core/pull/593)
2815
+
2816
+ - Update openfisca_serve [rst](https://openfisca.org/doc/openfisca-python-api/openfisca_serve.html) documentation
2817
+ * Make native gunicorn parameters use in `openfisca serve` obvious and make parameters' format more explicit
2818
+
2819
+ ### 22.0.1 [#628](https://github.com/openfisca/openfisca-core/pull/628)
2820
+
2821
+ - Fix a bug that broke the route `calculate` of the legacy web API since `21.0.2`
2822
+
2823
+ # 22.0.0 [#602](https://github.com/openfisca/openfisca-core/pull/602)
2824
+
2825
+ #### Breaking changes
2826
+
2827
+ - Improve entities projection consistency
2828
+
2829
+ Before, there were inconsistencies in the behaviors of projectors:
2830
+
2831
+ _For instance, for a simulation that contains 4 persons in 1 household:_
2832
+
2833
+ ```py
2834
+ person.household('rent', '2018-02') # The rent paid by the household of the person.
2835
+ >>> [800, 800, 800, 800] # Has the dimension of persons (4)
2836
+
2837
+ salaries = person.household.members('salary', '2018-02')
2838
+ sum_salary = person.household.sum(salaries) # The sum of the salaries of the person's family
2839
+ >>> [4000] Has the dimension of household (1)
2840
+ ```
2841
+
2842
+
2843
+ Now, consistency have been enforced for all entities related helpers (`sum`, `min`, `max`, `all`, `any`, `has_role`, etc.)
2844
+
2845
+
2846
+ ```py
2847
+ person.household('rent', '2018-02') # The rent paid by the household of the person.
2848
+ >>> [800, 800, 800, 800] # Has the dimension of persons (4)
2849
+
2850
+ salaries = person.household.members('salary')
2851
+ sum_salary = person.household.sum(salaries) # The sum of the salaries of the person's family
2852
+ >>> [4000, 4000, 4000, 4000] # Has the dimension of persons (4)
2853
+ ```
2854
+
2855
+ This is a breaking change, as all the adaptations (such as [this one](https://github.com/openfisca/openfisca-france/blob/18.11.0/openfisca_france/model/prestations/minima_sociaux/rsa.py#L375-L376)) used to overcome these inconsistensies must be removed.
2856
+
2857
+ ## 21.5.0 [#621](https://github.com/openfisca/openfisca-core/pull/621)
2858
+
2859
+ - Introduce:
2860
+ - [`person.get_rank(entity, criteria, condition)`](https://github.com/openfisca/openfisca-core/blob/21.4.0/openfisca_core/entities.py#L278-L293)
2861
+ - [`entity.value_nth_person(k, array, default)`](https://github.com/openfisca/openfisca-core/blob/21.4.0/openfisca_core/entities.py#L515-L520)
2862
+
2863
+ ## 21.4.0 [#603](https://github.com/openfisca/openfisca-core/pull/603)
2864
+
2865
+ #### New features
2866
+
2867
+ - Improve `Tracer`:
2868
+ - Make aggregation more efficient
2869
+ - Introduce [`tracer.print_trace`](https://openfisca.org/doc/openfisca-python-api/tracer.html#openfisca_core.tracers.Tracer.print_trace)
2870
+
2871
+ ### 21.3.6 [#616](https://github.com/openfisca/openfisca-core/pull/618)
2872
+
2873
+ - Describe `/spec` endpoint in OpenAPI documentation available at `/spec`
2874
+
2875
+ ### 21.3.5 [#620](https://github.com/openfisca/openfisca-core/pull/620)
2876
+
2877
+ * Technical improvement:
2878
+ * Details:
2879
+ - Adapt to version `2.1.0` of Country-Template and version `1.1.3` of Extension-Template.
2880
+
2881
+ ### 21.3.4 [#604](https://github.com/openfisca/openfisca-core/pull/604)
2882
+
2883
+ - Introduce [simulation generator](https://openfisca.org/doc/openfisca-python-api/simulation_generator.html)
2884
+
2885
+ ### 21.3.3 [#608](https://github.com/openfisca/openfisca-core/pull/608)
2886
+
2887
+ - Improve API response time
2888
+
2889
+ ### 21.3.2 [#617](https://github.com/openfisca/openfisca-core/pull/611)
2890
+
2891
+ - Make decompositions more robust
2892
+
2893
+ ### 21.3.1 [#617](https://github.com/openfisca/openfisca-core/pull/617)
2894
+
2895
+ - Fix bug on API `/variable/{id}`
2896
+ - Encode API `/variable/{id}` output to `utf-8`
2897
+ - Add tests for `/variable/{id}` and `/parameter/{id}` encoding
2898
+
2899
+ ## 21.3.0 [#610](https://github.com/openfisca/openfisca-core/pull/610)
2900
+
2901
+ Add `--only-variables` and `--ignore-variables` options to `openfisca-run-test` to filter out tested output variables if needed.
2902
+
2903
+ ### 21.2.2 [#612](https://github.com/openfisca/openfisca-core/pull/612)
2904
+
2905
+ - When a variable file is loaded twice in the same python interpreter, make sure the second loading doesn't corrupt the first one.
2906
+ - This fixes a bug introduced in 21.0.2, which could lead to a corruption of the tax and benefit in rare edge cases
2907
+
2908
+ ### 21.2.1 [#613](https://github.com/openfisca/openfisca-core/pull/613)
2909
+
2910
+ - Fix two bugs that appeared with 21.2.0:
2911
+ - Properly encode the result of a formula returning an Enum value
2912
+ - Enable storing an Enum value on disk
2913
+
2914
+ ## 21.2.0 [#601](https://github.com/openfisca/openfisca-core/pull/601)
2915
+
2916
+ #### New features
2917
+
2918
+ - Improve [`holder.get_memory_usage`]((https://openfisca.org/doc/openfisca-python-api/holder.html#openfisca_core.holders.Holder.get_memory_usage)):
2919
+ - Add `nb_requests` and `nb_requests_by_array` fields in the memory usage stats for traced simulations.
2920
+
2921
+ - Enable intermediate data storage on disk to avoid memory overflow
2922
+ - Introduce `memory_config` option in `Simulation` constructor
2923
+ - This allows fine tuning of memory management in OpenFisca
2924
+
2925
+ For instance:
2926
+
2927
+ ```
2928
+ from openfisca_core.experimental import MemoryConfig
2929
+
2930
+ simulation = ... # create a Simulation object
2931
+
2932
+ config = MemoryConfig(
2933
+ max_memory_occupation = 0.95, # When 95% of the virtual memory is full, switch to disk storage
2934
+ priority_variables = ['salary', 'age'], # Always store these variables in memory
2935
+ variables_to_drop = ['age_elder_for_family_benefit'] # Do not store the value of these variables
2936
+ )
2937
+
2938
+ simulation.memory_config = config
2939
+ ```
2940
+
2941
+ ## 21.1.0 [#598](https://github.com/openfisca/openfisca-core/pull/598)
2942
+
2943
+ #### New features
2944
+
2945
+ - Improve `Tracer`:
2946
+
2947
+ - Introduce an `aggregate` option in [`tracer.print_computation_log`](https://openfisca.org/doc/openfisca-python-api/tracer.html#openfisca_core.tracers.Tracer.print_computation_log) to handle large population simulations.
2948
+ - Introduce [`tracer.usage_stats`](https://openfisca.org/doc/openfisca-python-api/tracer.html#openfisca_core.tracers.Tracer.usage_stats) to keep track of the number of times a variable is computed.
2949
+
2950
+ - Introduce methods to keep track of memory usage:
2951
+
2952
+ - Introduce [`holder.get_memory_usage`](https://openfisca.org/doc/openfisca-python-api/holder.html#openfisca_core.holders.Holder.get_memory_usage)
2953
+ - Introduce `entity.get_memory_usage`
2954
+ - Introduce `simulation.get_memory_usage`
2955
+
2956
+ - Improve `Holder` public interface:
2957
+
2958
+ - Enhance [`holder.delete_arrays`](https://openfisca.org/doc/openfisca-python-api/holder.html#openfisca_core.holders.Holder.get_memory_usage) to be able to remove known values only for a specific period
2959
+ - Introduce [`holder.get_known_periods`](https://openfisca.org/doc/openfisca-python-api/holder.html#openfisca_core.holders.Holder.get_known_periods)
2960
+
2961
+ - Introduce [`variable.get_formula`](https://openfisca.org/doc/openfisca-python-api/variables.html#openfisca_core.variables.Variable.get_formula)
2962
+
2963
+ - Re-introduce `taxscales.combine_tax_scales` to combine several tax scales.
2964
+
2965
+ #### Deprecations
2966
+
2967
+ - Deprecate `requested_period_added_value` base function, as it had no effect.
2968
+
2969
+ ### 21.0.3 [#595](https://github.com/openfisca/openfisca-core/pull/595)
2970
+
2971
+ #### Bug fix
2972
+
2973
+ - Fix API response encoding from ascii to utf-8
2974
+ * Improve user message by displaying `UnicodeDecodeError` information
2975
+
2976
+ # 21.0.2 [#589](https://github.com/openfisca/openfisca-core/pull/589) [#600](https://github.com/openfisca/openfisca-core/pull/600) [#605](https://github.com/openfisca/openfisca-core/pull/605)
2977
+
2978
+ _Note: the 21.0.1 and 21.0.0 versions have been unpublished due to performance issues_
2979
+
2980
+ #### Breaking changes
2981
+
2982
+ ##### Change the way enumerations (Enum) are defined when coding variables
2983
+
2984
+ Before:
2985
+
2986
+ ```py
2987
+ HOUSING_OCCUPANCY_STATUS = Enum(["Tenant", "Owner", "Free lodger", "Homeless"])
2988
+ ```
2989
+
2990
+ Now:
2991
+
2992
+ ```py
2993
+ class HousingOccupancyStatus(Enum):
2994
+ tenant = "Tenant"
2995
+ owner = "Owner"
2996
+ free_lodger = "Free lodger"
2997
+ homeless = "Homeless"
2998
+ ```
2999
+
3000
+ > Each Enum item has:
3001
+ > - a `name` property that contains its key (e.g. `tenant`)
3002
+ > - a `value` property that contains its description (e.g. `"Tenant or lodger who pays a monthly rent"`)
3003
+
3004
+ - Enum variables must now have an explicit default value
3005
+
3006
+ ```py
3007
+ class housing_occupancy_status(Variable):
3008
+ possible_values = (HousingOccupancyStatus,)
3009
+ default_value = HousingOccupancyStatus.tenant
3010
+ entity = Household
3011
+ definition_period = MONTH
3012
+ label = "Legal housing situation of the household concerning their main residence"
3013
+ ```
3014
+
3015
+
3016
+ - In a formula, to compare an Enum variable to a fixed value, use `housing_occupancy_status == HousingOccupancyStatus.tenant`
3017
+
3018
+ - To access a parameter that has a value for each Enum item (e.g. a value for `zone_1`, a value for `zone_2` ... ), use fancy indexing
3019
+
3020
+ > For example, if there is an enum:
3021
+ > ```py
3022
+ > class TypesZone(Enum):
3023
+ > z1 = "Zone 1"
3024
+ > z2 = "Zone 2"
3025
+ > ```
3026
+ > And two parameters `parameters.city_tax.z1` and `parameters.city_tax.z2`, they can be dynamically accessed through:
3027
+ > ```py
3028
+ > zone = numpy.asarray([TypesZone.z1, TypesZone.z2, TypesZone.z2, TypesZone.z1])
3029
+ > zone_value = parameters.rate._get_at_instant('2015-01-01').single.owner[zone]
3030
+ > ```
3031
+ > returns
3032
+ > ```py
3033
+ > [100, 200, 200, 100]
3034
+ > ```
3035
+ >
3036
+
3037
+ ##### Change the simulation inputs and outputs for enumeration variables
3038
+
3039
+ ###### Web API and YAML tests
3040
+
3041
+ - When setting the value of an input Enum variable for a simulation, the user must now send the **string identifier** (e.g. `free_lodger`).
3042
+ - The item index (e.g. `2`) is not accepted anymore
3043
+ - The value (e.g. `Free lodger`) is not accepted anymore.
3044
+
3045
+ - When calculating an Enum variable through the web API, the output will now be the string identifier.
3046
+
3047
+ ###### Python API
3048
+
3049
+ - When using the Python API (`set_input`), the three following inputs are accepted:
3050
+ - The enum item (e.g. HousingOccupancyStatus.tenant)
3051
+ - The enum string identifier (e.g. "tenant")
3052
+ - The enum item index, though this is not recommended.
3053
+ - If you rely on index, make sure to specify an `__order__` attribute to all your enums to make sure each intem has the right index. See the enum34 [doc](https://pypi.python.org/pypi/enum34/1.1.1).
3054
+
3055
+ > Example:
3056
+ ```py
3057
+ holder = simulation.household.get_holder("housing_occupancy_status")
3058
+ # Three possibilities
3059
+ holder.set_input(period, numpy.asarray([HousingOccupancyStatus.owner]))
3060
+ holder.set_input(period, numpy.asarray(["owner"]))
3061
+ holder.set_input(period, numpy.asarray([0])) # Highly not recommended
3062
+ ```
3063
+
3064
+ - When calculating an Enum variable, the output will be an [EnumArray](https://openfisca.org/doc/openfisca-python-api/enum_array.html#module-openfisca_core.indexed_enums).
3065
+
3066
+ # 20.0.0 [#590](https://github.com/openfisca/openfisca-core/pull/590)
3067
+
3068
+ #### Breaking changes
3069
+
3070
+ ##### Change the way Variables are declared
3071
+
3072
+ - Replace `column` attribute by `value_type`
3073
+ * Possible values of `value_type` are:
3074
+ * `int`
3075
+ * `float`
3076
+ * `bool`
3077
+ * `str`
3078
+ * `date`
3079
+ * `Enum`
3080
+
3081
+ Before:
3082
+
3083
+ ```py
3084
+ class basic_income(Variable):
3085
+ column = FloatCol
3086
+ entity = Person
3087
+ definition_period = MONTH
3088
+ label = "Basic income provided to adults"
3089
+ ```
3090
+
3091
+ Now:
3092
+
3093
+ ```py
3094
+ class basic_income(Variable):
3095
+ value_type = float
3096
+ entity = Person
3097
+ definition_period = MONTH
3098
+ label = "Basic income provided to adults"
3099
+ ```
3100
+
3101
+ - `default_value` is now a `Variable` attribute
3102
+
3103
+ Before:
3104
+
3105
+ ```py
3106
+ class is_citizen(Variable):
3107
+ column = BoolCol(default=True)
3108
+ entity = Person
3109
+ definition_period = MONTH
3110
+ label = "Whether the person is a citizen"
3111
+ ```
3112
+
3113
+ Now:
3114
+
3115
+ ```py
3116
+ class is_citizen(Variable):
3117
+ value_type = bool
3118
+ default_value = True
3119
+ entity = Person
3120
+ definition_period = MONTH
3121
+ label = "Whether the person is a citizen"
3122
+ ```
3123
+
3124
+ - For `Variables` which `value_type` is `str`, `max_lentgh` is now an attribute
3125
+
3126
+ Before:
3127
+
3128
+ ```py
3129
+ class zipcode(Variable):
3130
+ column = FixedStrCol(max_length=5)
3131
+ entity = Menage
3132
+ label = "Code INSEE (depcom) du lieu de résidence"
3133
+ definition_period = MONTH
3134
+ ```
3135
+
3136
+ After:
3137
+
3138
+ ```py
3139
+ class zipcode(Variable):
3140
+ value_type = str
3141
+ max_length = 5
3142
+ entity = Menage
3143
+ label = "Code INSEE (depcom) du lieu de résidence"
3144
+ definition_period = MONTH
3145
+ ```
3146
+
3147
+ - For `Variables` which `value_type` is `Enum`, `possible_values` is now an attribute:
3148
+
3149
+ Before:
3150
+
3151
+ ```py
3152
+ class housing_occupancy_status(Variable):
3153
+ column = EnumCol(enum=Enum(["Tenant", "Owner", "Free lodger", "Homeless"]))
3154
+ entity = Household
3155
+ definition_period = MONTH
3156
+ label = "Legal housing situation of the household concerning their main residence"
3157
+ ```
3158
+
3159
+ After:
3160
+
3161
+ ```py
3162
+ class housing_occupancy_status(Variable):
3163
+ value_type = Enum
3164
+ possible_values = Enum(["Tenant", "Owner", "Free lodger", "Homeless"])
3165
+ entity = Household
3166
+ definition_period = MONTH
3167
+ label = "Legal housing situation of the household concerning their main residence"
3168
+ ```
3169
+
3170
+ - Remove `PeriodSizeIndependentIntCol`:
3171
+ * Replaced by `Variable` attribute `is_period_size_independent`
3172
+
3173
+
3174
+ ##### Deprecate `Column`
3175
+
3176
+ `Column` are now considered deprecated. Preferably use `Variable` instead.
3177
+
3178
+ If you do need a column for retro-compatibility, you can use:
3179
+
3180
+ ```py
3181
+ from openfisca_core.columns import make_column_from_variable
3182
+
3183
+ column = make_column_from_variable(variable)
3184
+ ```
3185
+
3186
+
3187
+ - In `TaxBenefitSystem`:
3188
+ * Remove `neutralize_column` (deprecated since `9.1.0`, replaced by `neutralize_variable`)
3189
+ * Rename `column_by_name` to `variables`
3190
+ * Rename `get_column` to `get_variable`
3191
+ * Remove `update_column`
3192
+ * Remove `add_column`
3193
+ * Remove `automatically_loaded_variable` (irrelevant since conversion columns have been removed)
3194
+ * Move `VariableNotFound` to `errors` module
3195
+
3196
+
3197
+ - In `Holder`:
3198
+ * Rename `holder.column` to `holder.variable`
3199
+
3200
+ - In `Column`:
3201
+ * `Column` should only be instantiated using `make_column_from_variable`. Former constructors do not work anymore.
3202
+ * Remove `column.start`, which was `None` since `14.0.0`
3203
+ * Replace `column.formula_class` by `variable.formula`
3204
+ * Replace `column.enum` by `variable.possible_values`
3205
+ * Replace `column.default` by `variable.default_value`
3206
+
3207
+ - In `formulas`:
3208
+ * Rename `get_neutralized_column` to `get_neutralized_variable`
3209
+ * Remove `new_filled_column`
3210
+
3211
+ - In `Variable`:
3212
+ * Remove `to_column`
3213
+ * Variables can now directly be instantiated:
3214
+
3215
+ ```py
3216
+ class salary(Variable):
3217
+ entity = Person
3218
+ ...
3219
+
3220
+
3221
+ salary_variable = salary()
3222
+ ```
3223
+
3224
+ You can learn more about `Variable` by checking its [reference documentation](https://openfisca.org/doc/openfisca-python-api/variables.html).
3225
+
3226
+ # 19.0.0 [#583](https://github.com/openfisca/openfisca-core/pull/583)
3227
+ > Wrongfully published as 18.2.0
3228
+
3229
+ #### Breaking changes
3230
+
3231
+ - Change the way the API is started
3232
+ * The previous command `COUNTRY_PACKAGE=openfisca_country gunicorn ...` does not work anymore
3233
+ * The new command to serve the API is `openfisca serve`.
3234
+ * Read more in the [doc](https://openfisca.readthedocs.io/en/latest/openfisca_serve.html)
3235
+ * This command allows to serve reforms and extensions in the new API
3236
+
3237
+ - In `openfisca-run-test` and `openfisca-serve`, rename option `--country_package` to `--country-package`
3238
+
3239
+ ## 18.1.0 [#578](https://github.com/openfisca/openfisca-core/pull/578)
3240
+
3241
+ #### New features
3242
+
3243
+ - Improve the representations of parameters when navigating the legislation in Python.
3244
+
3245
+ For instance:
3246
+ ```
3247
+ tax_benefit_system.parameters.benefits
3248
+
3249
+ >>> basic_income:
3250
+ >>> 2015-12-01: 600.0
3251
+ >>> housing_allowance:
3252
+ >>> 2016-12-01: None
3253
+ >>> 2010-01-01: 0.25
3254
+
3255
+ tax_benefit_system.parameters.benefits.basic_income
3256
+
3257
+ >>>2015-12-01: 600.0
3258
+ ```
3259
+
3260
+ - Request parameter at a given date with the `parameters.benefits('2015-07-01')` notation.
3261
+
3262
+ - Be more flexible about parameters definitions
3263
+
3264
+ The two following expressions are for instance strictly equivalent:
3265
+
3266
+ ```
3267
+ Parameter("taxes.rate", {"2015-01-01": 2000})
3268
+ Parameter("taxes.rate", {"values": {"2015-01-01":{"value": 2000}}})
3269
+ ```
3270
+
3271
+ - Make sure `parameters.benefits('2015-07-01')` and `parameters.benefits('2015-07')` return the same value.
3272
+ - Raise an error when calling `parameters.benefits('invalid_key')`.
3273
+ - Improve errors when `parameter.update` is used with wrong arguments
3274
+
3275
+ #### Deprecations
3276
+
3277
+ - Deprecate `ValuesHistory` class. Use `Parameter` instead.
3278
+ - Deprecate `parameter.values_history`. Just use `parameter` instead.
3279
+
3280
+ ### 18.0.2 [#585](https://github.com/openfisca/openfisca-core/pull/585)
3281
+
3282
+ - Track the real visitor IP in the web API
3283
+ - Handle the nginx proxy
3284
+
3285
+ ### 18.0.1 [#584](https://github.com/openfisca/openfisca-core/pull/584)
3286
+
3287
+ - Add a link in `openAPI.yml` to the OpenFisca documentation page explaining the web API inputs and outputs for the /calculate route.
3288
+
3289
+ ## 18.0.0 [#582](https://github.com/openfisca/openfisca-core/pull/582)
3290
+
3291
+ #### New features
3292
+
3293
+ Add tracing to get details about all the intermediate calculations of a simulation
3294
+
3295
+ - Introduce new Web API route `/trace` to get a simulation's detailed calculation steps
3296
+ - See the [swagger documentation for OpenFisca-France](https://legislation.openfisca.fr/swagger)
3297
+
3298
+ - Introduce `simulation.tracer.print_computation_log` to print a simulation's detailed calculation steps
3299
+ - This is available if the `trace` argument has been set to `True` in the `Simulation` constructor.
3300
+ - See the [reference documentation](https://openfisca.readthedocs.io/en/latest/tracer.html) about the tracer.
3301
+
3302
+ _Warning: Both of these features are still currently under experimentation. You are very welcome to use them and send us precious feedback, but keep in mind that the way they are used and the results they give might change without any major version bump._
3303
+
3304
+ #### Breaking changes
3305
+
3306
+ - Deprecate and remove:
3307
+ - `simulation.traceback`
3308
+ - `simulation.stack_trace`
3309
+ - `simulation.find_traceback_step`
3310
+ - `simulation.stringify_input_variables_infos`
3311
+ - `simulation.stringify_variable_for_period_with_array`
3312
+
3313
+ - Remove argument `debug_all` from:
3314
+ - `Scenario.new_simulation` method
3315
+ - `Simulation` constructor
3316
+
3317
+ ### 17.2.1 [#581](https://github.com/openfisca/openfisca-core/pull/581)
3318
+
3319
+ - Add the possibility to track API visitor's IP
3320
+
3321
+ ## 17.2.0 [#570](https://github.com/openfisca/openfisca-core/pull/570)
3322
+
3323
+ - Enable to calculate parameters according to a variable
3324
+
3325
+ For instance, if a parameter `rate` depends on a variable `zone` that can take the values `z1` or `z2`:
3326
+
3327
+ In `rate.yaml`:
3328
+
3329
+ ```
3330
+ z1:
3331
+ values:
3332
+ '2015-01-01':
3333
+ value: 100
3334
+ z2:
3335
+ values:
3336
+ '2015-01-01':
3337
+ value: 200
3338
+ ```
3339
+
3340
+ Then it is now possible to use:
3341
+
3342
+ ```
3343
+ zone = household('zone', period)
3344
+ rate = parameters(period).rate[zone]
3345
+ ```
3346
+
3347
+
3348
+ For more information, check the [documentation](https://openfisca.org/doc/coding-the-legislation/legislation_parameters.html#computing-a-parameter-that-depends-on-a-variable-fancy-indexing)
3349
+
3350
+ ### 17.1.2 [#569](https://github.com/openfisca/openfisca-core/pull/569)
3351
+
3352
+ - Fix migration script `xml_to_yaml.py`
3353
+ - The attributes `reference` of nodes `END`, `VALUE`, `PLACEHOLDER`, `BAREME`, `TRANCHE`, `ASSIETTE`, `TAUX`, `MONTANT`, `SEUIL` were not parsed. Now they are parsed to YAML.
3354
+
3355
+ ### 17.1.1
3356
+
3357
+ - Reference the new address of the documentation
3358
+
3359
+ ## 17.1.0
3360
+
3361
+ - Allow to document entities and entities roles
3362
+ - Add attribute `Entity.doc` (e.g. `Household.doc`)
3363
+ - Add attribute `Role.doc` (e.g. `Household.CHILD.doc`)
3364
+
3365
+ ### 17.0.1
3366
+
3367
+ #### Minor Change
3368
+
3369
+ - Handle the case where the user accidentally puts a coma at the end of a variable reference so it has no consequence on the API output.
3370
+ - All variable references are transformed into lists of strings.
3371
+
3372
+ # 17.0.0 - [#552](https://github.com/openfisca/openfisca-core/pull/552)
3373
+
3374
+ #### Breaking changes
3375
+
3376
+ ##### Parameter files
3377
+
3378
+ * Load the legislation parameters from a directory `parameters` containing YAML files, instead of XML files
3379
+
3380
+ Before:
3381
+ ```XML
3382
+ <NODE code="root">
3383
+ <NODE code="impot">
3384
+ <CODE code="taux" description="" format="percent">
3385
+ <END deb="2016-01-01"/>
3386
+ <VALUE deb="2015-01-01" valeur="0.32" />
3387
+ <VALUE deb="1998-01-01" valeur="0.3" />
3388
+ </CODE>
3389
+ </NODE>
3390
+ </NODE>
3391
+ ```
3392
+
3393
+ Now:
3394
+ ```yaml
3395
+ impot:
3396
+ taux:
3397
+ description: Taux d'impôt sur les salaires
3398
+ unit: /1
3399
+ values:
3400
+ 2016-01-01:
3401
+ value: null
3402
+ 2015-01-01:
3403
+ value: 0.32
3404
+ 1991-01-01:
3405
+ value: 0.3
3406
+ ```
3407
+
3408
+ - The XML attributes `format` and `type` are replaced by the YAML attribute `unit`, which is a free text field.
3409
+
3410
+ ##### reforms
3411
+
3412
+ * Rename `Reform.modify_legislation_json()` -> `Reform.modify_parameters()`
3413
+ * Remove `reforms.compose_reforms()`.
3414
+ * Remove `reforms.update_legislation()`.
3415
+ - To modify an existing parameter, use `ValuesHistory.update()` instead.
3416
+ - You can navigate the parameters using `.` (e.g. `parameters.taxes.tax_on_salaries.public_sector.rate`)
3417
+ - Before:
3418
+ ```python
3419
+ new_legislation_parameters = update_legislation(
3420
+ legislation_json=original_legislation_parameters,
3421
+ path=("children", "impot_revenu", "children", "bareme", "brackets", 1, "threshold"),
3422
+ period=reform_period,
3423
+ value=6011,
3424
+ )
3425
+ ```
3426
+ - Now:
3427
+ ```python
3428
+ parameters.impot_revenu.bareme[1].threshold.update(period=reform_period, value=6011)
3429
+ ```
3430
+
3431
+ * Change the syntax to dynamically create new parameters
3432
+ - Before :
3433
+ ```python
3434
+ reform_legislation_subtree = {
3435
+ "@type": "Node",
3436
+ "description": "PLF 2016 sur revenus 2015",
3437
+ "children": {
3438
+ "decote_seuil_celib": {
3439
+ "@type": "Parameter",
3440
+ "description": "Seuil de la décôte pour un célibataire",
3441
+ "format": "integer",
3442
+ "unit": "currency",
3443
+ "values": [
3444
+ {
3445
+ "start": "2016-01-01",
3446
+ },
3447
+ {"start": "2015-01-01", "value": round(1135 * (1 + inflation))},
3448
+ ],
3449
+ },
3450
+ "decote_seuil_couple": {
3451
+ "@type": "Parameter",
3452
+ "description": "Seuil de la décôte pour un couple",
3453
+ "format": "integer",
3454
+ "unit": "currency",
3455
+ "values": [
3456
+ {
3457
+ "start": "2065-01-01",
3458
+ },
3459
+ {"start": "2015-01-01", "value": round(1870 * (1 + inflation))},
3460
+ ],
3461
+ },
3462
+ },
3463
+ }
3464
+ reference_legislation_copy["children"]["plf2016_conterfactual"] = (
3465
+ reform_legislation_subtree
3466
+ )
3467
+ ```
3468
+
3469
+ - Now:
3470
+ ```python
3471
+ from openfisca_core.parameters import ParameterNode
3472
+
3473
+ inflation = 0.001
3474
+ reform_parameters_subtree = ParameterNode(
3475
+ "plf2016_conterfactual",
3476
+ data={
3477
+ "decote_seuil_celib": {
3478
+ "values": {
3479
+ "2015-01-01": {"value": round(1135 * (1 + inflation))},
3480
+ "2016-01-01": {"value": None},
3481
+ }
3482
+ },
3483
+ "decote_seuil_couple": {
3484
+ "values": {
3485
+ "2015-01-01": {"value": round(1870 * (1 + inflation))},
3486
+ "2065-01-01": {"value": None},
3487
+ }
3488
+ },
3489
+ },
3490
+ )
3491
+ reference_parameters.add_child("plf2016_conterfactual", reform_parameters_subtree)
3492
+ ```
3493
+
3494
+ - Note that this way of creating parameters is only recommended when using dynamically computed values (for instance `round(1135 * (1 + inflation))` in the previous example). If the values are static, the new parameters can be directly built from YAML (See New features section).
3495
+
3496
+ ##### TaxBenefitSystem
3497
+
3498
+ * Remove parameter `legislation_json` in constructor
3499
+ * Remove methods/attributes:
3500
+ - `compact_legislation_by_instant_cache`
3501
+ - `get_baseline_compact_legislation`
3502
+ - `compute_legislation`
3503
+ - `get_legislation`
3504
+ + We can now directly use the `parameters` attribute.
3505
+ * Rename
3506
+ - `preprocess_legislation` -> `preprocess_parameters`
3507
+ - `add_legislation_params` -> `load_parameters`
3508
+ - `get_compact_legislation` -> `get_parameters_at_instant`
3509
+ + The signature of the method has changed. Check the [documentation](https://openfisca.org/doc/openfisca-python-api/tax-benefit-system.html#openfisca_core.taxbenefitsystems.TaxBenefitSystem.load_parameters).
3510
+
3511
+ ##### Simulation
3512
+
3513
+ * Remove methods/attributes:
3514
+ - `compact_legislation_by_instant_cache`
3515
+ - `get_baseline_compact_legislation`
3516
+ * Rename
3517
+ `baseline_compact_legislation_by_instant_cache` -> `baseline_parameters_at_instant_cache`
3518
+ `legislation_at` -> `parameters_at`
3519
+
3520
+ #### New features
3521
+
3522
+ * In reforms, new parameters can be added from a YAML file.
3523
+ - The function `parameters.load_parameter_file()` loads a YAML file.
3524
+ - The function `ParameterNode.add_child()` adds a new child to an existing legislation node.
3525
+ - Example:
3526
+ ```python
3527
+ import os
3528
+ from openfisca_core.parameters import load_parameter_file
3529
+
3530
+ dir_path = os.path.dirname(__file__)
3531
+
3532
+
3533
+ def reform_modify_parameters(parameters):
3534
+ file_path = os.path.join(dir_path, "plf2016.yaml")
3535
+ reform_parameters_subtree = load_parameter_file(name="plf2016", file_path=file_path)
3536
+ parameters.add_child("plf2016", reform_parameters_subtree)
3537
+ return parameters
3538
+
3539
+
3540
+ ...
3541
+ ```
3542
+
3543
+ * In module model_api, add classes that are needed to build reforms:
3544
+ - `load_parameter_file`
3545
+ - `ParameterNodeNode`
3546
+ - `Scale`
3547
+ - `Bracket`
3548
+ - `Parameter`
3549
+ - `ValuesHistory`
3550
+ - `periods.period`.
3551
+
3552
+
3553
+ #### Technical changes
3554
+
3555
+ * Refactor the internal representation and the interface of legislation parameters
3556
+ - The parameters of a legislation are wrapped into the classes `Node`, `Parameter`, `Scale`, `Bracket`, `ValuesHistory`, `ValueAtInstant` instead of bare python dict.
3557
+ - The parameters of a legislation at a given instant are wrapped into the classes `NodeAtInstant`, `ValueAtInstant` and tax scales instead of bare python objects.
3558
+ - The file `parameters.py` and the classes defined inside are responsible both for loading and accessing the parameters. Before the loading was implemented in `legislationsxml.py` and the other processings were implemented in `legislations.py`
3559
+ - The validation of the XML files was performed against a XML schema defined in `legislation.xsd`. Now the YAML files are loaded with the library `yaml` and then validated in basic Python.
3560
+
3561
+ * The word "legislation" is replaced by the word "parameters" in several internal variables and internal methods. It Reduced the ambiguity between the legislation as a tax and benefit system and the legislation as the parameters.
3562
+ - `TaxBenefitSystem.compact_legislation_by_instant_cache` -> `TaxBenefitSystem._parameters_at_instant_cache`
3563
+ - `TaxBenefitSystem.get_baseline_compact_legislation()` -> `TaxBenefitSystem._get_baseline_parameters_at_instant()`
3564
+ - `Simulation.compact_legislation_by_instant_cache` -> `Simulation._parameters_at_instant_cache`
3565
+ - `Simulation.get_compact_legislation()` -> `Simulation._get_parameters_at_instant()`
3566
+ - `Simulation.get_baseline_compact_legislation()` -> `Simulation._get_baseline_parameters_at_instant()`
3567
+
3568
+ * The optional parameter `traced_simulation` is removed in function `TaxBenefitSystem.get_compact_legislation()` (now `TaxBenefitSystem.get_parameters_at_instant()`). This parameter had no effect.
3569
+
3570
+ * The optional parameter `with_source_file_infos` is removed in functions `TaxBenefitSystem.compute_legislation()` (now `TaxBenefitSystem._compute_parameters()`) and `TaxBenefitSystem.get_legislation()`. This parameter had no effect.
3571
+
3572
+ * In the API preview, update the internal transformation of the parameters.
3573
+
3574
+ * In the directory `script`, add a subdirectory `migrations`.
3575
+
3576
+ ## 16.3.0
3577
+
3578
+ - Support `reference` attributes on all parameter XML nodes.
3579
+ - You can now add a `reference` on a `<VALUE>`, for example.
3580
+
3581
+ ## 16.2.0
3582
+
3583
+ In the preview web API, for variables of type `Enum`:
3584
+
3585
+ * Accept and recommend to use strings as simulation inputs, instead of the enum indices.
3586
+ - For instance, `{"housing_occupancy_status": {"2017-01": "Tenant"}}` is now accepted and preferred to `{"housing_occupancy_status": {"2017-01": 0}}`).
3587
+ - Using the enum indices as inputs is _still accepted_ for backward compatibility, but _should not_ be encouraged.
3588
+ * Return strings instead of enum indices.
3589
+ - For instance, is `housing_occupancy_status` is calculated for `2017-01`, `{"housing_occupancy_status": {"2017-01": "Tenant"}}` is now returned, instead of `{"housing_occupancy_status": {"2017-01": 0}}`.
3590
+ * In the `/variable/<variable_name>` route, document possible values.
3591
+ * In the Open API specification, document possible values following JSON schema.
3592
+ * In the `/variable/<variable_name>` route:
3593
+ - Document possible values
3594
+ - Use a string as a default value (instead of the enum default indice)
3595
+ * In the Open API specification, document possible values following JSON schema.
3596
+
3597
+ ### 16.1.1
3598
+
3599
+ #### Minor Change
3600
+
3601
+ * Enhance logs
3602
+ - Replace prints by proper logs
3603
+ - Give clear and concise feedback to users when a formula cannot compute.
3604
+
3605
+ ## 16.1.0
3606
+
3607
+ * Enable API monitoring with Piwik
3608
+ - See the [documentation](https://github.com/openfisca/openfisca-core/#tracker)
3609
+
3610
+ # 16.0.0
3611
+
3612
+ #### Breaking changes - [#545](https://github.com/openfisca/openfisca-core/pull/545)
3613
+
3614
+ * Deprecate `parsers`
3615
+ - They can no longer be installed through `pip install openfisca_core[parsers]`
3616
+ - They can still install them directly with `pip install openfisca_parsers`, but they won't be maintained.
3617
+
3618
+ ### 15.0.1 - [#538](https://github.com/openfisca/openfisca-core/pull/538)
3619
+
3620
+ #### Bug fix
3621
+
3622
+ - Make `missing_value` base function compatible with v4 syntax and extra params
3623
+
3624
+ # 15.0.0
3625
+
3626
+ #### Breaking changes - [#525](https://github.com/openfisca/openfisca-core/pull/525)
3627
+
3628
+ * Rename `Variable` attribute `url` to `reference`
3629
+ - This attribute is the legislative reference of a variable.
3630
+ - As previously, this attribute can be a string, or a list of strings.
3631
+ * Rename `Variable` attribute `reference` to `baseline_variable`
3632
+ - This attribute is, for a variable defined in a reform, the baseline variable the reform variable is replacing.
3633
+ * Remove variable attribute `law_reference`
3634
+ * Rename `TaxBenefitSystem.reference` to `TaxBenefitSystem.baseline`
3635
+ * Rename `TaxBenefitSystem.get_reference_compact_legislation` to `TaxBenefitSystem.get_baseline_compact_legislation`
3636
+ * Rename `Simulation.reference_compact_legislation_by_instant_cache` to `Simulation.baseline_compact_legislation_by_instant_cache`
3637
+ * Rename `Simulation.get_reference_compact_legislation` to `Simulation.get_baseline_compact_legislation`
3638
+ * Rename parameter `reference` of `AbstractScenario.new_simulation()` to `use_baseline`
3639
+ * Rename parameter `reference` of `Simulation.legislation_at()` to `use_baseline`
3640
+
3641
+ ### 14.1.4 - [#539](https://github.com/openfisca/openfisca-core/pull/539)
3642
+
3643
+ #### New features
3644
+
3645
+ - In the preview API `/calculate` route
3646
+ - Handle roles with no plural
3647
+ - Force all persons to be allocated to all entities
3648
+ - Improve error messages
3649
+ - Detect unexpected entity errors first
3650
+ - Document new simulation and entities constructors.
3651
+
3652
+ ### 14.1.3 - [#541](https://github.com/openfisca/openfisca-core/pull/541)
3653
+
3654
+ #### Minor Change
3655
+
3656
+ - Rewrite `/calculate` example in the Open API spec so that it works for `Openfisca-France`
3657
+
3658
+ ### 14.1.2 - [#535](https://github.com/openfisca/openfisca-core/pull/535)
3659
+
3660
+ #### Bug fix
3661
+
3662
+ - Fix `formula.graph_parameters` and `formula.to_json`
3663
+ - Bugs were introduced in `14.0.0`
3664
+
3665
+ - Fix `simulation.graph`
3666
+ - A bug was introduced in `14.1.0`
3667
+
3668
+ ### 14.1.1 - [#533](https://github.com/openfisca/openfisca-core/pull/533)
3669
+
3670
+ #### Bug fix
3671
+
3672
+ - Fix `simulation.clone` and `entity.clone` methods.
3673
+ - A bug was introduced in `14.1.0`
3674
+
3675
+ ## 14.1.0 - [#528](https://github.com/openfisca/openfisca-core/pull/528)
3676
+
3677
+ #### New features
3678
+
3679
+ - Introduce `/calculate` route in the preview API
3680
+ - Allows to run calculations.
3681
+ - Takes a simulation `JSON` as an input, and returns a copy of the input extended with calculation results.
3682
+
3683
+ - Handle `500` errors in the preview API
3684
+ - In this case, the API returns a JSON with details about the error.
3685
+
3686
+ - Allows simulations to be built from a JSON using their constructor
3687
+ - For instance `Simulation(simulation_json = {"persons": {...}, "households": {...}}, tax_benefit_system = tax_benefit_system)`
3688
+
3689
+ - Allows entities to be built from a JSON using their constructor
3690
+ - For instance `Household(simulation, {"first_household": {...}})`
3691
+
3692
+ - Introduce `tax_benefit_system.get_variables(entity = None)`
3693
+ - Allows to get all variables contained in a tax and benefit system, with filtering by entity
3694
+
3695
+ #### Deprecations
3696
+
3697
+ - Deprecate `simulation.holder_by_name`, `simulation.get_holder`, `get_or_new_holder`
3698
+ - These functionalities are now provided by `entity.get_holder(name)`
3699
+
3700
+ - Deprecate constructor `Holder(simulation, column)`
3701
+ - A `Holder` should now be instantiated with `Holder(entity = entity, column = column)`
3702
+
3703
+ ### 14.0.1 - [#527](https://github.com/openfisca/openfisca-core/pull/527)
3704
+
3705
+ * Improve error message and add stack trace when a module import fails
3706
+
3707
+ # 14.0.0 - [#522](https://github.com/openfisca/openfisca-core/pull/522)
3708
+
3709
+ #### Breaking changes
3710
+
3711
+ - In variables:
3712
+ - Merge `Variable` and `DatedVariable`.
3713
+ - `Variable` can now handle formula evolution over time.
3714
+ - Remove `start_date` attribute
3715
+ - Rename `stop_date` attribute to `end`
3716
+ - Introduce end string format `end = 'YYYY-MM-DD'`
3717
+ - In formulas:
3718
+ - Merge `SimpleFormula` and `DatedFormula`.
3719
+ - `Formula` evolves over time.
3720
+ - Remove `@dated_function`
3721
+ - start definition goes to formula name: `formula_YYYY[_MM[_DD]]`
3722
+ - stop is deduced from next formula start
3723
+
3724
+ Before:
3725
+ ```
3726
+ class your_variable(DatedVariable):
3727
+ # ... attributes
3728
+ start_date = datetime.date(2015, 05, 01)
3729
+ stop_date = datetime.date(2017, 05, 31)
3730
+
3731
+ # openfisca chooses most restrictive start in (start_date, @dated_function start)
3732
+ @dated_function(start = date(2015, 1, 1), stop = date(2016, 12, 31))
3733
+ def function_2015_something(self, simulation, period):
3734
+ # Calculate for 2015
3735
+
3736
+ @dated_function(start = date(2016, 1, 1))
3737
+ def function__different_name(self, simulation, period):
3738
+ # Calculate for 2016 > 2017-05-31 (including 2017-05-31 stop_date day)
3739
+ ```
3740
+ After:
3741
+ ```
3742
+ class your_variable(Variable):
3743
+ # ... unchanged attributes
3744
+ end = '2017-05-31' # string format 'YYYY-MM-DD'
3745
+
3746
+ # name should begin with 'formula' / you define the start in the name
3747
+ def formula_2015_05_01(self, simulation, period): # stops on last day before next formula
3748
+ # Calculate for 2015
3749
+
3750
+ def formula_2016(self, simulation, period): # similar to formula_2016_01_01 or formula_2016_01
3751
+ # Calculate for 2016+ > 2017-05-31 (including 2017-05-31 end day)
3752
+ ```
3753
+
3754
+ #### New features
3755
+
3756
+ - Change `ETERNITY` period effect
3757
+ - Remove restriction that prevented formula changes over time for a variable with `definition_period = ETERNITY`.
3758
+
3759
+ ### 13.0.1 - [#526](https://github.com/openfisca/openfisca-core/pull/526)
3760
+
3761
+ ### Bug fix
3762
+
3763
+ * Require numpy < 1.13.
3764
+ - Openfisca is not yet compatible with the new numpy version 1.13.
3765
+
3766
+ # 13.0.0
3767
+
3768
+ #### Breaking changes
3769
+
3770
+ * Disallow text out of tags in XML parameters
3771
+ - This prevents to add "comments" that would be lost by automated transformation of these parameters.
3772
+
3773
+ #### New features
3774
+
3775
+ * Introduce a "reference" attribute to document a source in XML parameters
3776
+
3777
+ ## 12.3.0
3778
+
3779
+ * Serve the [OpenAPI specification](https://www.openapis.org/) under the API route `/spec/`
3780
+
3781
+ ## 12.2.0
3782
+
3783
+ * Use `nose` in the `openfisca-run-test` script
3784
+ - This avoids boilerplate code on country packages, and makes parallelism easier to set on Circle CI.
3785
+
3786
+ ### 12.1.4
3787
+
3788
+ * Fix package naming conflict between the preview API and the official one.
3789
+ * Fix import error
3790
+
3791
+ ### 12.1.3
3792
+
3793
+ * Validate XML parameters with lxml and a XML Schema
3794
+ * Raise nicer errors during validation
3795
+
3796
+ ### 12.1.2
3797
+
3798
+ * Improve the error when the period argument is forgotten in entity call
3799
+
3800
+ ### 12.1.1
3801
+
3802
+ * When replacing a variable by another one in a reform, assume the new variable has the same metadata than the reference one.
3803
+ - The is currently the behaviour for all other metadata.
3804
+
3805
+ ## 12.1.0
3806
+
3807
+ * Include the preview API into OpenFisca-Core
3808
+ * Remove internationalization (`i18n`, `Babel`)
3809
+ * Use CircleCI instead of Travis
3810
+
3811
+ ### 12.0.3
3812
+
3813
+ * Fix variable `source_file_path` computation.
3814
+ - Make sure the tax and benefit system `location` metadata is consistent with the actual python files being loaded.
3815
+
3816
+ ### 12.0.2
3817
+
3818
+ * Fix a bug introduced by 11.0.0: variables with several references could not be loaded.
3819
+
3820
+ ### 12.0.1
3821
+
3822
+ * Fix a bug introduced by 12.0.0: the description of a parameter node was no longer exported in the parameter JSON.
3823
+
3824
+ # 12.0.0
3825
+
3826
+ #### Breaking changes
3827
+
3828
+ * Deprecate and remove the `fin` attribute in XML parameters.
3829
+ - The end date of a parameter is assumed to be the start of the next one.
3830
+ - The `<END>` indicates that a parameter does not exist anymore
3831
+ * Deprecate and remove the `fuzzy` attribute in XML parameters.
3832
+ - By construction, the value of a parameter is always extended towards the future.
3833
+ - To indicate a likely change of the legislation, a `<PLACEHOLDER>` can be added.
3834
+ * Deprecate and remove `reforms.create_item`
3835
+ - New items are created directly with the method `reforms.update_items`.
3836
+ * Deprecate and remove `reforms.split_item_containing_instant`
3837
+ - Splitting items does not make sense in the new convention. Use `reform.update_items` to update the parameters.
3838
+
3839
+ # 11.0.0
3840
+
3841
+ #### Breaking changes
3842
+
3843
+ These breaking changes only concern variable and tax and benefit system **metadata**. They **do not** impact calculations.
3844
+
3845
+ * Make `tax_benefit_system.get_package_metadata()` return a `dict` instead of a `tuple`
3846
+ * Make `column.source_file_path` a relative path (was absolute before)
3847
+ * Make `column.url` a list instead of a string
3848
+
3849
+ #### New features
3850
+
3851
+ * Make `tax_benefit_system.get_package_metadata()` more robust
3852
+ - Handle reforms
3853
+ - Handle tax and benefit systems that are not defined within a package and/or a distribution
3854
+
3855
+ #### Technical changes
3856
+
3857
+ * Turn `Variable`s with a `start_date` and/or a `stop_date` into `DatedVariable`s
3858
+ - This is transparent for users.
3859
+
3860
+ ### 10.0.2
3861
+
3862
+ * Do not cache values for neutralized variables
3863
+ - To reduce memory usage for large population simulations
3864
+
3865
+ ### 10.0.1
3866
+
3867
+ * Improve the raised error message when a wrong period type is given as an input
3868
+
3869
+ # 10.0.0
3870
+
3871
+ #### Breaking changes
3872
+
3873
+ * In YAML tests:
3874
+ - Deprecate and remove the `IGNORE_` prefix
3875
+ - Deprecate and remove the `ignore` property
3876
+ * In the YAML test runner:
3877
+ - Deprecate and remove the `force` option (`-f` in the shell script)
3878
+ - Deprecate and remove the `default_absolute_error_margin` option (`-M` in the shell script)
3879
+ - Deprecate and remove the `default_relative_error_margin` option (`-m` in the shell script)
3880
+
3881
+ #### New features
3882
+
3883
+ * Add `Reform` and `numpy.round` (as `round_`) in the model API
3884
+ * Introduce `tax_benefit_system.apply_reform(reform_path)`
3885
+ * Allow YAML tests to declare the reforms they need to be executed (through the `reforms` property)
3886
+
3887
+ #### Technical changes
3888
+
3889
+ * Move the `dummy_extension` to `OpenFisca-Dummy-Country`
3890
+ * Test `openfisca-run-test` script
3891
+
3892
+ ## 9.1.0
3893
+
3894
+ * Rename `neutralize_column` to `neutralize_variable`
3895
+ - Deprecate `neutralize_column` without removing it
3896
+ * Document `neutralize_variable`
3897
+
3898
+ ### 9.0.2
3899
+
3900
+ * Fix spelling in error messages
3901
+
3902
+ ### 9.0.1
3903
+
3904
+ * Test marginal scales
3905
+ * Move tests out of the main package
3906
+ * These changes are transparent for users
3907
+
3908
+ # 9.0.0
3909
+
3910
+ * Make sure identical periods are stringified the same way
3911
+ * _Breaking changes_:
3912
+ - Change `periods.period` signature.
3913
+ - It now only accepts strings.
3914
+ - Restrict the possible inputs for `periods.period`
3915
+ - The authorized formats are listed in [the doc](https://openfisca.org/doc/key-concepts/periodsinstants.html)
3916
+ - Deprecate and remove:
3917
+ - `periods.json_or_python_to_period`
3918
+ - `periods.make_json_or_python_to_period`
3919
+
3920
+ ### 8.0.1
3921
+
3922
+ * Move the dummy country to [its own repository](https://github.com/openfisca/openfisca-dummy-country)
3923
+
3924
+ # 8.0.0
3925
+
3926
+ * Raise more explicit error when an invalid test case is given
3927
+ * Raise more friendly error when trying to calculate a variable which doesn't exist
3928
+ * _Breaking change_: Python exceptions will now be raised when the test case in invalid. Before, only a byriani error was returned. Reusers must therefore adapt their exception handling.
3929
+
3930
+ ## 7.1.0
3931
+
3932
+ * Add `Entity.to_json` method. Used by OpenFisca-Web-API in `/entity` endpoint in particular.
3933
+
3934
+ ### 7.0.1
3935
+
3936
+ * Declare `Openfisca-Parsers` as an optional dependency of `Openfisca-Core`.
3937
+
3938
+ # 7.0.0
3939
+
3940
+ * Make it mandatory to provide a period when calculating a variable.
3941
+ - When a computation is requested (with *.calculate_output, entities.__call__, *.calculate[_add|_divide], *.compute[_add|_divide]), the argument `period` is no longer optional.
3942
+ - Previously, the period of the simulation was used instead of a missing period. It was error-prone, as values would be returned for the wrong period, without any error or warning to alert the formula writer about a likely coding error.
3943
+
3944
+ ## 6.1.0
3945
+
3946
+ * Move `base.py` content (file usually located in country packages) to core module `formula_toolbox` so that it can be reused by all countries
3947
+ * Use `AbstractScenario` if no custom scenario is defined for a tax and benefit system
3948
+
3949
+ # 6.0.0
3950
+
3951
+ #### Breaking changes
3952
+
3953
+ * Add **mandatory** attribute `definition_period` to variables
3954
+ * Enforce that inputs provided for a variable match the variable `definition_period`
3955
+ - If a `set_input` attribute has been defined, automatically cast the input accordingly.
3956
+ * Change the expected output of a formula
3957
+ - Only `result` must be returned, instead of `period, result`
3958
+ * Deprecate and remove:
3959
+ - `simulation.print_trace`
3960
+ - `simulation.calculate_add_divide` and `simulation.compute_add_divide`
3961
+ - `last_duration_last_value` base function
3962
+ - `variables_name_to_skip` and `use_set_input_hooks` parameters in `scenario.fill_simulation`
3963
+ - `holders.new_test_case_array`
3964
+ * Deprecate and forbid `dated_holder.array = ...`
3965
+ * Raise an error when inconsistent year and month inputs provided for a variable
3966
+ - Before, the year value would be silently ignored.
3967
+ * Rename `period.this_month` to `period.first_month`
3968
+
3969
+ #### Technical changes
3970
+
3971
+ * Make sure the cache only store values for periods matching the variable `definition_period`
3972
+ * Use a cache buffer in simulation initialisation when axes are used, to avoid `set_input` conflicts
3973
+ * Make `DatedHolder` only a wrapper of a variable value for a given period, and no more a dated view of a `Holder`
3974
+
3975
+ #### Documentation
3976
+
3977
+ * the attribute `definition_period` is documented here : https://openfisca.org/doc/coding-the-legislation/35_periods.html
3978
+
3979
+ ### 5.0.2
3980
+
3981
+ * Add `TaxBenefitSystem` doc to the reference doc
3982
+ - This is transparent for all users
3983
+
3984
+ ### 5.0.1
3985
+
3986
+ * Improve `openfisca-run-test` script
3987
+ - Make country package detection more robust (it only worked for packages installed in editable mode)
3988
+ - Use spaces instead of commas as separator in the script arguments when loading several extensions or reforms (this is more standard)
3989
+ * Refactor the `scripts` module to separate the logic specific to yaml test running from the one that can be reused by any script which needs to build a tax and benefit system.
3990
+
3991
+ # 5.0.0
3992
+
3993
+ * Move `json_or_python_to_test_case` from country packages to core
3994
+ * Breaking change: `scenarios.set_entities_json_id` has been moved, and should not be considered a public function.
3995
+
3996
+ ### 4.3.6
3997
+
3998
+ * Bug fix : handle the case when CompactNode.name is None.
3999
+
4000
+ ### 4.3.5
4001
+
4002
+ * Refactor decomposition TaxBenefitSystem attributes. Reform inherit the decomposition_file_path from the reference TaxBenefitSystem.
4003
+ This does not require changing anything from the caller, which should use the `decompositions.get_decomposition_json` function instead of those attributes.
4004
+
4005
+ ### 4.3.4
4006
+
4007
+ * Fix occasionnal `NaN` creation in `MarginalRateTaxScale.calc` resulting from `0 * numpy.inf`
4008
+
4009
+ ### 4.3.3
4010
+
4011
+ * Use the actual TaxBenefitSystem and not its reference when neutralizing a column.
4012
+
4013
+ ### 4.3.2
4014
+
4015
+ * Fix `to_value_json` for `DatedVariable` with extra parameters.
4016
+
4017
+ This was causing a crash when calculating intermediate variables with the API.
4018
+
4019
+ Unlike simple formulas, a `DatedVariable` have several functions. We thus need to select the right one according to the period before doing parameters introspection.
4020
+
4021
+ ### 4.3.1
4022
+
4023
+ * Fix `set_input` and `default` setting in `new_filled_column`
4024
+
4025
+ ## 4.3.0
4026
+
4027
+ * Add reference documentation
4028
+
4029
+ ### 4.2.1
4030
+
4031
+ * Fix permanent and period size independent variables neutralization
4032
+
4033
+ ## 4.2.0
4034
+
4035
+ * Introduce a YAML test runner in openfisca_core
4036
+ - Introduce command line tool `openfisca-run-test`
4037
+
4038
+ * Refactor the dummy tax benefit system included in openfisca-core
4039
+ - Make the dummy country look like a real one
4040
+ - Split defining the country from testing
4041
+
4042
+ ### 4.1.7
4043
+
4044
+ * Improve docstring of `MarginalTaxRate.inverse` and add test
4045
+
4046
+ ### 4.1.6
4047
+
4048
+ * Decrease verbosity of `combine_tax_scales`
4049
+
4050
+ ### 4.1.5
4051
+
4052
+ * Enable `extra_params` in formulas with new syntax.
4053
+
4054
+ ### 4.1.4-Beta
4055
+
4056
+ * Fixup 4.1.2:
4057
+ * When building positions, handle cases where persons belonging to an entity are not grouped by entity in the persons array.
4058
+
4059
+ ### 4.1.3-Beta
4060
+
4061
+ * Fix bug in entity.sum
4062
+
4063
+ ### 4.1.2-Beta
4064
+
4065
+ * Enable simulation initialization with only legacy roles
4066
+ * New roles are in this case automatically inferred
4067
+ * Positions are always inferred from persons entity id
4068
+
4069
+ ### 4.1.1-Beta
4070
+
4071
+ * Fix update_legislation in reforms
4072
+
4073
+ ### 4.1.0-Beta
4074
+
4075
+ * Add `conflicts` and `origin` fields to xml params (needed for baremes IPP importation)
4076
+
4077
+ ### 4.0.0-Beta
4078
+
4079
+ * Refactor formula syntax
4080
+
4081
+ - Don't use the object simulation in formula writing. The entity the variable is calculated for is now the first argument of the formula, for instance `person` or `family`.
4082
+
4083
+ - The `legislation` is now the (optional) third argument of a formula. It is a function that can be called with a period (or an instant) for argument, and will compute the legislation at `period.start`.
4084
+
4085
+ - Don't use `calculate_add` and equivalents. Instead, `add` and `divide` are just given in the `options` argument, for instance `options = [ADD]`.
4086
+
4087
+ - Rename `entity_class` to `entity`.
4088
+
4089
+ - Don't explicitly use a `calculate` method, but the `person('salary', period)` notation instead.
4090
+
4091
+ * Introduce implicit conversions between entities, and improve aggregations formulas.
4092
+
4093
+ * Deprecate PersonToEntityColumn and EntityToPersonColumn
4094
+
4095
+ * Change the way entities are declared
4096
+
4097
+ More information on https://github.com/openfisca/openfisca-core/pull/415
4098
+
4099
+ ## 3.1.0
4100
+
4101
+ * Add a `DeprecationWarning` when using a `DateCol` with no `default`, but keep the default date to 1970-01-01.
4102
+ * Enforce `DateCol.default` to be a `date`.
4103
+
4104
+ ### 3.0.3
4105
+
4106
+ * Fix `cerfa_field` validation in `Column`, `Formula` and `AbstractConversionVariable`.
4107
+ Previously, some variables having `cerfa_field` as a `dict` were converted to `unicode` by mistake.
4108
+ See https://github.com/openfisca/openfisca-france/issues/543
4109
+
4110
+ ### 3.0.2
4111
+
4112
+ * Move `calmar.py` to [OpenFisca-Survey-Manager](https://github.com/openfisca/openfisca-survey-manager).
4113
+
4114
+ No incidence on users since it was only needed for dataframes.
4115
+
4116
+ ### 3.0.1
4117
+
4118
+ * Adapt requested_period_last_value and last_duration_last_value to extra params
4119
+
4120
+ # 3.0.0
4121
+
4122
+ * Update introspection data. This allows to enhance data served by the web API which itself feeds the Legislation Explorer.
4123
+
4124
+ ### 2.2.2
4125
+
4126
+ * Update travis procedures
4127
+
4128
+ ### 2.2.1
4129
+
4130
+ * Remove conda from travis config
4131
+
4132
+ ## 2.2.0
4133
+
4134
+ * Implement simulation.calculate `print_trace=True` argument. Options: `max_depth` and `show_default_values`
4135
+
4136
+ Examples:
4137
+ ```python
4138
+ simulation = scenario.new_simulation(trace=True)
4139
+ simulation.calculate("irpp", 2014, print_trace=True)
4140
+ simulation.calculate("irpp", 2014, print_trace=True, max_depth=-1)
4141
+ simulation.calculate(
4142
+ "irpp", 2014, print_trace=True, max_depth=-1, show_default_values=False
4143
+ )
4144
+ ```
4145
+
4146
+ ## 2.1.0 – [diff](https://github.com/openfisca/openfisca-core/compare/2.0.3...2.0.4)
4147
+
4148
+ * Load extensions from pip packages
4149
+
4150
+ ### 2.0.4 – [diff](https://github.com/openfisca/openfisca-core/compare/2.0.3...2.0.4)
4151
+
4152
+ * Use DEFAULT_DECOMP_FILE attribute from reference TB system
4153
+
4154
+ ### 2.0.3 – [diff](https://github.com/openfisca/openfisca-core/compare/2.0.2...2.0.3)
4155
+
4156
+ * Explicit the error when a variable is not found
4157
+
4158
+ ### 2.0.2 – [diff](https://github.com/openfisca/openfisca-core/compare/2.0.1...2.0.2)
4159
+
4160
+ * Update numpy dependency to 1.11
4161
+
4162
+ ### 2.0.1 – [diff](https://github.com/openfisca/openfisca-core/compare/2.0.0...2.0.1)
4163
+
4164
+ * Force updating version number and CHANGELOG.md before merging on master
4165
+ * Release tag and Pip version automatically
4166
+
4167
+ # 2.0.0 – [diff](https://github.com/openfisca/openfisca-core/compare/1.1.0...2.0.0)
4168
+
4169
+ * Variables are not added to the TaxBenefitSystem when the entities class are imported, but explicitly when the TaxBenefitSystem is instantiated.
4170
+ * Metaclasses are not used anymore.
4171
+ * New API for TaxBenefitSystem
4172
+ * Columns are now stored in the TaxBenefitSystem, not in entities.
4173
+ * New API for rerforms.
4174
+ * XmlBasedTaxBenefitSystem is deprecated, and MultipleXmlBasedTaxBenefitSystem renamed to TaxBenefitSystem
4175
+
4176
+ ## 1.1.0 – [diff](https://github.com/openfisca/openfisca-core/compare/1.0.0...1.1.0)
4177
+
4178
+ * Implement cache opt out system
4179
+
4180
+ # 1.0.0 – [diff](https://github.com/openfisca/openfisca-core/compare/0.5.4...1.0.0)
4181
+
4182
+ * Remove `build_column` obsolete function. Use `Variable` class instead.
4183
+
4184
+ ## 0.5.4 – [diff](https://github.com/openfisca/openfisca-core/compare/0.5.3...0.5.4)
4185
+
4186
+ * Merge pull request #382 from openfisca/fix-sum-by-entity
4187
+ * The result size must be the targent entity'one
4188
+
4189
+ ## 0.5.3 – [diff](https://github.com/openfisca/openfisca-core/compare/0.5.2...0.5.3)
4190
+
4191
+ * Many updates
4192
+
4193
+ ## 0.5.2 – [diff](https://github.com/openfisca/openfisca-core/compare/0.5.1...0.5.2)
4194
+
4195
+ * Add trim option to marginal rate computation
4196
+ * Compute stop date of whole tax scale instead of a single bracket.
4197
+ * Use bracket stop date instead of legislation stop date inside a bracket.
4198
+ * Introduce reference periods
4199
+ * Fix roles_count bug : was set to 1 for scenarios vectorially defined
4200
+
4201
+ ## 0.5.1 – [diff](https://github.com/openfisca/openfisca-core/compare/0.5.0...0.5.1)
4202
+
4203
+ * Move docs to gitbook repo
4204
+ * Upgrade to new Travis infrastructure
4205
+ * Enhance errors display when a reform modifies the legislation
4206
+
4207
+ ## 0.5.0
4208
+
4209
+ * First release uploaded to PyPI