policyengine 5.0.4__tar.gz → 5.2.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 (287) hide show
  1. {policyengine-5.0.4 → policyengine-5.2.0}/CHANGELOG.md +27 -0
  2. {policyengine-5.0.4 → policyengine-5.2.0}/CITATION.cff +17 -12
  3. {policyengine-5.0.4 → policyengine-5.2.0}/PKG-INFO +13 -3
  4. {policyengine-5.0.4 → policyengine-5.2.0}/README.md +12 -0
  5. {policyengine-5.0.4 → policyengine-5.2.0}/docs/bundles.md +32 -4
  6. {policyengine-5.0.4 → policyengine-5.2.0}/docs/data-publishing-design.md +8 -3
  7. {policyengine-5.0.4 → policyengine-5.2.0}/docs/microsim.md +32 -21
  8. {policyengine-5.0.4 → policyengine-5.2.0}/docs/release-bundles.md +17 -2
  9. {policyengine-5.0.4 → policyengine-5.2.0}/pyproject.toml +4 -3
  10. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/bundle.py +113 -364
  11. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/run_record.py +2 -10
  12. policyengine-5.2.0/src/policyengine/core/variable.py +71 -0
  13. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/data/bundle/manifest.json +18 -10
  14. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/data/bundle/uk.trace.tro.jsonld +5 -5
  15. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/data/bundle/us.trace.tro.jsonld +5 -5
  16. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/provenance/__init__.py +12 -3
  17. policyengine-5.2.0/src/policyengine/provenance/dataset_materialization.py +344 -0
  18. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/provenance/manifest.py +30 -76
  19. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/common/model_version.py +42 -0
  20. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/uk/datasets.py +30 -16
  21. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/uk/model.py +19 -36
  22. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/us/datasets.py +49 -62
  23. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/us/model.py +14 -31
  24. policyengine-5.2.0/src/policyengine/utils/hashing.py +15 -0
  25. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine.egg-info/PKG-INFO +13 -3
  26. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine.egg-info/SOURCES.txt +7 -6
  27. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine.egg-info/requires.txt +0 -2
  28. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/region_fixtures.py +8 -4
  29. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_bundle.py +39 -87
  30. policyengine-5.2.0/tests/test_dataset_materialization.py +254 -0
  31. policyengine-5.2.0/tests/test_dataset_runtime.py +168 -0
  32. policyengine-5.2.0/tests/test_dataset_source.py +140 -0
  33. policyengine-5.2.0/tests/test_parameter_nodes.py +56 -0
  34. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_region.py +3 -1
  35. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_release_manifests.py +69 -31
  36. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_us_long_term_datasets.py +61 -49
  37. policyengine-5.2.0/tests/test_variable_metadata.py +144 -0
  38. {policyengine-5.0.4 → policyengine-5.2.0}/uv.lock +73 -537
  39. policyengine-5.0.4/src/policyengine/core/variable.py +0 -20
  40. policyengine-5.0.4/src/policyengine/provenance/dataset_sources.py +0 -119
  41. policyengine-5.0.4/src/policyengine/utils/data/__init__.py +0 -1
  42. policyengine-5.0.4/src/policyengine/utils/data/caching_google_storage_client.py +0 -105
  43. policyengine-5.0.4/src/policyengine/utils/data/version_aware_storage_client.py +0 -127
  44. policyengine-5.0.4/src/policyengine/utils/google_cloud_bucket.py +0 -48
  45. policyengine-5.0.4/tests/test_dataset_sources.py +0 -149
  46. {policyengine-5.0.4 → policyengine-5.2.0}/.claude/policyengine-guide.md +0 -0
  47. {policyengine-5.0.4 → policyengine-5.2.0}/.claude/quick-reference.md +0 -0
  48. {policyengine-5.0.4 → policyengine-5.2.0}/.github/CONTRIBUTING.md +0 -0
  49. {policyengine-5.0.4 → policyengine-5.2.0}/.github/bump_version.py +0 -0
  50. {policyengine-5.0.4 → policyengine-5.2.0}/.github/capture-version.sh +0 -0
  51. {policyengine-5.0.4 → policyengine-5.2.0}/.github/changelog_template.md +0 -0
  52. {policyengine-5.0.4 → policyengine-5.2.0}/.github/check-changelog.sh +0 -0
  53. {policyengine-5.0.4 → policyengine-5.2.0}/.github/copilot-instructions.md +0 -0
  54. {policyengine-5.0.4 → policyengine-5.2.0}/.github/dispatch-policyengine-release.sh +0 -0
  55. {policyengine-5.0.4 → policyengine-5.2.0}/.github/fetch_version.py +0 -0
  56. {policyengine-5.0.4 → policyengine-5.2.0}/.github/get-changelog-diff.sh +0 -0
  57. {policyengine-5.0.4 → policyengine-5.2.0}/.github/has-functional-changes.sh +0 -0
  58. {policyengine-5.0.4 → policyengine-5.2.0}/.github/is-version-number-acceptable.sh +0 -0
  59. {policyengine-5.0.4 → policyengine-5.2.0}/.github/publish-git-tag.sh +0 -0
  60. {policyengine-5.0.4 → policyengine-5.2.0}/.github/wait-for-pypi.sh +0 -0
  61. {policyengine-5.0.4 → policyengine-5.2.0}/.github/workflows/draft-pdf.yml +0 -0
  62. {policyengine-5.0.4 → policyengine-5.2.0}/.github/workflows/pr_code_changes.yaml +0 -0
  63. {policyengine-5.0.4 → policyengine-5.2.0}/.github/workflows/pr_docs_changes.yaml +0 -0
  64. {policyengine-5.0.4 → policyengine-5.2.0}/.github/workflows/push.yaml +0 -0
  65. {policyengine-5.0.4 → policyengine-5.2.0}/.gitignore +0 -0
  66. {policyengine-5.0.4 → policyengine-5.2.0}/.python-version +0 -0
  67. {policyengine-5.0.4 → policyengine-5.2.0}/AGENTS.md +0 -0
  68. {policyengine-5.0.4 → policyengine-5.2.0}/CLAUDE.md +0 -0
  69. {policyengine-5.0.4 → policyengine-5.2.0}/CODE_OF_CONDUCT.md +0 -0
  70. {policyengine-5.0.4 → policyengine-5.2.0}/CONTRIBUTING.md +0 -0
  71. {policyengine-5.0.4 → policyengine-5.2.0}/LICENSE +0 -0
  72. {policyengine-5.0.4 → policyengine-5.2.0}/Makefile +0 -0
  73. {policyengine-5.0.4 → policyengine-5.2.0}/architecture.png +0 -0
  74. {policyengine-5.0.4 → policyengine-5.2.0}/architecture.svg +0 -0
  75. {policyengine-5.0.4 → policyengine-5.2.0}/changelog.d/.gitkeep +0 -0
  76. {policyengine-5.0.4 → policyengine-5.2.0}/docs/.gitignore +0 -0
  77. {policyengine-5.0.4 → policyengine-5.2.0}/docs/_generator/README.md +0 -0
  78. {policyengine-5.0.4 → policyengine-5.2.0}/docs/_generator/build_reference.py +0 -0
  79. {policyengine-5.0.4 → policyengine-5.2.0}/docs/_quarto.yml +0 -0
  80. {policyengine-5.0.4 → policyengine-5.2.0}/docs/countries.md +0 -0
  81. {policyengine-5.0.4 → policyengine-5.2.0}/docs/decile-impact-spec.md +0 -0
  82. {policyengine-5.0.4 → policyengine-5.2.0}/docs/dev.md +0 -0
  83. {policyengine-5.0.4 → policyengine-5.2.0}/docs/engineering/runbooks/build-m-us-populace-certification.md +0 -0
  84. {policyengine-5.0.4 → policyengine-5.2.0}/docs/engineering/skills/README.md +0 -0
  85. {policyengine-5.0.4 → policyengine-5.2.0}/docs/engineering/skills/data-certification.md +0 -0
  86. {policyengine-5.0.4 → policyengine-5.2.0}/docs/engineering/skills/github-prs.md +0 -0
  87. {policyengine-5.0.4 → policyengine-5.2.0}/docs/engineering/skills/repository-guidance.md +0 -0
  88. {policyengine-5.0.4 → policyengine-5.2.0}/docs/examples.md +0 -0
  89. {policyengine-5.0.4 → policyengine-5.2.0}/docs/getting-started.md +0 -0
  90. {policyengine-5.0.4 → policyengine-5.2.0}/docs/households.md +0 -0
  91. {policyengine-5.0.4 → policyengine-5.2.0}/docs/impact-analysis.md +0 -0
  92. {policyengine-5.0.4 → policyengine-5.2.0}/docs/index.md +0 -0
  93. {policyengine-5.0.4 → policyengine-5.2.0}/docs/methodology/index.md +0 -0
  94. {policyengine-5.0.4 → policyengine-5.2.0}/docs/methodology/model-architecture.md +0 -0
  95. {policyengine-5.0.4 → policyengine-5.2.0}/docs/methodology/us-health-costs.md +0 -0
  96. {policyengine-5.0.4 → policyengine-5.2.0}/docs/outputs.md +0 -0
  97. {policyengine-5.0.4 → policyengine-5.2.0}/docs/programs/index.md +0 -0
  98. {policyengine-5.0.4 → policyengine-5.2.0}/docs/programs/us-chip.md +0 -0
  99. {policyengine-5.0.4 → policyengine-5.2.0}/docs/reference/index.md +0 -0
  100. {policyengine-5.0.4 → policyengine-5.2.0}/docs/reforms.md +0 -0
  101. {policyengine-5.0.4 → policyengine-5.2.0}/docs/regions.md +0 -0
  102. {policyengine-5.0.4 → policyengine-5.2.0}/docs/run-records.md +0 -0
  103. {policyengine-5.0.4 → policyengine-5.2.0}/docs/trace-case-study.md +0 -0
  104. {policyengine-5.0.4 → policyengine-5.2.0}/docs/visualisation.md +0 -0
  105. {policyengine-5.0.4 → policyengine-5.2.0}/examples/employment_income_variation_uk.py +0 -0
  106. {policyengine-5.0.4 → policyengine-5.2.0}/examples/employment_income_variation_us.py +0 -0
  107. {policyengine-5.0.4 → policyengine-5.2.0}/examples/household_impact_example.py +0 -0
  108. {policyengine-5.0.4 → policyengine-5.2.0}/examples/income_bands_uk.py +0 -0
  109. {policyengine-5.0.4 → policyengine-5.2.0}/examples/income_distribution_us.py +0 -0
  110. {policyengine-5.0.4 → policyengine-5.2.0}/examples/paper_repro_uk.py +0 -0
  111. {policyengine-5.0.4 → policyengine-5.2.0}/examples/policy_change_uk.py +0 -0
  112. {policyengine-5.0.4 → policyengine-5.2.0}/examples/speedtest_us_simulation.py +0 -0
  113. {policyengine-5.0.4 → policyengine-5.2.0}/examples/us_budgetary_impact.py +0 -0
  114. {policyengine-5.0.4 → policyengine-5.2.0}/paper-preview.html +0 -0
  115. {policyengine-5.0.4 → policyengine-5.2.0}/paper.bib +0 -0
  116. {policyengine-5.0.4 → policyengine-5.2.0}/paper.md +0 -0
  117. {policyengine-5.0.4 → policyengine-5.2.0}/scripts/bundle.py +0 -0
  118. {policyengine-5.0.4 → policyengine-5.2.0}/scripts/certify_data_release.py +0 -0
  119. {policyengine-5.0.4 → policyengine-5.2.0}/scripts/check_data_staleness.py +0 -0
  120. {policyengine-5.0.4 → policyengine-5.2.0}/scripts/export_bundle_release_assets.py +0 -0
  121. {policyengine-5.0.4 → policyengine-5.2.0}/scripts/generate_bundle_artifacts.py +0 -0
  122. {policyengine-5.0.4 → policyengine-5.2.0}/scripts/generate_trace_tros.py +0 -0
  123. {policyengine-5.0.4 → policyengine-5.2.0}/scripts/prepare_package_bundle_update.py +0 -0
  124. {policyengine-5.0.4 → policyengine-5.2.0}/setup.cfg +0 -0
  125. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/__init__.py +0 -0
  126. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/cli.py +0 -0
  127. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/__init__.py +0 -0
  128. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/cache.py +0 -0
  129. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/dataset.py +0 -0
  130. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/dynamic.py +0 -0
  131. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/output.py +0 -0
  132. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/parameter.py +0 -0
  133. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/parameter_node.py +0 -0
  134. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/parameter_value.py +0 -0
  135. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/policy.py +0 -0
  136. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/region.py +0 -0
  137. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/scoping_strategy.py +0 -0
  138. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/simulation.py +0 -0
  139. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/tax_benefit_model.py +0 -0
  140. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/core/tax_benefit_model_version.py +0 -0
  141. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/countries/__init__.py +0 -0
  142. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/countries/uk/__init__.py +0 -0
  143. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/countries/uk/regions.py +0 -0
  144. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/countries/us/__init__.py +0 -0
  145. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/countries/us/data/__init__.py +0 -0
  146. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/countries/us/data/districts.py +0 -0
  147. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/countries/us/data/places.py +0 -0
  148. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/countries/us/data/states.py +0 -0
  149. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/countries/us/regions.py +0 -0
  150. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/data/__init__.py +0 -0
  151. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/data/schemas/trace_tro.schema.json +0 -0
  152. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/data/uk_geography_assets.py +0 -0
  153. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/derivations/__init__.py +0 -0
  154. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/derivations/narrate.py +0 -0
  155. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/derivations/trace.py +0 -0
  156. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/graph/__init__.py +0 -0
  157. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/graph/extractor.py +0 -0
  158. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/graph/graph.py +0 -0
  159. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/__init__.py +0 -0
  160. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/aggregate.py +0 -0
  161. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/change_aggregate.py +0 -0
  162. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/cliff_impact.py +0 -0
  163. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/congressional_district_impact.py +0 -0
  164. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/constituency_impact.py +0 -0
  165. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/decile_analysis.py +0 -0
  166. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/decile_grouping.py +0 -0
  167. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/decile_impact.py +0 -0
  168. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/extra_variables.py +0 -0
  169. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/inequality.py +0 -0
  170. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/intra_decile_impact.py +0 -0
  171. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/labor_supply_response.py +0 -0
  172. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/local_authority_impact.py +0 -0
  173. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/poverty.py +0 -0
  174. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/program_statistics.py +0 -0
  175. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/uk_geography_assets.py +0 -0
  176. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/outputs/uk_geography_impact.py +0 -0
  177. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/provenance/certification.py +0 -0
  178. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/provenance/pyproject_pins.py +0 -0
  179. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/provenance/trace.py +0 -0
  180. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/provenance/verify.py +0 -0
  181. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/provenance/zenodo.py +0 -0
  182. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/results/__init__.py +0 -0
  183. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/results/schema.py +0 -0
  184. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/results/trace_tro.py +0 -0
  185. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/results/tracking.py +0 -0
  186. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/common/__init__.py +0 -0
  187. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/common/axes.py +0 -0
  188. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/common/extra_variables.py +0 -0
  189. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/common/household.py +0 -0
  190. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/common/reform.py +0 -0
  191. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/common/result.py +0 -0
  192. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/uk/__init__.py +0 -0
  193. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/uk/analysis.py +0 -0
  194. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/uk/household.py +0 -0
  195. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/us/__init__.py +0 -0
  196. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/us/analysis.py +0 -0
  197. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/tax_benefit_models/us/household.py +0 -0
  198. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/utils/__init__.py +0 -0
  199. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/utils/dates.py +0 -0
  200. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/utils/design.py +0 -0
  201. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/utils/entity_utils.py +0 -0
  202. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/utils/errors.py +0 -0
  203. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/utils/household_validation.py +0 -0
  204. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/utils/parameter_labels.py +0 -0
  205. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/utils/parametric_reforms.py +0 -0
  206. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine/utils/plotting.py +0 -0
  207. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine.egg-info/dependency_links.txt +0 -0
  208. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine.egg-info/entry_points.txt +0 -0
  209. {policyengine-5.0.4 → policyengine-5.2.0}/src/policyengine.egg-info/top_level.txt +0 -0
  210. {policyengine-5.0.4 → policyengine-5.2.0}/tests/__init__.py +0 -0
  211. {policyengine-5.0.4 → policyengine-5.2.0}/tests/conftest.py +0 -0
  212. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/__init__.py +0 -0
  213. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/filtering_fixtures.py +0 -0
  214. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/household_calculator_snapshots/uk_couple_two_kids.json +0 -0
  215. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/household_calculator_snapshots/uk_model_surface.json +0 -0
  216. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/household_calculator_snapshots/uk_single_adult_employment_income.json +0 -0
  217. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/household_calculator_snapshots/uk_single_adult_no_income.json +0 -0
  218. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/household_calculator_snapshots/uk_single_parent_one_child.json +0 -0
  219. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/household_calculator_snapshots/us_married_two_kids_high_income.json +0 -0
  220. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/household_calculator_snapshots/us_model_surface.json +0 -0
  221. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/household_calculator_snapshots/us_single_adult_employment_income.json +0 -0
  222. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/household_calculator_snapshots/us_single_adult_no_income.json +0 -0
  223. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/household_calculator_snapshots/us_single_parent_one_child.json +0 -0
  224. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/parameter_labels_fixtures.py +0 -0
  225. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/parametric_reforms_fixtures.py +0 -0
  226. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/poverty_by_demographics_fixtures.py +0 -0
  227. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/us_reform_fixtures.py +0 -0
  228. {policyengine-5.0.4 → policyengine-5.2.0}/tests/fixtures/variable_label_fixtures.py +0 -0
  229. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_aggregate.py +0 -0
  230. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_budgetary_impact.py +0 -0
  231. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_bump_version.py +0 -0
  232. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_bundle_metadata.py +0 -0
  233. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_cache.py +0 -0
  234. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_certify_data_release.py +0 -0
  235. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_change_aggregate.py +0 -0
  236. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_cliff_impact.py +0 -0
  237. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_cliff_impact_analysis.py +0 -0
  238. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_congressional_district_impact.py +0 -0
  239. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_constituency_impact.py +0 -0
  240. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_dataset_persistence.py +0 -0
  241. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_decile_grouping.py +0 -0
  242. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_derivations.py +0 -0
  243. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_dict_reforms_on_simulation.py +0 -0
  244. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_entity_mapping.py +0 -0
  245. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_entity_utils.py +0 -0
  246. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_entity_utils_characterization.py +0 -0
  247. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_errors.py +0 -0
  248. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_extra_variables.py +0 -0
  249. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_filtering.py +0 -0
  250. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_graph/__init__.py +0 -0
  251. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_graph/conftest.py +0 -0
  252. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_graph/test_extractor.py +0 -0
  253. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_household_calculator_snapshot.py +0 -0
  254. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_household_impact.py +0 -0
  255. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_inequality.py +0 -0
  256. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_intra_decile_impact.py +0 -0
  257. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_labor_supply_response.py +0 -0
  258. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_local_authority_impact.py +0 -0
  259. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_manifest_version_mismatch.py +0 -0
  260. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_models.py +0 -0
  261. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_pandas3_compatibility.py +0 -0
  262. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_parameter_labels.py +0 -0
  263. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_parameter_values.py +0 -0
  264. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_parametric_reforms.py +0 -0
  265. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_poverty.py +0 -0
  266. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_poverty_by_demographics.py +0 -0
  267. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_poverty_run.py +0 -0
  268. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_preservation_mirror.py +0 -0
  269. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_program_statistics.py +0 -0
  270. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_pyproject_pins.py +0 -0
  271. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_region_group_strategy.py +0 -0
  272. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_results.py +0 -0
  273. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_run_record.py +0 -0
  274. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_scoping_strategy.py +0 -0
  275. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_small_follow_ups.py +0 -0
  276. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_trace_tro.py +0 -0
  277. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_trace_tro_verify.py +0 -0
  278. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_uk_analysis.py +0 -0
  279. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_uk_geography_assets.py +0 -0
  280. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_uk_program_statistics.py +0 -0
  281. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_uk_regions.py +0 -0
  282. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_us_microsim_structural_reforms.py +0 -0
  283. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_us_program_statistics.py +0 -0
  284. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_us_reform_application.py +0 -0
  285. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_us_regions.py +0 -0
  286. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_variable_labels.py +0 -0
  287. {policyengine-5.0.4 → policyengine-5.2.0}/tests/test_zenodo_mirror.py +0 -0
