What problem does it solve?
Prevents slow, buggy, or numerically unstable NumPy code by enforcing idiomatic, memory-efficient patterns and robust validation practices.
Core Features & Use Cases
- Zero-copy performance discipline: Prefer views, broadcasting with dimension expansion (np.newaxis/None), and avoid accidental copies from fancy/boolean indexing.
- Type- and shape-safety: Enforce explicit dtypes and shape normalization for reliable downstream model/estimator compatibility.
- Numerical hygiene & testing: Detect NaNs/Infs correctly and validate with numpy.testing tolerances (assert_allclose) rather than fragile equality.
- Performance primitives: Use argpartition for top-k selection, out= reuse patterns, and C-level/GIL-releasing operations (e.g., FFT) to enable safe multithreading.
Quick Start
Use the 326-numpy skill to refactor your NumPy code for vectorization, explicit dtypes, and NaN-safe validation while ensuring top-k selection uses argpartition instead of argsort.