| 90 | } |
| 91 | |
| 92 | static std::string ProcessBufferInfoFormat(const std::string &fmt) |
| 93 | { |
| 94 | // pybind11 (as of v2.6.2) doesn't recognize formats 'l' and 'L', |
| 95 | // which according to https://docs.python.org/3/library/struct.html#format-characters |
| 96 | // are equal to 'i' and 'I', respectively. |
| 97 | if (fmt == "l") |
| 98 | { |
| 99 | return "i"; |
| 100 | } |
| 101 | else if (fmt == "L") |
| 102 | { |
| 103 | return "I"; |
| 104 | } |
| 105 | else |
| 106 | { |
| 107 | return fmt; |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | py::dtype ToDType(const py::buffer_info &info) |
| 112 | { |