@@ -1,3 +1,30 @@
1
+ ## [5.2.0] - 2026-08-29
2
+
3
+ ### Added
4
+
5
+ - Expose variable period, unit, quantity type, references, applicability, numeric bounds, period-size behavior, and sanitized country metadata on the public `Variable` model. Exclude empty organizational nodes from the public parameter catalogue.
6
+
7
+
8
+ ## [5.1.0] - 2026-08-29
9
+
10
+ ### Changed
11
+
12
+ - PolicyEngine.py now exposes one `materialize_dataset` entry point for
13
+ bundle-managed datasets, explicit Hugging Face URIs, and explicit local paths.
14
+ Managed datasets are reused or downloaded from the exact repository type,
15
+ immutable revision, and SHA-256 recorded in the release bundle; the other two
16
+ inputs remain opt-in.
17
+
18
+ ### Removed
19
+
20
+ - Removed the legacy dataset-specific GCS downloader and its direct dependencies,
21
+ the public `resolve_local_managed_dataset_source` export, and the former
22
+ `policyengine.provenance.dataset_sources.materialize_dataset_source` function.
23
+ Use `policyengine.provenance.materialize_dataset` for bundle-managed datasets,
24
+ explicit Hugging Face references, and explicit local files. The separate UK
25
+ geography asset implementation is unchanged.
26
+
27
+
1
28
  ## [5.0.4] - 2026-08-27
