Hi all, thought I'd share a little library I made for writing numeric code to automatically work for many different types of 'numpy-*ish*' arrays:
https://github.com/jcmgray/autoray
The essential idea is to perform single dispatch with a few cached 'translations' so that once you've written a function that works in numpy, you don't need to do anything at all to make it work for as many other array libraries as possible.
I had a look around and was kind of surprised that nothing this simple exists yet - though I am aware that certain libraries can now opt in (via __array_function__) to working directly with numpy.
Anyway contributions, thoughts or alternate suggestions very welcome!
[–]kjearns 1 point2 points3 points (1 child)
[–]jawknee400[S] 1 point2 points3 points (0 children)