Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back MANIFEST.in #948

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ 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.0] - 2024-09-18 11:04:12

### Fixed

- Add back recursive-include.

## [2.0.0] - 2024-09-18 10:53:42

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



[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
[1.7.4]: https://github.com/PolicyEngine/openfisca-uk/compare/1.7.3...1.7.4
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include policyengine_uk *
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,12 @@ changelog:
bump-version changelog.yaml setup.py
rm changelog_entry.yaml || true
touch changelog_entry.yaml

compare_psnd:
pip uninstall policyengine-uk -y
pip install policyengine-uk
cd policyengine_uk/utils && python psnd.py
mv policyengine_uk/utils/psnd.csv psnd_old.csv
pip install -e .
cd policyengine_uk/utils && python psnd.py
mv policyengine_uk/utils/psnd.csv psnd_new.csv
5 changes: 5 additions & 0 deletions changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1239,3 +1239,8 @@
changed:
- Dataset handling outsourced to policyengine-uk-data.
date: 2024-09-18 10:53:42
- bump: minor
changes:
fixed:
- Add back recursive-include.
date: 2024-09-18 11:04:12
38 changes: 28 additions & 10 deletions docs/book/model/baseline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"OBR_PSND = [2_540, 2_691, 2_793, 2_820, 2_903, 2_995, 3_078]\n",
"from policyengine_uk_data.storage import STORAGE_FOLDER\n",
"import pandas as pd\n",
"\n",
"tax_ben = pd.read_csv(STORAGE_FOLDER / \"tax_benefit.csv\")\n",
"REVENUES = [\n",
" \"income_tax\",\n",
Expand All @@ -54,9 +55,14 @@
" \"pip\",\n",
" \"dla\",\n",
"]\n",
"tax_ben_revenues = tax_ben[tax_ben.name.isin(REVENUES)].set_index(\"name\").loc[REVENUES]\n",
"tax_ben_spending = tax_ben[tax_ben.name.isin(SPENDING)].set_index(\"name\").loc[SPENDING]\n",
"tax_ben_revenues = (\n",
" tax_ben[tax_ben.name.isin(REVENUES)].set_index(\"name\").loc[REVENUES]\n",
")\n",
"tax_ben_spending = (\n",
" tax_ben[tax_ben.name.isin(SPENDING)].set_index(\"name\").loc[SPENDING]\n",
")\n",
"from policyengine_uk import Microsimulation\n",
"\n",
"PE_REVENUES = [\n",
" \"income_tax\",\n",
" \"ni_employee\",\n",
Expand All @@ -78,17 +84,29 @@
"\n",
"for year in range(2022, 2029):\n",
" obr_psnd = OBR_PSND[year - 2022]\n",
" obr_totals = tax_ben_spending[str(year)].sum() - tax_ben_revenues[str(year)].sum()\n",
" pe_revenues = sum(baseline.calculate(variable, map_to=\"household\", period=year).sum()/1e9 for variable in PE_REVENUES)\n",
" pe_spending = sum(baseline.calculate(variable, map_to=\"household\", period=year).sum()/1e9 for variable in PE_SPENDING)\n",
" obr_totals = (\n",
" tax_ben_spending[str(year)].sum() - tax_ben_revenues[str(year)].sum()\n",
" )\n",
" pe_revenues = sum(\n",
" baseline.calculate(variable, map_to=\"household\", period=year).sum()\n",
" / 1e9\n",
" for variable in PE_REVENUES\n",
" )\n",
" pe_spending = sum(\n",
" baseline.calculate(variable, map_to=\"household\", period=year).sum()\n",
" / 1e9\n",
" for variable in PE_SPENDING\n",
" )\n",
" pe_totals = pe_spending - pe_revenues\n",
" pe_psnd.append(obr_psnd + pe_totals - obr_totals)\n",
"\n",
"df = pd.DataFrame({\n",
" \"year\": range(2022, 2029),\n",
" \"OBR\": OBR_PSND,\n",
" \"PE\": pe_psnd,\n",
"})"
"df = pd.DataFrame(\n",
" {\n",
" \"year\": range(2022, 2029),\n",
" \"OBR\": OBR_PSND,\n",
" \"PE\": pe_psnd,\n",
" }\n",
")"
]
},
{
Expand Down
58 changes: 34 additions & 24 deletions docs/book/programs/gov/dwp/PIP.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,18 @@
"enhanced_daily = parameters.gov.dwp.pip.daily_living.enhanced\n",
"standard_daily = parameters.gov.dwp.pip.daily_living.standard\n",
"\n",
"elements = [enhanced_daily, standard_daily] # [...]\n",
"elements = [enhanced_daily, standard_daily] # [...]\n",
"\n",
"dates = [\"2016-01-01\",\"2017-01-01\",\"2018-01-01\",\"2019-01-01\",\"2020-01-01\", \"2021-01-01\", \"2022-01-01\",\"2023-01-01\"]\n",
"dates = [\n",
" \"2016-01-01\",\n",
" \"2017-01-01\",\n",
" \"2018-01-01\",\n",
" \"2019-01-01\",\n",
" \"2020-01-01\",\n",
" \"2021-01-01\",\n",
" \"2022-01-01\",\n",
" \"2023-01-01\",\n",
"]\n",
"names = [\"enhanced\", \"standard\"]\n",
"\n",
"import pandas as pd\n",
Expand All @@ -174,18 +183,14 @@
"for date in dates:\n",
" for element, name in zip(elements, names):\n",
" # Append to a dataframe: row = date, column = element, value = amount\n",
" new_row = {\n",
" \"date\": date,\n",
" \"element\": name,\n",
" \"amount\": element(date)\n",
" }\n",
" # Append row to the dataframe\n",
" new_row = {\"date\": date, \"element\": name, \"amount\": element(date)}\n",
" # Append row to the dataframe\n",
" df = pd.concat([df, pd.DataFrame([new_row])])\n",
"\n",
"\n",
"# merge element cells\n",
"pivot_df = df.pivot(index=\"date\", columns=\"element\", values=\"amount\")\n",
"pivot_df.fillna(\"\")\n"
"pivot_df.fillna(\"\")"
]
},
{
Expand Down Expand Up @@ -1234,9 +1239,9 @@
" yaxis_range=[0, 100],\n",
" yaxis_tickformat=\",.0f\",\n",
" yaxis_tickprefix=\"£\",\n",
" yaxis_title = \"Amount(£m)\",\n",
" xaxis_title = \"Year\",\n",
" legend_title = \"Element\"\n",
" yaxis_title=\"Amount(£m)\",\n",
" xaxis_title=\"Year\",\n",
" legend_title=\"Element\",\n",
")\n",
"\n",
"fig = format_fig(fig)\n",
Expand Down Expand Up @@ -1374,9 +1379,18 @@
"enhanced_mobility = parameters.gov.dwp.pip.mobility.enhanced\n",
"standard_mobility = parameters.gov.dwp.pip.mobility.standard\n",
"\n",
"elements = [enhanced_mobility, standard_mobility] # [...]\n",
"elements = [enhanced_mobility, standard_mobility] # [...]\n",
"\n",
"dates = [\"2016-01-01\",\"2017-01-01\",\"2018-01-01\",\"2019-01-01\",\"2020-01-01\", \"2021-01-01\", \"2022-01-01\",\"2023-01-01\"]\n",
"dates = [\n",
" \"2016-01-01\",\n",
" \"2017-01-01\",\n",
" \"2018-01-01\",\n",
" \"2019-01-01\",\n",
" \"2020-01-01\",\n",
" \"2021-01-01\",\n",
" \"2022-01-01\",\n",
" \"2023-01-01\",\n",
"]\n",
"names = [\"enhanced\", \"standard\"]\n",
"\n",
"import pandas as pd\n",
Expand All @@ -1386,18 +1400,14 @@
"for date in dates:\n",
" for element, name in zip(elements, names):\n",
" # Append to a dataframe: row = date, column = element, value = amount\n",
" new_row = {\n",
" \"date\": date,\n",
" \"element\": name,\n",
" \"amount\": element(date)\n",
" }\n",
" # Append row to the dataframe\n",
" new_row = {\"date\": date, \"element\": name, \"amount\": element(date)}\n",
" # Append row to the dataframe\n",
" df = pd.concat([df, pd.DataFrame([new_row])])\n",
"\n",
"\n",
"# merge element cells\n",
"pivot_df = df.pivot(index=\"date\", columns=\"element\", values=\"amount\")\n",
"pivot_df.fillna(\"\")\n"
"pivot_df.fillna(\"\")"
]
},
{
Expand Down Expand Up @@ -2417,9 +2427,9 @@
" yaxis_range=[0, 100],\n",
" yaxis_tickformat=\",.0f\",\n",
" yaxis_tickprefix=\"£\",\n",
" yaxis_title = \"Amount(£m)\",\n",
" xaxis_title = \"Year\",\n",
" legend_title = \"Element\"\n",
" yaxis_title=\"Amount(£m)\",\n",
" xaxis_title=\"Year\",\n",
" legend_title=\"Element\",\n",
")\n",
"\n",
"fig = format_fig(fig)\n",
Expand Down
100 changes: 67 additions & 33 deletions docs/book/programs/gov/dwp/pension-credit.ipynb

Large diffs are not rendered by default.

Loading
Loading