numpy-ts 0.1.0 → 0.2.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
@@ -5,14 +5,13 @@ Complete NumPy implementation for TypeScript and JavaScript
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
6
6
  ![Under Construction](https://img.shields.io/badge/Under%20Construction-red)
7
7
 
8
- > [!WARNING]
9
- > This project is under construction and is currently unstable. Expect breaking changes.
8
+ **⚠️ WARNING: This project is under construction and is currently unstable. Expect breaking changes.**
10
9
 
11
10
  ---
12
11
 
13
12
  ## What is numpy-ts?
14
13
 
15
- A complete, functionally-equivalent implementation of NumPy 2.0+ for the JavaScript ecosystem. (At least that's the goal!)
14
+ A complete, functionally-equivalent implementation of NumPy 2.0+ for the TypeScript/JavaScript ecosystem. (At least that's the goal!)
16
15
 
17
16
  ### Goals
18
17
 
@@ -188,27 +187,21 @@ const c = a.add(b); // (3, 4) + (4,) → (3, 4)
188
187
 
189
188
  ---
190
189
 
191
- ## Installation (Future)
190
+ ## Installation
192
191
 
193
192
  ```bash
194
193
  npm install numpy-ts
195
194
  ```
196
195
 
197
- ### Node.js
198
196
  ```typescript
199
- import * as np from 'numpy-ts/node';
200
- ```
201
-
202
- ### Browser
203
- ```typescript
204
- import * as np from 'numpy-ts/browser';
197
+ import * as np from 'numpy-ts';
205
198
  ```
206
199
 
207
200
  ---
208
201
 
209
202
  ## Development Status
210
203
 
211
- ### Phase 0: Project Setup ✅ COMPLETE
204
+ ### Phase 0: Project Setup
212
205
  - [x] Package configuration
213
206
  - [x] TypeScript setup
214
207
  - [x] Build system (esbuild)
@@ -219,24 +212,25 @@ import * as np from 'numpy-ts/browser';
219
212
  - [x] First working implementation
220
213
 
221
214
 
222
- ### Phase 1: Core Foundation ✅ **COMPLETE**
215
+ ### Phase 1: Core Foundation
223
216
  - [x] NDArray wrapper class (using @stdlib/ndarray)
224
217
  - [x] Array creation: `zeros()`, `ones()`, `array()`, `arange()`, `linspace()`, `eye()`
225
218
  - [x] Matrix operations: `matmul()` using optimized BLAS
226
219
  - [x] Properties: `shape`, `ndim`, `size`, `dtype`, `data`, `strides`
227
220
  - [x] View tracking: `base` attribute, `flags` property
228
221
  - [x] Memory flags: `C_CONTIGUOUS`, `F_CONTIGUOUS`, `OWNDATA`
229
- - [x] Basic arithmetic: `add()`, `subtract()`, `multiply()`, `divide()` with dtype preservation
230
- - [x] Broadcasting **COMPLETE** (fully integrated into all operations)
231
- - [x] String-based slicing **COMPLETE** (`arr.slice('0:5', ':')`, `row()`, `col()`, etc.)
232
- - [x] Reductions with axis support **COMPLETE** (`sum(axis, keepdims)`, `mean()`, `max()`, `min()`)
233
- - [x] Comparison operations **COMPLETE** (`greater()`, `less()`, `equal()`, `isclose()`, `allclose()`)
234
- - [x] Reshape operations **COMPLETE** (`reshape()`, `flatten()`, `ravel()`, `transpose()`, `squeeze()`, `expand_dims()`)
235
- - [x] DType system **COMPLETE** (11 types: float32/64, int8/16/32/64, uint8/16/32/64, bool)
222
+ - [x] Arithmetic operations: `add()`, `subtract()`, `multiply()`, `divide()`, `mod()`, `floor_divide()`, `negative()`, `positive()`, `absolute()`, `sign()`, `reciprocal()`
223
+ - [x] Broadcasting - fully integrated into all operations
224
+ - [x] String-based slicing - `arr.slice('0:5', ':')`, `row()`, `col()`, etc.
225
+ - [x] Reductions with axis support - `sum(axis, keepdims)`, `mean()`, `max()`, `min()`
226
+ - [x] Comparison operations - `greater()`, `less()`, `equal()`, `isclose()`, `allclose()`
227
+ - [x] Reshape operations - `reshape()`, `flatten()`, `ravel()`, `transpose()`, `squeeze()`, `expand_dims()`
228
+ - [x] DType system - 11 types: float32/64, int8/16/32/64, uint8/16/32/64, bool
236
229
  - Full dtype preservation
237
230
  - NumPy-compatible promotion rules
238
231
  - BigInt support for int64/uint64
239
- - [x] Testing **748/750 tests passing (99.7%)**
232
+ - [x] Exponential operations - `sqrt()`, `power()`
233
+ - [x] Testing
240
234
  - Unit tests for all operations
241
235
  - NumPy validation tests (cross-checked against Python NumPy 2.3.3)
242
236
  - Edge case validation (overflow, underflow, special values)
@@ -246,17 +240,22 @@ import * as np from 'numpy-ts/browser';
246
240
  - [X] PR workflow
247
241
  - [X] Publish workflow
248
242
  - [ ] Implement benchmarks
249
- - [ ] Regression (vs. previous runs)
243
+ - [X] Auto-calibrated benchmark runner (100ms samples, ops/sec metrics)
250
244
  - [X] Comparison against Python NumPy
245
+ - [X] Matching Python/TypeScript output format
246
+ - [X] Ops/sec visualization (HTML/PNG)
247
+ - [ ] **Result validation** - Verify numpy-ts and NumPy produce same results before benchmarking
248
+ - [ ] Regression tracking (vs. previous runs)
251
249
  - [ ] Automated in CI/CD
252
250
 
253
251
  ### Phase 3: Essential Operations
254
- - [ ] Matrix operations (using @stdlib BLAS)
255
- - [ ] Linear algebra (using @stdlib LAPACK)
256
- - [ ] Reductions with axis support
257
- - [ ] Mathematical functions
258
- - [ ] Comparison operations
259
- - [ ] dtype consistency testing
252
+ - [x] Matrix operations (using @stdlib BLAS)
253
+ - [ ] Linear algebra (using @stdlib LAPACK) - eig, svd, qr, etc.
254
+ - [x] Reductions with axis support
255
+ - [x] Arithmetic functions - 11/11 complete
256
+ - [ ] Mathematical functions - 2/40+ (sqrt, power) - trigonometric, exponential, rounding, etc.
257
+ - [x] Comparison operations
258
+ - [x] dtype consistency testing
260
259
 
261
260
  ### Phase 4: Extended Features
262
261
  - [ ] Random number generation
@@ -278,7 +277,6 @@ See [API-REFERENCE.md](./docs/API-REFERENCE.md) for complete function checklist.
278
277
  ### Developer Documentation
279
278
  - [ARCHITECTURE.md](./docs/ARCHITECTURE.md) - Design and implementation details
280
279
  - [TESTING-GUIDE.md](./docs/TESTING-GUIDE.md) - How to add tests (unit, validation, benchmarks)
281
- - [IMPLEMENTATION-NOTES.md](./docs/IMPLEMENTATION-NOTES.md) - Development notes and decisions
282
280
  - [benchmarks/README.md](./benchmarks/README.md) - Performance benchmarking guide
283
281
 
284
282
  ---
@@ -390,22 +388,21 @@ See [TESTING-GUIDE.md](./docs/TESTING-GUIDE.md) for detailed instructions on add
390
388
 
391
389
  ## Benchmarking
392
390
 
393
- Compare numpy-ts performance against Python NumPy:
391
+ Compare numpy-ts performance against Python NumPy with auto-calibrated benchmarks:
394
392
 
395
393
  ```bash
396
- # Run quick benchmarks (~1-2 min)
397
- npm run bench:quick
398
-
399
- # Run standard benchmarks (~5-10 min)
400
- npm run bench
394
+ # Quick benchmarks (~2-3 min) - 1 sample, 50ms/sample
395
+ source ~/.zshrc && conda activate py313 && npm run bench:quick
401
396
 
402
- # Run comprehensive benchmarks (~30-60 min)
403
- npm run bench:full
397
+ # Standard benchmarks (~5-10 min) - 5 samples, 100ms/sample (default)
398
+ source ~/.zshrc && conda activate py313 && npm run bench
404
399
 
405
- # View interactive HTML report
400
+ # View interactive HTML report with ops/sec comparison
406
401
  npm run bench:view
407
402
  ```
408
403
 
404
+ **Both modes use the same array sizes** - only sampling strategy differs (quick for speed, standard for accuracy).
405
+
409
406
  ### Performance Overview
410
407
 
411
408
  ![Benchmark Results](./benchmarks/results/plots/latest.png)
@@ -444,4 +441,4 @@ Focus is correctness and completeness first, then performance.
444
441
 
445
442
  ---
446
443
 
447
- **Ready to bring NumPy to JavaScript!** ⭐
444
+ **Ready to bring NumPy to TypeScript + JavaScript!** ⭐