2
29
 
3
30
  ### Fixed
@@ -1,36 +1,41 @@
1
1
  cff-version: 1.2.0
2
2
  message: "If you use this software, please cite it as below."
3
3
  type: software
4
- title: policyengine
5
- version: 4.10.0
6
- date-released: "2026-05-22"
4
+ title: "policyengine: A Microsimulation Tool for Tax-Benefit Policy Analysis"
5
+ version: 5.0.4
6
+ date-released: "2026-08-28"
7
7
  url: "https://github.com/PolicyEngine/policyengine.py"
8
8
  abstract: "An open-source Python package that provides a common analysis layer for tax-benefit microsimulation across the US and the UK."
9
- license: AGPL-3.0
9
+ license: AGPL-3.0-or-later
10
10
  authors:
11
- - family-names: Ghenis
12
- given-names: Max
13
- orcid: "https://orcid.org/0000-0002-1335-8277"
14
- affiliation: PolicyEngine
15
11
  - family-names: Ahmadi
16
12
  given-names: Vahid
17
13
  orcid: "https://orcid.org/0009-0004-1093-6272"
18
- affiliation: PolicyEngine
14
+ affiliation: "PolicyEngine, Washington, DC, United States"
15
+ - family-names: Ghenis
16
+ given-names: Max
17
+ orcid: "https://orcid.org/0000-0002-1335-8277"
18
+ affiliation: "PolicyEngine, Washington, DC, United States"
19
19
  - family-names: Woodruff
