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

Function forder_to_pyarray

tests/to_py.rs:199–213  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

197
198#[test]
199fn 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]
216fn forder_into_pyarray() {

Callers

nothing calls this directly

Calls 1

to_pyarrayMethod · 0.80

Tested by

no test coverage detected