PolicyEngine / PolicyEngine/policyengine.py

Add a datasets-only mode to `policyengine bundle install` (inverse of --no-datasets)

Open
#452 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7
Forks
9
Avg merge
15h 51m
Merged PRs (30d)
9

Description

Motivation

policyengine bundle install currently couples two responsibilities: installing the bundle's package scaffold and downloading certified datasets (+ writing the bundle receipt). The CLI offers --no-datasets (packages only) but no inverse — there is no way to obtain just the certified datasets and receipt for a bundle without also having the bundle installer manage packages.

In PolicyEngine/policyengine-api-v2 we are moving the simulation service's Modal images to canonical uv-lockfile installs (PolicyEngine/policyengine-api-v2#609): uv sync --frozen against a committed uv.lock should own all Python packages in the image, so that image environments are byte-identical to the CI-tested environment and can only change through a relock. The bundle's model-package pins are already mirrored into that project's pyproject.toml/uv.lock by automation, so uv can install them — but the bundle install step must still run for the datasets and receipt, and today that drags its package installer along with it. As a bridge we currently run bundle install --venv /.uv/.venv so both installers at least share one environment.

Request

A datasets-only mode, e.g.:

policyengine bundle install <version> --no-packages --data-dir /opt/policyengine/data --yes
# or a dedicated subcommand:
policyengine bundle fetch-data <version> --data-dir /opt/policyengine/data --yes

Behavior: download/verify the bundle's certified datasets for the selected countries into --data-dir and write the bundle receipt, without installing or modifying any Python packages. Symmetric with the existing --no-datasets.

With that available, consumers who manage packages via uv (or any other resolver) can keep the bundle as the source of truth for certified data while their lockfile is the sole source of truth for packages.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the implementation of policyengine bundle install and trace the existing --no-datasets option and receipt-writing flow. Define the datasets-only interface, then verify that selected-country datasets and the bundle receipt are written to --data-dir without installing or modifying Python packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.