20
20
  given-names: Nikhil
21
21
  orcid: "https://orcid.org/0009-0009-5004-4910"
22
- affiliation: PolicyEngine
22
+ affiliation: "PolicyEngine, Washington, DC, United States"
23
23
  - family-names: Makarchuk
24
24
  given-names: Pavel
25
25
  orcid: "https://orcid.org/0009-0003-4869-7409"
26
- affiliation: PolicyEngine
26
+ affiliation: "PolicyEngine, Washington, DC, United States"
27
27
  - family-names: Volk
28
28
  given-names: Anthony
29
- affiliation: PolicyEngine
29
+ orcid: "https://orcid.org/0009-0009-2183-3064"
30
+ affiliation: "PolicyEngine, Washington, DC, United States"
30
31
  keywords:
31
32
  - microsimulation
32
33
  - tax
33
34
  - benefit
34
35
  - public policy
35
36
  - Python
37
+ identifiers:
38
+ - type: doi
39
+ value: 10.5281/zenodo.22145449
40
+ description: Concept DOI for all versions
36
41
  repository-code: "https://github.com/PolicyEngine/policyengine.py"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: policyengine
3
- Version: 5.0.4
3
+ Version: 5.2.0
4
4
  Summary: A package to conduct policy analysis using PolicyEngine tax-benefit models.
