3 ms·
Looks like _elkai.c implements a CPython-API function "ElkSolve" that parses the Python lists into a C array, calls a pure-C function "InvokeSolver", and puts t
by rav 7y ago
Looks like _elkai.c implements a CPython-API function "ElkSolve" that parses the Python lists into a C array, calls a pure-C function "InvokeSolver", and puts the result of "InvokeSolver" into a Python list.
It should be easy to implement "ElkSolve" in pure Python using ctypes to call a pure-C library that exposes the "InvokeSolver" function. That would make it possible to distribute a single Python wheel that works on both Python 2 and 3 and works across all minor versions of Python 3.
Currently, elkai works on 3.5, 3.6 and 3.7, but the build system requires a separate build artifact on each, and when Python 3.8 comes out, elkai won't be available until the author builds it for 3.8. With a pure-C library, elkai would be immediately available in new Python versions.
- pyentropy 7y agoCorrect, but you will have to find/build the shared library. Also, as soon as the build systems support 3.8, I will add 3.8 wheels. I tried to support all 3.xx platforms that numpy supports: https://pypi.org/project/numpy/#files https://pypi.org/project/numpy/#files
- rav 7y agoI've implemented my suggestion and sent you a pull request: https://github.com/pyEntropy/elkai/pull/3 https://github.com/pyEntropy/elkai/pull/3 The resulting wheel contains the shared library (using milksnake), so there's no need for the user to install that separately. Let me know what you think. If you're unhappy about adding Python 2 support to your library, you can make 'runs' a keyword-only argument to solve_int_matrix ;-)