Skip to content

Commit 32ea670

Browse files
authored
Merge pull request #394 from MaxGhenis/fix-readme-typo
Fix README typo and add PyPI auto-publish workflow
2 parents fa8ff22 + 7a37cb4 commit 32ea670

File tree

4 files changed

+36
-7
lines changed

4 files changed

+36
-7
lines changed

.github/workflows/code_changes.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,26 @@ jobs:
6767
branch: gh-pages
6868
folder: docs/_build/html
6969
clean: true
70+
Publish:
71+
runs-on: ubuntu-latest
72+
needs: [Lint, Test]
73+
if: github.event.head_commit.message == 'Update package version'
74+
steps:
75+
- name: Checkout repo
76+
uses: actions/checkout@v4
77+
- name: Set up Python
78+
uses: actions/setup-python@v5
79+
with:
80+
python-version: 3.13
81+
- name: Install uv
82+
uses: astral-sh/setup-uv@v5
83+
- name: Install package
84+
run: uv pip install -e .[dev] --system
85+
- name: Build package
86+
run: python -m build
87+
- name: Publish a Python distribution to PyPI
88+
uses: pypa/gh-action-pypi-publish@release/v1
89+
with:
90+
user: __token__
91+
password: ${{ secrets.PYPI }}
92+
skip-existing: true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ While it is possible to install via PyPi:
66
```bash
77
pip install policyengine-us-data
88
```
9-
the recommended installion is
9+
the recommended installation is
1010
```
1111
pip install -e .[dev]
1212
```

changelog_entry.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- bump: patch
2+
changes:
3+
added:
4+
- PyPI auto-publish workflow in GitHub Actions
5+
fixed:
6+
- README typo (installion -> installation)

policyengine_us_data/datasets/cps/cps.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ def downsample(self, frac: float):
122122
original_data[key] = values.astype(original_dtypes[key])
123123
except:
124124
# If conversion fails, log it but continue
125-
print(
126-
f"Warning: Could not convert {key} back to {original_dtypes[key]}"
125+
logging.warning(
126+
f"Could not convert {key} back to {original_dtypes[key]}"
127127
)
128128
original_data[key] = values
129129
else:
@@ -175,11 +175,11 @@ def add_rent(self, cps: h5py.File, person: DataFrame, household: DataFrame):
175175
inference_df = inference_df[mask]
176176

177177
qrf = QRF()
178-
print("Training imputation model for rent and real estate taxes.")
178+
logging.info("Training imputation model for rent and real estate taxes.")
179179
qrf.fit(train_df[PREDICTORS], train_df[IMPUTATIONS])
180-
print("Imputing rent and real estate taxes.")
180+
logging.info("Imputing rent and real estate taxes.")
181181
imputed_values = qrf.predict(inference_df[PREDICTORS])
182-
print("Imputation complete.")
182+
logging.info("Imputation complete.")
183183
cps["rent"] = np.zeros_like(cps["age"])
184184
cps["rent"][mask] = imputed_values["rent"]
185185
# Assume zero housing assistance since
@@ -645,7 +645,7 @@ def add_household_variables(cps: h5py.File, household: DataFrame) -> None:
645645

646646
def add_previous_year_income(self, cps: h5py.File) -> None:
647647
if self.previous_year_raw_cps is None:
648-
print(
648+
logging.info(
649649
"No previous year data available for this dataset, skipping previous year income imputation."
650650
)
651651
return

0 commit comments

Comments
 (0)