Download the H5 through releases.json, not the root file

#3
by anth-volk - opened
PolicyEngine org

The card's "Or grab the H5 directly" example downloads populace_us_2024.h5 from the repository root on main. Microcosm is about to delete the root dataset files and the release-per-build folders (releases/<tag>/) from main with its switch tool's delete-old-layout step (PolicyEngine/microcosm#1592). Builds now live in their own folders, releases/<release>/<build>/, listed in releases.json, so the example would stop working.

Change

Only that example and the sentence before it change. The new example:

  • reads releases.json, takes the default release and its current build, and stops with a clear error if either is null;
  • reads that build's release_manifest.json;
  • downloads the dataset the manifest names as the national default, from the build's folder.

It is the same approach as Microcosm's US quickstart notebook (examples/quickstart_us.ipynb). Today it downloads releases/microcosm-us-2024-national/populace-us-2024-spm-20260915/populace_us_2024.h5, SHA-256 6496cc43…, the build policyengine.py's bundle pins. It reads only releases.json and files inside build folders, which the deletion keeps. The text now says that the example follows the current build, and that builds releases.json doesn't list stay readable at their tags.

Left as it is

The "Load it" section is out of date: pip install 'populace-data[us]' fails because there's no populace-data package on PyPI, and the module is now microcosm.data. That is separate from the deletion.

anth-volk changed pull request status to merged

Sign up or log in to comment