opt_einsum
opt_einsum copied to clipboard
Support for Python array API standard
Description
This PR adds support for libraries that conform to the Python array API standard. It discovers complying modules upon import of opt_einsum.
Eventually (and hopefully soon), once the array API standard becomes ubiquitous, this should largely eliminate the need for backend-specific code.
Note that to test this you'll need a version of an array library which implements the API. Right now AFAIK closest thing to this is latest (dev) Numpy which you can install using
pip install --upgrade git+https://github.com/numpy/numpy
Todos
- [x] Tests
- [x] Update docs
Status
- [x] Ready to go
Codecov Report
Merging #197 (13ec280) into master (3824e4f) will decrease coverage by
0.03%
. The diff coverage is94.59%
.
Looks like plenty of errors for Py3.6 where importlib.metadata
is not yet extant.
Thanks Daniel! The errors for Python <= 3.7 should be fixed. I've set it to bypass array API backend discovery altogether in such cases. Numpy doesn't support <= 3.7 as-is, so I don't think this will be missed.
I've fixed up the formatting too.
@IsaacBreen I'm looking to push out another release in the next month or so. Is this a PR which you would like to support?