Skip to content

Commit

Permalink
Fix Restrict Winter Fuel Payment to recipients of means-tested benefits
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilwoodruff committed Sep 18, 2024
1 parent 66fb076 commit 696b7ec
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/compare_psnd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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))
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
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

0 comments on commit 696b7ec

Please sign in to comment.