npy-rs
npy-rs copied to clipboard
Nested arrays have backwards shapes in `dtype`
use npy::NpyData;
use npy::Serializable;
#[derive(npy_derive::Serializable)]
#[derive(Debug, PartialEq)]
struct Array23 {
field: [[i32; 3]; 2],
}
fn main() {
println!("{}", <Array23 as Serializable>::dtype().descr());
}
[('field', '<i4', (3,2,)), ]
Observe that the outer dimension of 2 comes last in the output.
(Thankfully, saving a file still writes the correct number of total elements... it's just that, if you read the file in numpy, it'll turn into a 3x2 array)
A fix for this will be included in #15 since it completely replaces the Serializable trait.