From ffadc156f69fe0745146c89234f6806a850a2190 Mon Sep 17 00:00:00 2001 From: Anthony Volk Date: Thu, 9 Jul 2026 19:17:20 +0200 Subject: [PATCH] Certify policyengine.py against policyengine-core 3.30.0 Update the bundle manifest (the source of truth for package pins) to policyengine-core 3.30.0 via scripts/bundle.py update-packages --core, then regenerate the derived pyproject pins, uv.lock, and the vendored TRACE TRO sidecars (which bind the bundle manifest by sha256). 3.30.0 enforces formula-time determinism with a static check at variable registration (policyengine-core#518) and fixes Reform.from_dict bare-date period semantics (#510). Verified both country systems build under 3.30.0 with no NonDeterministicFormulaError (us 1.764.6: 5770 variables; uk 2.89.2: 869 variables); pinned packages already allow policyengine-core>=3.26.0, so no country-package bump is needed. bundle.py check and the TRO sidecar-binding test pass. Co-Authored-By: Claude Opus 4.8 --- changelog.d/464.fixed.md | 1 + pyproject.toml | 8 +++--- src/policyengine/data/bundle/manifest.json | 4 +-- .../data/bundle/uk.trace.tro.jsonld | 4 +-- .../data/bundle/us.trace.tro.jsonld | 4 +-- uv.lock | 28 +++++++++---------- 6 files changed, 25 insertions(+), 24 deletions(-) create mode 100644 changelog.d/464.fixed.md diff --git a/changelog.d/464.fixed.md b/changelog.d/464.fixed.md new file mode 100644 index 00000000..23c07e47 --- /dev/null +++ b/changelog.d/464.fixed.md @@ -0,0 +1 @@ +Upgrade `policyengine-core` to 3.30.0. This enforces formula-time determinism with a static check at variable registration instead of a runtime monkeypatch of the process-global `numpy.random`, fixing intermittent, misattributed `NonDeterministicFormulaError`s that could be raised when building or running many simulations concurrently in one process (policyengine-core#518). It also corrects `Reform.from_dict` bare-date period semantics (policyengine-core#510). The pinned country packages already allow `policyengine-core>=3.26.0` and are randomness-clean, so no country-package bump is required. diff --git a/pyproject.toml b/pyproject.toml index 944beb58..9f0864a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,16 +44,16 @@ graph = [ "networkx>=3.0", ] models = [ - "policyengine-core==3.28.0", + "policyengine-core==3.30.0", "policyengine-us==1.764.6", "policyengine-uk==2.89.2", ] uk = [ - "policyengine-core==3.28.0", + "policyengine-core==3.30.0", "policyengine-uk==2.89.2", ] us = [ - "policyengine-core==3.28.0", + "policyengine-core==3.30.0", "policyengine-us==1.764.6", ] dev = [ @@ -70,7 +70,7 @@ dev = [ "towncrier>=24.8.0", "mypy>=1.11.0", "pytest-cov>=5.0.0", - "policyengine-core==3.28.0", + "policyengine-core==3.30.0", "policyengine-us==1.764.6", "policyengine-uk==2.89.2", ] diff --git a/src/policyengine/data/bundle/manifest.json b/src/policyengine/data/bundle/manifest.json index 1b92e0c2..4d854f58 100644 --- a/src/policyengine/data/bundle/manifest.json +++ b/src/policyengine/data/bundle/manifest.json @@ -203,10 +203,10 @@ }, "policyengine-core": { "import_name": "policyengine_core", - "install_requirement": "policyengine-core==3.28.0", + "install_requirement": "policyengine-core==3.30.0", "name": "policyengine-core", "role": "runtime_dependency", - "version": "3.28.0" + "version": "3.30.0" }, "policyengine-uk": { "country": "uk", diff --git a/src/policyengine/data/bundle/uk.trace.tro.jsonld b/src/policyengine/data/bundle/uk.trace.tro.jsonld index d84a09c8..2a51d350 100644 --- a/src/policyengine/data/bundle/uk.trace.tro.jsonld +++ b/src/policyengine/data/bundle/uk.trace.tro.jsonld @@ -75,7 +75,7 @@ "@type": "trov:ResearchArtifact", "schema:name": "policyengine.py bundle manifest for uk", "trov:mimeType": "application/json", - "trov:sha256": "b6f6781bcb98355ec4542320a73be47e980f17e292eaf0b931f961191d420f7d" + "trov:sha256": "5f88cc36a8a2a9081a0531918567519f65bc8f320c66e2e520f3a3f4cc833b30" }, { "@id": "composition/1/artifact/data_release_manifest", @@ -102,7 +102,7 @@ "trov:hasFingerprint": { "@id": "composition/1/fingerprint", "@type": "trov:CompositionFingerprint", - "trov:sha256": "dd7e4ef83d7cfeb8ed50105543bcf3505d5d5e84a501bfeb0e9e95955300c3f4" + "trov:sha256": "e9f91a5d93eb33485134237dcf34d96c8c93eaac6557ceb4b4326d2f74850982" } }, "trov:hasPerformance": { diff --git a/src/policyengine/data/bundle/us.trace.tro.jsonld b/src/policyengine/data/bundle/us.trace.tro.jsonld index 9572187d..6ae0056f 100644 --- a/src/policyengine/data/bundle/us.trace.tro.jsonld +++ b/src/policyengine/data/bundle/us.trace.tro.jsonld @@ -75,7 +75,7 @@ "@type": "trov:ResearchArtifact", "schema:name": "policyengine.py bundle manifest for us", "trov:mimeType": "application/json", - "trov:sha256": "b6f6781bcb98355ec4542320a73be47e980f17e292eaf0b931f961191d420f7d" + "trov:sha256": "5f88cc36a8a2a9081a0531918567519f65bc8f320c66e2e520f3a3f4cc833b30" }, { "@id": "composition/1/artifact/data_release_manifest", @@ -102,7 +102,7 @@ "trov:hasFingerprint": { "@id": "composition/1/fingerprint", "@type": "trov:CompositionFingerprint", - "trov:sha256": "22191c7ac896137c89824af7f50195dd09909b3d2c5f5404637e16cf9b5c74ee" + "trov:sha256": "08e2850e9be03c3dd671297cec7f70410f79b388160ff7f398dae5d42bbc73b8" } }, "trov:hasPerformance": { diff --git a/uv.lock b/uv.lock index dd39bb1b..556cf036 100644 --- a/uv.lock +++ b/uv.lock @@ -2820,7 +2820,7 @@ wheels = [ [[package]] name = "policyengine" -version = "4.18.10" +version = "4.20.1" source = { editable = "." } dependencies = [ { name = "diskcache" }, @@ -2897,16 +2897,16 @@ requires-dist = [ { name = "pandas", specifier = ">=2.0.0" }, { name = "plotly", marker = "extra == 'dev'", specifier = ">=5.0.0" }, { name = "plotly", marker = "extra == 'plotting'", specifier = ">=5.0.0" }, - { name = "policyengine-core", marker = "extra == 'dev'", specifier = "==3.28.0" }, - { name = "policyengine-core", marker = "extra == 'models'", specifier = "==3.28.0" }, - { name = "policyengine-core", marker = "extra == 'uk'", specifier = "==3.28.0" }, - { name = "policyengine-core", marker = "extra == 'us'", specifier = "==3.28.0" }, + { name = "policyengine-core", marker = "extra == 'dev'", specifier = "==3.30.0" }, + { name = "policyengine-core", marker = "extra == 'models'", specifier = "==3.30.0" }, + { name = "policyengine-core", marker = "extra == 'uk'", specifier = "==3.30.0" }, + { name = "policyengine-core", marker = "extra == 'us'", specifier = "==3.30.0" }, { name = "policyengine-uk", marker = "extra == 'dev'", specifier = "==2.89.2" }, { name = "policyengine-uk", marker = "extra == 'models'", specifier = "==2.89.2" }, { name = "policyengine-uk", marker = "extra == 'uk'", specifier = "==2.89.2" }, - { name = "policyengine-us", marker = "extra == 'dev'", specifier = "==1.752.2" }, - { name = "policyengine-us", marker = "extra == 'models'", specifier = "==1.752.2" }, - { name = "policyengine-us", marker = "extra == 'us'", specifier = "==1.752.2" }, + { name = "policyengine-us", marker = "extra == 'dev'", specifier = "==1.764.6" }, + { name = "policyengine-us", marker = "extra == 'models'", specifier = "==1.764.6" }, + { name = "policyengine-us", marker = "extra == 'us'", specifier = "==1.764.6" }, { name = "psutil", specifier = ">=5.9.0" }, { name = "pydantic", specifier = ">=2.0.0" }, { name = "pytest", marker = "extra == 'dev'" }, @@ -2921,7 +2921,7 @@ provides-extras = ["plotting", "graph", "models", "uk", "us", "dev"] [[package]] name = "policyengine-core" -version = "3.28.0" +version = "3.30.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "dpath" }, @@ -2945,9 +2945,9 @@ dependencies = [ { name = "standard-imghdr" }, { name = "wheel" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/69/bf/d870af03abe76a64249fe9e95d7561c99c0484af1d3f3ae3773caa1c57d8/policyengine_core-3.28.0.tar.gz", hash = "sha256:3ae894577d8c40cb6c6d0f7d1df8ccdce2ee46aecbe52de0604e0af7ed454ecb", size = 484615, upload-time = "2026-06-26T13:38:51.09Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c0/04/1934fe401c2f654b1e483c08cdbe4b9cd8007a57b4c89e6556cd2bec8cbf/policyengine_core-3.30.0.tar.gz", hash = "sha256:f922e096efa59e748210202b5023ba56d1a1326963e4dc7fed57030247308a35", size = 498324, upload-time = "2026-07-09T17:08:31.67Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/49/b6/efec8f49cc926cd8aa4f6767ae56d1d29e31fc42fc1efebed611cb8499c3/policyengine_core-3.28.0-py3-none-any.whl", hash = "sha256:069b83f76f636c138975ca85270500e47b81f191bc00da47090b237500eeabc0", size = 238479, upload-time = "2026-06-26T13:38:49.705Z" }, + { url = "https://files.pythonhosted.org/packages/1d/fa/47e01d9f6c62e6fcacc1c9aa62d181e157bcb14beff7a1a4fe39974f52ea/policyengine_core-3.30.0-py3-none-any.whl", hash = "sha256:5e896b469ca1af04d783e84e033c7479344ba4c51a65e8fd043bf44c6b6cd646", size = 244334, upload-time = "2026-07-09T17:08:30.223Z" }, ] [[package]] @@ -2969,7 +2969,7 @@ wheels = [ [[package]] name = "policyengine-us" -version = "1.752.2" +version = "1.764.6" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "microdf-python" }, @@ -2981,9 +2981,9 @@ dependencies = [ { name = "tables", version = "3.11.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, { name = "tqdm" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/12/c0/5adc314e94f6b1063c4bb697b9ebe9d6777998b571c9fce166603ac9a408/policyengine_us-1.752.2.tar.gz", hash = "sha256:caf536ad9bef345379f664146798c17f51813403255b5c57a36d4d9b98b4f1db", size = 10648079, upload-time = "2026-07-01T14:50:55.523Z" } +sdist = { url = "https://files.pythonhosted.org/packages/6e/cc/9e65a9586069beab1f02102a23f7a0e6332f1a9c2d590cb9f0e68f9ac987/policyengine_us-1.764.6.tar.gz", hash = "sha256:9817d48abc5b7d690b8abe33047005e5cf40b71654a85a2534bb5e3bcf921f79", size = 11009555, upload-time = "2026-07-06T13:13:07.254Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7f/85/bbee92f747a382779bae41a67da39fa5a8592d068853a64226279e6c32a7/policyengine_us-1.752.2-py3-none-any.whl", hash = "sha256:7e30468ae369ddd14e5d834c12cacbc5b5159c809b0990caf204c0747ef4c096", size = 12524440, upload-time = "2026-07-01T14:50:52.432Z" }, + { url = "https://files.pythonhosted.org/packages/e2/5a/0566666f30ad06e416f0cf25b24bdee73acd71897fb2de3c0ac43b59e3e3/policyengine_us-1.764.6-py3-none-any.whl", hash = "sha256:2b2c5c02c26ab212270948db1f30129728b625fc6109fc9ca0c604b714546909", size = 13117921, upload-time = "2026-07-06T13:13:03.476Z" }, ] [[package]]