From 532c9e61234be6ccf501313946ca671438c9648a Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 23 Nov 2023 12:42:18 -0500 Subject: [PATCH 1/3] Remove 19% rate and name fields --- changelog_entry.yaml | 4 +++ .../gov/hmrc/income_tax/rates/dividends.yaml | 4 --- .../rates/scotland/post_starter_rate.yaml | 27 +++++++------------ .../gov/hmrc/income_tax/rates/uk.yaml | 11 -------- 4 files changed, 13 insertions(+), 33 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..95520ea4c 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + removed: + - 19% basic rate change proposed for 2024 that was never enacted. diff --git a/policyengine_uk/parameters/gov/hmrc/income_tax/rates/dividends.yaml b/policyengine_uk/parameters/gov/hmrc/income_tax/rates/dividends.yaml index c3d51c9d1..7ba3701dd 100644 --- a/policyengine_uk/parameters/gov/hmrc/income_tax/rates/dividends.yaml +++ b/policyengine_uk/parameters/gov/hmrc/income_tax/rates/dividends.yaml @@ -3,7 +3,6 @@ brackets: - rate: metadata: label: Dividends basic rate - name: dividend_basic_rate unit: /1 reference: - title: Finance Act 2022 s. 4 @@ -20,7 +19,6 @@ brackets: values: 2015-06-01: 0 metadata: - name: dividend_basic_threshold label: Dividends basic rate threshold reference: - title: Finance Act 2022 s. 4 @@ -28,7 +26,6 @@ brackets: - rate: metadata: label: Dividends higher rate - name: dividend_higher_rate unit: /1 reference: - title: Finance Act 2022 s. 4 @@ -68,7 +65,6 @@ brackets: 2015-06-01: 150_000 metadata: period: year - name: dividend_additional_threshold label: Dividends additional rate threshold reference: - title: Finance Act 2022 s. 4 diff --git a/policyengine_uk/parameters/gov/hmrc/income_tax/rates/scotland/post_starter_rate.yaml b/policyengine_uk/parameters/gov/hmrc/income_tax/rates/scotland/post_starter_rate.yaml index 0d2794acf..614d753e9 100644 --- a/policyengine_uk/parameters/gov/hmrc/income_tax/rates/scotland/post_starter_rate.yaml +++ b/policyengine_uk/parameters/gov/hmrc/income_tax/rates/scotland/post_starter_rate.yaml @@ -4,7 +4,6 @@ brackets: rate metadata: label: Scottish starter rate - name: scottish_starter_rate unit: /1 values: 2018-06-01: 0.19 @@ -15,7 +14,6 @@ brackets: over a smaller region of income metadata: label: Scottish basic rate - name: scottish_basic_rate unit: /1 values: 2018-06-01: 0.2 @@ -23,13 +21,12 @@ brackets: description: The threshold at which an individual pays the basic rate metadata: label: Scottish basic rate threshold - name: scottish_basic_threshold period: year unit: currency-GBP values: - 2018-06-01: 2000 - 2019-06-01: 2049 - 2020-06-01: 2085 + 2018-06-01: 2_000 + 2019-06-01: 2_049 + 2020-06-01: 2_085 2022-01-01: value: 2_162 reference: @@ -44,7 +41,6 @@ brackets: description: The third rate in Scottish Income Tax metadata: label: Scottish intermediate rate - name: scottish_intermediate_rate unit: /1 values: 2018-06-01: 0.21 @@ -53,13 +49,12 @@ brackets: rate metadata: label: Scottish intermediate rate threshold - name: scottish_intermediate_threshold period: year unit: currency-GBP values: - 2018-06-01: 12150 - 2020-06-01: 12444 - 2021-06-01: 12658 + 2018-06-01: 12_150 + 2020-06-01: 12_444 + 2021-06-01: 12_658 2022-01-01: value: 13_118 reference: @@ -74,7 +69,6 @@ brackets: description: The fourth rate in Scottish Income Tax metadata: label: Scottish higher rate - name: scottish_higher_rate unit: /1 values: 2018-06-01: 0.4 @@ -82,13 +76,12 @@ brackets: description: The threshold at which an individual pays the Scottish higher rate metadata: label: Scottish higher rate threshold - name: scottish_higher_threshold period: year unit: currency-GBP values: - 2018-06-01: 31580 - 2019-06-01: 30930 - 2020-06-01: 30930 + 2018-06-01: 31_580 + 2019-06-01: 30_930 + 2020-06-01: 30_930 2022-01-01: value: 31_092 reference: @@ -103,7 +96,6 @@ brackets: description: The fifth and final rate in Scottish Income Tax metadata: label: Scottish additional rate - name: scottish_additional_rate unit: /1 values: 2018-06-01: 0.47 @@ -112,7 +104,6 @@ brackets: rate metadata: label: Scottish additional rate threshold - name: scottish_add_threshold period: year unit: currency-GBP values: diff --git a/policyengine_uk/parameters/gov/hmrc/income_tax/rates/uk.yaml b/policyengine_uk/parameters/gov/hmrc/income_tax/rates/uk.yaml index da3470496..4d6436383 100644 --- a/policyengine_uk/parameters/gov/hmrc/income_tax/rates/uk.yaml +++ b/policyengine_uk/parameters/gov/hmrc/income_tax/rates/uk.yaml @@ -4,19 +4,12 @@ brackets: after allowances are deducted metadata: label: Basic rate - name: basic_rate reference: - href: https://www.legislation.gov.uk/ukpga/2022/3/section/2/enacted title: Finance Act 2022 s. 2 unit: /1 values: 2015-06-01: 0.2 - 2024-04-01: - metadata: - reference: - - href: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/1043689/Budget_AB2021_Web_Accessible.pdf - title: Autumn Budget and Spending Review 2022 - value: 0.19 threshold: description: The starting threshold for the basic rate, after allowances. metadata: @@ -29,7 +22,6 @@ brackets: description: The higher rate is the middle tax bracket on earned income. metadata: label: Higher rate - name: higher_rate reference: - href: https://www.legislation.gov.uk/ukpga/2022/3/section/2/enacted title: Finance Act 2022 s. 2 @@ -41,7 +33,6 @@ brackets: the upper threshold of the basic rate) metadata: label: Higher rate threshold - name: higher_threshold period: year reference: - href: https://www.legislation.gov.uk/ukpga/2022/3/section/2/enacted @@ -60,7 +51,6 @@ brackets: description: The additional rate is the highest tax bracket, with no upper bound metadata: label: Additional rate - name: add_rate reference: - href: https://www.legislation.gov.uk/ukpga/2022/3/section/2/enacted title: Finance Act 2022 s. 2 @@ -74,7 +64,6 @@ brackets: description: The lower threshold for the additional rate metadata: label: Additional rate threshold - name: add_threshold period: year reference: - href: https://www.legislation.gov.uk/ukpga/2022/3/section/2/enacted From 7b3e1e9482602d0e00571c6af889c158622bdfd7 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 23 Nov 2023 12:52:14 -0500 Subject: [PATCH 2/3] fix outdated references --- .github/CONTRIBUTING.md | 54 +--------------- .github/ISSUE_TEMPLATE.md | 30 --------- .github/PULL_REQUEST_TEMPLATE.md | 17 ----- .vscode/README.md | 2 +- .vscode/python.code-snippets | 10 +-- .vscode/yaml.code-snippets | 16 ++--- PSL_catalog.json | 12 ++-- docs/summary/INSTALLATION.md | 72 +++------------------ docs/summary/VARIABLES.md | 4 +- policyengine_uk/tools/baseline_variables.py | 12 ++-- policyengine_uk/tools/cli.py | 10 +-- 11 files changed, 39 insertions(+), 200 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f234f118b..ded34380b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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/). @@ -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 `` 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 ``. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 4e2a205b0..e69de29bb 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -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) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2cc89f832..e69de29bb 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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) diff --git a/.vscode/README.md b/.vscode/README.md index 474d7d9fc..f80d6b2fb 100644 --- a/.vscode/README.md +++ b/.vscode/README.md @@ -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 diff --git a/.vscode/python.code-snippets b/.vscode/python.code-snippets index d099cf1f4..90b102510 100644 --- a/.vscode/python.code-snippets +++ b/.vscode/python.code-snippets @@ -12,7 +12,7 @@ // ], // "description": "Log output to console" // } - "OpenFisca Variable": { + "PolicyEngine Variable": { "prefix": "var", "body": [ "class ${1:name}(Variable):", @@ -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 *", diff --git a/.vscode/yaml.code-snippets b/.vscode/yaml.code-snippets index 6b5464f36..cec3034eb 100644 --- a/.vscode/yaml.code-snippets +++ b/.vscode/yaml.code-snippets @@ -12,7 +12,7 @@ // ], // "description": "Log output to console" // } - "Insert OpenFisca basic parameter": { + "Insert PolicyEngine basic parameter": { "prefix": "param", "body": [ "description: ${1:Description}", @@ -23,9 +23,9 @@ " 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}", @@ -33,9 +33,9 @@ " - 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}", @@ -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", @@ -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", diff --git a/PSL_catalog.json b/PSL_catalog.json index ee927545b..d8e695274 100644 --- a/PSL_catalog.json +++ b/PSL_catalog.json @@ -4,42 +4,42 @@ "end_header": null, "source": null, "type": "html", - "data": "

