numpy-ts 0.8.0 → 0.10.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,7 +3,7 @@
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
- ![numpy api coverage](https://img.shields.io/badge/numpy_api_coverage-71%20%25-yellow)
6
+ ![numpy api coverage](https://img.shields.io/badge/numpy_api_coverage-65%20%25-yellow)
7
7
 
8
8
  ```
9
9
  ███╗ ██╗██╗ ██╗███╗ ███╗██████╗ ██╗ ██╗ ████████╗███████╗
@@ -24,8 +24,8 @@ npm install numpy-ts
24
24
 
25
25
  ## Why numpy-ts?
26
26
 
27
- - **📊 Extensive API** — **238 of 333 NumPy functions (71.5% coverage)**
28
- - **✅ NumPy-validated** — 2000+ test cases cross-validated against Python NumPy
27
+ - **📊 Extensive API** — **331 of 507 NumPy functions (65.3% coverage)**
28
+ - **✅ NumPy-validated** — 3000+ test cases cross-validated against Python NumPy
29
29
  - **🔒 Type-safe** — Full TypeScript support with shape and dtype inference
30
30
  - **🌐 Universal** — Works in Node.js and browsers with .npy/.npz file support
31
31
  - **🎯 Zero dependencies** — Pure TypeScript, no heavy external libraries
@@ -62,32 +62,38 @@ Progress toward complete NumPy API compatibility:
62
62
 
63
63
  | Category | Complete | Total | Status |
64
64
  |----------|----------|-------|--------|
65
- | **Arithmetic** | 19/19 | 100% | ✅ |
66
- | **Array Creation** | 32/32 | 100% | ✅ |
67
- | **Array Manipulation** | 35/35 | 100% | ✅ |
68
- | **Bit Operations** | 9/9 | 100% | ✅ |
65
+ | **Arithmetic** | 29/29 | 100% | ✅ |
69
66
  | **Broadcasting** | 3/3 | 100% | ✅ |
70
67
  | **Comparison** | 10/10 | 100% | ✅ |
71
- | **Hyperbolic** | 6/6 | 100% | ✅ |
68
+ | **Exponential** | 9/9 | 100% | ✅ |
69
+ | **Gradient** | 4/4 | 100% | ✅ |
70
+ | **Hyperbolic** | 9/9 | 100% | ✅ |
72
71
  | **I/O** | 8/8 | 100% | ✅ |
73
- | **Indexing** | 20/20 | 100% | ✅ |
74
- | **Linear Algebra** | 9/9 | 100% | ✅ |
75
- | **Reductions** | 30/30 | 100% | ✅ |
76
- | **Searching** | 6/6 | 100% | ✅ |
72
+ | **Indexing** | 21/21 | 100% | ✅ |
73
+ | **Logic** | 24/24 | 100% | ✅ |
74
+ | **Rounding** | 7/7 | 100% | ✅ |
75
+ | **Searching** | 7/7 | 100% | ✅ |
77
76
  | **Sorting** | 6/6 | 100% | ✅ |
78
- | **Trigonometric** | 12/12 | 100% | ✅ |
79
- | **Exponential** | 0/9 | 0% | 🔴 |
77
+ | **Trigonometric** | 16/16 | 100% | ✅ |
78
+ | **Reductions** | 34/36 | 94% | 🟡 |
79
+ | **Array Creation** | 33/35 | 94% | 🟡 |
80
+ | **Array Manipulation** | 37/46 | 80% | 🟡 |
81
+ | **Statistics** | 9/12 | 75% | 🟡 |
82
+ | **Bit Operations** | 9/13 | 69% | 🟡 |
83
+ | **NDArray Methods** | 34/53 | 64% | 🟡 |
84
+ | **Linear Algebra (linalg)** | 19/31 | 61% | 🟡 |
85
+ | **Linear Algebra** | 9/15 | 60% | 🟡 |
86
+ | **Set Operations** | 7/12 | 58% | 🟡 |
87
+ | **Random** | 17/53 | 32% | 🔴 |
88
+ | **Utilities** | 4/16 | 25% | 🔴 |
80
89
  | **FFT** | 0/18 | 0% | 🔴 |
81
- | **Gradient** | 0/4 | 0% | 🔴 |
82
- | **Linear Algebra (linalg)** | 0/19 | 0% | 🔴 |
83
- | **Logic** | 0/12 | 0% | 🔴 |
84
- | **Other Math** | 0/11 | 0% | 🔴 |
85
- | **Random** | 0/17 | 0% | 🔴 |
86
- | **Rounding** | 0/7 | 0% | 🔴 |
87
- | **Set Operations** | 0/7 | 0% | 🔴 |
88
- | **Statistics** | 0/9 | 0% | 🔴 |
90
+ | **Other Math** | 0/15 | 0% | 🔴 |
91
+ | **Polynomials** | 0/10 | 0% | 🔴 |
92
+ | **String/Formatting** | 0/10 | 0% | 🔴 |
93
+ | **Type Checking** | 0/7 | 0% | 🔴 |
94
+ | **Unplanned** | 0/25 | 0% | 🔴 |
89
95
 
90
- **Overall: 238/333 functions (71.5% complete)**
96
+ **Overall: 331/507 functions (65.3% complete)**
91
97
 
92
98
  See the complete [API Reference](docs/API-REFERENCE.md) for detailed function list.
93
99
 
@@ -100,7 +106,7 @@ NumPy-compatible type system with automatic promotion:
100
106
  | **Floating Point** ||||
101
107
  | `float64` | ✅ | ✅ | Default dtype |
102
108
  | `float32` | ✅ | ✅ | |
103
- | `float16` | ✅ | ⚠️ | Planned (half-precision) |
109
+ | `float16` | ✅ | ⚠️ | Planned (waiting for [this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float16Array)) |
104
110
  | **Signed Integers** ||||
105
111
  | `int64` | ✅ | ✅ | Uses BigInt |
106
112
  | `int32` | ✅ | ✅ | |
@@ -195,7 +201,7 @@ const arr = np.parseNpy(await response.arrayBuffer());
195
201
  const bytes = np.serializeNpy(arr);
196
202
  ```
197
203
 
198
- > **Why separate imports?** The `/node` entry includes Node.js `fs` usage. Keeping it separate ensures browser bundles stay clean.
204
+ *Why separate imports?* The `/node` entry includes Node.js `fs` usage. Keeping it separate ensures browser bundles stay clean.
199
205
 
200
206
  ## Examples
201
207
 
@@ -237,12 +243,12 @@ arr.sum(); // Type: number
237
243
 
238
244
  | Feature | numpy-ts | numjs | ndarray | TensorFlow.js |
239
245
  |---------|----------|-------|---------|---------------|
240
- | NumPy API Coverage | 238/333 (71%) | ~20% | Different | ML-focused |
246
+ | NumPy API Coverage | 331/507 (65%) | ~20% | Different | ML-focused |
241
247
  | TypeScript Native | ✅ Full | Partial | ❌ No | ✅ Yes |
242
248
  | NumPy Validated | ✅ 1365+ tests | Mostly | ❌ No | ❌ No |
243
249
  | .npy/.npz Files | ✅ v1/v2/v3 | ❌ No | ❌ No | ❌ No |
244
250
  | Broadcasting | ✅ Full | Limited | Limited | ✅ Full |
245
- | Bundle Size | ~50kb | ~20kb | ~5kb | ~500kb |
251
+ | Bundle Size | <50kb | ~60kb | ~5kb | >100kb |
246
252
 
247
253
  ## Contributing
248
254