#![forbid(unsafe_code)]
#![allow(clippy::missing_errors_doc, clippy::missing_panics_doc)]
pub mod config;
pub mod prelude;
pub use ferray_core::ArcArray;
pub use ferray_core::Array;
pub use ferray_core::ArrayFlags;
pub use ferray_core::ArrayView;
pub use ferray_core::ArrayViewMut;
pub use ferray_core::AsRawBuffer;
pub use ferray_core::CowArray;
pub use ferray_core::DynArray;
pub use ferray_core::FerrayRecord;
pub use ferray_core::FieldDescriptor;
pub use ferray_core::dimension::{self, Axis, Dimension, Ix0, Ix1, Ix2, Ix3, Ix4, Ix5, Ix6, IxDyn};
pub use ferray_core::dtype::casting;
pub use ferray_core::dtype::finfo;
pub use ferray_core::dtype::promotion;
pub use ferray_core::{DType, Element, SliceInfoElem};
pub use ferray_core::{FerrayError, FerrayResult};
pub use ferray_core::MemoryLayout;
pub use ferray_core::{promoted_type, s};
pub use num_complex::Complex;
pub use ferray_core::aliases;
pub use ferray_core::array::display::{get_print_options, set_print_options};
pub use ferray_core::constants::{E, EULER_GAMMA, INF, NAN, NEG_INF, NEWAXIS, NZERO, PI, PZERO};
pub use ferray_core::creation::{
arange, array, asarray, diag, diagflat, empty, empty_like, eye, frombuffer, frombuffer_view,
fromiter, full, full_like, geomspace, identity, linspace, logspace, meshgrid, mgrid, ogrid,
ones, ones_like, tri, tril, triu, zeros, zeros_like,
};
pub use ferray_core::manipulation::{
array_split, block, broadcast_to, concatenate, dsplit, dstack, expand_dims, flatten, flip,
fliplr, flipud, hsplit, hstack, moveaxis, ravel, reshape, roll, rollaxis, rot90, split,
squeeze, stack, swapaxes, transpose, vsplit, vstack,
};
pub use ferray_core::manipulation::extended::{
append, delete, insert, pad, repeat, resize, tile, trim_zeros,
};
pub use ferray_core::ops::{copyto, copyto_where};
pub use ferray_core::indexing::extended::{
argwhere, choose, compress, diag_indices, diag_indices_from, flatnonzero, indices, ix_,
ndenumerate, ndindex, nonzero, ravel_multi_index, select, take, take_along_axis, tril_indices,
tril_indices_from, triu_indices, triu_indices_from, unravel_index,
};
pub use ferray_ufunc::{
arccos, arccosh, arcsin, arcsinh, arctan, arctan2, arctanh, cos, cosh, deg2rad, degrees, hypot,
rad2deg, radians, sin, sinh, tan, tanh, unwrap,
};
pub use ferray_ufunc::{
exp, exp_fast, exp2, expm1, log, log1p, log2, log10, logaddexp, logaddexp2,
};
pub use ferray_ufunc::{around, ceil, fix, floor, rint, round, trunc};
pub use ferray_ufunc::{
absolute, add, add_accumulate, add_broadcast, add_reduce, add_reduce_all, add_reduce_axes,
add_reduce_keepdims, cbrt, cross, cumprod, cumsum, diff, divide, divide_broadcast, divmod,
ediff1d, fabs, floor_divide, fmod, gcd, gradient, heaviside, lcm, mod_, multiply,
multiply_broadcast, multiply_outer, nan_add_reduce, nan_add_reduce_all, nan_add_reduce_axes,
nan_max_reduce, nan_max_reduce_all, nan_max_reduce_axes, nan_min_reduce, nan_min_reduce_all,
nan_min_reduce_axes, nan_multiply_reduce, nan_multiply_reduce_all, nan_multiply_reduce_axes,
nancumprod, nancumsum, negative, positive, power, reciprocal, remainder, sign, sqrt, square,
subtract, subtract_broadcast, trapezoid, true_divide,
};
pub use ferray_ufunc::{
clip, copysign, float_power, fmax, fmin, frexp, isfinite, isinf, isnan, isneginf, isposinf,
ldexp, maximum, minimum, nan_to_num, nextafter, signbit, spacing,
};
pub use ferray_ufunc::{abs, angle, conj, conjugate, imag, real};
pub use ferray_ufunc::{
BitwiseCount, BitwiseOps, ShiftOps, bitwise_and, bitwise_count, bitwise_not, bitwise_or,
bitwise_xor, invert, left_shift, right_shift,
};
pub use ferray_ufunc::Logical;
pub use ferray_ufunc::{
allclose, array_equal, array_equiv, equal, equal_broadcast, greater, greater_broadcast,
greater_equal, greater_equal_broadcast, isclose, isclose_broadcast, less, less_broadcast,
less_equal, less_equal_broadcast, not_equal, not_equal_broadcast,
};
pub use ferray_ufunc::{
all, all_axis, any, any_axis, logical_and, logical_not, logical_or, logical_xor,
};
pub use ferray_ufunc::{i0, sinc};
pub use ferray_ufunc::{ConvolveMode, convolve, interp, interp_one};
pub use ferray_ufunc::{
array_add, array_bitand, array_bitnot, array_bitor, array_bitxor, array_div, array_mul,
array_neg, array_rem, array_shl, array_shr, array_sub,
};
pub use ferray_stats::{
argmax, argmin, max, max_into, max_with, mean, mean_into, mean_where, min, min_into, min_with,
prod, prod_into, prod_with, std_, std_into, sum, sum_into, sum_with, var, var_into,
};
pub use ferray_stats::{
QuantileMethod, median, percentile, percentile_with_method, quantile, quantile_with_method,
};
pub use ferray_stats::{
nanmax, nanmean, nanmedian, nanmin, nanpercentile, nanprod, nanstd, nansum, nanvar,
};
pub use ferray_stats::{CorrelateMode, corrcoef, correlate, cov};
pub use ferray_stats::{
Bins, bincount, bincount_u64, bincount_weighted, digitize, histogram, histogram2d, histogramdd,
};
pub use ferray_stats::{
Side, SortKind, argsort, lexsort, searchsorted, searchsorted_with_sorter, sort,
};
pub use ferray_stats::{UniqueResult, count_nonzero, unique, where_};
pub use ferray_stats::{in1d, intersect1d, isin, setdiff1d, setxor1d, union1d};
#[cfg(feature = "io")]
pub use ferray_io as io;
#[cfg(feature = "linalg")]
pub use ferray_linalg as linalg;
#[cfg(feature = "fft")]
pub use ferray_fft as fft;
#[cfg(feature = "random")]
pub use ferray_random as random;
#[cfg(feature = "polynomial")]
pub use ferray_polynomial as polynomial;
#[cfg(feature = "window")]
pub use ferray_window as window;
#[cfg(feature = "strings")]
pub use ferray_strings as strings;
#[cfg(feature = "ma")]
pub use ferray_ma as ma;
#[cfg(feature = "stride-tricks")]
pub use ferray_stride_tricks as stride_tricks;
#[cfg(feature = "autodiff")]
pub use ferray_autodiff as autodiff;
#[cfg(feature = "numpy")]
pub use ferray_numpy_interop as numpy_interop;
pub use config::{set_num_threads, with_num_threads};
pub mod threshold {
pub use crate::config::{
PARALLEL_THRESHOLD_COMPUTE, PARALLEL_THRESHOLD_ELEMENTWISE, PARALLEL_THRESHOLD_REDUCTION,
PARALLEL_THRESHOLD_SORT,
};
}
#[cfg(test)]
#[allow(clippy::float_cmp)] mod tests {
use super::*;
#[test]
fn constants_accessible_ac7() {
assert_eq!(PI, std::f64::consts::PI);
assert_eq!(E, std::f64::consts::E);
assert_eq!(INF, f64::INFINITY);
assert_eq!(NEG_INF, f64::NEG_INFINITY);
assert!(NAN.is_nan());
}
#[test]
fn prelude_compiles_ac1() {
use crate::prelude::*;
let arr = zeros::<f64, Ix2>(Ix2::new([2, 3])).unwrap();
assert_eq!(arr.shape(), &[2, 3]);
let _: &[usize] = arr.shape();
}
#[test]
fn creation_at_toplevel() {
let a = zeros::<f64, Ix1>(Ix1::new([5])).unwrap();
assert_eq!(a.size(), 5);
let b = ones::<f64, Ix1>(Ix1::new([3])).unwrap();
assert_eq!(b.size(), 3);
let c = arange(0i32, 10, 2).unwrap();
assert_eq!(c.size(), 5);
}
#[test]
fn ufuncs_at_toplevel() {
let a = ones::<f64, Ix1>(Ix1::new([4])).unwrap();
let s = sin(&a).unwrap();
assert_eq!(s.shape(), &[4]);
}
#[test]
#[allow(clippy::assertions_on_constants)]
fn threshold_constants_accessible() {
assert!(threshold::PARALLEL_THRESHOLD_ELEMENTWISE > 0);
assert!(threshold::PARALLEL_THRESHOLD_COMPUTE > 0);
}
}