numpy-ts 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,22 +3,20 @@
3
3
  ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
4
4
  [![npm version](https://img.shields.io/npm/v/numpy-ts)](https://www.npmjs.com/package/numpy-ts)
5
5
  ![bundle size](https://img.shields.io/bundlephobia/minzip/numpy-ts)
6
- ![Under Construction](https://img.shields.io/badge/Under%20Construction-red)
6
+ ![numpy api coverage](https://img.shields.io/badge/numpy_api_coverage-65%20%25-yellow)
7
7
 
8
8
  ```
9
- _
10
- _ __ _ _ _ __ ___ _ __ _ _ ____| |_ ___
11
- | '_ \| | | | '_ ` _ \| '_ \| | | |____| __/ __)
12
- | | | | |_| | | | | | | |_) | |_| | | |_\__ \
13
- |_| |_|\__,_|_| |_| |_| .__/ \__, | \__(___/
14
- |_| (___/
9
+ ███╗ ██╗██╗ ██╗███╗ ███╗██████╗ ██╗ ██╗ ████████╗███████╗
10
+ ████╗ ██║██║ ██║████╗ ████║██╔══██╗╚██╗ ██╔╝ ╚══██╔══╝██╔════╝
11
+ ██╔██╗ ██║██║ ██║██╔████╔██║██████╔╝ ╚████╔╝█████╗██║ ███████╗
12
+ ██║╚██╗██║██║ ██║██║╚██╔╝██║██╔═══╝ ╚██╔╝ ╚════╝██║ ╚════██║
13
+ ██║ ╚████║╚██████╔╝██║ ╚═╝ ██║██║ ██║ ██║ ███████║
14
+ ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚══════╝
15
15
  ```
16
16
 
17
17
  Complete NumPy implementation for TypeScript and JavaScript
18
18
 
19
- > **⚠️ Under active development** — API may change before v1.0
20
-
21
- A faithful NumPy 2.0+ implementation for TypeScript/JavaScript, validated against Python NumPy. **128 of 333 NumPy functions (38.4% complete)** covering array creation, manipulation, linear algebra, reductions, and more.
19
+ **⚠️ Under active development** — API may change before v1.0
22
20
 
23
21
  ```bash
24
22
  npm install numpy-ts
@@ -26,8 +24,8 @@ npm install numpy-ts
26
24
 
27
25
  ## Why numpy-ts?
28
26
 
29
- - **📊 Extensive API** — 120+ NumPy functions with 1365+ tests validated against Python NumPy
30
- - **✅ NumPy-validated** — 1365+ test cases cross-validated against Python NumPy
27
+ - **📊 Extensive API** — **218 of 333 NumPy functions (65.5% coverage)**
28
+ - **✅ NumPy-validated** — 2000+ test cases cross-validated against Python NumPy
31
29
  - **🔒 Type-safe** — Full TypeScript support with shape and dtype inference
32
30
  - **🌐 Universal** — Works in Node.js and browsers with .npy/.npz file support
33
31
  - **🎯 Zero dependencies** — Pure TypeScript, no heavy external libraries
@@ -64,17 +62,17 @@ Progress toward complete NumPy API compatibility:
64
62
 
65
63
  | Category | Complete | Total | Status |
66
64
  |----------|----------|-------|--------|
65
+ | **Arithmetic** | 19/19 | 100% | ✅ |
66
+ | **Array Creation** | 32/32 | 100% | ✅ |
67
+ | **Array Manipulation** | 35/35 | 100% | ✅ |
68
+ | **Bit Operations** | 9/9 | 100% | ✅ |
69
+ | **Broadcasting** | 3/3 | 100% | ✅ |
70
+ | **Comparison** | 10/10 | 100% | ✅ |
67
71
  | **Hyperbolic** | 6/6 | 100% | ✅ |
68
- | **Comparison** | 9/10 | 90% | 🟡 |
69
- | **Trigonometric** | 10/12 | 83% | 🟡 |
70
- | **Arithmetic** | 13/19 | 68% | 🟡 |
71
- | **Broadcasting** | 2/3 | 67% | 🟡 |
72
- | **Linear Algebra** | 6/9 | 67% | 🟡 |
73
- | **Array Creation** | 17/32 | 53% | 🟡 |
74
- | **Array Manipulation** | 18/35 | 51% | 🟡 |
75
- | **Reductions** | 11/30 | 37% | 🔴 |
76
- | **Indexing** | 3/20 | 15% | 🔴 |
77
- | **Bit Operations** | 0/9 | 0% | 🔴 |
72
+ | **Indexing** | 20/20 | 100% | |
73
+ | **Linear Algebra** | 9/9 | 100% | |
74
+ | **Reductions** | 30/30 | 100% | |
75
+ | **Trigonometric** | 12/12 | 100% | |
78
76
  | **Exponential** | 0/9 | 0% | 🔴 |
79
77
  | **FFT** | 0/18 | 0% | 🔴 |
80
78
  | **Gradient** | 0/4 | 0% | 🔴 |
@@ -89,7 +87,7 @@ Progress toward complete NumPy API compatibility:
89
87
  | **Sorting** | 0/6 | 0% | 🔴 |
90
88
  | **Statistics** | 0/9 | 0% | 🔴 |
91
89
 
92
- **Overall: 128/333 functions (38.4% complete)**
90
+ **Overall: 218/333 functions (65.5% complete)**
93
91
 
94
92
  See the complete [API Reference](docs/API-REFERENCE.md) for detailed function list.
95
93
 
@@ -144,20 +142,20 @@ console.log(arr.flags.C_CONTIGUOUS); // true - row-major layout
144
142
  ## Architecture
145
143
 
146
144
  ```
147
- ┌───────────────────────────────────┐
148
- │ NumPy-Compatible API
149
- │ Broadcasting, DType Promotion
150
- └─────────────────┬─────────────────┘
151
-
152
- ┌─────────────────┴─────────────────┐
153
- │ NDArray (Views & Memory Mgmt)
154
- │ Strided Arrays, Base Tracking
155
- └─────────────────┬─────────────────┘
156
- │- - - - - - - - - - - - - - - - - - -
157
- ┌─────────────────┴─────────────────┐ ┌ ─ ─ ─ ─ ─ ─ ─ ┴ ─ ─ ─ ─ ─ ─ ─ ─ ┐
158
- │ TypeScript / JavaScript Core │ │ WASM Compute Engine (Future)
159
- │ Computational Engine │ │ Optimized BLAS / arithmetic
160
- └───────────────────────────────────┘ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘
145
+ ┌─────────────────────────────────┐
146
+ │ NumPy-Compatible API
147
+ │ Broadcasting, DType Promotion
148
+ └───────────────┬─────────────────┘
149
+
150
+ ┌───────────────┴─────────────────┐
151
+ │ NDArray (Views & Memory Mgmt)
152
+ │ Strided Arrays, Base Tracking
153
+ └───────────────┬─────────────────┘
154
+ │- - - - - - - - - - - - - - - - - - ┐
155
+ ┌───────────────┴─────────────────┐ ┌ ─ ─ ─ ─ ─ ─ ─ ┴ ─ ─ ─ ─ ─ ─ ─ ─┐
156
+ │ TypeScript / JavaScript Core │ │ WASM Compute Engine (Future)
157
+ │ Computational Engine │ │ Optimized BLAS / arithmetic
158
+ └─────────────────────────────────┘ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─┘
161
159
  ```
162
160
 
163
161
  Pure TypeScript implementation built from scratch for correctness and NumPy compatibility.
@@ -239,7 +237,7 @@ arr.sum(); // Type: number
239
237
 
240
238
  | Feature | numpy-ts | numjs | ndarray | TensorFlow.js |
241
239
  |---------|----------|-------|---------|---------------|
242
- | NumPy API Coverage | 128/333 (38%) | ~20% | Different | ML-focused |
240
+ | NumPy API Coverage | 218/333 (65%) | ~20% | Different | ML-focused |
243
241
  | TypeScript Native | ✅ Full | Partial | ❌ No | ✅ Yes |
244
242
  | NumPy Validated | ✅ 1365+ tests | Mostly | ❌ No | ❌ No |
245
243
  | .npy/.npz Files | ✅ v1/v2/v3 | ❌ No | ❌ No | ❌ No |