Developer Notes¶
Contributing¶
Things to check if new functionality added:
Ensure functions are unit tested.
Ensure functions have numpy style docstrings.
Ensure code is PEP8 compliant.
Add to
quimb/__init__.py
and"__all__"
if appropriate (or the tensor network equivalentquimb.tensor.__init__.py
).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 MPI).
Building the docs locally¶
Building the docs requires sphinx, myst_nb, sphinx-autoapi, sphinx_copybutton, and furo.
cd
into thequimb/docs
folder.To start from scratch, remove the
_build
folder.Run
sphinx-build -b html . ./_build/html/
.Launch the page:
open _build/html/index.html
.
Building the DocSet¶
Building the DocSet requires doc2dash >= 2.4.1.
To start from scratch, remove
quimb/docs/_build
.Run
make docset
in thequimb/docs
folder.Open the file
quimb/docs/_build/quimb.docset
to load it to Dash.
Afterwards, in order to update the Dash repository with a the DocSet after a new release:
Clone the Dash-User-Contributions.
Go to
docsets/quimb
, create a new directory with the version name inside theversions
dir and copy there the generated DocSet.Edit the
docset.json
: update the"version"
and add a new element below"specific_versions"
.Commit and create a new Pull Request.
Minting a Release¶
quimb
uses setuptools_scm
to manage version. The steps to release a new version
on pypi are as follows:
Make sure all tests are passing, as well as the continuous integration and readthedocs build.
git tag
the release with nextvX.Y.Z
Push the tag to github:
git push --tags
and github actions will build and upload the release to pypi, which will then get picked up by conda-forge.
Alternate manual release steps (after tagging):
Remove any old builds:
rm dist/*`
Build the tar and wheel
python -m build
Upload using twine:
twine upload dist/*