Developer Notes


Things to check if new functionality added:

  1. Ensure functions are unit tested.

  2. Ensure functions have numpy style docstrings.

  3. Ensure code is PEP8 compliant.

  4. If module, add to docs/api.rst for autosummarizing.

  5. Add to quimb/ and "__all__" if appropriate (or the tensor network equivalent

  6. Add to changelog and elsewhere in docs.

Running the Tests

Testing quimb requires pytest (as well as coverage and pytest-cov) and simply involves running pytest in the root quimb directory.

The tests can also be run with pre-spawned mpi workers using the command quimb-mpi-python -m pytest (but not in syncro mode – see Distributed Parallelism - MPI).

Building the docs locally

Building the docs requires sphinx, pydata-sphinx-theme, and nbsphinx.

  1. To start from scratch, remove quimb/docs/_autosummary and quimb/docs/_build.

  2. Run make html (make.bat html on windows) in the quimb/docs folder.

  3. Launch the page: quimb/docs/_build/html/index.html.

Minting a Release

quimb uses versioneer to manage versions and releases. The steps to release a new version on pypi are as follows:

  1. Make sure all tests are passing, as well as the continuous integration and readthedocs build.

  2. git tag the release with next X.Y.Z (n.b. no ‘v’ prefix).

  3. Remove any old builds: rm dist/*`

  4. Build the tar and wheel python bdist_wheel sdist

  5. Optionally remove the build folder.

  6. Upload using twine: twine upload dist/*