Skip to content

Commit

Permalink
Fix Decapitalise 'Upload Data' in action #17 (#23)
Browse files Browse the repository at this point in the history
* Fix Decapitalise 'Upload Data' in action #17

* Remove forced imports

* Format

* Don't do a full install before publishing
  • Loading branch information
nikhilwoodruff authored Sep 18, 2024
1 parent ac4949b commit b7f7998
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci_cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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'
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions policyengine_uk_data/datasets/frs/enhanced_frs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from policyengine_uk_data.utils.imputations.capital_gains import (
impute_cg_to_dataset,
)

try:
import torch
except ImportError:
Expand Down
2 changes: 1 addition & 1 deletion policyengine_uk_data/datasets/frs/extended_frs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion policyengine_uk_data/datasets/frs/frs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *


Expand Down
12 changes: 9 additions & 3 deletions policyengine_uk_data/utils/imputations/capital_gains.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 0 additions & 3 deletions policyengine_uk_data/utils/imputations/wealth.py
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit b7f7998

Please sign in to comment.