Skip to content

Commit

Permalink
Merge pull request #790 from PolicyEngine/MaxGhenis/issue789
Browse files Browse the repository at this point in the history
Remove 19% rate and name fields
  • Loading branch information
MaxGhenis authored Nov 23, 2023
2 parents b07f976 + 53f8184 commit 2c0ee72
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 225 deletions.
54 changes: 1 addition & 53 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Thank you for wanting to contribute to OpenFisca! :smiley:
Thank you for wanting to contribute to PolicyEngine! :smiley:

TL;DR: [GitHub Flow](https://guides.github.com/introduction/flow/), [SemVer](http://semver.org/).

Expand Down Expand Up @@ -40,55 +40,3 @@ Examples:

- Renaming or removing a variable from the tax and benefit system.

### Changelog

PolicyEngine-UK changes must be understood by users who don't necessarily work on the code. The Changelog must therefore be as explicit as possible.

Each change must be documented with the following elements:

- On the first line appears as a title the version number, as well as a link towards the Pull Request introducing the change. The title level must match the incrementation level of the version.

> For instance :
>
> # 13.0.0 - [#671](https://github.com/openfisca/openfisca-france/pull/671)
>
> ## 13.2.0 - [#676](https://github.com/openfisca/openfisca-france/pull/676)
>
> ### 13.1.5 - [#684](https://github.com/openfisca/openfisca-france/pull/684)
- The second line indicates the type of the change. The possible types are:
- `Tax and benefit system evolution`: Calculation improvement, fix, or update. Impacts the users interested in calculations.
- `Technical improvement`: Performances improvement, installing process change, formula syntax change… Impacts the users who write legislation and/or deploy their own instance.
- `Crash fix`: Impact all reusers.
- `Minor change`: Refactoring, metadata… Has no impact on users.

- In the case of a `Tax and benefit system evolution`, the following elements must then be specified:
- The periods impacted by the change. To avoid any ambiguity, the start day and/or the end day of the impacted periods must be precised. For instance, `from 01/01/2017` is correct, but `from 2017` is not, as it is ambiguous: it is not clear wheter 2017 is included or not in the impacted period.
- The tax and benefit system areas impacted by the change. These areas are described by the relative paths to the modified files, without the `.py` extension.

> For instance :
>
> - Impacted periods: Until 31/12/2015.
> - Impacted areas: `benefits/healthcare/universal_coverage`
- Finally, for all cases except `Minor Change`, the changes must be explicited by details given from a user perspective: in which case was an error or a problem was noticed ? What is the new available feature ? Which new behaviour is adopted.

> For instance:
>
> - Details :
> - These variables now return a yearly amount (instead of monthly):
> - `middle_school_scholarship`
> - `high_school_scholarship`
> - _The previous monthly amounts were just yearly amounts artificially divided by 12_
>
> or :
>
> - Details :
>
> * Use OpenFisca-Core `12.0.0`
> * Change the syntax used to declare parameters:
> - Remove "fuzzy" attribute
> - Remove "end" attribute
> - All parameters are assumed to be valid until and end date is explicitely specified with an `<END>` tag
When a Pull Request contains several disctincts changes, several paragraphs may be added to the Changelog. To be properly formatted in Markdown, these paragraphs must be separated by `<!-- -->`.
30 changes: 0 additions & 30 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,30 +0,0 @@
Hi there!

I really enjoy OpenFisca, but I recently encountered an issue.

### Here is what I did:


### Here is what I expected to happen:


### Here is what actually happened:


### Here is data (or links to it) that can help you reproduce this issue:



## Context

I identify more as a:

- Analyst _(I make macroscopic computations on real populations)_.
- Business expert _(I create tests and model legislation)_.
- Commenter _(I make data visualisations)_.
- Developer _(I create tools that use the existing OpenFisca code)_.
- Historian _(I accumulate data based on past legislation values)_.
- Lobbyist _(I model reforms to make them exist)_.
- Producer _(I make computations on individual situations)_.

(remove this line as well as all items in the list that don't fit your situation)
17 changes: 0 additions & 17 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,17 +0,0 @@
Thanks for contributing to OpenFisca! Please remove this line, as well as, for each line below, the cases which are not relevant to your contribution :)

* Tax and benefit system evolution. | Technical improvement. | Crash fix. | Minor change.
* Impacted periods: all. | until YYYY-MM-DD. | from YYYY-MM-DD.
* Impacted areas: `path/to/file/containing/impacted/variables`
* Details:
- New feature or new behaviour description
- Cases for which an error was noticed

- - - -

These changes _(remove lines which are not relevant to your contribution)_:

- Impact the PolicyEngine-UK public API (for instance renaming or removing a variable)
- Add a new feature (for instance adding a variable)
- Fix or improve an already existing calculation.
- Change non-functional parts of this repository (for instance editing the README)
2 changes: 1 addition & 1 deletion .vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This folder contains some helper files that speed up development within Visual Studio Code:

- ```launch.json``` describes the behaviour when debugging Python files within the repo.
- ```snippets/``` contains code snippets for creating OpenFisca constructs.
- ```snippets/``` contains code snippets for creating PolicyEngine constructs.

## Code Snippets

Expand Down
10 changes: 5 additions & 5 deletions .vscode/python.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ],
// "description": "Log output to console"
// }
"OpenFisca Variable": {
"PolicyEngine Variable": {
"prefix": "var",
"body": [
"class ${1:name}(Variable):",
Expand All @@ -25,17 +25,17 @@
"",
""
],
"description": "Insert a new OpenFisca Variable, without a formula."
"description": "Insert a new PolicyEngine Variable, without a formula."
},
"OpenFisca Formula": {
"PolicyEngine Formula": {
"prefix": "form",
"body": [
"def formula(${1:person}, period, parameters):",
" ${2:pass}"
],
"description": "Insert a new OpenFisca Formula."
"description": "Insert a new PolicyEngine Formula."
},
"OpenFisca Variable File": {
"PolicyEngine Variable File": {
"prefix": "file",
"body": [
"from policyengine_uk.model_api import *",
Expand Down
16 changes: 8 additions & 8 deletions .vscode/yaml.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ],
// "description": "Log output to console"
// }
"Insert OpenFisca basic parameter": {
"Insert PolicyEngine basic parameter": {
"prefix": "param",
"body": [
"description: ${1:Description}",
Expand All @@ -23,19 +23,19 @@
" unit: currency-GBP",
" reference: ${3:none}"
],
"description": "Insert a basic OpenFisca parameter."
"description": "Insert a basic PolicyEngine parameter."
},
"Insert OpenFisca parameter value with reference": {
"Insert PolicyEngine parameter value with reference": {
"prefix": "refparam",
"body": [
"value: ${1:0.00}",
"reference:",
" - title: ${2:Title}",
" href: ${3:Link}",
],
"description": "Insert a basic OpenFisca parameter."
"description": "Insert a basic PolicyEngine parameter."
},
"Insert OpenFisca basic test": {
"Insert PolicyEngine basic test": {
"prefix": "test",
"body": [
"- name: ${1:Name}",
Expand All @@ -45,9 +45,9 @@
" output:",
" ${4:expected output here}"
],
"description": "Insert a basic OpenFisca parameter for one person."
"description": "Insert a basic PolicyEngine parameter for one person."
},
"2019-2025 (millions) OpenFisca parameter": {
"2019-2025 (millions) PolicyEngine parameter": {
"prefix": "1926bn",
"body": [
"2019-01-01: ${1}_000_000",
Expand All @@ -59,7 +59,7 @@
"2025-01-01: ${7}_000_000",
]
},
"2019-2025 (thousands) OpenFisca parameter": {
"2019-2025 (thousands) PolicyEngine parameter": {
"prefix": "1926mn",
"body": [
"2019-01-01: ${1}_000",
Expand Down
12 changes: 6 additions & 6 deletions PSL_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,42 @@
"end_header": null,
"source": null,
"type": "html",
"data": "<p>PolicyEngine-UK is a static microsimulation model of the UK Tax-Benefit system using the OpenFisca framework.</p>"
"data": "<p>PolicyEngine UK is a static microsimulation model of the UK Tax-Benefit system.</p>"
},
"project_overview": {
"start_header": null,
"end_header": null,
"source": null,
"type": "html",
"data": "<a href=\"https://github.com/PSLmodels/openfisca-uk\">What is PolicyEngine-UK?</a>"
"data": "<a href=\"https://github.com/PolicyEngine/policyengine-uk\">What is PolicyEngine-UK?</a>"
},
"core_maintainers": {
"start_header": null,
"end_header": null,
"source": null,
"type": "html",
"data": "<ul><li>Nikhil Woodruff</li><ul><li>email: nikhil.woodruff@ubicenter.org</li></ul>"
"data": "<ul><li>Nikhil Woodruff</li><ul><li>email: nikhil@policyengine.org</li></ul>"
},
"user_documentation": {
"start_header": null,
"end_header": null,
"source": null,
"type": "html",
"data": "<a href=\"https://github.com/PSLmodels/openfisca-uk/blob/master/docs/\"></a>"
"data": "<a href=\"https://policyengine.github.io/policyengine-uk/\"></a>"
},
"contributor_overview": {
"start_header": null,
"end_header": null,
"source": null,
"type": "html",
"data": "<a href=\"https://github.com/PSLmodels/openfisca-uk\"></a>"
"data": "<a href=\"https://github.com/PolicyEngine/PolicyEngine-uk\"></a>"
},
"user_changelog_recent": {
"start_header": null,
"end_header": null,
"source": null,
"type": "html",
"data": "<a href=\"https://github.com/PSLmodels/openfisca-uk/blob/master/CHANGELOG.md\"></a>"
"data": "<a href=\"https://github.com/PSLmodels/policyengine-uk/blob/master/CHANGELOG.md\"></a>"
},
"link_to_webapp": {
"start_header": null,
Expand Down
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: patch
changes:
removed:
- 19% basic rate change proposed for 2024 that was never enacted.
72 changes: 8 additions & 64 deletions docs/summary/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To install pew, launch a terminal on your computer and follow these instructions
```sh
pip install --upgrade pip
pip install pew # if asked, answer "Y" to the question about modifying your shell config file.
pew new openfisca --python=python3.7 # create a new virtualenv called “openfisca
pew new policyengine --python=python3.7 # create a new virtualenv called “policyengine
```

The virtualenv you just created will be automatically activated. This means you will operate in the virtualenv immediately. You should see a prompt resembling this:
Expand All @@ -26,9 +26,9 @@ Installing setuptools, pip, wheel...done.
Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.
```

You can re-activate that virtualenv at any time with `pew workon openfisca`.
You can re-activate that virtualenv at any time with `pew workon policyengine`.

:tada: You are now ready to install this OpenFisca Country Package!
:tada: You are now ready to install this PolicyEngine Country Package!

Two install procedures are available. Pick procedure A or B below depending on how you plan to use this Country Package.

Expand All @@ -39,7 +39,6 @@ Follow this installation if you wish to:
- run calculations on a large population;
- create tax & benefits simulations;
- write an extension to this legislation (e.g. city specific tax & benefits);
- serve your Country Package with the OpenFisca Web API.

For more advanced uses, head to the [Advanced Installation](#advanced-installation-git-clone).

Expand All @@ -63,18 +62,8 @@ Install the Country Package:
pip install policyengine_uk
```

:tada: This OpenFisca Country Package is now installed and ready!
:tada: This OpenFPolicyEngineisca Country Package is now installed and ready!

#### Next Steps

- To learn how to use OpenFisca, follow our [tutorials](https://openfisca.org/doc/).
- To serve this Country Package, serve the [OpenFisca web API](#serve-your-country-package-with-the-openFisca-web-api).

Depending on what you want to do with OpenFisca, you may want to install yet other packages in your virtualenv:

- To install extensions or write on top of this Country Package, head to the [Extensions documentation](https://openfisca.org/doc/contribute/extensions.html).
- To plot simulation results, try [matplotlib](http://matplotlib.org/).
- To manage data, check out [pandas](http://pandas.pydata.org/).

### B. Advanced Installation (Git Clone)

Expand All @@ -87,7 +76,7 @@ Follow this tutorial if you wish to:

First of all, make sure [Git](https://www.git-scm.com/) is installed on your machine.

Set your working directory to the location where you want this OpenFisca Country Package cloned.
Set your working directory to the location where you want this PolicyEngine Country Package cloned.

Inside your virtualenv, check the prerequisites:

Expand All @@ -104,56 +93,11 @@ pip --version # should print at least 9.0.
Clone this Country Package on your machine:

```sh
git clone https://github.com/openfisca/openfisca-uk.git
cd openfisca-uk
git clone https://github.com/policyengine/policyengine-uk.git
cd policyengine-uk
pip install --editable .[dev]
```

You can make sure that everything is working by running the provided tests with `make test`.

> [Learn more about tests](https://openfisca.org/doc/coding-the-legislation/writing_yaml_tests.html)
:tada: This OpenFisca Country Package is now installed and ready!

#### Next Steps

- To write new legislation, read the [Coding the legislation](https://openfisca.org/doc/coding-the-legislation/index.html) section to know how to write legislation.
- To contribute to the code, read our [Contribution Guidebook](https://openfisca.org/doc/contribute/index.html).

## Serve this Country Package with the OpenFisca Web API

If you are considering building a web application, you can use the packaged OpenFisca Web API with your Country Package.

To serve the Openfisca Web API locally, run:

```sh
openfisca serve --port 5000
```

Or use the quick-start Make command:

```
make serve-local
```

To read more about the `openfisca serve` command, check out its [documentation](https://openfisca.org/doc/openfisca-python-api/openfisca_serve.html).

You can make sure that your instance of the API is working by requesting:

```sh
curl "http://localhost:5000/spec"
```

This endpoint returns the [Open API specification](https://www.openapis.org/) of your API.

:tada: This OpenFisca Country Package is now served by the OpenFisca Web API! To learn more, go to the [OpenFisca Web API documentation](https://openfisca.org/doc/openfisca-web-api/index.html).

You can test your new Web API by sending it example JSON data located in the `situation_examples` folder.

Substitute your package's country name for `policyengine_uk` below:

```sh
curl -X POST -H "Content-Type: application/json" \
-d @./policyengine_uk/situation_examples/couple.json \
http://localhost:5000/calculate
```
:tada: This PolicyEngine Country Package is now installed and ready!
4 changes: 2 additions & 2 deletions docs/summary/VARIABLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Note. Benefit Units are often referred to as "families". While this is often equ

Each entity type has a set of variables which can be populated. In PolicyEngine-UK, all variable definitions are organised by their entity type. These are detailed with descriptive statistics in `docs\VARIABLE_STATS.md`.

IMPORTANT: All variables are weeklysed. This decision has been taken because the FRS weeklyises practically all variables - this has been preserved in PolicyEngine-UK in order to minimise the risk of incorrectly imputing values. However, OpenFisca itself does not provide a WEEK period for variables, so currently all variables use the YEAR period. This should be interpreted as a variable describing an abstract week, instead of a particular week in time. Suggestions very welcome on other approaches than this imperfect solution.
IMPORTANT: All variables are weeklysed. This decision has been taken because the FRS weeklyises practically all variables - this has been preserved in PolicyEngine-UK in order to minimise the risk of incorrectly imputing values. However, PolicyEngine itself does not provide a WEEK period for variables, so currently all variables use the YEAR period. This should be interpreted as a variable describing an abstract week, instead of a particular week in time. Suggestions very welcome on other approaches than this imperfect solution.

## Obtaining datasets

OpenFisca country models can deal with either manual input of individual data, or CSV input for datasets. The primary use of PolicyEngine-UK is in simulating tax changes across survey data - specifically, the Family Resources Survey. This is obtainable via the [UK Data Service](https://beta.ukdataservice.ac.uk/datacatalogue/series/series?id=200017), and comes in two forms, safeguarded (accessible only to academic members) and restricted (accessible only to vetted users in a secure environment). PolicyEngine-UK has been designed to take inputs from the safeguarded version - for code which automates this process, see [frs-tools](https://github.com/nikhilwoodruff/frs-tools).
PolicyEngine country models can deal with either manual input of individual data, or CSV input for datasets. The primary use of PolicyEngine-UK is in simulating tax changes across survey data - specifically, the Family Resources Survey. This is obtainable via the [UK Data Service](https://beta.ukdataservice.ac.uk/datacatalogue/series/series?id=200017), and comes in two forms, safeguarded (accessible only to academic members) and restricted (accessible only to vetted users in a secure environment). PolicyEngine-UK has been designed to take inputs from the safeguarded version - for code which automates this process, see [frs-tools](https://github.com/nikhilwoodruff/frs-tools).
Loading

0 comments on commit 2c0ee72

Please sign in to comment.