Skip to content

Commit

Permalink
Merge pull request #62 from PolicyEngine/local-authority-breakdowns
Browse files Browse the repository at this point in the history
Improve repo style, interface and add UK local authority breakdowns
  • Loading branch information
nikhilwoodruff authored Dec 18, 2024
2 parents eb0818e + 2d50767 commit 8b5af39
Show file tree
Hide file tree
Showing 46 changed files with 38,155 additions and 764 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: '3.10'

- name: Install package
run: make install

- name: install dependencies
- name: Install dependencies
run: |
pip install jupyter-book
pip install furo
pip install sphinx-argparse
- name: Generate documentation
run: make documentation
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: '3.10'

- name: Install package
run: make install

- name: install dependencies
- name: Install dependencies
run: |
pip install jupyter-book
pip install furo
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

old/
*.ipynb
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ 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.3.0] - 2024-12-06 14:07:31

### Added

- Household variation charts.
- Region filtering improvements.

## [2.2.2] - 2024-12-06 14:02:41

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



[2.3.0]: https://github.com/PolicyEngine/policyengine.py/compare/2.2.2...2.3.0
[2.2.2]: https://github.com/PolicyEngine/policyengine.py/compare/2.2.1...2.2.2
[2.2.1]: https://github.com/PolicyEngine/policyengine.py/compare/2.2.0...2.2.1
[2.2.0]: https://github.com/PolicyEngine/policyengine.py/compare/2.1.0...2.2.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# policyengine.py

[WIP] PolicyEngine's main user-facing Python package, incorporating country packages and integrating data visualization and analytics.
PolicyEngine's main user-facing Python package, incorporating country packages and integrating data visualization and analytics. Read the documentation [here](https://policyengine.github.io/policyengine/policyengine.py).
6 changes: 6 additions & 0 deletions changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@
fixed:
- Household simulation example broken due to a type error.
date: 2024-12-06 14:02:41
- bump: minor
changes:
added:
- Household variation charts.
- Region filtering improvements.
date: 2024-12-06 14:07:31
7 changes: 5 additions & 2 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ copyright: "2025"
logo: logo.png

execute:
execute_notebooks: off
execute_notebooks: cache
allow_errors: false

repository:
url: https://github.com/policyengine/policyengine.py
Expand All @@ -19,4 +20,6 @@ sphinx:
html_theme: furo
pygments_style: default
html_css_files:
- style.css
- style.css
extra_extensions:
- "sphinx.ext.autodoc"
5 changes: 3 additions & 2 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parts:
- caption: Maintenance
chapters:
- file: maintaining
- caption: Schema
- caption: Reference
chapters:
- file: schema
- file: reference/simulation
- file: reference/calculate
19 changes: 12 additions & 7 deletions docs/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@
"Generally, PolicyEngine's models' usage falls into a 2x2 of categories:\n",
"\n",
"1. Simulating over a specific household\n",
"\n",
" a. Simulating a particular policy (scenario) over a household (e.g. what benefits am I entitled to now?)\n",
"\n",
" b. Comparing two policies over a household (how would this tax reform affect my net income?)\n",
"2. Simulating over the entire population\n",
"\n",
" a. Simulating a particular policy over the population (what's the poverty rate right now?)\n",
"\n",
" b. Comparing two policies over the population (how would this tax reform affect the poverty rate?)\n",
"\n",
"\n",
"Here's an example of how to use it to calculate how abolishing the Personal Allowance in the UK (US- standard deduction) would affect an earner on £30,000."
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand All @@ -31,7 +36,7 @@
"-2514.0"
]
},
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -66,16 +71,16 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"137.95680800660614"
"130.71499538568372"
]
},
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -84,15 +89,15 @@
"sim = Simulation(\n",
" country=\"uk\",\n",
" scope=\"macro\",\n",
" data=\"enhanced_frs_2022_23\",\n",
" data=\"enhanced_frs\",\n",
" time_period=2025,\n",
" reform={\n",
" \"gov.hmrc.income_tax.allowances.personal_allowance.amount\": {\n",
" \"2025\": 0,\n",
" }\n",
" }\n",
")\n",
"sim.calculate(\"macro/comparison/revenue_impact\")"
"sim.calculate(\"macro/comparison/budget/general/tax_revenue_impact\")/1e9"
]
}
],
Expand Down
Loading

0 comments on commit 8b5af39

Please sign in to comment.