Contributions to this project are welcome! If you're new to contributing to CarbonPlan projects, here are some resources to help you get started:
- Familiarize yourself with our GitHub organization
- Read our Code of Conduct
We follow a standard Github-centric model for collaborating on software projects. Here are the basic steps:
Click the "Fork" button in the top right corner of the repository page to create your own copy of the repository. Once you have forked the repository, clone it to your local machine:
git clone https://github.com/{user-name}/{repo-name}.gitWe use pixi to manage our development environment. To set it up, please follow the instructions from pixi's installation guide. Once pixi is installed, you can create local development environments for the project by running:
pixi installThis will install all the necessary dependencies for the project. Once the installation is complete, you can enable pre-commit hooks to ensure that your code adheres to our style guidelines:
pixi pre-commit installThis will set up pre-commit hooks that will automatically format your code and run tests before you commit any changes.
Before you get started with your work on the project, it's a good idea to create a new branch. This keeps your changes organized and makes it easier to submit a pull request later. You can create a new branch with the following command:
git fetch upstream
git checkout -b {branch-name} upstream/mainReplace {branch-name} with a descriptive name for your branch.
Before you start making changes, it's a good idea to run the tests to ensure everything is working as expected. You can run the tests with the following command:
pixi run testsThis will execute the test suite and let you know if everything is functioning correctly. If you are adding new features or making changes, consider adding tests for your new code as well.
Then, once you have made your changes, you can commit them to your branch:
git add .
git commit
git push origin {branch-name}Once you have pushed your changes to your forked repository, you can submit a pull request to the original repository. Go to the original repository on GitHub, and you should see a prompt to create a pull request for your branch. Click on it and fill out the necessary details. Make sure to provide a clear description of the changes you made and why they are necessary.
Our documentation is built with Sphinx and deployed automatically to ReadTheDocs on every PR and merge to main.
To build and serve the docs locally:
# Build the documentation
pixi run docs-build
# Serve the documentation locally
pixi run docs-serveThen navigate to http://localhost:8000 to view the docs.
Documentation is automatically deployed:
- PR previews: Every pull request gets a preview deployment on ReadTheDocs
- Production: Merges to
mainautomatically deploy to https://open-climate-risk.readthedocs.io/