#![cfg_attr(
feature = "nalgebra",
doc = "Integration with [`nalgebra`] is rovided via an implementation of [`ToPyArray`] for [`nalgebra::Matrix`] to convert nalgebra matrices into NumPy arrays
as well as the [`PyReadonlyArray::try_as_matrix`] and [`PyReadwriteArray::try_as_matrix_mut`] methods to treat NumPy array as nalgebra matrix slices.
"
)]
#![cfg_attr(feature = "nalgebra", doc = "```")]
#![cfg_attr(not(feature = "nalgebra"), doc = "```rust,ignore")]
#![deny(missing_docs, missing_debug_implementations)]
#![allow(clippy::needless_lifetimes)]
pub mod array;
pub mod borrow;
pub mod convert;
pub mod datetime;
mod dtype;
mod error;
pub mod npyffi;
mod slice_container;
mod sum_products;
pub use ndarray;
pub use pyo3;
#[cfg(feature = "nalgebra")]
pub use nalgebra;
pub use crate::array::{
get_array_module, PyArray, PyArray0, PyArray1, PyArray2, PyArray3, PyArray4, PyArray5,
PyArray6, PyArrayDyn,
};
pub use crate::borrow::{
PyReadonlyArray, PyReadonlyArray1, PyReadonlyArray2, PyReadonlyArray3, PyReadonlyArray4,
PyReadonlyArray5, PyReadonlyArray6, PyReadonlyArrayDyn, PyReadwriteArray, PyReadwriteArray1,
PyReadwriteArray2, PyReadwriteArray3, PyReadwriteArray4, PyReadwriteArray5, PyReadwriteArray6,
PyReadwriteArrayDyn,
};
pub use crate::convert::{IntoPyArray, NpyIndex, ToNpyDims, ToPyArray};
pub use crate::dtype::{dtype, Complex32, Complex64, Element, PyArrayDescr};
pub use crate::error::{BorrowError, FromVecError, NotContiguousError};
pub use crate::npyffi::{PY_ARRAY_API, PY_UFUNC_API};
pub use crate::sum_products::{dot, einsum, inner};
pub use ndarray::{array, Ix1, Ix2, Ix3, Ix4, Ix5, Ix6, IxDyn};
#[cfg(doctest)]
mod doctest {
macro_rules! doc_comment {
($doc_string:expr, $mod_name:ident) => {
#[doc = $doc_string]
mod $mod_name {}
};
}
doc_comment!(include_str!("../README.md"), readme);
}
mod sealed {
pub trait Sealed {}
}
#[cold]
#[inline(always)]
fn cold() {}
#[macro_export]
macro_rules! pyarray {
($py: ident, $([$([$($x:expr),* $(,)*]),+ $(,)*]),+ $(,)*) => {{
$crate::IntoPyArray::into_pyarray($crate::array![$([$([$($x,)*],)*],)*], $py)
}};
($py: ident, $([$($x:expr),* $(,)*]),+ $(,)*) => {{
$crate::IntoPyArray::into_pyarray($crate::array![$([$($x,)*],)*], $py)
}};
($py: ident, $($x:expr),* $(,)*) => {{
$crate::IntoPyArray::into_pyarray($crate::array![$($x,)*], $py)
}};
}