Skip to content

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. If you already have public, (Matfree-compatible) code for the feature you're asking for, please include a link in the issue so we can get an idea how comprehensive a typical implementation is.

Pull requests:

To make a pull request, proceed as follows:

  • Fork the repository.
  • Install all dependencies with pip install .[full] or pip install -e .[full].
  • Make your changes.
  • From the project's root, run the tests via make test. Check out make format-and-lint as 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:

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 user friendly 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.