diff --git a/.github/compare_psnd.py b/.github/compare_psnd.py new file mode 100644 index 000000000..104cc86ca --- /dev/null +++ b/.github/compare_psnd.py @@ -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)) \ No newline at end of file diff --git a/Makefile b/Makefile index b4a61f501..d34abb228 100644 --- a/Makefile +++ b/Makefile @@ -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 \ No newline at end of file diff --git a/policyengine_uk/parameters/gov/dwp/winter_fuel_payment/eligibility/require_benefits.yaml b/policyengine_uk/parameters/gov/dwp/winter_fuel_payment/eligibility/require_benefits.yaml index 363f87554..a218fad01 100644 --- a/policyengine_uk/parameters/gov/dwp/winter_fuel_payment/eligibility/require_benefits.yaml +++ b/policyengine_uk/parameters/gov/dwp/winter_fuel_payment/eligibility/require_benefits.yaml @@ -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 diff --git a/policyengine_uk/utils/psnd.py b/policyengine_uk/utils/psnd.py index 979f51bf3..55c4dce83 100644 --- a/policyengine_uk/utils/psnd.py +++ b/policyengine_uk/utils/psnd.py @@ -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] @@ -42,6 +43,7 @@ def project_psnd(): "housing_benefit", "pip", "dla", + "winter_fuel_allowance", ] baseline = Microsimulation() @@ -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)