Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Certify the US populace data release `populace-us-2024-f0af251-703bd81a565c-20260620T201958Z` (populace_us_2024, policyengine-us 1.729.0) into the PolicyEngine bundle manifest.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ graph = [
]
models = [
"policyengine-core==3.28.0",
"policyengine-us==1.745.0",
"policyengine-us==1.729.0",
"policyengine-uk==2.89.2",
]
uk = [
Expand All @@ -54,7 +54,7 @@ uk = [
]
us = [
"policyengine-core==3.28.0",
"policyengine-us==1.745.0",
"policyengine-us==1.729.0",
]
dev = [
"pytest",
Expand All @@ -71,7 +71,7 @@ dev = [
"mypy>=1.11.0",
"pytest-cov>=5.0.0",
"policyengine-core==3.28.0",
"policyengine-us==1.745.0",
"policyengine-us==1.729.0",
"policyengine-uk==2.89.2",
]

Expand Down
68 changes: 34 additions & 34 deletions src/policyengine/data/bundle/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,91 +97,91 @@
"version": "populace-uk-2023-dd68c73-4aa4b14-20260619T023711Z"
},
"us": {
"build_id": "populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z",
"build_id": "populace-us-2024-f0af251-703bd81a565c-20260620T201958Z",
"bundle_id": "us-4.18.6",
"certification": {
"built_with_model_version": "1.745.0",
"built_with_model_version": "1.729.0",
"certified_by": "policyengine.py bundle certification",
"certified_for_model_version": "1.745.0",
"certified_for_model_version": "1.729.0",
"compatibility_basis": "built_with_model_package",
"data_build_id": "populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z"
"data_build_id": "populace-us-2024-f0af251-703bd81a565c-20260620T201958Z"
},
"certified_data_artifact": {
"build_id": "populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z",
"build_id": "populace-us-2024-f0af251-703bd81a565c-20260620T201958Z",
"data_package": {
"name": "populace-data",
"version": "0.1.0"
},
"dataset": "populace_us_2024",
"sha256": "32fcf6b23e96d27d59cf4eca618bd21bd5a689d6099db6655e9e8d955442b41d",
"uri": "hf://policyengine/populace-us/populace_us_2024.h5@populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z"
"sha256": "16be6338f9d0b3c339883dae59949e995663b64cf145de6728b3dd0f916c5d5f",
"uri": "hf://policyengine/populace-us/populace_us_2024.h5@populace-us-2024-f0af251-703bd81a565c-20260620T201958Z"
},
"country_id": "us",
"data_package": {
"name": "populace-data",
"release_manifest_path": "releases/populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z/release_manifest.json",
"release_manifest_revision": "populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z",
"release_manifest_path": "releases/populace-us-2024-f0af251-703bd81a565c-20260620T201958Z/release_manifest.json",
"release_manifest_revision": "populace-us-2024-f0af251-703bd81a565c-20260620T201958Z",
"repo_id": "policyengine/populace-us",
"repo_type": "dataset",
"version": "0.1.0"
},
"data_producer": "populace",
"datasets": {
"calibration_diagnostics": {
"path": "releases/populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z/calibration_diagnostics.json",
"path": "releases/populace-us-2024-f0af251-703bd81a565c-20260620T201958Z/calibration_diagnostics.json",
"repo_id": "policyengine/populace-us",
"revision": "populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z",
"sha256": "19610f0dea6c1b92f2efe9466d06b510be6247e1ab4e536f082a61498b775c7f"
"revision": "populace-us-2024-f0af251-703bd81a565c-20260620T201958Z",
"sha256": "448a3c7ff0bda996332764d3c0a831f0e1df05a0eaaff8c2b3d65a40d9383c13"
},
"demographics": {
"path": "releases/populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z/demographics.json",
"path": "releases/populace-us-2024-f0af251-703bd81a565c-20260620T201958Z/demographics.json",
"repo_id": "policyengine/populace-us",
"revision": "populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z",
"sha256": "394fc6c9b22a5aa804b7bd9e12e721065dcc345222fae315b9e6ac240fa21949"
"revision": "populace-us-2024-f0af251-703bd81a565c-20260620T201958Z",
"sha256": "eea9b24a198ff654390cf8a14c2dc12eb5b9894d203d0fd9674747bbe3ab7815"
},
"populace_us_2024": {
"path": "populace_us_2024.h5",
"repo_id": "policyengine/populace-us",
"revision": "populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z",
"sha256": "32fcf6b23e96d27d59cf4eca618bd21bd5a689d6099db6655e9e8d955442b41d"
"revision": "populace-us-2024-f0af251-703bd81a565c-20260620T201958Z",
"sha256": "16be6338f9d0b3c339883dae59949e995663b64cf145de6728b3dd0f916c5d5f"
},
"populace_us_2024_calibration": {
"path": "populace_us_2024_calibration.npz",
"repo_id": "policyengine/populace-us",
"revision": "populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z",
"sha256": "bdb1eb728652bc9bea9f2033201e9e241412616ce6e83e5b8c6f7c79d57b7d41"
"revision": "populace-us-2024-f0af251-703bd81a565c-20260620T201958Z",
"sha256": "bf79d64a5e18a028ecd1236f393b72fea26b32411b2e41c0a0e68e48e556adbb"
},
"reform_validation": {
"path": "releases/populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z/reform_validation.json",
"path": "releases/populace-us-2024-f0af251-703bd81a565c-20260620T201958Z/reform_validation.json",
"repo_id": "policyengine/populace-us",
"revision": "populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z",
"sha256": "f6360c3668f38dd9c3bfe600170fdaf1a9a631a0c2accc5ecab03adb7ddfd8d6"
"revision": "populace-us-2024-f0af251-703bd81a565c-20260620T201958Z",
"sha256": "c577e0b1419f9c12de0cad7a4b3bf32507e718f5ea9d79bc3a32d0c48160cc89"
},
"us_source_coverage": {
"path": "releases/populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z/us_source_coverage.json",
"path": "releases/populace-us-2024-f0af251-703bd81a565c-20260620T201958Z/us_source_coverage.json",
"repo_id": "policyengine/populace-us",
"revision": "populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z",
"sha256": "094240968ce3b617ecd214525f46649b9586f6d6a66e136833d261a413553ab6"
"revision": "populace-us-2024-f0af251-703bd81a565c-20260620T201958Z",
"sha256": "c3e0c388be2f53ca03b59dddc110db28bc4b0acaa21e2eb86003c735e4f47d8e"
}
},
"default_dataset": "populace_us_2024",
"default_dataset_uri": "hf://policyengine/populace-us/populace_us_2024.h5@populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z",
"default_dataset_uri": "hf://policyengine/populace-us/populace_us_2024.h5@populace-us-2024-f0af251-703bd81a565c-20260620T201958Z",
"model_package": {
"name": "policyengine-us",
"sha256": "2af30b694b681adca7c2e2bd695bbeb41c03769d9ae908f82f671f8502ce32d9",
"version": "1.745.0",
"wheel_url": "https://files.pythonhosted.org/packages/49/36/ef50de1108cd0e0b89a7820ac3262bda7701d5ac6d998c27e570e63b7b82/policyengine_us-1.745.0-py3-none-any.whl"
"sha256": "8d21d3f7c0e82a9415edffe8ea53939330a63d9c8f6bd334299bddb697cf2c00",
"version": "1.729.0",
"wheel_url": "https://files.pythonhosted.org/packages/b9/7d/778f92ae94997b00c3c9ac34b345f6c9333435f905670ee4eeb2f5e19809/policyengine_us-1.729.0-py3-none-any.whl"
},
"policyengine_version": "4.18.6",
"region_datasets": {
"national": {
"path_template": "populace_us_2024.h5"
}
},
"release_manifest_uri": "https://huggingface.co/datasets/policyengine/populace-us/resolve/populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z/releases/populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z/release_manifest.json",
"release_manifest_uri": "https://huggingface.co/datasets/policyengine/populace-us/resolve/populace-us-2024-f0af251-703bd81a565c-20260620T201958Z/releases/populace-us-2024-f0af251-703bd81a565c-20260620T201958Z/release_manifest.json",
"schema_version": 1,
"source_manifest_uri": "hf://dataset/policyengine/populace-us@populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z/releases/populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z/release_manifest.json",
"version": "populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z"
"source_manifest_uri": "hf://dataset/policyengine/populace-us@populace-us-2024-f0af251-703bd81a565c-20260620T201958Z/releases/populace-us-2024-f0af251-703bd81a565c-20260620T201958Z/release_manifest.json",
"version": "populace-us-2024-f0af251-703bd81a565c-20260620T201958Z"
}
},
"extras": {
Expand Down Expand Up @@ -225,10 +225,10 @@
"policyengine-us": {
"country": "us",
"import_name": "policyengine_us",
"install_requirement": "policyengine-us==1.745.0",
"install_requirement": "policyengine-us==1.729.0",
"name": "policyengine-us",
"role": "country_model",
"version": "1.745.0"
"version": "1.729.0"
}
},
"policyengine_version": "4.18.6",
Expand Down
30 changes: 15 additions & 15 deletions src/policyengine/data/bundle/us.trace.tro.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"schema:name": "PolicyEngine",
"schema:url": "https://policyengine.org"
},
"schema:dateCreated": "2026-06-27T04:55:05.133582+00:00",
"schema:dateCreated": "2026-06-20T20:33:09.794848+00:00",
"schema:description": "TRACE TRO for certified runtime bundle us-4.18.6 covering the bundle manifest, the certified dataset artifact, the country model wheel, and the country data release manifest when it is available.",
"schema:name": "policyengine us certified bundle TRO",
"trov:createdWith": {
Expand Down Expand Up @@ -45,23 +45,23 @@
"trov:hasArtifact": {
"@id": "composition/1/artifact/data_release_manifest"
},
"trov:hasLocation": "https://huggingface.co/datasets/policyengine/populace-us/resolve/populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z/releases/populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z/release_manifest.json"
"trov:hasLocation": "https://huggingface.co/datasets/policyengine/populace-us/resolve/populace-us-2024-f0af251-703bd81a565c-20260620T201958Z/releases/populace-us-2024-f0af251-703bd81a565c-20260620T201958Z/release_manifest.json"
},
{
"@id": "arrangement/1/location/dataset",
"@type": "trov:ArtifactLocation",
"trov:hasArtifact": {
"@id": "composition/1/artifact/dataset"
},
"trov:hasLocation": "https://huggingface.co/datasets/policyengine/populace-us/resolve/populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z/populace_us_2024.h5"
"trov:hasLocation": "https://huggingface.co/datasets/policyengine/populace-us/resolve/populace-us-2024-f0af251-703bd81a565c-20260620T201958Z/populace_us_2024.h5"
},
{
"@id": "arrangement/1/location/model_wheel",
"@type": "trov:ArtifactLocation",
"trov:hasArtifact": {
"@id": "composition/1/artifact/model_wheel"
},
"trov:hasLocation": "https://files.pythonhosted.org/packages/49/36/ef50de1108cd0e0b89a7820ac3262bda7701d5ac6d998c27e570e63b7b82/policyengine_us-1.745.0-py3-none-any.whl"
"trov:hasLocation": "https://files.pythonhosted.org/packages/b9/7d/778f92ae94997b00c3c9ac34b345f6c9333435f905670ee4eeb2f5e19809/policyengine_us-1.729.0-py3-none-any.whl"
}
]
}
Expand All @@ -75,50 +75,50 @@
"@type": "trov:ResearchArtifact",
"schema:name": "policyengine.py bundle manifest for us",
"trov:mimeType": "application/json",
"trov:sha256": "b3c7843fcc506e642c60ea5376fd3f7eb35d8257005c62bd240dbe84d1b5f615"
"trov:sha256": "a0c1beb011d2020d5e7def59e61bdd4f2a1a0362969ed974398653b0dc0835af"
},
{
"@id": "composition/1/artifact/data_release_manifest",
"@type": "trov:ResearchArtifact",
"schema:name": "populace-data release manifest 0.1.0",
"trov:mimeType": "application/json",
"trov:sha256": "ab08312a309f17e76299df17acef0816f300dfe4d2ca2fba7793b1b37edc3a26"
"trov:sha256": "917655e713397ad18e52e0893ffeb1975c609616c15c2b08f9e989e7bad2a2d9"
},
{
"@id": "composition/1/artifact/dataset",
"@type": "trov:ResearchArtifact",
"schema:name": "populace_us_2024",
"trov:mimeType": "application/x-hdf5",
"trov:sha256": "32fcf6b23e96d27d59cf4eca618bd21bd5a689d6099db6655e9e8d955442b41d"
"trov:sha256": "16be6338f9d0b3c339883dae59949e995663b64cf145de6728b3dd0f916c5d5f"
},
{
"@id": "composition/1/artifact/model_wheel",
"@type": "trov:ResearchArtifact",
"schema:name": "policyengine-us==1.745.0 wheel",
"schema:name": "policyengine-us==1.729.0 wheel",
"trov:mimeType": "application/zip",
"trov:sha256": "2af30b694b681adca7c2e2bd695bbeb41c03769d9ae908f82f671f8502ce32d9"
"trov:sha256": "8d21d3f7c0e82a9415edffe8ea53939330a63d9c8f6bd334299bddb697cf2c00"
}
],
"trov:hasFingerprint": {
"@id": "composition/1/fingerprint",
"@type": "trov:CompositionFingerprint",
"trov:sha256": "ada0cbd40361667f6883e868d7f0d4273712c4613ae7b20b137fd8fada39ec19"
"trov:sha256": "79bf31052a6597c0dd319824ca863051c08980cf29d6c7485f46ae99282b40b7"
}
},
"trov:hasPerformance": {
"@id": "trp/1",
"@type": "trov:TransparentResearchPerformance",
"pe:builtWithModelVersion": "1.745.0",
"pe:builtWithModelVersion": "1.729.0",
"pe:certifiedBy": "policyengine.py bundle certification",
"pe:certifiedForModelVersion": "1.745.0",
"pe:certifiedForModelVersion": "1.729.0",
"pe:compatibilityBasis": "built_with_model_package",
"pe:dataBuildId": "populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z",
"pe:dataBuildId": "populace-us-2024-f0af251-703bd81a565c-20260620T201958Z",
"pe:emittedIn": "repository-bundle",
"rdfs:comment": "Certification of build populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z for policyengine-us 1.745.0.",
"rdfs:comment": "Certification of build populace-us-2024-f0af251-703bd81a565c-20260620T201958Z for policyengine-us 1.729.0.",
"trov:accessedArrangement": {
"@id": "arrangement/1"
},
"trov:startedAtTime": "2026-06-27T04:55:05.133582+00:00",
"trov:startedAtTime": "2026-06-20T20:33:09.794848+00:00",
"trov:wasConductedBy": {
"@id": "trs"
}
Expand Down
4 changes: 4 additions & 0 deletions src/policyengine/provenance/certification.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@ def build_country_manifest_payload(
continue
if isinstance(template, dict) and "path_template" in template:
region_datasets[region] = {"path_template": template["path_template"]}
region_datasets.setdefault(
"national",
{"path_template": default_artifact.path},
)

certification: dict = {
"compatibility_basis": compatibility_basis,
Expand Down
19 changes: 19 additions & 0 deletions tests/test_certify_data_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,25 @@ def test__given_populace_region_templates__then_only_national_is_carried_through
"national": {"path_template": "populace_us_2024.h5"}
}

def test__given_populace_manifest_without_regions__then_adds_national_template(
self,
):
payload = build_country_manifest_payload(
country="us",
manifest=DataReleaseManifest.model_validate(
_populace_manifest_payload_without_regions()
),
uri_parts=parse_manifest_uri(MANIFEST_URI),
policyengine_version="9.9.9",
model_package="policyengine-us",
model_version="1.723.0",
model_wheel={},
)

assert payload["region_datasets"] == {
"national": {"path_template": "populace_us_2024.h5"}
}

def test__given_build_provenance__then_certification_carries_it(self):
payload = self._payload()

Expand Down
5 changes: 2 additions & 3 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,13 @@ def test_has_release_manifest_metadata(self):
assert us_latest.release_manifest is not None
assert us_latest.release_manifest.country_id == "us"
assert us_latest.model_package.name == "policyengine-us"
assert us_latest.model_package.version == "1.745.0"
assert us_latest.model_package.version == "1.729.0"
assert us_latest.data_package.name == "populace-data"
assert us_latest.data_package.version == "0.1.0"
assert (
us_latest.default_dataset_uri
== "hf://policyengine/populace-us/populace_us_2024.h5"
"@populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-"
"20260627T022640Z"
"@populace-us-2024-f0af251-703bd81a565c-20260620T201958Z"
)

def test_has_hundreds_of_parameters(self):
Expand Down
8 changes: 3 additions & 5 deletions tests/test_release_manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@
PYPROJECT.read_text(),
re.MULTILINE,
).group(1)
US_MODEL_VERSION = "1.745.0"
US_BUILT_WITH_MODEL_VERSION = "1.745.0"
US_MODEL_VERSION = "1.729.0"
US_BUILT_WITH_MODEL_VERSION = "1.729.0"
US_DATA_RELEASE_VERSION = "0.1.0"
US_DATA_RELEASE_ID = (
"populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-20260627T022640Z"
)
US_DATA_RELEASE_ID = "populace-us-2024-f0af251-703bd81a565c-20260620T201958Z"
US_DATA_RELEASE_REVISION = US_DATA_RELEASE_ID
US_DATA_RELEASE_PATH = f"releases/{US_DATA_RELEASE_ID}/release_manifest.json"
US_DATA_ARTIFACT_REVISION = US_DATA_RELEASE_ID
Expand Down
3 changes: 1 addition & 2 deletions tests/test_us_regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ def test__given_us_registry__then_has_national_region(self):
assert national.region_type == "national"
assert national.dataset_path == (
"hf://policyengine/populace-us/populace_us_2024.h5"
"@populace-us-2024-cd-concept-budget-dbbdcec-512e-b2500-r2-"
"20260627T022640Z"
"@populace-us-2024-f0af251-703bd81a565c-20260620T201958Z"
)

def test__given_us_registry__then_has_51_states(self):
Expand Down
Loading
Loading