How to Contribute
Contribution workflow — development setup, running the tests, and building the documentation.
Development setup
Here is a short summary on how to fork and clone the repository, set up a development environment, and run the tests.
- Go to Algorithmiq/monoprop to fork and clone the repository.
- Clone the project to your local machine:
git clone https://github.com/Algorithmiq/monoprop.git- Change the directory to the project root:
cd monopropThe repository's DevContainer provides a ready-made development environment.
Alternatively, set up a local development build — prerequisites,
the editable uv build of the Python bindings (with or without MPI),
the C++ unit-test build, and verifying the install — as described
in Building from source.
The sections below cover the parts specific to contributing: running the tests and building the documentation.
Running the tests
Running the Python and C++ test suites — with and without MPI — is documented in Testing.
Code quality checks
The project uses automated code quality checks via pre-commit hooks. To run all pre-commit checks manually:
prek run --allC++ ownership
Keep owning classes on the Rule of Zero. Use monoprop::indirect<T> from
monoprop/Indirect.h for a heap-owned value that must be copied deeply, and use
std::optional<monoprop::indirect<T>> when absence is part of the domain model.
The pointee must be copy-constructible. Copying the wrapper constructs an
independent pointee; moving it transfers the allocation and leaves the source
valueless.
T may be forward-declared where indirect<T> is named. As with C++26
std::indirect, however, operations that construct, copy, or destroy the pointee
require T to be complete. For an opaque member, declare the holder's special
members in its header and default them in the implementation file after the
pointee definition.
This C++23 subset intentionally omits allocator support, comparisons, hashing, value assignment, pointer adoption, and initializer-list overloads. Its copy assignment replaces the allocation and does not preserve the pointee's address.
Documentation
Building the documentation locally requires npm, the Node.js package manager. Once npm is available, you can run:
just serve-docs # live-reloading dev server at http://localhost:3000
just build-docs # full static build → docs/out/The rendered site is written to docs/out/. See Documenting monoprop for guidelines on writing documentation pages, the API reference, and tutorial notebooks.
To submit your contribution
- Go to Algorithmiq/monoprop to fork the repository. Then, clone the project to your local machine:
git clone https://github.com/your-namespace/monoprop.git- Change the directory to the project root:
cd monoprop- Set up a development environment as described in Development setup.
- Create a branch for the feature you are working on.
- Commit locally and push your changes to your forked repository. Make sure to follow the coding style and conventions used in the project. In particular, commit messages must be structured according to the conventional commits standard:
- Write tests for your changes and ensure that all tests pass before submitting your pull request.
- Finally, submit a pull request to the main repository. Make sure to provide a clear description of your changes and any relevant information for the reviewers.