Skip to main content

Core microsimulation engine enabling country-specific policy models.

Project description

PolicyEngine Core

codecov PyPI version Ruff

This package, a fork of OpenFisca-Core, powers PolicyEngine country models and apps.

Prerequisites

Python 3.10, 3.11, 3.12, or 3.13 is required.

Setting Up

1. Fork the repo

https://github.com/PolicyEngine/policyengine-core/fork

2. Clone your own fork

3. Install dependencies

make install

If you are using Windows (not recommended), please install make first. You can either directly download from Make for Windows; or install Chocolatey, and simply install make with

choco install make

(See Acknowledgements for credit)

Contributing

Choosing an Issue

All of our code changes are made against a GitHub issue. If you're new to the project, go to Issues and search for good first issues label: "good first issue". If you see an open issue that no one's opened a PR against, it's all yours! Feel free to make some edits, then open a PR, as described below.

Developing

Keep your fork's master branch in sync with the original repo by pulling the original repo's code at times; typically (if the original repo is called "upstream" by Git) this means running git pull upstream master, then git push origin master to sync the code to your local repo.

Create branches on your fork off of your master or main branch. Periodically, if you're working on something for a while, you might also run git rebase master within your feature branch to sync your code with any new changes.

Testing, Formatting, Changelogging

You've finished your contribution, but now what? Before opening a PR, we ask contributors to do three things.

Step 1: Testing

To test your changes against our series of automated tests, run

make test

We also ask that you add tests for any new features or bug-fixes you add, so we can gradually build up the code coverage. Our tests are written in the Python standard, Pytest, and will be run again against the production environment, as well.

Step 2: Formatting

In addition to the tests, we use Ruff to format our codebase, so before opening a pull request, Step 2 is to format the code by running

make format

This will automatically format the code for you; no need to do anything else.

Step 3: Changelogging

Finally, we ask contributors to make it clear for our users what changes have been made by contributing to a changelog. This changelog is formatted in YAML and describes the changes you've made to the code. This should follow the below format:

- bump: {major, minor, patch}
  changes:
    {added, removed, changed, fixed}:
      - <variable or program>

For more info on the syntax, check out the semantic versioning docs and keep a changelog.

Write your changelog info into the empty file called changelog_entry.yaml. When you open your PR, this will automatically be added to the overall changelog.

Opening a Pull Request

Now you've finished your contribution! Please open a pull request (PR) from your branch to the live master branch and request review. At times, it may take some time for the team to review your PR, especially for larger contributions, so please be patient--we will be sure to get to it.

In the first line of your PR, please make sure to include the following:

Fixes {issue_number}

This makes it much easier for us to maintain and prune our issue board.

Please try to be detailed in your PRs about the changes you made and why you made them. You may find yourself looking back at them for reference in the future, or needing insight about someone else's changes. Save yourself a conversation and write it all in the PR!

Here are some best practices for using Git.

When you're ready for review, switch the PR from Draft to Ready for review.

License

Distributed under the AGPL License. See LICENSE for more info.

Acknowledgements

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

policyengine_core-3.24.1.tar.gz (455.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

policyengine_core-3.24.1-py3-none-any.whl (229.9 kB view details)

Uploaded Python 3

File details

Details for the file policyengine_core-3.24.1.tar.gz.

File metadata

  • Download URL: policyengine_core-3.24.1.tar.gz
  • Upload date:
  • Size: 455.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for policyengine_core-3.24.1.tar.gz
Algorithm Hash digest
SHA256 2800a8619f68c141009319d598ee4dc939fb90f0aba0c91a064115818a6e7829
MD5 6819a3d6080de8581159d44dfe631e5d
BLAKE2b-256 a1d9ab604be73baac6629a7ea2aa21cdc79eddca06d4ddd1e77c474dd6f428a4

See more details on using hashes here.

File details

Details for the file policyengine_core-3.24.1-py3-none-any.whl.

File metadata

File hashes

Hashes for policyengine_core-3.24.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bbdd561c7d0082a4613642ac9a7dfb6718a834d2ae6a0876f30a959eecd0384d
MD5 b91fc952efe193b9100f462369fd63de
BLAKE2b-256 ff3ab9e5a83202482c3d8e3eb0657557ecf967f8073809dfdd8903006707829e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page