Contribute to Matfree
Contributions are welcome!
Issues:
Most contributions start with an issue. Please don't hesitate to create issues in which you ask for features, give performance feedback, or simply want to reach out.
Pull requests:
To make a pull request, proceed as follows:
- Fork the repository.
- Install all dependencies with
pip install .[full]orpip install -e .[full]. - Make your changes.
- From the project's root, run the tests via
make test. Check outmake format-and-lintas well. Use the pre-commit hook if you like. - Then, make the pull request. Choose an informative title (have a look at previous PRs if you need inspiration), link all related issues, describe the change, and pick a label (e.g. "documentation", or "enhancement"). The label is important because the release notes group the pull requests by label.
When making a pull request, keep in mind the following (rough) guidelines:
- Most PRs resolve an issue.
- Most PRs contain a single commit. Here is how we can write better commit messages.
- Most enhancements (e.g. new features) are covered by tests.
Here is what GitHub considers important for informative pull requests.
A quick unittest checklist:
Starting with a basic version of an algorithm is fine, but eventually, Matfree aims to provide robust and userfriendly code. This includes testing different variations in the tests. Common considerations include:
- Is the algorithm randomised? Then, we should test different seeds (e.g. 1, 2, 3). See the existing tests for Hessenberg adjoints for inspiration.
- Should the algorithm support real and complex arithmetic? If so, parametrise the tests with corresponding dtypes. Use the existing tests for stochastic trace estimation for inspiration.
- Should the algorithm work for general linear operators, e.g. functions that linearly map dictionaries to dictionaries such as Jacobians of neural networks? If so, cover this case in a test as well. See the tests and code for partial SVDs for inspiration.
If any of the current code does not fulfill these goals, reach out by opening an issue.