MCPcopy Create free account
hub / github.com/PyO3/rust-numpy / forder_into_pyarray

Function forder_into_pyarray

tests/to_py.rs:216–230  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

214
215#[test]
216fn 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]
233fn to_pyarray_object_vec() {

Callers

nothing calls this directly

Calls 1

into_pyarrayMethod · 0.80

Tested by

no test coverage detected