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
7 changes: 0 additions & 7 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,3 @@ jobs:
HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }}
- name: Publish a git tag
run: ".github/publish-git-tag.sh || true"
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI }}
skip-existing: true
verbose: true
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ install:
pip install -e ".[dev]" --config-settings editable_mode=compat

install-uv:
uv pip install --system policyengine-uk
uv pip install --system policyengine>=2.40.2
uv pip install --system "jupyter-book>=2.0.0a0"
uv pip install --system -e ".[dev]" --config-settings editable_mode=compat

download:
Expand All @@ -37,6 +36,7 @@ data:
python policyengine_uk_data/datasets/frs/local_areas/constituencies/calibrate.py
python policyengine_uk_data/datasets/frs/local_areas/local_authorities/calibrate.py
python policyengine_uk_data/utils/create_multi_year_dataset.py
python policyengine_uk_data/storage/migrate_to_uk_single_year_datasets.py

efrs:
python policyengine_uk_data/datasets/frs/enhanced_frs.py
Expand Down
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: patch
changes:
fixed:
- Migrated to more efficient dataset version.
19 changes: 19 additions & 0 deletions policyengine_uk_data/storage/migrate_to_uk_single_year_datasets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from policyengine_uk.data import UKSingleYearDataset
from policyengine_uk import Microsimulation
from policyengine_core.data import Dataset
from policyengine_uk_data.datasets import EnhancedFRS_2023_24, FRS_2023_24


def migrate_to_uk_single_year_dataset(file_path: str):
sim = Microsimulation(dataset=Dataset.from_file(file_path))

single_year_dataset = UKSingleYearDataset.from_simulation(
sim, fiscal_year=2023
)

single_year_dataset.save(file_path)


if __name__ == "__main__":
migrate_to_uk_single_year_dataset(FRS_2023_24.file_path)
migrate_to_uk_single_year_dataset(EnhancedFRS_2023_24.file_path)
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies = [
"google-cloud-storage",
"google-auth",
"uk-public-services-imputation",
"policyengine-uk>=2.40.2",
"policyengine-uk==2.40.2",
]

[project.optional-dependencies]
Expand All @@ -32,7 +32,6 @@ dev = [
"torch",
"tables",
"furo",
"jupyter-book",
"yaml-changelog>=0.1.7",
"itables",
"quantile-forest",
Expand Down
Loading