We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 39f5a77 commit 363f229Copy full SHA for 363f229
core/src/G3Vector.cxx
@@ -80,6 +80,9 @@ auto vector_from_python(const py::array_t<T> &buf) {
80
if (buf.ndim() != 1)
81
throw py::type_error("Only valid 1D buffers can be copied to a vector");
82
83
+ if (buf.strides(0) == sizeof(T))
84
+ return std::make_shared<V>(buf.data(), buf.data() + buf.size());
85
+
86
auto rbuf = buf.template unchecked<1>();
87
auto vec = std::make_shared<V>(rbuf.shape(0));
88
0 commit comments