scirs2_core/python/mod.rs
1//! Python integration module for scirs2-core
2//!
3//! This module provides PyO3 bindings and NumPy compatibility layers for scirs2-core,
4//! enabling seamless integration with Python scientific computing ecosystem.
5//!
6//! # Features
7//!
8//! - NumPy array compatibility
9//! - Zero-copy conversions where possible
10//! - Type-safe Python bindings
11//! - Automatic trait implementations for numpy::Dimension
12//!
13//! # Usage
14//!
15//! Enable the `python` feature in your Cargo.toml:
16//!
17//! ```toml
18//! scirs2-core = { version = "0.1", features = ["python"] }
19//! ```
20//!
21//! # Architecture
22//!
23//! This module bridges the gap between scirs2-core's ndarray types and Python's NumPy arrays.
24//! It provides:
25//!
26//! 1. **NumPy Compatibility** - Trait implementations that make scirs2_core::ndarray types
27//! compatible with the PyO3 `numpy` crate
28//! 2. **Conversion Utilities** - Helper functions for converting between Rust and Python types
29//! 3. **Array Protocol** - Support for Python's array protocol for third-party integrations
30
31pub mod conversions;
32pub mod numpy_compat;
33
34#[cfg(feature = "python")]
35pub use conversions::*;
36#[cfg(feature = "python")]
37pub use numpy_compat::*;