()
| 183 | |
| 184 | #[test] |
| 185 | fn sliced_to_pyarray() { |
| 186 | Python::attach(|py| { |
| 187 | let matrix = Array2::from_shape_vec([4, 2], vec![0, 1, 2, 3, 4, 5, 6, 7]).unwrap(); |
| 188 | let sliced_matrix = matrix.slice(s![1..4; -1, ..]); |
| 189 | |
| 190 | let py_arr = sliced_matrix.to_pyarray(py); |
| 191 | |
| 192 | assert_eq!(py_arr.readonly().as_array(), array![[6, 7], [4, 5], [2, 3]],); |
| 193 | |
| 194 | py_run!(py, py_arr, "assert py_arr.flags['C_CONTIGUOUS']") |
| 195 | }); |
| 196 | } |
| 197 | |
| 198 | #[test] |
| 199 | fn forder_to_pyarray() { |
nothing calls this directly
no test coverage detected