Welcome to arrayops Documentationο
Rust-backed acceleration for Pythonβs ``array.array`` type
Fast, lightweight numeric operations for Pythonβs array.array, numpy.ndarray (1D), and memoryview objects. Built with Rust and PyO3 for zero-copy, memory-safe performance.
Getting Started
Developer Guide
- Contributing Guide
- Development Guide
- Design Document
- 1. Purpose & Goals
- 2. Target Users
- 3. High-Level Architecture
- 4. Public Python API
- 5. Rust Implementation Strategy
- 6. Python Callable Handling
- 7. Safety Guarantees
- 8. Performance Characteristics
- 9. Error Handling
- 10. Packaging & Distribution
- 11. Testing Strategy
- 12. Documentation Plan
- 13. Future Extensions
- 14. Risks & Mitigations
- 15. Summary
- Code Coverage Guide
Reference
Key Featuresο
β‘ High Performance: 10-100x faster than pure Python loops
π Memory Safe: Zero-copy buffer access with Rustβs safety guarantees
π¦ Lightweight: No dependencies beyond Rust standard library (optional: parallel execution via
rayon)π Compatible: Works directly with Pythonβs
array.array,numpy.ndarray(1D), andmemoryview- no new typesβ Fully Tested: 100% code coverage (Python and Rust)
π― Type Safe: Full mypy type checking support
π Optional Optimizations: Parallel execution and SIMD support via feature flags
Quick Startο
import array
import arrayops
# Create an array
data = array.array('i', [1, 2, 3, 4, 5])
# Fast sum operation
total = ao.sum(data)
print(total) # 15
# In-place scaling
ao.scale(data, 2.0)
print(list(data)) # [2, 4, 6, 8, 10]
# Map operation (returns new array)
doubled = ao.map(data, lambda x: x * 2)
print(list(doubled)) # [4, 8, 12, 16, 20]
Installationο
# Install maturin if not already installed
pip install maturin
# Install in development mode
maturin develop
# Or install from source
pip install -e .
# With optional features
maturin develop --features parallel
Documentation Overviewο
- Getting Started
New to arrayops? Start here to learn the basics.
- User Guide
Comprehensive guides for using arrayops, including API reference, examples, performance tips, and troubleshooting.
- Developer Guide
Information for contributors, including development setup, architecture details, and contribution guidelines.
- Reference
Reference materials including changelog and roadmap.