| 8 | namespace { |
| 9 | |
| 10 | static void check_stream( |
| 11 | const std::istream& f, |
| 12 | const std::string filename, |
| 13 | const std::string action) { |
| 14 | if (!f.good()) { |
| 15 | throw std::runtime_error( |
| 16 | std::string("loadNumpy: error " + action + " file <") + filename + ">"); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | /// structure of the npy file format string (a string-serialized python |
| 21 | /// dictionary), see parseNumpyFormat |