Expand description
Type conversion utilities for Python integration
This module provides comprehensive conversion utilities between Python types and scirs2-core types, with a focus on performance and correctness.
Structs§
- Memory
Layout Info - Information about NumPy array memory layout
Functions§
- get_
memory_ layout_ info - Get detailed memory layout information from NumPy array
- numpy_
to_ scirs_ array1 - Convert NumPy array to scirs2 Array1
- numpy_
to_ scirs_ array2 - Convert NumPy array to scirs2 Array2
- py_
float_ to_ f32 - Convert Python float to Rust f32
- py_
float_ to_ f64 - Convert Python float to Rust f64
- py_
int_ to_ i32 - Convert Python int to Rust i32
- py_
int_ to_ i64 - Convert Python int to Rust i64
- py_
list_ to_ vec_ f32 - Convert Python list to Rust
Vec<f32> - py_
list_ to_ vec_ i32 - Convert Python list to Rust
Vec<i32> - py_
list_ to_ vec_ usize - Convert Python list to Rust
Vec<usize> - py_
shape_ to_ vec - Convert Python shape tuple to Rust
Vec<usize> - rust_
dtype_ to_ numpy_ str - Get NumPy dtype string for a Rust type
- scirs_
array1_ to_ numpy - Convert scirs2 Array1 to NumPy
- scirs_
array2_ to_ numpy - Convert scirs2 Array2 to NumPy
- shape_
to_ py_ tuple - Convert Rust shape Vec to Python tuple
- validate_
numpy_ array - Validate NumPy array meets scirs2 requirements