()
| 167 | |
| 168 | #[test] |
| 169 | fn collapsed_into_pyarray() { |
| 170 | // Check that `into_pyarray` works for array with the pointer of the first element is |
| 171 | // not at the start of the allocation. |
| 172 | // See https://github.com/PyO3/rust-numpy/issues/182 for more. |
| 173 | Python::attach(|py| { |
| 174 | let mut arr = Array2::<f64>::from_shape_fn([3, 4], |(i, j)| (i * 10 + j) as f64); |
| 175 | arr.slice_collapse(s![1.., ..]); |
| 176 | let cloned_arr = arr.clone(); |
| 177 | |
| 178 | let py_arr = arr.into_pyarray(py); |
| 179 | |
| 180 | assert_eq!(py_arr.readonly().as_array(), cloned_arr); |
| 181 | }); |
| 182 | } |
| 183 | |
| 184 | #[test] |
| 185 | fn sliced_to_pyarray() { |
nothing calls this directly
no test coverage detected