Closed PerretB closed 3 years ago
It seems that the CI configurations are outdated:
I'm making a pass on the whole stack to fix all the CI issues (among them, migrating from travis to Azure), it takes time but eventually we'll get there.
The tests validating the correctness of the memory management (keep alive policies) are perhaps not very interesting for regression detection has they focus on pybind11 mechanism rather than xtensor_python and could probably be removed.
I think we should keep them, this would help detecting any change or regression in pybind11. Even if pybind11 is well tested, having tests specific to our use case is a good thing.
This PR partly solves #130 by adding pybind11 type casters for
strided_views
andarray/tensor_adapters
.As for
xarrays
andxtensors
, those objects are casted tondarray
and do not use any proxy object (such aspyarray
orpytensor
): I did a bit of refactoring to put all those casters in a dedicated file.Memory management becomes of course trickier with such objects. I have the impression that what is done in
xtensor_type_caster_base
to handle return value policies is generic enough to fit these cases but I am not totally sure. I tried to demonstrate critical cases in the test file (cpp main). The tests validating the correctness of the memory management (keep alive policies) are perhaps not very interesting for regression detection has they focus on pybind11 mechanism rather than xtensor_python and could probably be removed.