-
Notifications
You must be signed in to change notification settings - Fork 1
Package has a dependency on pkgconfig
but it isn't in the setup.py
#24
Comments
Thanks ! I will do it soon, but if you have the time a PR would also be very great. Not that I recently ported the capabilities of this library also to https://github.com/xtensor-stack/xtensor-python that now has a wide array of capabilities to wrap you library (templated library allowing in-place use of NumPy arrays, or non-templated library with minimal wrapping code (but a copy)) |
I'll try and submit a PR soon. I've decided just to copy in the headers for now, as it simplifies my build. As for I'm sure I'm missing some reasons, but for now I like the simple approach in your library. |
So the idea behind Instead, in this library, when a function That is the reason why Indeed, writing a library with templates allowing I hope I was clear ;) |
Thanks for taking the time to explain. I understand the difference between the two libraries, and I can see the advantages of As I understand it, there are two problems with trying to wrap xtensor. The first is: How can we share an array across the C++ / python boundary without copying? The mechanism for doing this is to use the buffer interface provided by python. I know that this is possible without having a specialised C++ class, as I have wrapped boost's multiarray using cython (before I discovered pybind11), and the link I included above shows how this is possible with xtensor as well. The second problem is how do we decide who maintains ownership of the shared memory? This is a hard one, and I'm less sure about it. It will depend on the details (who created the array, for example), but I think some settings in numpy and the buffer interface together with the ownership policies provided by pybind11 can be used to solve the problem. It's also entirely possible that I've missed something important, or misunderstood the constraints! In any case, for now I'm happy to use your much smaller / simpler package, as the memory copying is not a problem for my current requirements (Thanks!). I've actually decided to vendor it in (copy the headers), rather than use |
You are welcome!
So I agree that introducing template <class T>
void foo(T& a); you can use it with In you Python API you can just do e.g.
I'm not entirely sure in this case. I think that
Not sure it this is ever a problem. If you pass the reference you are responsible for keeping it alive, that is also true in pure C++. This is not different for the Python API, and I think not hard to achieve (you simple don't change the reference count). Probably this is all arranged in xtensor-python / pybind11
Agreed, that's why I created it, and have been using it often. I only recently switched to xtensor-python as I have more serious use-cases for the Python API |
Hi -- thanks for writing this. I just tried installing it, but needed to install another package to get it to run:
pkgconfig
. (an easy fix, but thought you might like to know)The text was updated successfully, but these errors were encountered: