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.
If you would like to contribute to cuthbert, please follow these steps:
- Fork the repo from GitHub and clone it locally:
git clone git@github.com/YourUserName/cuthbert.git
cd cuthbert- Install the package with the development dependencies and pre-commit hooks.
With uv:
uv sync --all-extras
pre-commit installWith pip:
pip install -e ./pkg/cuthbertlib
pip install -e "./pkg/cuthbert[tests,docs,examples]"
pre-commit install-
Add your code. Add your tests. Update the docs if needed.
-
Make sure to run the linter, type checker, tests and check coverage:
pre-commit run --all-files
python -m pytest --cov=cuthbert --cov-report term-missing!!! tip "VS Code Users"
VS Code users can use the [Ruff](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff)
and [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance)
(with Type Checking Mode: standard)
extensions for assistance with linting and type checking during development.
-
Commit your changes and push your new branch to your fork.
-
Open a pull request on GitHub.
The documentation site is built with Zensical.
You can render locally with:
zensical serveThe live preview should be available at http://localhost:8000.
Pages under docs/ often pull shared copy from repository README.md files via
PyMdown Snippets
(--8<-- "path" and named sections in HTML comments). See that guide for syntax and
options. We recommend using Snippets where possible, to avoid duplication,
with source text in an appropriate README.md file and then linked to in docs/ files.
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:
```{.python file=examples_scripts/example_name.py}
<<example_name-code_block_name_1>>
<<example_name-code_block_name_2>>
...
Again, see the docs/quickstart.md example for reference.
- Add a reference to your new example in the
docs/examples/index.mdfile and thezensical.tomlfile. 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:
entangled tangle
python examples_scripts/example_name.py