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

Function to_pyarray_vec

tests/to_py.rs:13–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12#[test]
13fn to_pyarray_vec() {
14 Python::attach(|py| {
15 #[allow(clippy::useless_vec)]
16 let arr = vec![1, 2, 3].to_pyarray(py);
17
18 assert_eq!(arr.shape(), [3]);
19 assert_eq!(arr.readonly().as_slice().unwrap(), &[1, 2, 3])
20 });
21}
22
23#[test]
24fn to_pyarray_boxed_slice() {

Callers

nothing calls this directly

Calls 1

to_pyarrayMethod · 0.80

Tested by

no test coverage detected