MCPcopy Create free account
hub / github.com/bab2min/tomotopy / getArrayNdim

Function getArrayNdim

src/python/handler/PyUtils.h:1346–1353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1344 }
1345
1346 inline size_t getArrayNdim(PyObject* obj)
1347 {
1348 UniqueObj attr{ PyObject_GetAttrString(obj, "ndim") };
1349 if (!attr) throw ExcPropagation{};
1350 size_t v = (size_t)PyLong_AsSize_t(attr.get());
1351 if (v == (size_t)-1 && PyErr_Occurred()) throw ExcPropagation{};
1352 return v;
1353 }
1354
1355 template<typename _Ty, typename _Alloc>
1356 struct ValueBuilder<std::vector<_Ty, _Alloc>,

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected