Package: banded-matrices
Banded MatricesOverviewA library providing C++ linear algebra operators (matmul, solve, ...) dedicated to banded matrices and aTensorFlowinterface.
This extends the set of existing TensorFlow operators which as of August 2021 only includebanded_triangular_solve.Details on the implemented operators may be found in Durrande et al.:
"Banded Matrix Operators for Gaussian Markov Models in the Automatic Differentiation Era", and in Adam et al.: "Doubly Sparse Variational Gaussian Processes"InstallationFor usersTo install the latest (stable) release of the toolbox fromPyPI, usepip:$pipinstallbanded_matricesFor contributorsThis project usesPoetryto
manage dependencies in a local virtual environment. To install Poetry,follow the
instructions in the Poetry documentation.To install this project in editable mode, run the commands below from the root directory of thebanded_matricesrepository.poetryinstallThis command creates a virtual environment for this project
in a hidden.venvdirectory under the root directory.You must also run thepoetry installcommand to install updated dependencies when
thepyproject.tomlfile is updated, for example after agit pull.NOTE:Unlike most other Python packages, by installing thebanded_matricespackage
from source you will trigger a compilation of the C++ TensorFlow ops library. This means that
runningpoetry installcan take a while - in the order of 5 minutes, depending on the machine
you are installing onto.Known issuesPoetry versions above1.0.9don't get along (for now) with Ubuntu 18.04, if you have this OS,
you will likely need to install version1.0.9. This can be done with the following commandwgethttps://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.pyPOETRY_VERSION=1.0.9pythonget-poetry.pyRecommended Poetry installation might pick up Python 2 if it is used by the operating system,
this will cause problems with looking up libraries and sorting out dependencies if your
library uses Python 3. If this happens, poetry has a command you can use to instruct it to use
a correct Python version (here assuming you want to use python3.7 and have it installed on your
system - note thatpython3.7-venvpackage will need to be installed as well).poetryenvusepython3.7&&poetryinstallThepoetry installcommand might fail to install certain Python packages
(those that use the 'manylinux2010' platform tag), if the version ofpipinstalled when creating the Poetry virtual environment is too old.
Unfortunately the version ofpipused when creating the virtual environment is vendored with each
Python version, and it is not possible to update this.The solution is to update the version ofpipin the Poetry virtual environment after the initial
install fails, and then reattempt the installation. To do this, use the command:poetryinstall||{poetryrunpipinstall-Upip==20.0.2&&poetryinstall;}Running the testsRun these commands from the root directory of this repository.
To run the full Python test suite, including pylint and Mypy, run:poetryruntasktestAlternatively, you can run just the unit tests, starting with the failing tests and exiting after
the first test failure:poetryruntaskquicktestTo run linting of the C++ code (using cpplint), run:poetryruntaskcpplintNOTE:Running the tests requires
that the project virtual environment has been updated. SeeInstallation.The Secondmind Labs CommunityGetting helpBugs, feature requests, pain points, annoying design quirks, etc:Please useGitHub issuesto flag up bugs/issues/pain points, suggest new features, and discuss anything else related to the use of banded_matrices that in some sense involves changing the banded_matrices code itself. We positively welcome comments or concerns about usability, and suggestions for changes at any level of design. We aim to respond to issues promptly, but if you believe we may have forgotten about an issue, please feel free to add another comment to remind us.Slack workspaceWe have a publicSecondmind Labs slack workspace. Please use thisinvite linkand join the #banded_matrices channel, whether you'd just like to ask short informal questions or want to be involved in the discussion and future development of banded_matrices.ContributingAll constructive input is very much welcome. For detailed information, see theguidelines for contributors.MaintainersBanded_matrices was originally created atSecondmind Labsand is now maintained by (in alphabetical order)Vincent Adam,Artem Artemev.We are grateful toall contributorswho have helped shape banded_matrices.Banded_matrices is an open source project. If you have relevant skills and are interested in contributing then please do contact us (see"The Secondmind Labs Community" sectionabove).We are very grateful to our Secondmind Labs colleagues, maintainers ofGPflow,GPflux,TriesteandBellman, for their help with creating contributing guidelines, instructions for users and open-sourcing in general.