Contributing
We love to chat about state-space-models! If you do too, you can get involved in the following ways:
- Open an issue if you have a question, suggestion or spotted a bug or specific code that could be improved.
- Start or join a discussion for more general conversation regarding
cuthbertcode structure and design. - Open a pull request to add code yourself, follow the steps below (feel free to make it a draft at an early stage for feedback).
- Join us on discord for everything else; including memes, research ideas and meetups.
Opening a Pull Request
If you would like to contribute to cuthbert, please follow these steps:
-
Fork the repo from GitHub and clone it locally:
-
Install the package with the development dependencies and pre-commit hooks:
-
Add your code. Add your tests. Update the docs if needed.
-
If you have made changes to the docs, check that they render nicely:
-
Make sure to run the linter, type checker, tests and check coverage:
-
Commit your changes and push your new branch to your fork.
-
Open a pull request on GitHub.
Adding an example
Examples in cuthbert are written in Markdown and tangled into Python scripts using entangled so they can be run as tests.
To add an example, you can use the following steps:
- Write the example in Markdown in the
docsdirectory. - Make sure to start each code block with
{.python #example_name-code_block_name}. See thedocs/quickstart.mdexample for reference.
(Note that it's important to include the example name here as code block names must be unique across all examples.) -
Add a hidden code block at the end of the file with the following content:
Again, see the```{.python file=examples_scripts/example_name.py} <<example_name-code_block_name_1>> <<example_name-code_block_name_2>> ...docs/quickstart.mdexample for reference. -
Add a reference to your new example in the
docs/examples/index.mdfile and themkdocs.ymlfile.
You may need to add any new dependencies to thepyproject.tomlfile underexamples. - Make sure your example ends with "Key Takeaways" and "Next Steps" sections, linking to other documentation and examples where appropriate.
- That's it! If you want to generate the python script and run it locally to check it works, you can run: