Hello there. Looks like you are interested in contributing to cactus, which is just great, so welcome!
We are open to any kind of contribution: code, documentation, bug-fixing (even just reports), feature-requests and anything else you may come up with.
Discussions should be the first line of contact for new users to provide direct feedback on the library. Post your Ideas for new features or examples, showcase your work using cactus in Show and tell, or get support for usage in Q&As, please post them in one of our categories.
To contribute code to the project:
- Fork this repo
- Set up the coding environment
- Commit your code
- Submit a pull request. It will be reviewed by maintainers and they'll give you proper feedback so you can iterate over it.
- Make sure existing tests pass
- Make sure your new code is properly tested and fully-covered
- Following The seven rules of a great Git commit message is highly encouraged
- When adding a new feature, branch from main-branch
As mentioned above, existing tests must pass and new features are required to be tested and fully-covered.
Code should be self-documented. But, in case there is any code that may be hard to understand, it must include some comments to make it easier to review and maintain later on.
To make a contribution, you will need to set up the development environment. This repo uses Rye, but any virtualenv
python tool will work (Pyenv, virtualenv, venv, etc.).
Make sure to have
rye
installed before performing these steps.
If using rye, you can quickly spin up the development environment using the following:
git clone https://github.com/pnnl/cactus.git
cd cactus
rye sync
Note that you must first uninstall any current version you may already have.
This will will install the code in an editable configuration and install all the required dev dependencies.
First you must install the code via:
git clone https://github.com/pnnl/cactus.git
cd cactus
pip install -e .
Note that you must first uninstall any current version you may already have.
Then you can make sure you have all the dev dependencies installed by running
pip install -r requirements-dev.lock
When making commits to your branch to prepare for your PR, make sure to follow proper code quality assessments by frequently running the linter, formatter, and test suite on your code. The PR will not be able to be merged if the linter and tests do not pass.
Be in the root directory of the repo before running these instructions.
To lint your code, use the command:
rye lint
rye run mypy --ignore-missing-imports .
This will return a list of current issues with your code.
To format your code, use the command:
rye fmt
To run the test suite on your code, use the command:
rye test
To lint your code, use the command:
ruff check .
mypy --ignore-missing-imports .
This will return a list of current issues with your code.
To format your code, use the command:
ruff format .
To test your code, use the command:
pytest