()
| 214 | |
| 215 | #[test] |
| 216 | fn forder_into_pyarray() { |
| 217 | Python::attach(|py| { |
| 218 | let matrix = Array2::from_shape_vec([4, 2], vec![0, 1, 2, 3, 4, 5, 6, 7]).unwrap(); |
| 219 | let forder_matrix = matrix.reversed_axes(); |
| 220 | |
| 221 | let py_arr = forder_matrix.into_pyarray(py); |
| 222 | |
| 223 | assert_eq!( |
| 224 | py_arr.readonly().as_array(), |
| 225 | array![[0, 2, 4, 6], [1, 3, 5, 7]], |
| 226 | ); |
| 227 | |
| 228 | py_run!(py, py_arr, "assert py_arr.flags['F_CONTIGUOUS']") |
| 229 | }); |
| 230 | } |
| 231 | |
| 232 | #[test] |
| 233 | fn to_pyarray_object_vec() { |
nothing calls this directly
no test coverage detected