This commit is contained in:
Francis Williams 2024-09-19 11:52:07 -04:00 committed by GitHub
commit cddec01946
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -760,6 +760,15 @@ public:
}
#endif
/// NumPy array type char
char type() const { return detail::array_descriptor_proxy(m_ptr)->type; }
/// NumPy array type num
int type_num() const { return detail::array_descriptor_proxy(m_ptr)->type_num; }
/// NumPy array element size
int elsize() const { return detail::array_descriptor_proxy(m_ptr)->elsize; }
private:
static object &_dtype_from_pep3118() {
PYBIND11_CONSTINIT static gil_safe_call_once_and_store<object> storage;
@ -965,6 +974,9 @@ public:
/// Return the NumPy array flags
int flags() const { return detail::array_proxy(m_ptr)->flags; }
/// Mutable NumPy array flags
int &flags() { return detail::array_proxy(m_ptr)->flags; }
/// If set, the array is writeable (otherwise the buffer is read-only)
bool writeable() const {
return detail::check_flags(m_ptr, detail::npy_api::NPY_ARRAY_WRITEABLE_);