python-javabridge icon indicating copy to clipboard operation
python-javabridge copied to clipboard

depend on small extracted subset of numpy

Open rrva opened this issue 10 years ago • 2 comments

The dependency on numpy is unfortunate since it takes quite some time to compile numpy (can be mitigated by whl files) but still..

Proposing to extract the actual needs from numpy into a separate lib and to make both numpy and javabridge depend on that.

rrva avatar Oct 16 '15 15:10 rrva

Or, if extracting what is needed from numpy is not feasible, consider duplicating that code inside javabridge (if it reduces install time for javabridge)

rrva avatar Oct 16 '15 15:10 rrva

I think that the best we could do would be to make numpy an optional dependency. Numpy lets us efficiently process large arrays of numeric data from Java (which just happens to be the use case for which it was designed), so one approach would be to have methods for populating or reading arrays using Python primitives (bool, int and float) and a second set that used numpy, conditionally included if numpy was available.

An alternative would be to drop support for array interoperability if numpy isn't available.

We use the numpy array type - it would be difficult to extract or patch around only that functionality from numpy.

Not work I can justify doing myself, but would consider a pull request.

LeeKamentsky avatar Oct 27 '15 17:10 LeeKamentsky