()
| 14 | |
| 15 | #[test] |
| 16 | fn extract_reference() { |
| 17 | Python::attach(|py| { |
| 18 | let locals = get_np_locals(py); |
| 19 | let py_array = py |
| 20 | .eval( |
| 21 | c_str!("np.array([[1,2],[3,4]], dtype='float64')"), |
| 22 | Some(&locals), |
| 23 | None, |
| 24 | ) |
| 25 | .unwrap(); |
| 26 | let extracted_array = py_array.extract::<PyArrayLike2<'_, f64>>().unwrap(); |
| 27 | |
| 28 | assert_eq!( |
| 29 | array![[1_f64, 2_f64], [3_f64, 4_f64]], |
| 30 | extracted_array.as_array() |
| 31 | ); |
| 32 | }); |
| 33 | } |
| 34 | |
| 35 | #[test] |
| 36 | fn convert_array_on_extract() { |
nothing calls this directly
no test coverage detected