5
5
  Author-email: PolicyEngine <hello@policyengine.org>
6
6
  License: GNU AFFERO GENERAL PUBLIC LICENSE
@@ -682,8 +682,6 @@ Requires-Dist: jsonschema>=4.0.0
682
682
  Requires-Dist: requests>=2.31.0
683
683
  Requires-Dist: psutil>=5.9.0
684
684
  Requires-Dist: packaging>=23.0
685
- Requires-Dist: google-cloud-storage<4.0.0,>=3.1.0
686
- Requires-Dist: diskcache<6.0.0,>=5.6.3
687
685
  Provides-Extra: plotting
688
686
  Requires-Dist: plotly>=5.0.0; extra == "plotting"
689
687
  Provides-Extra: graph
@@ -719,6 +717,8 @@ Dynamic: license-file
719
717
 
720
718
  # PolicyEngine.py
721
719
 
720
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22145449.svg)](https://doi.org/10.5281/zenodo.22145449)
721
+
722
722
  A Python package for tax-benefit microsimulation analysis. Run policy simulations, analyse distributional impacts, and visualise results across the UK and US.
723
723
 
724
724
  > **Results are estimates.** PolicyEngine simulates a large, evolving body of tax-benefit law (the US model alone encodes more than 95,000 parameters across 5,500+ variables) over survey microdata calibrated to administrative targets. Treat outputs as estimates, and validate them against the policies relevant to your analysis, the scope of the rules engine, and external or back-of-the-envelope calculations. You can inspect the certified US dataset's calibration at https://calibration-diagnostics.vercel.app/populace.
@@ -1045,3 +1045,13 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
1045
1045
  ## License
1046
1046
 
1047
1047
  AGPL-3.0
1048
+
1049
+ ## Citing
1050
+
1051
+ If you use this package in research, please cite it. Citation metadata is in
1052
+ [CITATION.cff](CITATION.cff), and each release is archived on Zenodo:
1053
+
1054
+ > Ahmadi, V., Ghenis, M., Woodruff, N., Makarchuk, P., & Volk, A. (2026).
1055
+ > policyengine: A Microsimulation Tool for Tax-Benefit Policy Analysis
1056
+ > (Version 5.0.4) [Computer software]. Zenodo.
1057
+ > https://doi.org/10.5281/zenodo.22145449
@@ -1,5 +1,7 @@
1
1
  # PolicyEngine.py
2
2
 
3
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22145449.svg)](https://doi.org/10.5281/zenodo.22145449)
4
+
3
5
  A Python package for tax-benefit microsimulation analysis. Run policy simulations, analyse distributional impacts, and visualise results across the UK and US.
4
6
 
5
7
  > **Results are estimates.** PolicyEngine simulates a large, evolving body of tax-benefit law (the US model alone encodes more than 95,000 parameters across 5,500+ variables) over survey microdata calibrated to administrative targets. Treat outputs as estimates, and validate them against the policies relevant to your analysis, the scope of the rules engine, and external or back-of-the-envelope calculations. You can inspect the certified US dataset's calibration at https://calibration-diagnostics.vercel.app/populace.
@@ -326,3 +328,13 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
326
328
  ## License
327
329
 
328
330
  AGPL-3.0
331
+
332
+ ## Citing
333
+
334
+ If you use this package in research, please cite it. Citation metadata is in
335
+ [CITATION.cff](CITATION.cff), and each release is archived on Zenodo:
336
+
337
+ > Ahmadi, V., Ghenis, M., Woodruff, N., Makarchuk, P., & Volk, A. (2026).
338
+ > policyengine: A Microsimulation Tool for Tax-Benefit Policy Analysis
339
+ > (Version 5.0.4) [Computer software]. Zenodo.
340
+ > https://doi.org/10.5281/zenodo.22145449
@@ -29,10 +29,15 @@ When run from `uvx` or `pipx`, the installer creates or reuses `./.venv`.
29
29
  Inside an existing virtualenv or conda environment, it installs into that active
30
30
  environment. The installer then installs the
31
31
  exact bundled package scaffold with pip, downloads certified default US and UK
32
- datasets into `./data`, moves replaced dataset files into
33
- `./data/.policyengine-bundle-backups/<timestamp>/`, and writes a
34
- `./data/.policyengine-bundle-receipt.json` receipt that records the target
35
- Python.
32
+ datasets into `./data`, and writes a `./data/.policyengine-bundle-receipt.json`
33
+ receipt that records the target Python.
34
+
35
+ Dataset pre-download and US and UK calculations share the same verified-download
36
+ implementation. For every managed artifact, PolicyEngine.py reads the source
37
+ data package name, Hugging Face repository type, immutable revision, and SHA-256
38
+ from the bundle. It reuses an existing file only when its hash matches, downloads
39
+ and verifies a replacement before atomically replacing an invalid local file,
40
+ and records the verified result in the receipt.
36
41
 
37
42
  The bundle manifest can certify additional regional datasets, such as US state
38
43
  datasets. Those artifacts are part of the citable bundle manifest, but
@@ -40,6 +45,29 @@ datasets. Those artifacts are part of the citable bundle manifest, but
40
45
  Runtime callers should use the manifest's regional dataset URI when a regional
41
46
  simulation needs one.
42
47
 
48
+ To materialize a default or named artifact without installing the complete
49
+ package scaffold:
50
+
51
+ ```python
52
+ from policyengine.provenance import materialize_dataset
53
+
54
+ result = materialize_dataset("us", "populace_us_2024")
55
+ print(result.path)
56
+ print(result.bundle_dataset.sha256)
57
+ ```
58
+
59
+ `materialize_dataset` returns the selected source URI and local path. For a
60
+ bundle-managed input, `bundle_dataset` also contains the selected source
61
+ package, repository type, revision, verified SHA-256, and optional metadata
62
+ path.
63
+ `policyengine-*-data` and `populace-data` artifacts use the repository type
64
+ recorded in the bundle. Callers do not infer repository type from the repository
65
+ name.
66
+
67
+ Managed datasets are downloaded from the Hugging Face artifact specified in the
68
+ bundle. GCS dataset URIs are unsupported. The separate UK geography lookup files
69
+ retain their existing storage implementation.
70
+
43
71
  Country-specific and package-only installs are supported:
44
72
 
45
73
  ```bash
@@ -162,17 +162,22 @@ concrete `artifact_sha256` pin in the country release manifest.
162
162
  After that, the release manifest is what papers cite; the storage
163
163
  channel is just the cache.
164
164
 
165
- ## Consumer resolver (what `pe.py` changes)
165
+ ## Consumer resolver (historical proposal)
166
166
 
167
- Minimal. The existing `pe.us.ensure_datasets` takes a URI today:
167
+ PolicyEngine.py now resolves managed datasets by logical name through its
168
+ certified release bundle:
168
169
 
169
170
  ```python
170
171
  pe.us.ensure_datasets(
171
- datasets=["hf://policyengine/populace-us/populace_us_2024.h5@<release>"],
172
+ datasets=["populace_us_2024"],
172
173
  years=[2026],
173
174
  )
174
175
  ```
175
176
 
177
+ Direct Hugging Face references require `allow_unmanaged=True`; GCS dataset
178
+ references are unsupported. The `pe-data://` examples below remain an
179
+ unimplemented design proposal rather than a description of current behavior.
180
+
176
181
  Under the substrate, the URI scheme gains a new prefix:
177
182
 
178
183
  ```python
@@ -40,7 +40,15 @@ datasets = pe.us.ensure_datasets(
40
40
  dataset = datasets["populace_us_2024_2026"]
41
41
  ```
42
42
 
43
- The default US dataset is **Populace US 2024** — a Populace-built dataset calibrated to IRS, CMS, SNAP, Census, and other administrative totals. The UK default is **Populace UK 2023** — a Populace-built Family Resources Survey dataset calibrated to UK administrative targets.
43
+ The default US dataset is **Populace US 2024** — a Populace-built dataset
44
+ calibrated to IRS, CMS, SNAP, Census, and other administrative totals. The
45
+ current UK certified default is **Enhanced FRS 2024–25**, supplied by
46
+ `policyengine-uk-data`. **Populace UK 2023** remains available as a named,
47
+ non-default bundle dataset.
48
+
49
+ PolicyEngine.py obtains the repository type, immutable revision, and SHA-256
50
+ from the installed release bundle. An existing file in the configured data
51
+ directory is reused only after hash verification.
44
52
 
45
53
  List datasets already known to the country:
46
54
 
@@ -97,7 +105,7 @@ ca = Simulation(
97
105
 
98
106
  UK population data uses licensed Family Resources Survey inputs. The default
99
107
  UK release bundle points to the private
100
- `policyengine/populace-uk-private` Hugging Face dataset repository. Set
108
+ `policyengine/policyengine-uk-data-private` Hugging Face repository. Set
101
109
  `HUGGING_FACE_TOKEN` to a token from a Hugging Face account with access:
102
110
 
103
111
  ```bash
@@ -113,11 +121,11 @@ import policyengine as pe
113
121
  from policyengine.core import Simulation
114
122
 
115
123
  datasets = pe.uk.ensure_datasets(
116
- datasets=["populace_uk_2023"],
124
+ datasets=["enhanced_frs_2024_25"],
117
125
  years=[2026],
118
126
  data_folder="./data",
119
127
  )
120
- dataset = datasets["populace_uk_2023_2026"]
128
+ dataset = datasets["enhanced_frs_2024_25_2026"]
121
129
 
122
130
  simulation = Simulation(
123
131
  dataset=dataset,
@@ -126,28 +134,25 @@ simulation = Simulation(
126
134
  simulation.run()
127
135
  ```
128
136
 
129
- To download the raw h5 artifact directly from Hugging Face, use
130
- `huggingface_hub` and specify `repo_type="dataset"`:
137
+ To materialize the raw certified artifact without creating uprated yearly
138
+ datasets, use PolicyEngine.py's bundle API:
131
139
 
132
140
  ```python
133
- import os
134
- from huggingface_hub import hf_hub_download
135
-
136
- path = hf_hub_download(
137
- repo_id="policyengine/populace-uk-private",
138
- filename="populace_uk_2023.h5",
139
- repo_type="dataset",
140
- token=os.environ["HUGGING_FACE_TOKEN"],
141
+ from policyengine.provenance import materialize_dataset
142
+
143
+ result = materialize_dataset(
144
+ "uk",
145
+ "enhanced_frs_2024_25",
141
146
  )
142
147
 
143
- print(path)
148
+ print(result.path)
149
+ print(result.bundle_dataset.sha256)
144
150
  ```
145
151
 
146
- The repository URL is
147
- <https://huggingface.co/datasets/policyengine/populace-uk-private>. A 404 from
148
- the website or `RepositoryNotFoundError` from the Hub API usually means the
149
- browser or token is not authenticated as an account with access, or that the
150
- Hub call omitted `repo_type="dataset"`.
152
+ The bundle API uses the repository type recorded in the bundle, so callers do
153
+ not need repository-specific download logic. Authentication or authorization
154
+ failures are reported directly and do not cause a retry against another
155
+ repository type.
151
156
 
152
157
  ## Simulations
153
158
 
@@ -219,6 +224,7 @@ Smaller custom H5 datasets can be passed explicitly for testing:
219
224
  datasets = pe.us.ensure_datasets(
220
225
  datasets=["/path/to/smoke_test_populace_us_2024.h5"],
221
226
  years=[2026],
227
+ allow_unmanaged=True,
222
228
  )
223
229
  ```
224
230
 
@@ -235,7 +241,12 @@ sim = managed_microsimulation()
235
241
  # `sim` is a policyengine_us.Microsimulation — use its API directly
236
242
  ```
237
243
 
238
- Pass `allow_unmanaged=True` with a custom `dataset=` to opt out of the release bundle.
244
+ Pass `allow_unmanaged=True` with a custom `dataset=` to opt out of the release
245
+ bundle. Explicit local paths and Hugging Face URIs remain supported in this
246
+ mode. GCS dataset URIs are not supported.
247
+
248
+ For managed simulations, `sim.policyengine_bundle` records the actual source
249
+ package, repository type, revision, verified SHA-256, and local path.
239
250
 
240
251
  ## Pinned model versions
241
252
 
@@ -41,8 +41,13 @@ environment. It installs the bundled Python packages with pip, downloads the
41
41
  certified default US and UK datasets into `./data`, and writes a
42
42
  `./data/.policyengine-bundle-receipt.json` receipt that records the target
43
43
  Python.
44
- Existing dataset files with the same filename are moved to
45
- `./data/.policyengine-bundle-backups/<timestamp>/`.
44
+ An existing file is reused when its SHA-256 matches the manifest. Otherwise, a
45
+ verified download atomically replaces it.
46
+
47
+ The command invokes the same bundle materializer used by calculations. The
48
+ materializer uses the manifest's exact Hugging Face repository type, immutable
49
+ revision, and certified SHA-256. The data package name is retained only as
50
+ provenance metadata; it does not select a download implementation.
46
51
 
47
52
  Regional datasets may also be certified in the bundle manifest. They are not
48
53
  eagerly downloaded by `policyengine bundle install`; callers should materialize
@@ -153,8 +158,10 @@ sibling `dataset_overlays.{country}` map:
153
158
  "dataset_overlays": {
154
159
  "us": {
155
160
  "populace_us_2024_acs_local": {
161
+ "data_package_name": "populace-data",
156
162
  "path": "populace_us_2024_acs_local.h5",
157
163
  "repo_id": "policyengine/populace-us",
164
+ "repo_type": "dataset",
158
165
  "revision": "populace-us-2024-buildo-acs-local-...",
159
166
  "sha256": "..."
160
167
  }
@@ -170,6 +177,11 @@ default resolution is untouched. Because certification only rewrites
170
177
  `data_releases`, overlays survive re-certification without any manual
171
178
  re-add step.
172
179
 
180
+ Cross-package overlays must declare `data_package_name` and `repo_type`
181
+ explicitly. Ordinary artifacts inherit these values from the country release's
182
+ primary `data_package`. This prevents runtime code from guessing how a
183
+ repository should be addressed.
184
+
173
185
  Earlier releases (policyengine 4.15.x–4.16.x) were certified through the
174
186
  `PolicyEngine/policyengine-bundles` archive flow; those bundles remain the
175
187
  historical record of their certifications.
@@ -601,6 +613,9 @@ The target implementation in `policyengine.py` should add:
601
613
  - explicit runtime bundle metadata on simulations, APIs, and app responses
602
614
  - checksum-backed dataset resolution from the certified bundle manifest
603
615
 
616
+ The checksum-backed runtime resolution described above is now implemented.
617
+ Managed materialization is Hugging Face-only; GCS is not a dataset source.
618
+
604
619
  ## Why not let `policyengine.py` build all country data directly?
605
620
 
606
621
  Because that would centralise the wrong concerns:
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "policyengine"
7
- version = "5.0.4"
7
+ version = "5.2.0"
8
8
  description = "A package to conduct policy analysis using PolicyEngine tax-benefit models."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -29,8 +29,6 @@ dependencies = [
29
29
  "requests>=2.31.0",
30
30
  "psutil>=5.9.0",
31
31
  "packaging>=23.0",
32
- "google-cloud-storage>=3.1.0,<4.0.0",
33
- "diskcache>=5.6.3,<6.0.0",
34
32
  ]
35
33
 
36
34
  [project.scripts]
@@ -85,6 +83,9 @@ where = ["src"]
85
83
  [tool.setuptools.package-data]
86
84
  "policyengine" = ["**/*"]
87
85
 
86
+ [tool.setuptools.exclude-package-data]
87
+ "policyengine" = ["**/__pycache__/*", "**/*.pyc", "**/*.pyo"]
88
+
88
89
  [tool.pytest.ini_options]
89
90
  addopts = "-v"
90
91
  testpaths = [