diff --git a/.github/workflows/ci_cd.yaml b/.github/workflows/ci_cd.yaml index 0fc23c4..271525c 100644 --- a/.github/workflows/ci_cd.yaml +++ b/.github/workflows/ci_cd.yaml @@ -21,7 +21,7 @@ jobs: with: python-version: 3.12 - name: Install package - run: pip install -e ".[dev]" + run: pip install -e . - name: Build package run: python -m build - name: Publish to PyPI @@ -95,7 +95,7 @@ jobs: run: make documentation docker: - name: Docker + name: Publish docker image runs-on: ubuntu-latest if: github.event_name == 'push' && github.ref == 'refs/heads/main' steps: @@ -113,7 +113,7 @@ jobs: run: docker push ghcr.io/policyengine/policyengine-uk-data:latest upload: - name: Upload Data + name: Upload data runs-on: ubuntu-latest needs: [lint, test] if: github.event_name == 'push' && github.ref == 'refs/heads/main' diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d5d6cd..1130f8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.2.5] - 2024-09-18 13:57:40 + +### Fixed + +- GH actions naming. +- Bug causing the Extended FRS to error. + ## [1.2.4] - 2024-09-18 13:26:36 ## [1.2.3] - 2024-09-18 12:57:28 @@ -41,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +[1.2.5]: https://github.com/PolicyEngine/policyengine-us-data/compare/1.2.4...1.2.5 [1.2.4]: https://github.com/PolicyEngine/policyengine-us-data/compare/1.2.3...1.2.4 [1.2.3]: https://github.com/PolicyEngine/policyengine-us-data/compare/1.2.2...1.2.3 [1.2.2]: https://github.com/PolicyEngine/policyengine-us-data/compare/1.2.1...1.2.2 diff --git a/changelog.yaml b/changelog.yaml index dae74cd..955e40b 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -33,3 +33,9 @@ removed: - Torch as a dependency. date: 2024-09-18 13:26:36 +- bump: patch + changes: + fixed: + - GH actions naming. + - Bug causing the Extended FRS to error. + date: 2024-09-18 13:57:40 diff --git a/policyengine_uk_data/datasets/frs/enhanced_frs.py b/policyengine_uk_data/datasets/frs/enhanced_frs.py index ceffae9..80d2aac 100644 --- a/policyengine_uk_data/datasets/frs/enhanced_frs.py +++ b/policyengine_uk_data/datasets/frs/enhanced_frs.py @@ -8,6 +8,7 @@ from policyengine_uk_data.utils.imputations.capital_gains import ( impute_cg_to_dataset, ) + try: import torch except ImportError: diff --git a/policyengine_uk_data/datasets/frs/extended_frs.py b/policyengine_uk_data/datasets/frs/extended_frs.py index edfb155..48fd0ed 100644 --- a/policyengine_uk_data/datasets/frs/extended_frs.py +++ b/policyengine_uk_data/datasets/frs/extended_frs.py @@ -11,6 +11,7 @@ class ExtendedFRS(Dataset): def generate(self): from policyengine_uk import Microsimulation + from survey_enhance import Imputation create_consumption_model() create_vat_model() @@ -68,7 +69,6 @@ def generate(self): ["age", "gender", "region"] ) create_income_model() - from survey_enhance import Imputation income = Imputation.load(STORAGE_FOLDER / "income.pkl") full_imputations = income.predict(income_inputs) diff --git a/policyengine_uk_data/datasets/frs/frs.py b/policyengine_uk_data/datasets/frs/frs.py index 2600d60..22ea303 100644 --- a/policyengine_uk_data/datasets/frs/frs.py +++ b/policyengine_uk_data/datasets/frs/frs.py @@ -14,7 +14,6 @@ from numpy import maximum as max_, where from typing import Type import h5py -from pathlib import Path from policyengine_uk_data.datasets.frs.dwp_frs import * diff --git a/policyengine_uk_data/utils/imputations/capital_gains.py b/policyengine_uk_data/utils/imputations/capital_gains.py index fcfec08..074047d 100644 --- a/policyengine_uk_data/utils/imputations/capital_gains.py +++ b/policyengine_uk_data/utils/imputations/capital_gains.py @@ -2,13 +2,19 @@ import numpy as np # Fit a spline to each income band's percentiles -from scipy.interpolate import UnivariateSpline +try: + from scipy.interpolate import UnivariateSpline +except ImportError: + pass from policyengine_uk_data.storage import STORAGE_FOLDER from tqdm import tqdm import copy -import torch -from torch.optim import Adam +try: + import torch + from torch.optim import Adam +except ImportError: + pass from tqdm import tqdm capital_gains = pd.read_csv( diff --git a/policyengine_uk_data/utils/imputations/wealth.py b/policyengine_uk_data/utils/imputations/wealth.py index a9188b3..611e42b 100644 --- a/policyengine_uk_data/utils/imputations/wealth.py +++ b/policyengine_uk_data/utils/imputations/wealth.py @@ -1,7 +1,4 @@ import pandas as pd -from pathlib import Path -import numpy as np -import yaml from policyengine_uk_data.storage import STORAGE_FOLDER WAS_TAB_FOLDER = STORAGE_FOLDER / "was_2006_20" diff --git a/pyproject.toml b/pyproject.toml index c81f954..0258d98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "policyengine_uk_data" -version = "1.2.4" +version = "1.2.5" description = "A package to create representative microdata for the UK." readme = "README.md" authors = [