numpy-ts 0.10.0 → 0.11.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-65%20%25-yellow)
6
+ ![numpy api coverage](https://img.shields.io/badge/numpy_api_coverage-66%20%25-yellow)
7
7
 
8
8
  ```
9
9
  ███╗ ██╗██╗ ██╗███╗ ███╗██████╗ ██╗ ██╗ ████████╗███████╗
@@ -24,7 +24,7 @@ npm install numpy-ts
24
24
 
25
25
  ## Why numpy-ts?
26
26
 
27
- - **📊 Extensive API** — **331 of 507 NumPy functions (65.3% coverage)**
27
+ - **📊 Extensive API** — **336 of 507 NumPy functions (66.3% coverage)**
28
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
@@ -84,16 +84,16 @@ Progress toward complete NumPy API compatibility:
84
84
  | **Linear Algebra (linalg)** | 19/31 | 61% | 🟡 |
85
85
  | **Linear Algebra** | 9/15 | 60% | 🟡 |
86
86
  | **Set Operations** | 7/12 | 58% | 🟡 |
87
+ | **Other Math** | 5/15 | 33% | 🔴 |
87
88
  | **Random** | 17/53 | 32% | 🔴 |
88
89
  | **Utilities** | 4/16 | 25% | 🔴 |
89
90
  | **FFT** | 0/18 | 0% | 🔴 |
90
- | **Other Math** | 0/15 | 0% | 🔴 |
91
91
  | **Polynomials** | 0/10 | 0% | 🔴 |
92
92
  | **String/Formatting** | 0/10 | 0% | 🔴 |
93
93
  | **Type Checking** | 0/7 | 0% | 🔴 |
94
94
  | **Unplanned** | 0/25 | 0% | 🔴 |
95
95
 
96
- **Overall: 331/507 functions (65.3% complete)**
96
+ **Overall: 336/507 functions (66.3% complete)**
97
97
 
98
98
  See the complete [API Reference](docs/API-REFERENCE.md) for detailed function list.
99
99
 
@@ -119,16 +119,29 @@ NumPy-compatible type system with automatic promotion:
119
119
  | `uint8` | ✅ | ✅ | |
120
120
  | **Other Numeric** ||||
121
121
  | `bool` | ✅ | ✅ | Stored as uint8 |
122
- | `complex64` | ✅ | | Not yet supported |
123
- | `complex128` | ✅ | | Not yet supported |
122
+ | `complex64` | ✅ | | |
123
+ | `complex128` | ✅ | | |
124
124
  | **Non-Numeric** ||||
125
125
  | `str_` | ✅ | ❌ | Not planned |
126
126
  | `bytes_` | ✅ | ❌ | Not planned |
127
127
  | `object_` | ✅ | ❌ | Not planned |
128
- | `datetime64` | ✅ | ❌ | Future consideration |
129
- | `timedelta64` | ✅ | ❌ | Future consideration |
128
+ | `datetime64` | ✅ | ❌ | Not planned |
129
+ | `timedelta64` | ✅ | ❌ | Not planned |
130
130
 
131
- **Supported: 11/20 numeric dtypes** • Complex and temporal types planned for future releases
131
+ **Supported: 13/20 numeric dtypes**
132
+
133
+ ### Intentional Divergences from NumPy
134
+
135
+ numpy-ts focuses on numeric array computing. The following NumPy features are **not planned**:
136
+
137
+ | Feature | Why Not Included |
138
+ |---------|------------------|
139
+ | **Datetime/Timedelta** (`datetime64`, `timedelta64`) | JS has native `Date`; libraries like [date-fns](https://date-fns.org/) handle time math better |
140
+ | **F-order memory layout** | Exists in NumPy for Fortran/BLAS interop, which doesn't exist in JS |
141
+ | **Object dtype** (`object_`) | Defeats the purpose of typed arrays; use regular JS arrays instead |
142
+ | **String/Bytes dtypes** (`str_`, `bytes_`, `U`, `S`) | JS strings are first-class; no need for fixed-width string arrays |
143
+
144
+ These omissions keep the library focused and the bundle small. For string manipulation, datetime math, or heterogeneous data, use native JS/TS constructs alongside numpy-ts.
132
145
 
133
146
  ### NumPy Memory Model
134
147
 
@@ -243,7 +256,7 @@ arr.sum(); // Type: number
243
256
 
244
257
  | Feature | numpy-ts | numjs | ndarray | TensorFlow.js |
245
258
  |---------|----------|-------|---------|---------------|
246
- | NumPy API Coverage | 331/507 (65%) | ~20% | Different | ML-focused |
259
+ | NumPy API Coverage | 336/507 (66%) | ~20% | Different | ML-focused |
247
260
  | TypeScript Native | ✅ Full | Partial | ❌ No | ✅ Yes |
248
261
  | NumPy Validated | ✅ 1365+ tests | Mostly | ❌ No | ❌ No |
249
262
  | .npy/.npz Files | ✅ v1/v2/v3 | ❌ No | ❌ No | ❌ No |