()
| 197 | |
| 198 | #[test] |
| 199 | fn forder_to_pyarray() { |
| 200 | Python::attach(|py| { |
| 201 | let matrix = Array2::from_shape_vec([4, 2], vec![0, 1, 2, 3, 4, 5, 6, 7]).unwrap(); |
| 202 | let forder_matrix = matrix.reversed_axes(); |
| 203 | |
| 204 | let py_arr = forder_matrix.to_pyarray(py); |
| 205 | |
| 206 | assert_eq!( |
| 207 | py_arr.readonly().as_array(), |
| 208 | array![[0, 2, 4, 6], [1, 3, 5, 7]], |
| 209 | ); |
| 210 | |
| 211 | py_run!(py, py_arr, "assert py_arr.flags['F_CONTIGUOUS']") |
| 212 | }); |
| 213 | } |
| 214 | |
| 215 | #[test] |
| 216 | fn forder_into_pyarray() { |
nothing calls this directly
no test coverage detected