Skip to content

Commit

Permalink
Remove survey enhance as a dependency (#949)
Browse files Browse the repository at this point in the history
* Add back MANIFES.in

* Format

* Remove Survey-Enhanced dependency

* Fix Restrict Winter Fuel Payment to recipients of means-tested benefits #936

* Add comparison step

* Bump data

* Bump UK data

* Bump data yet again

* Add microdf as dep
  • Loading branch information
nikhilwoodruff authored Sep 18, 2024
1 parent 61e7b32 commit a8a2c1c
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 5 deletions.
18 changes: 18 additions & 0 deletions .github/compare_psnd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import pandas as pd

psnd_old = pd.read_csv("psnd_old.csv")
psnd_new = pd.read_csv("psnd_new.csv")

df = pd.DataFrame(
{
"year": psnd_old["year"],
"OBR": psnd_old["OBR"],
"PE_current": psnd_old["PE"],
"PE_new": psnd_new["PE"],
}
)
df["change"] = df["PE_new"] - df["PE_current"]
df["percent_change"] = (df["change"] / df["PE_current"] * 100).round(1)

print("Projection for public sector net debt (PSND):")
print(df.to_markdown(index=False))
4 changes: 4 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ jobs:
run: make documentation
env:
POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN: ${{ secrets.POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN}}
- name: Compare baseline change
run: make compare_psnd
env:
POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN: ${{ secrets.POLICYENGINE_GITHUB_MICRODATA_AUTH_TOKEN}}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ 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).

## [2.1.1] - 2024-09-18 11:12:23

## [2.1.0] - 2024-09-18 11:04:12

### Fixed
Expand Down Expand Up @@ -1486,6 +1488,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0



[2.1.1]: https://github.com/PolicyEngine/openfisca-uk/compare/2.1.0...2.1.1
[2.1.0]: https://github.com/PolicyEngine/openfisca-uk/compare/2.0.0...2.1.0
[2.0.0]: https://github.com/PolicyEngine/openfisca-uk/compare/1.8.0...2.0.0
[1.8.0]: https://github.com/PolicyEngine/openfisca-uk/compare/1.7.4...1.8.0
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ compare_psnd:
pip install -e .
cd policyengine_uk/utils && python psnd.py
mv policyengine_uk/utils/psnd.csv psnd_new.csv
python .github/compare_psnd.py
5 changes: 5 additions & 0 deletions changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1244,3 +1244,8 @@
fixed:
- Add back recursive-include.
date: 2024-09-18 11:04:12
- bump: patch
changes:
removed:
- Survey-Enhance as a dependency.
date: 2024-09-18 11:12:23
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description: Whether receipt of means-tested benefits is required to qualify for the Winter Fuel Payment.
values:
2000-01-01: false
2000-01-01: true
metadata:
unit: bool
label: Winter Fuel Payment means-tested benefits requirement
Expand Down
4 changes: 3 additions & 1 deletion policyengine_uk/utils/psnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def project_psnd():
"housing_benefit",
"pip",
"dla",
"winter_fuel_allowance",
]
tax_ben_revenues = (
tax_ben[tax_ben.name.isin(REVENUES)].set_index("name").loc[REVENUES]
Expand All @@ -42,6 +43,7 @@ def project_psnd():
"housing_benefit",
"pip",
"dla",
"winter_fuel_allowance",
]
baseline = Microsimulation()

Expand Down Expand Up @@ -74,7 +76,7 @@ def project_psnd():
}
)

df["PE"] = df["PE"].round().astype(int)
df["PE"] = df["PE"].round(1)

df.to_csv("psnd.csv", index=False)

Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="PolicyEngine-UK",
version="2.1.0",
version="2.1.1",
author="PolicyEngine",
author_email="[email protected]",
classifiers=[
Expand All @@ -27,7 +27,8 @@
],
install_requires=[
"PolicyEngine-Core>=3.6.4",
"PolicyEngine-UK-Data>=1.2.1,<1.3",
"PolicyEngine-UK-Data>=1.2.5,<1.3",
"microdf_python",
],
extras_require={
"dev": [
Expand All @@ -41,7 +42,6 @@
"setuptools",
"sphinx-argparse>=0.3.2,<1",
"sphinx-math-dollar>=1.2.1,<2",
"survey-enhance",
"wheel",
"yaml-changelog>=0.1.7",
]
Expand Down

0 comments on commit a8a2c1c

Please sign in to comment.