boostorg / boostorg/python

Add method to numpy::dtype to set byteorder

Đang mở
#230 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
537
Fork
223
Merge trung bình
11 giờ 22 phút
Pull request đã merge (30 ngày)
2

Mô tả

I've taken a look at `numpy/dtype.hpp`, and there does not appear to be any way to set the byte order of the array being constructed. The workaround I am currently using (which requires adding the numpy C API to my build and including the headers in my source) is the following:

```
np::dtype scalarDtype = np::dtype::get_builtin();
reinterpret_cast(scalarDtype.ptr())->byteorder = '>';
```

So it should be as simple as adding a method to dtype to allow the user to set the byteorder on the underlying numpy struct.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.