MCPcopy Create free account
hub / github.com/pybind/pybind11 / auxiliaries

Function auxiliaries

tests/test_numpy_array.cpp:143–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141
142template <typename T, typename T2>
143py::handle auxiliaries(T &&r, T2 &&r2) {
144 if (r.ndim() != 2) {
145 throw std::domain_error("error: ndim != 2");
146 }
147 py::list l;
148 l.append(*r.data(0, 0));
149 l.append(*r2.mutable_data(0, 0));
150 l.append(r.data(0, 1) == r2.mutable_data(0, 1));
151 l.append(r.ndim());
152 l.append(r.itemsize());
153 l.append(r.shape(0));
154 l.append(r.shape(1));
155 l.append(r.size());
156 l.append(r.nbytes());
157 return l.release();
158}
159
160template <typename PyObjectType>
161PyObjectType convert_to_pyobjecttype(py::object obj);

Callers 1

TEST_SUBMODULEFunction · 0.85

Calls 9

releaseMethod · 0.80
ndimMethod · 0.45
appendMethod · 0.45
dataMethod · 0.45
mutable_dataMethod · 0.45
itemsizeMethod · 0.45
shapeMethod · 0.45
sizeMethod · 0.45
nbytesMethod · 0.45

Tested by

no test coverage detected