MCPcopy Create free account
hub / github.com/YuminosukeSato/ironkernel / asarray_roundtrip

Function asarray_roundtrip

src/python/py_runtime.rs:395–404  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

393
394 #[test]
395 fn asarray_roundtrip() {
396 pyo3::prepare_freethreaded_python();
397 Python::with_gil(|py| {
398 use numpy::PyArrayMethods;
399 let runtime = PyRuntimeModule::new();
400 let np_array = numpy::PyArray1::from_vec(py, vec![1.0, 2.0, 3.0]);
401 let buf = runtime.asarray(np_array.readonly());
402 assert_eq!(buf.inner.as_f64_slice(), &[1.0, 2.0, 3.0]);
403 });
404 }
405
406 #[test]
407 fn try_convert_to_buffer_accepts_buffer_scalar_list_and_numpy_why_callable_out_channel_must_cover_supported_shapes(

Callers

nothing calls this directly

Calls 1

asarrayMethod · 0.45

Tested by

no test coverage detected