Skip to content

Commit bf17d84

Browse files
Fix import errors (#60)
* Fix import error * Versioning * Format * Add missing import * Format
1 parent 1d3ae22 commit bf17d84

6 files changed

Lines changed: 23 additions & 5 deletions

File tree

.github/workflows/ci_cd.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
- name: Checkout repo
8282
uses: actions/checkout@v4
8383
- name: Log in to the Container registry
84-
uses: docker/login-action@v2
84+
uses: docker/login-action@v3
8585
with:
8686
registry: ghcr.io
8787
username: ${{github.actor}}

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.4.1] - 2024-09-18 16:30:37
9+
10+
### Fixed
11+
12+
- Import errors in non-dev mode.
13+
814
## [1.4.0] - 2024-09-18 03:05:11
915

1016
### Added
@@ -75,6 +81,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7581

7682

7783

84+
[1.4.1]: https://github.com/PolicyEngine/policyengine-us-data/compare/1.4.0...1.4.1
7885
[1.4.0]: https://github.com/PolicyEngine/policyengine-us-data/compare/1.3.1...1.4.0
7986
[1.3.1]: https://github.com/PolicyEngine/policyengine-us-data/compare/1.3.0...1.3.1
8087
[1.3.0]: https://github.com/PolicyEngine/policyengine-us-data/compare/1.2.1...1.3.0

changelog.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,8 @@
5252
changed:
5353
- Fixed export structure within __init__ files
5454
date: 2024-09-18 03:05:11
55+
- bump: patch
56+
changes:
57+
fixed:
58+
- Import errors in non-dev mode.
59+
date: 2024-09-18 16:30:37

policyengine_us_data/datasets/cps/enhanced_cps.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
CPS_2019,
1515
CPS_2024,
1616
)
17-
import torch
17+
18+
try:
19+
import torch
20+
except ImportError:
21+
torch = None
1822

1923

2024
def reweight(

policyengine_us_data/datasets/puf/puf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from policyengine_core.data import Dataset
66
from policyengine_us_data.storage import STORAGE_FOLDER
77
from .uprate_puf import uprate_puf
8-
from survey_enhance import Imputation
98
from .irs_puf import IRS_PUF_2015
109
from policyengine_us_data.utils.uprating import (
1110
create_policyengine_uprating_factors_table,
@@ -23,6 +22,8 @@ def impute_pension_contributions_to_puf(puf_df):
2322
["employment_income", "household_weight", "pre_tax_contributions"]
2423
)
2524

25+
from survey_enhance import Imputation
26+
2627
pension_contributions = Imputation()
2728

2829
pension_contributions.train(
@@ -38,6 +39,8 @@ def impute_pension_contributions_to_puf(puf_df):
3839
def impute_missing_demographics(
3940
puf: pd.DataFrame, demographics: pd.DataFrame
4041
) -> pd.DataFrame:
42+
from survey_enhance import Imputation
43+
4144
puf_with_demographics = (
4245
puf[puf.RECID.isin(demographics.RECID)]
4346
.merge(demographics, on="RECID")

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "policyengine_us_data"
7-
version = "1.4.0"
7+
version = "1.4.1"
88
description = "A package to create representative microdata for the US."
99
readme = "README.md"
1010
authors = [
@@ -23,7 +23,6 @@ dev = [
2323
"black",
2424
"pytest",
2525
"policyengine_us==1.71.1",
26-
"streamlit",
2726
"survey_enhance",
2827
"torch",
2928
"tables",

0 commit comments

Comments
 (0)