PolicyEngine-UK is a static microsimulation model of the UK Tax-Benefit system using the OpenFisca framework.

" + "data": "

PolicyEngine UK is a static microsimulation model of the UK Tax-Benefit system.

" }, "project_overview": { "start_header": null, "end_header": null, "source": null, "type": "html", - "data": "What is PolicyEngine-UK?" + "data": "What is PolicyEngine-UK?" }, "core_maintainers": { "start_header": null, "end_header": null, "source": null, "type": "html", - "data": "
  • Nikhil Woodruff
    • email: nikhil.woodruff@ubicenter.org
    " + "data": "
    • Nikhil Woodruff
      • email: nikhil@policyengine.org
      " }, "user_documentation": { "start_header": null, "end_header": null, "source": null, "type": "html", - "data": "" + "data": "" }, "contributor_overview": { "start_header": null, "end_header": null, "source": null, "type": "html", - "data": "" + "data": "" }, "user_changelog_recent": { "start_header": null, "end_header": null, "source": null, "type": "html", - "data": "" + "data": "" }, "link_to_webapp": { "start_header": null, diff --git a/docs/summary/INSTALLATION.md b/docs/summary/INSTALLATION.md index 547e9defa..f717c3293 100644 --- a/docs/summary/INSTALLATION.md +++ b/docs/summary/INSTALLATION.md @@ -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: @@ -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. @@ -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). @@ -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) @@ -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: @@ -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! diff --git a/docs/summary/VARIABLES.md b/docs/summary/VARIABLES.md index bf35c1a18..6186ec4f4 100644 --- a/docs/summary/VARIABLES.md +++ b/docs/summary/VARIABLES.md @@ -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). diff --git a/policyengine_uk/tools/baseline_variables.py b/policyengine_uk/tools/baseline_variables.py index ed77c0014..7a0062f77 100644 --- a/policyengine_uk/tools/baseline_variables.py +++ b/policyengine_uk/tools/baseline_variables.py @@ -7,14 +7,14 @@ def baseline_is_nonzero(variable: Type[Variable]) -> Callable: - """Creates an OpenFisca formula calculating the whether the specified + """Creates an PolicyEngine formula calculating the whether the specified variable is non-zero in the baseline. Args: variable (Type[Variable]): The variable to calculate the change in. Returns: - Callable: The OpenFisca formula. + Callable: The PolicyEngine formula. """ def formula(entity, period): @@ -25,14 +25,14 @@ def formula(entity, period): def change_over_baseline(variable: Type[Variable]) -> Callable: - """Creates an OpenFisca formula calculating the change in the + """Creates an PolicyEngine formula calculating the change in the specified variable over its baseline value. Args: variable (Type[Variable]): The variable to calculate the change in. Returns: - Callable: The OpenFisca formula. + Callable: The PolicyEngine formula. """ def formula(entity, period): @@ -63,9 +63,7 @@ def generate_baseline_variables(): year, [True] * len( - baseline.calc( - variable_metadata[variable].entity.key + "_id" - ) + baseline.calc(variable_metadata[variable].entity.key + "_id") ), ) diff --git a/policyengine_uk/tools/cli.py b/policyengine_uk/tools/cli.py index bdab7205b..91cbdd0c7 100644 --- a/policyengine_uk/tools/cli.py +++ b/policyengine_uk/tools/cli.py @@ -14,7 +14,7 @@ def add_tax_benefit_system_arguments(parser): "--country-package", default=policyengine_uk, action="store", - help='country package to use. If not provided, an automatic detection will be attempted by scanning the python packages installed in your environment which name contains the word "openfisca".', + help='country package to use. If not provided, an automatic detection will be attempted by scanning the python packages installed in your environment which name contains the word "policyengine".', ) parser.add_argument( "-e", @@ -38,9 +38,7 @@ def add_tax_benefit_system_arguments(parser): def build_parser(): parser = argparse.ArgumentParser() - subparsers = parser.add_subparsers( - help="Available commands", dest="command" - ) + subparsers = parser.add_subparsers(help="Available commands", dest="command") subparsers.required = ( True # Can be added as an argument of add_subparsers in Python 3 ) @@ -102,9 +100,7 @@ def build_test_parser(parser): return parser - parser_test = subparsers.add_parser( - "test", help="Run OpenFisca YAML tests" - ) + parser_test = subparsers.add_parser("test", help="Run PolicyEngine YAML tests") parser_test = build_test_parser(parser_test) return parser From 53f8184f3c3eefba8c28bbd7352bc7420912098b Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 23 Nov 2023 12:53:20 -0500 Subject: [PATCH 3/3] make format --- policyengine_uk/tools/baseline_variables.py | 4 +++- policyengine_uk/tools/cli.py | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/policyengine_uk/tools/baseline_variables.py b/policyengine_uk/tools/baseline_variables.py index 7a0062f77..cbbb05493 100644 --- a/policyengine_uk/tools/baseline_variables.py +++ b/policyengine_uk/tools/baseline_variables.py @@ -63,7 +63,9 @@ def generate_baseline_variables(): year, [True] * len( - baseline.calc(variable_metadata[variable].entity.key + "_id") + baseline.calc( + variable_metadata[variable].entity.key + "_id" + ) ), ) diff --git a/policyengine_uk/tools/cli.py b/policyengine_uk/tools/cli.py index 91cbdd0c7..b20ab7af5 100644 --- a/policyengine_uk/tools/cli.py +++ b/policyengine_uk/tools/cli.py @@ -38,7 +38,9 @@ def add_tax_benefit_system_arguments(parser): def build_parser(): parser = argparse.ArgumentParser() - subparsers = parser.add_subparsers(help="Available commands", dest="command") + subparsers = parser.add_subparsers( + help="Available commands", dest="command" + ) subparsers.required = ( True # Can be added as an argument of add_subparsers in Python 3 ) @@ -100,7 +102,9 @@ def build_test_parser(parser): return parser - parser_test = subparsers.add_parser("test", help="Run PolicyEngine YAML tests") + parser_test = subparsers.add_parser( + "test", help="Run PolicyEngine YAML tests" + ) parser_test = build_test_parser(parser_test) return parser