Developer Notes
Contents
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.
If module, add to
docs/api.rst
for autosummarizing.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 Distributed Parallelism - MPI).
Building the docs locally#
Building the docs requires sphinx, sphinx-book-theme, and nbsphinx.
To start from scratch, remove
quimb/docs/_autosummary
andquimb/docs/_build
.Run
make html
(make.bat html
on windows) in thequimb/docs
folder.Launch the page:
quimb/docs/_build/html/index.html
.
Building the DocSet#
Building the DocSet requires doc2dash >= 2.4.1.
To start from scratch, remove
quimb/docs/_autosummary
andquimb/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 the versions 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 versioneer
to manage versions and releases. 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 nextX.Y.Z
(n.b. no ‘v’ prefix).Remove any old builds:
rm dist/*`
Build the tar and wheel
python setup.py bdist_wheel sdist
Optionally remove the
build
folder.Upload using twine:
twine upload dist/*