326-numpy
CommunityWrite fast, correct NumPy with guardrails.
Software Engineering#broadcasting#vectorization#numpy#dtype-safety#numerical-hygiene#top-k-argpartition#parallel-fft
Authorulf1
Version1.0.0
Installs0
System Documentation
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.
Dependency Matrix
Required Modules
None requiredComponents
assets
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: 326-numpy Download link: https://github.com/ulf1/trading-regime/archive/main.zip#326-numpy Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.