numpy-ts 0.13.1 → 1.0.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
@@ -2,37 +2,36 @@
2
2
 
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
- ![bundle size](https://img.shields.io/bundlephobia/minzip/numpy-ts)
5
+ ![bundle size](https://img.shields.io/bundlejs/size/numpy-ts)
6
6
  ![numpy api coverage](https://img.shields.io/badge/numpy_api_coverage-94%20%25-brightgreen)
7
7
 
8
- ```
9
- ███╗ ██╗██╗ ██╗███╗ ███╗██████╗ ██╗ ██╗ ████████╗███████╗
10
- ████╗ ██║██║ ██║████╗ ████║██╔══██╗╚██╗ ██╔╝ ╚══██╔══╝██╔════╝
11
- ██╔██╗ ██║██║ ██║██╔████╔██║██████╔╝ ╚████╔╝█████╗██║ ███████╗
12
- ██║╚██╗██║██║ ██║██║╚██╔╝██║██╔═══╝ ╚██╔╝ ╚════╝██║ ╚════██║
13
- ██║ ╚████║╚██████╔╝██║ ╚═╝ ██║██║ ██║ ██║ ███████║
14
- ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚══════╝
15
- ```
8
+ <picture>
9
+ <source
10
+ media="(prefers-color-scheme: dark)"
11
+ srcset="https://raw.githubusercontent.com/dupontcyborg/numpy-ts/main/docs/images/hero-dark.svg"
12
+ />
13
+ <img
14
+ src="https://raw.githubusercontent.com/dupontcyborg/numpy-ts/main/docs/images/hero-light.svg"
15
+ alt="numpy-ts"
16
+ />
17
+ </picture>
18
+
19
+ Complete NumPy implementation for TypeScript and JavaScript.
20
+
21
+ - **📊 Extensive API** — **476 of 507 NumPy functions (93.9% coverage)**
22
+ - **✅ NumPy-validated** — 6,000+ tests compared against Python NumPy
23
+ - **🔒 Type-safe** — Full TypeScript type definitions
24
+ - **🌳 Tree-shakeable** — Import only what you use
25
+ - **🌐 Universal** — Works in Node.js and browsers
16
26
 
17
- Complete NumPy implementation for TypeScript and JavaScript
27
+ [Docs](https://numpyts.dev) [Examples](https://numpyts.dev/examples) [Benchmarks](https://numpyts.dev/performance)
18
28
 
19
- **⚠️ Under active development** — API may change before v1.0
29
+ ## Install
20
30
 
21
31
  ```bash
22
32
  npm install numpy-ts
23
33
  ```
24
34
 
25
- ## Why numpy-ts?
26
-
27
- - **📊 Extensive API** — **476 of 507 NumPy functions (93.9% coverage)**
28
- - **✅ NumPy-validated** — 6,000+ test cases cross-validated against Python NumPy
29
- - **🔒 Type-safe** — Full TypeScript support with shape and dtype inference
30
- - **🌐 Universal** — Works in Node.js and browsers with .npy/.npz file support
31
- - **🎯 Zero dependencies** — Pure TypeScript, no heavy external libraries
32
- - **🌳 Tree-shakeable** — Import only what you need (~11KB for `zeros`, not 180KB)
33
-
34
- > **💡 Bundle size tip:** Standalone functions like `sin(arr)` tree-shake well. Method chaining like `arr.sin()` is convenient but pulls in the full library. See [modular imports guide](docs/modular-imports.mdx).
35
-
36
35
  ## Quick Start
37
36
 
38
37
  ```typescript
@@ -57,239 +56,18 @@ const row = A.slice('0', ':'); // A[0, :]
57
56
  const submatrix = A.slice('0:2', '1:'); // A[0:2, 1:]
58
57
  ```
59
58
 
60
- ## Features
61
-
62
- ### API Coverage
63
-
64
- Progress toward complete NumPy API compatibility:
65
-
66
- | Category | Complete | Total | Status |
67
- |----------|----------|-------|--------|
68
- | **Arithmetic** | 29/29 | 100% | ✅ |
69
- | **Array Creation** | 35/35 | 100% | ✅ |
70
- | **Array Manipulation** | 46/46 | 100% | ✅ |
71
- | **Bit Operations** | 13/13 | 100% | ✅ |
72
- | **Broadcasting** | 3/3 | 100% | ✅ |
73
- | **Comparison** | 10/10 | 100% | ✅ |
74
- | **Exponential** | 9/9 | 100% | ✅ |
75
- | **FFT** | 18/18 | 100% | ✅ |
76
- | **Gradient** | 4/4 | 100% | ✅ |
77
- | **Hyperbolic** | 9/9 | 100% | ✅ |
78
- | **I/O** | 8/8 | 100% | ✅ |
79
- | **Indexing** | 21/21 | 100% | ✅ |
80
- | **Linear Algebra** | 16/16 | 100% | ✅ |
81
- | **Linear Algebra (linalg)** | 31/31 | 100% | ✅ |
82
- | **Logic** | 24/24 | 100% | ✅ |
83
- | **NDArray Methods** | 47/47 | 100% | ✅ |
84
- | **Other Math** | 15/15 | 100% | ✅ |
85
- | **Polynomials** | 10/10 | 100% | ✅ |
86
- | **Printing/Formatting** | 10/10 | 100% | ✅ |
87
- | **Random** | 53/53 | 100% | ✅ |
88
- | **Reductions** | 36/36 | 100% | ✅ |
89
- | **Rounding** | 7/7 | 100% | ✅ |
90
- | **Searching** | 7/7 | 100% | ✅ |
91
- | **Set Operations** | 12/12 | 100% | ✅ |
92
- | **Sorting** | 6/6 | 100% | ✅ |
93
- | **Statistics** | 11/11 | 100% | ✅ |
94
- | **Trigonometric** | 16/16 | 100% | ✅ |
95
- | **Type Checking** | 7/7 | 100% | ✅ |
96
- | **Utilities** | 10/10 | 100% | ✅ |
97
- | **Unplanned** | 0/31 | 0% | 🔴 |
98
-
99
- **Overall: 476/507 functions (93.9% coverage)**
100
-
101
- See the complete [API Reference](docs/API-REFERENCE.md) for detailed function list.
102
-
103
- ### Data Types (dtypes)
104
-
105
- NumPy-compatible type system with automatic promotion:
106
-
107
- | DType | NumPy | numpy-ts | Notes |
108
- |-------|-------|----------|-------|
109
- | **Floating Point** ||||
110
- | `float64` | ✅ | ✅ | Default dtype |
111
- | `float32` | ✅ | ✅ | |
112
- | `float16` | ✅ | ⚠️ | Planned (waiting for [this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float16Array)) |
113
- | **Signed Integers** ||||
114
- | `int64` | ✅ | ✅ | Uses BigInt |
115
- | `int32` | ✅ | ✅ | |
116
- | `int16` | ✅ | ✅ | |
117
- | `int8` | ✅ | ✅ | |
118
- | **Unsigned Integers** ||||
119
- | `uint64` | ✅ | ✅ | Uses BigInt |
120
- | `uint32` | ✅ | ✅ | |
121
- | `uint16` | ✅ | ✅ | |
122
- | `uint8` | ✅ | ✅ | |
123
- | **Other Numeric** ||||
124
- | `bool` | ✅ | ✅ | Stored as uint8 |
125
- | `complex64` | ✅ | ✅ | |
126
- | `complex128` | ✅ | ✅ | |
127
- | **Non-Numeric** ||||
128
- | `str_` | ✅ | ❌ | Not planned |
129
- | `bytes_` | ✅ | ❌ | Not planned |
130
- | `object_` | ✅ | ❌ | Not planned |
131
- | `datetime64` | ✅ | ❌ | Not planned |
132
- | `timedelta64` | ✅ | ❌ | Not planned |
133
-
134
- **Supported: 13/20 numeric dtypes**
135
-
136
- ### Intentional Divergences from NumPy
137
-
138
- numpy-ts focuses on numeric array computing. The following NumPy features are **not planned**:
139
-
140
- | Feature | Why Not Included |
141
- |---------|------------------|
142
- | **Datetime/Timedelta** (`datetime64`, `timedelta64`) | JS has native `Date`; libraries like [date-fns](https://date-fns.org/) handle time math better |
143
- | **F-order memory layout** | Exists in NumPy for Fortran/BLAS interop, which doesn't exist in JS |
144
- | **Object dtype** (`object_`) | Defeats the purpose of typed arrays; use regular JS arrays instead |
145
- | **String/Bytes dtypes** (`str_`, `bytes_`, `U`, `S`) | JS strings are first-class; no need for fixed-width string arrays |
146
- | **Exact random sequence reproduction** | numpy-ts random functions produce statistically correct distributions but use different transformation algorithms (Box-Muller vs Ziggurat), so seeded sequences won't match NumPy exactly |
147
-
148
- 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.
149
-
150
- ### NumPy Memory Model
151
-
152
- - **View tracking** — `base` attribute and `OWNDATA` flag
153
- - **Strided arrays** — C/F contiguous flags for memory layout
154
- - **Zero-copy ops** — Views for slicing, transpose, reshape (when possible)
155
-
156
- ```typescript
157
- const arr = np.ones([4, 4]);
158
- const view = arr.slice('0:2', '0:2');
159
-
160
- console.log(view.base === arr); // true - view tracks base
161
- console.log(view.flags.OWNDATA); // false - doesn't own data
162
- console.log(arr.flags.C_CONTIGUOUS); // true - row-major layout
163
- ```
164
-
165
- ## Architecture
166
-
167
- ```
168
- ┌─────────────────────────────────┐
169
- │ NumPy-Compatible API │
170
- │ Broadcasting, DType Promotion │
171
- └───────────────┬─────────────────┘
172
-
173
- ┌───────────────┴─────────────────┐
174
- │ NDArray (Views & Memory Mgmt) │
175
- │ Strided Arrays, Base Tracking │
176
- └───────────────┬─────────────────┘
177
- │- - - - - - - - - - - - - - - - - - ┐
178
- ┌───────────────┴─────────────────┐ ┌ ─ ─ ─ ─ ─ ─ ─ ┴ ─ ─ ─ ─ ─ ─ ─ ─┐
179
- │ TypeScript / JavaScript Core │ │ WASM Compute Engine (Future) │
180
- │ Computational Engine │ │ Optimized BLAS / arithmetic │
181
- └─────────────────────────────────┘ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─┘
182
- ```
183
-
184
- Pure TypeScript implementation built from scratch for correctness and NumPy compatibility.
185
-
186
- ## Performance
187
-
188
- ![Benchmark Results](benchmarks/results/plots/latest.png)
189
-
190
- See [benchmarks/README.md](benchmarks/README.md) for detailed performance analysis.
191
-
192
- ## File I/O
193
-
194
- Read and write `.npy` and `.npz` files with Node.js or browsers.
195
-
196
- ### Node.js
197
-
198
- ```typescript
199
- import { load, save, savez, savez_compressed } from 'numpy-ts/node';
200
-
201
- save('array.npy', arr);
202
- const arr = load('array.npy');
203
-
204
- savez('arrays.npz', { a: arr1, b: arr2 });
205
- const { a, b } = load('arrays.npz');
206
- ```
207
-
208
- ### Browser
209
-
210
- ```typescript
211
- import * as np from 'numpy-ts';
212
-
213
- // Parse fetched .npy file
214
- const response = await fetch('array.npy');
215
- const arr = np.parseNpy(await response.arrayBuffer());
216
-
217
- // Serialize for download
218
- const bytes = np.serializeNpy(arr);
219
- ```
220
-
221
- *Why separate imports?* The `/node` entry includes Node.js `fs` usage. Keeping it separate ensures browser bundles stay clean.
222
-
223
- ## Examples
224
-
225
- ### Broadcasting
226
-
227
- ```typescript
228
- const matrix = np.ones([3, 4]); // (3, 4)
229
- const row = np.arange(4); // (4,)
230
- const result = matrix.add(row); // (3, 4) - row broadcast to each row
231
-
232
- const col = np.array([[1], [2], [3]]); // (3, 1)
233
- const grid = col.multiply(row); // (3, 4) - outer product via broadcasting
234
- ```
235
-
236
- ### Slicing
237
-
238
- TypeScript doesn't support Python's `arr[0:5, :]`, so we use strings:
239
-
240
- ```typescript
241
- arr.slice('0:5', '1:3'); // arr[0:5, 1:3]
242
- arr.slice(':', '-1'); // arr[:, -1]
243
- arr.slice('::2'); // arr[::2]
244
-
245
- // Convenience helpers
246
- arr.row(0); // arr[0, :]
247
- arr.col(2); // arr[:, 2]
248
- ```
249
-
250
- ### Type Safety
59
+ ## Resources
251
60
 
252
- ```typescript
253
- const arr = np.zeros([3, 4]); // Type: NDArray<Float64>
254
- arr.shape; // Type: readonly [3, 4]
255
- arr.sum(); // Type: number
256
- ```
257
-
258
-
259
- ## Comparison with Alternatives
260
-
261
- | Feature | numpy-ts | numjs | ndarray | TensorFlow.js |
262
- |---------|----------|-------|---------|---------------|
263
- | NumPy API Coverage | 476/507 (94%) | ~20% | Different | ML-focused |
264
- | TypeScript Native | ✅ Full | Partial | ❌ No | ✅ Yes |
265
- | NumPy Validated | ✅ 6,000+ tests | Mostly | ❌ No | ❌ No |
266
- | .npy/.npz Files | ✅ v1/v2/v3 | ❌ No | ❌ No | ❌ No |
267
- | Broadcasting | ✅ Full | Limited | Limited | ✅ Full |
268
- | Bundle Size | <100kb | ~60kb | ~5kb | >100kb |
61
+ - Docs: https://numpyts.dev
62
+ - Playground: https://numpyts.dev/playground
63
+ - Usage Examples: https://numpyts.dev/examples
64
+ - API Coverage Report: https://numpyts.dev/coverage
65
+ - Performance Benchmarks: https://numpyts.dev/performance
269
66
 
270
67
  ## Contributing
271
68
 
272
- Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed instructions on:
273
-
274
- - Setting up the development environment
275
- - Adding new functions with tests
276
- - Running benchmarks
277
- - Submitting pull requests
278
-
279
- ## Documentation
280
-
281
- - **[API Reference](docs/API-REFERENCE.md)** — Complete function checklist (120+ functions)
282
- - **[Feature Details](docs/FEATURES.md)** — Broadcasting, dtypes, views, slicing
283
- - **[Contributing Guide](CONTRIBUTING.md)** — How to contribute
284
- - **[Testing Guide](docs/TESTING-GUIDE.md)** — Testing strategy and examples
285
- - **[Architecture](docs/ARCHITECTURE.md)** — System design and internals
286
-
69
+ Issues and PRs are welcome: https://github.com/dupontcyborg/numpy-ts
287
70
 
288
71
  ## License
289
72
 
290
- [MIT License](LICENSE) — Copyright (c) 2025 Nicolas Dupont
291
-
292
- ---
293
-
294
- **Bring NumPy to TypeScript!** ⭐
295
- [GitHub](https://github.com/dupontcyborg/numpy-ts) • [Issues](https://github.com/dupontcyborg/numpy-ts/issues) • [NumPy Docs](https://numpy.org/)
73
+ MIT © Nicolas Dupont
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{Complex as J}from"./common/complex";import{NDArray as Q}from"./full";import{NDArrayCore as X}from"./common/ndarray-core";import{zeros as $,ones as rr,empty as er,full as ar,array as nr,arange as tr,linspace as or,logspace as sr,geomspace as mr,eye as ir,identity as ur,asarray as pr,zeros_like as fr,ones_like as br,empty_like as lr,full_like as dr,copy as cr,asanyarray as yr,asarray_chkfinite as _r,ascontiguousarray as gr,asfortranarray as xr,require as hr,diag as Nr,diagflat as Ar,frombuffer as wr,fromfile as zr,fromfunction as Sr,fromiter as vr,fromstring as Dr,meshgrid as kr,tri as Cr,tril as Tr,triu as Or,vander as Ir}from"./full";import{add as Pr,subtract as Rr,multiply as Er,divide as Mr,true_divide as jr,floor_divide as Ur,mod as Hr,sqrt as Lr,power as Br,exp as Vr,exp2 as Gr,expm1 as Yr,log as Fr,log2 as Jr,log10 as Kr,log1p as Qr,logaddexp as Wr,logaddexp2 as Xr,absolute as Zr,negative as $r,sign as re,positive as ee,reciprocal as ae,cbrt as ne,fabs as te,divmod as oe,square as se,remainder as me,heaviside as ie,float_power as ue,fmod as pe,frexp as fe,gcd as be,lcm as le,ldexp as de,modf as ce,clip as ye,maximum as _e,minimum as ge,fmax as xe,fmin as he,nan_to_num as Ne,interp as Ae,unwrap as we,sinc as ze,i0 as Se}from"./full";import{power as De,absolute as ke}from"./full";import{sin as Te,cos as Oe,tan as Ie,arcsin as qe,arccos as Pe,arctan as Re,arctan2 as Ee,hypot as Me,degrees as je,radians as Ue,deg2rad as He,rad2deg as Le,sinh as Be,cosh as Ve,tanh as Ge,arcsinh as Ye,arccosh as Fe,arctanh as Je}from"./full";import{arcsin as Qe,arccos as We,arctan as Xe,arctan2 as Ze,arcsinh as $e,arccosh as ra,arctanh as ea}from"./full";import{dot as na,trace as ta,diagonal as oa,kron as sa,transpose as ma,inner as ia,outer as ua,tensordot as pa,einsum as fa,einsum_path as ba,vdot as la,vecdot as da,matrix_transpose as ca,permute_dims as ya,matvec as _a,vecmat as ga,cross as xa,matmul as ha,linalg as Na}from"./full";import{reshape as wa,flatten as za,ravel as Sa,squeeze as va,expand_dims as Da,swapaxes as ka,moveaxis as Ca,rollaxis as Ta,concatenate as Oa,stack as Ia,vstack as qa,hstack as Pa,dstack as Ra,column_stack as Ea,row_stack as Ma,block as ja,split as Ua,array_split as Ha,vsplit as La,hsplit as Ba,dsplit as Va,unstack as Ga,tile as Ya,repeat as Fa,flip as Ja,fliplr as Ka,flipud as Qa,rot90 as Wa,roll as Xa,resize as Za,atleast_1d as $a,atleast_2d as rn,atleast_3d as en,append as an,delete_ as nn,delete_ as tn,insert as on,pad as sn}from"./full";import{concatenate as un}from"./full";import{sum as fn,mean as bn,prod as ln,amax as dn,amin as cn,ptp as yn,argmin as _n,argmax as gn,std as xn,variance as hn,var_ as Nn,median as An,percentile as wn,quantile as zn,average as Sn,all as vn,any as Dn,cumsum as kn,cumprod as Cn,nansum as Tn,nanprod as On,nanmean as In,nanvar as qn,nanstd as Pn,nanmin as Rn,nanmax as En,nanargmin as Mn,nanargmax as jn,nancumsum as Un,nancumprod as Hn,nanmedian as Ln,nanquantile as Bn,nanpercentile as Vn}from"./full";import{amax as Yn,amin as Fn,cumsum as Jn,cumprod as Kn}from"./full";import{logical_and as Wn,logical_or as Xn,logical_not as Zn,logical_xor as $n,isfinite as rt,isinf as et,isnan as at,isnat as nt,isneginf as tt,isposinf as ot,iscomplex as st,iscomplexobj as mt,isreal as it,isrealobj as ut,real_if_close as pt,isfortran as ft,isscalar as bt,iterable as lt,isdtype as dt,promote_types as ct,copysign as yt,signbit as _t,nextafter as gt,spacing as xt,greater as ht,greater_equal as Nt,less as At,less_equal as wt,equal as zt,not_equal as St,isclose as vt,allclose as Dt}from"./full";import{sort as Ct,argsort as Tt,lexsort as Ot,partition as It,argpartition as qt,sort_complex as Pt,nonzero as Rt,argwhere as Et,flatnonzero as Mt,where as jt,searchsorted as Ut,extract as Ht,count_nonzero as Lt}from"./full";import{bitwise_and as Vt,bitwise_or as Gt,bitwise_xor as Yt,bitwise_not as Ft,invert as Jt,left_shift as Kt,right_shift as Qt,packbits as Wt,unpackbits as Xt,bitwise_count as Zt}from"./full";import{bitwise_not as ro,left_shift as eo,right_shift as ao}from"./full";import{around as to,round_ as oo,ceil as so,fix as mo,floor as io,rint as uo,trunc as po}from"./full";import{around as bo}from"./full";import{unique as co,in1d as yo,intersect1d as _o,isin as go,setdiff1d as xo,setxor1d as ho,union1d as No,trim_zeros as Ao,unique_all as wo,unique_counts as zo,unique_inverse as So,unique_values as vo}from"./full";import{bincount as ko,digitize as Co,histogram as To,histogram2d as Oo,histogramdd as Io,correlate as qo,convolve as Po,cov as Ro,corrcoef as Eo,histogram_bin_edges as Mo,trapezoid as jo}from"./full";import{diff as Ho,ediff1d as Lo,gradient as Bo}from"./full";import{real as Go,imag as Yo,conj as Fo,angle as Jo}from"./full";import{conj as Qo}from"./full";import{broadcast_to as Xo,broadcast_arrays as Zo,broadcast_shapes as $o,take as rs,put as es,iindex as as,bindex as ns,copyto as ts,choose as os,array_equal as ss,array_equiv as ms,take_along_axis as is,put_along_axis as us,putmask as ps,compress as fs,select as bs,place as ls,fill_diagonal as ds,diag_indices as cs,diag_indices_from as ys,tril_indices as _s,tril_indices_from as gs,triu_indices as xs,triu_indices_from as hs,mask_indices as Ns,indices as As,ix_ as ws,ravel_multi_index as zs,unravel_index as Ss,fill as vs,item as Ds,tolist as ks,tobytes as Cs,byteswap as Ts,view as Os,tofile as Is}from"./full";import{apply_along_axis as Ps,apply_over_axes as Rs,may_share_memory as Es,shares_memory as Ms,ndim as js,shape as Us,size as Hs,geterr as Ls,seterr as Bs}from"./full";import{array2string as Gs,array_repr as Ys,array_str as Fs,base_repr as Js,binary_repr as Ks,format_float_positional as Qs,format_float_scientific as Ws,get_printoptions as Xs,set_printoptions as Zs,printoptions as $s}from"./full";import{can_cast as em,common_type as am,result_type as nm,min_scalar_type as tm,issubdtype as om,typename as sm,mintypecode as mm}from"./full";import{poly as um,polyadd as pm,polyder as fm,polydiv as bm,polyfit as lm,polyint as dm,polymul as cm,polysub as ym,polyval as _m,roots as gm}from"./full";import{UnsupportedDTypeError as hm,InvalidNpyError as Nm,SUPPORTED_DTYPES as Am,DTYPE_TO_DESCR as wm}from"./io/npy/format";import{serializeNpy as Sm}from"./io/npy/serializer";import{serializeNpz as Dm,serializeNpzSync as km}from"./io/npz/serializer";import{serializeTxt as Tm}from"./io/txt/serializer";import{parseNpy as b,parseNpyHeader as l,parseNpyData as d}from"./io/npy/parser";import{parseNpz as c,parseNpzSync as y,loadNpz as _,loadNpzSync as g}from"./io/npz/parser";import{parseTxt as x,genfromtxt as h,fromregex as N}from"./io/txt/parser";function p(r){return s.fromStorage(r.storage)}function v(r){return p(b(r))}const D=l;function k(r,e){return p(d(r,e))}async function C(r,e={}){const a=await c(r,e),t=new Map;for(const[u,f]of a.arrays)t.set(u,p(f));return{arrays:t,skipped:a.skipped,errors:a.errors}}function T(r,e={}){const a=y(r,e),t=new Map;for(const[u,f]of a.arrays)t.set(u,p(f));return{arrays:t,skipped:a.skipped,errors:a.errors}}async function O(r,e={}){const a=await _(r,e),t={};for(const[u,f]of Object.entries(a))t[u]=p(f);return t}function I(r,e={}){const a=g(r,e),t={};for(const[u,f]of Object.entries(a))t[u]=p(f);return t}function q(r,e={}){return p(x(r,e))}function P(r,e={}){return p(h(r,e))}function R(r,e,a="float64"){return p(N(r,e,a))}import*as n from"./common/ops/random";import{NDArray as s}from"./full";function o(r){return r&&typeof r=="object"&&"_data"in r&&"_shape"in r?s.fromStorage(r):r}const L={seed:n.seed,get_state:n.get_state,set_state:n.set_state,get_bit_generator:n.get_bit_generator,set_bit_generator:n.set_bit_generator,default_rng:n.default_rng,Generator:n.Generator,random:r=>o(n.random(r)),rand:(...r)=>o(n.rand(...r)),randn:(...r)=>o(n.randn(...r)),randint:(r,e,a,t)=>o(n.randint(r,e,a,t)),random_sample:r=>o(n.random_sample(r)),ranf:r=>o(n.ranf(r)),sample:r=>o(n.sample(r)),random_integers:(r,e,a)=>o(n.random_integers(r,e,a)),bytes:n.bytes,uniform:(r,e,a)=>o(n.uniform(r,e,a)),normal:(r,e,a)=>o(n.normal(r,e,a)),standard_normal:r=>o(n.standard_normal(r)),exponential:(r,e)=>o(n.exponential(r,e)),standard_exponential:r=>o(n.standard_exponential(r)),gamma:(r,e,a)=>o(n.gamma(r,e,a)),standard_gamma:(r,e)=>o(n.standard_gamma(r,e)),beta:(r,e,a)=>o(n.beta(r,e,a)),chisquare:(r,e)=>o(n.chisquare(r,e)),noncentral_chisquare:(r,e,a)=>o(n.noncentral_chisquare(r,e,a)),f:(r,e,a)=>o(n.f(r,e,a)),noncentral_f:(r,e,a,t)=>o(n.noncentral_f(r,e,a,t)),standard_cauchy:r=>o(n.standard_cauchy(r)),standard_t:(r,e)=>o(n.standard_t(r,e)),laplace:(r,e,a)=>o(n.laplace(r,e,a)),logistic:(r,e,a)=>o(n.logistic(r,e,a)),lognormal:(r,e,a)=>o(n.lognormal(r,e,a)),gumbel:(r,e,a)=>o(n.gumbel(r,e,a)),pareto:(r,e)=>o(n.pareto(r,e)),power:(r,e)=>o(n.power(r,e)),rayleigh:(r,e)=>o(n.rayleigh(r,e)),triangular:(r,e,a,t)=>o(n.triangular(r,e,a,t)),wald:(r,e,a)=>o(n.wald(r,e,a)),weibull:(r,e)=>o(n.weibull(r,e)),poisson:(r,e)=>o(n.poisson(r,e)),binomial:(r,e,a)=>o(n.binomial(r,e,a)),geometric:(r,e)=>o(n.geometric(r,e)),hypergeometric:(r,e,a,t)=>o(n.hypergeometric(r,e,a,t)),logseries:(r,e)=>o(n.logseries(r,e)),negative_binomial:(r,e,a)=>o(n.negative_binomial(r,e,a)),zipf:(r,e)=>o(n.zipf(r,e)),multinomial:(r,e,a)=>o(n.multinomial(r,e,a)),multivariate_normal:(r,e,a,t,u)=>o(n.multivariate_normal(r,e,a,t,u)),dirichlet:(r,e)=>o(n.dirichlet(r,e)),vonmises:(r,e,a)=>o(n.vonmises(r,e,a)),choice:(r,e,a,t)=>o(n.choice(r,e,a,t)),permutation:r=>o(n.permutation(r)),shuffle:n.shuffle};import*as m from"./common/ops/fft";import{NDArrayCore as A}from"./common/ndarray-core";function i(r){return r instanceof s||r instanceof A?r.storage:r}const V={fft:(r,e,a,t)=>s.fromStorage(m.fft(i(r),e,a,t)),ifft:(r,e,a,t)=>s.fromStorage(m.ifft(i(r),e,a,t)),fft2:(r,e,a,t)=>s.fromStorage(m.fft2(i(r),e,a,t)),ifft2:(r,e,a,t)=>s.fromStorage(m.ifft2(i(r),e,a,t)),fftn:(r,e,a,t)=>s.fromStorage(m.fftn(i(r),e,a,t)),ifftn:(r,e,a,t)=>s.fromStorage(m.ifftn(i(r),e,a,t)),rfft:(r,e,a,t)=>s.fromStorage(m.rfft(i(r),e,a,t)),irfft:(r,e,a,t)=>s.fromStorage(m.irfft(i(r),e,a,t)),rfft2:(r,e,a,t)=>s.fromStorage(m.rfft2(i(r),e,a,t)),irfft2:(r,e,a,t)=>s.fromStorage(m.irfft2(i(r),e,a,t)),rfftn:(r,e,a,t)=>s.fromStorage(m.rfftn(i(r),e,a,t)),irfftn:(r,e,a,t)=>s.fromStorage(m.irfftn(i(r),e,a,t)),hfft:(r,e,a,t)=>s.fromStorage(m.hfft(i(r),e,a,t)),ihfft:(r,e,a,t)=>s.fromStorage(m.ihfft(i(r),e,a,t)),fftfreq:(r,e)=>s.fromStorage(m.fftfreq(r,e)),rfftfreq:(r,e)=>s.fromStorage(m.rfftfreq(r,e)),fftshift:(r,e)=>s.fromStorage(m.fftshift(i(r),e)),ifftshift:(r,e)=>s.fromStorage(m.ifftshift(i(r),e))},G="0.13.1";export{J as Complex,wm as DTYPE_TO_DESCR,Nm as InvalidNpyError,Q as NDArray,X as NDArrayCore,Am as SUPPORTED_DTYPES,hm as UnsupportedDTypeError,G as __version__,ke as abs,Zr as absolute,We as acos,ra as acosh,Pr as add,vn as all,Dt as allclose,dn as amax,cn as amin,Jo as angle,Dn as any,an as append,Ps as apply_along_axis,Rs as apply_over_axes,tr as arange,Pe as arccos,Fe as arccosh,qe as arcsin,Ye as arcsinh,Re as arctan,Ee as arctan2,Je as arctanh,gn as argmax,_n as argmin,qt as argpartition,Tt as argsort,Et as argwhere,to as around,nr as array,Gs as array2string,ss as array_equal,ms as array_equiv,Ys as array_repr,Ha as array_split,Fs as array_str,yr as asanyarray,pr as asarray,_r as asarray_chkfinite,gr as ascontiguousarray,xr as asfortranarray,Qe as asin,$e as asinh,Xe as atan,Ze as atan2,ea as atanh,$a as atleast_1d,rn as atleast_2d,en as atleast_3d,Sn as average,Js as base_repr,Ks as binary_repr,ko as bincount,ns as bindex,Vt as bitwise_and,Zt as bitwise_count,ro as bitwise_invert,eo as bitwise_left_shift,Ft as bitwise_not,Gt as bitwise_or,ao as bitwise_right_shift,Yt as bitwise_xor,ja as block,Zo as broadcast_arrays,$o as broadcast_shapes,Xo as broadcast_to,Ts as byteswap,em as can_cast,ne as cbrt,so as ceil,os as choose,ye as clip,Ea as column_stack,am as common_type,fs as compress,un as concat,Oa as concatenate,Fo as conj,Qo as conjugate,Po as convolve,cr as copy,yt as copysign,ts as copyto,Eo as corrcoef,qo as correlate,Oe as cos,Ve as cosh,Lt as count_nonzero,Ro as cov,xa as cross,Cn as cumprod,kn as cumsum,Kn as cumulative_prod,Jn as cumulative_sum,He as deg2rad,je as degrees,tn as delete,nn as delete_,Nr as diag,cs as diag_indices,ys as diag_indices_from,Ar as diagflat,oa as diagonal,Ho as diff,Co as digitize,Mr as divide,oe as divmod,na as dot,Va as dsplit,Ra as dstack,Lo as ediff1d,fa as einsum,ba as einsum_path,er as empty,lr as empty_like,zt as equal,Vr as exp,Gr as exp2,Da as expand_dims,Yr as expm1,Ht as extract,ir as eye,te as fabs,V as fft,vs as fill,ds as fill_diagonal,mo as fix,Mt as flatnonzero,za as flatten,Ja as flip,Ka as fliplr,Qa as flipud,ue as float_power,io as floor,Ur as floor_divide,xe as fmax,he as fmin,pe as fmod,Qs as format_float_positional,Ws as format_float_scientific,fe as frexp,wr as frombuffer,zr as fromfile,Sr as fromfunction,vr as fromiter,R as fromregex,Dr as fromstring,ar as full,dr as full_like,be as gcd,P as genfromtxt,mr as geomspace,Xs as get_printoptions,Ls as geterr,Bo as gradient,ht as greater,Nt as greater_equal,ie as heaviside,To as histogram,Oo as histogram2d,Mo as histogram_bin_edges,Io as histogramdd,Ba as hsplit,Pa as hstack,Me as hypot,Se as i0,ur as identity,as as iindex,Yo as imag,yo as in1d,As as indices,ia as inner,on as insert,Ae as interp,_o as intersect1d,Jt as invert,vt as isclose,st as iscomplex,mt as iscomplexobj,dt as isdtype,rt as isfinite,ft as isfortran,go as isin,et as isinf,at as isnan,nt as isnat,tt as isneginf,ot as isposinf,it as isreal,ut as isrealobj,bt as isscalar,om as issubdtype,Ds as item,lt as iterable,ws as ix_,sa as kron,le as lcm,de as ldexp,Kt as left_shift,At as less,wt as less_equal,Ot as lexsort,Na as linalg,or as linspace,O as loadNpz,I as loadNpzSync,Fr as log,Kr as log10,Qr as log1p,Jr as log2,Wr as logaddexp,Xr as logaddexp2,Wn as logical_and,Zn as logical_not,Xn as logical_or,$n as logical_xor,sr as logspace,Ns as mask_indices,ha as matmul,ca as matrix_transpose,_a as matvec,Yn as max,_e as maximum,Es as may_share_memory,bn as mean,An as median,kr as meshgrid,Fn as min,tm as min_scalar_type,ge as minimum,mm as mintypecode,Hr as mod,ce as modf,Ca as moveaxis,Er as multiply,Ne as nan_to_num,jn as nanargmax,Mn as nanargmin,Hn as nancumprod,Un as nancumsum,En as nanmax,In as nanmean,Ln as nanmedian,Rn as nanmin,Vn as nanpercentile,On as nanprod,Bn as nanquantile,Pn as nanstd,Tn as nansum,qn as nanvar,js as ndim,$r as negative,gt as nextafter,Rt as nonzero,St as not_equal,rr as ones,br as ones_like,ua as outer,Wt as packbits,sn as pad,v as parseNpy,k as parseNpyData,D as parseNpyHeader,C as parseNpz,T as parseNpzSync,q as parseTxt,It as partition,wn as percentile,ya as permute_dims,ls as place,um as poly,pm as polyadd,fm as polyder,bm as polydiv,lm as polyfit,dm as polyint,cm as polymul,ym as polysub,_m as polyval,ee as positive,De as pow,Br as power,$s as printoptions,ln as prod,ct as promote_types,yn as ptp,es as put,us as put_along_axis,ps as putmask,zn as quantile,Le as rad2deg,Ue as radians,L as random,Sa as ravel,zs as ravel_multi_index,Go as real,pt as real_if_close,ae as reciprocal,me as remainder,Fa as repeat,hr as require,wa as reshape,Za as resize,nm as result_type,Qt as right_shift,uo as rint,Xa as roll,Ta as rollaxis,gm as roots,Wa as rot90,bo as round,oo as round_,Ma as row_stack,Ut as searchsorted,bs as select,Sm as serializeNpy,Dm as serializeNpz,km as serializeNpzSync,Tm as serializeTxt,Zs as set_printoptions,xo as setdiff1d,Bs as seterr,ho as setxor1d,Us as shape,Ms as shares_memory,re as sign,_t as signbit,Te as sin,ze as sinc,Be as sinh,Hs as size,Ct as sort,Pt as sort_complex,xt as spacing,Ua as split,Lr as sqrt,se as square,va as squeeze,Ia as stack,xn as std,Rr as subtract,fn as sum,ka as swapaxes,rs as take,is as take_along_axis,Ie as tan,Ge as tanh,pa as tensordot,Ya as tile,Cs as tobytes,Is as tofile,ks as tolist,ta as trace,ma as transpose,jo as trapezoid,Cr as tri,Tr as tril,_s as tril_indices,gs as tril_indices_from,Ao as trim_zeros,Or as triu,xs as triu_indices,hs as triu_indices_from,jr as true_divide,po as trunc,sm as typename,No as union1d,co as unique,wo as unique_all,zo as unique_counts,So as unique_inverse,vo as unique_values,Xt as unpackbits,Ss as unravel_index,Ga as unstack,we as unwrap,Ir as vander,Nn as var,hn as variance,la as vdot,da as vecdot,ga as vecmat,Os as view,La as vsplit,qa as vstack,jt as where,$ as zeros,fr as zeros_like};
1
+ import{Complex as J}from"./common/complex";import{NDArray as Q}from"./full";import{NDArrayCore as X}from"./common/ndarray-core";import{zeros as $,ones as rr,empty as er,full as ar,array as nr,arange as tr,linspace as or,logspace as sr,geomspace as mr,eye as ir,identity as ur,asarray as pr,zeros_like as fr,ones_like as br,empty_like as lr,full_like as dr,copy as cr,asanyarray as yr,asarray_chkfinite as _r,ascontiguousarray as gr,asfortranarray as xr,require as hr,diag as Nr,diagflat as Ar,frombuffer as wr,fromfile as zr,fromfunction as Sr,fromiter as vr,fromstring as Dr,meshgrid as kr,tri as Cr,tril as Tr,triu as Or,vander as Ir}from"./full";import{add as Pr,subtract as Rr,multiply as Er,divide as Mr,true_divide as jr,floor_divide as Ur,mod as Hr,sqrt as Lr,power as Br,exp as Vr,exp2 as Gr,expm1 as Yr,log as Fr,log2 as Jr,log10 as Kr,log1p as Qr,logaddexp as Wr,logaddexp2 as Xr,absolute as Zr,negative as $r,sign as re,positive as ee,reciprocal as ae,cbrt as ne,fabs as te,divmod as oe,square as se,remainder as me,heaviside as ie,float_power as ue,fmod as pe,frexp as fe,gcd as be,lcm as le,ldexp as de,modf as ce,clip as ye,maximum as _e,minimum as ge,fmax as xe,fmin as he,nan_to_num as Ne,interp as Ae,unwrap as we,sinc as ze,i0 as Se}from"./full";import{power as De,absolute as ke}from"./full";import{sin as Te,cos as Oe,tan as Ie,arcsin as qe,arccos as Pe,arctan as Re,arctan2 as Ee,hypot as Me,degrees as je,radians as Ue,deg2rad as He,rad2deg as Le,sinh as Be,cosh as Ve,tanh as Ge,arcsinh as Ye,arccosh as Fe,arctanh as Je}from"./full";import{arcsin as Qe,arccos as We,arctan as Xe,arctan2 as Ze,arcsinh as $e,arccosh as ra,arctanh as ea}from"./full";import{dot as na,trace as ta,diagonal as oa,kron as sa,transpose as ma,inner as ia,outer as ua,tensordot as pa,einsum as fa,einsum_path as ba,vdot as la,vecdot as da,matrix_transpose as ca,permute_dims as ya,matvec as _a,vecmat as ga,cross as xa,matmul as ha,linalg as Na}from"./full";import{reshape as wa,flatten as za,ravel as Sa,squeeze as va,expand_dims as Da,swapaxes as ka,moveaxis as Ca,rollaxis as Ta,concatenate as Oa,stack as Ia,vstack as qa,hstack as Pa,dstack as Ra,column_stack as Ea,row_stack as Ma,block as ja,split as Ua,array_split as Ha,vsplit as La,hsplit as Ba,dsplit as Va,unstack as Ga,tile as Ya,repeat as Fa,flip as Ja,fliplr as Ka,flipud as Qa,rot90 as Wa,roll as Xa,resize as Za,atleast_1d as $a,atleast_2d as rn,atleast_3d as en,append as an,delete_ as nn,delete_ as tn,insert as on,pad as sn}from"./full";import{concatenate as un}from"./full";import{sum as fn,mean as bn,prod as ln,amax as dn,amin as cn,ptp as yn,argmin as _n,argmax as gn,std as xn,variance as hn,var_ as Nn,median as An,percentile as wn,quantile as zn,average as Sn,all as vn,any as Dn,cumsum as kn,cumprod as Cn,nansum as Tn,nanprod as On,nanmean as In,nanvar as qn,nanstd as Pn,nanmin as Rn,nanmax as En,nanargmin as Mn,nanargmax as jn,nancumsum as Un,nancumprod as Hn,nanmedian as Ln,nanquantile as Bn,nanpercentile as Vn}from"./full";import{amax as Yn,amin as Fn,cumsum as Jn,cumprod as Kn}from"./full";import{logical_and as Wn,logical_or as Xn,logical_not as Zn,logical_xor as $n,isfinite as rt,isinf as et,isnan as at,isnat as nt,isneginf as tt,isposinf as ot,iscomplex as st,iscomplexobj as mt,isreal as it,isrealobj as ut,real_if_close as pt,isfortran as ft,isscalar as bt,iterable as lt,isdtype as dt,promote_types as ct,copysign as yt,signbit as _t,nextafter as gt,spacing as xt,greater as ht,greater_equal as Nt,less as At,less_equal as wt,equal as zt,not_equal as St,isclose as vt,allclose as Dt}from"./full";import{sort as Ct,argsort as Tt,lexsort as Ot,partition as It,argpartition as qt,sort_complex as Pt,nonzero as Rt,argwhere as Et,flatnonzero as Mt,where as jt,searchsorted as Ut,extract as Ht,count_nonzero as Lt}from"./full";import{bitwise_and as Vt,bitwise_or as Gt,bitwise_xor as Yt,bitwise_not as Ft,invert as Jt,left_shift as Kt,right_shift as Qt,packbits as Wt,unpackbits as Xt,bitwise_count as Zt}from"./full";import{bitwise_not as ro,left_shift as eo,right_shift as ao}from"./full";import{around as to,round_ as oo,ceil as so,fix as mo,floor as io,rint as uo,trunc as po}from"./full";import{around as bo}from"./full";import{unique as co,in1d as yo,intersect1d as _o,isin as go,setdiff1d as xo,setxor1d as ho,union1d as No,trim_zeros as Ao,unique_all as wo,unique_counts as zo,unique_inverse as So,unique_values as vo}from"./full";import{bincount as ko,digitize as Co,histogram as To,histogram2d as Oo,histogramdd as Io,correlate as qo,convolve as Po,cov as Ro,corrcoef as Eo,histogram_bin_edges as Mo,trapezoid as jo}from"./full";import{diff as Ho,ediff1d as Lo,gradient as Bo}from"./full";import{real as Go,imag as Yo,conj as Fo,angle as Jo}from"./full";import{conj as Qo}from"./full";import{broadcast_to as Xo,broadcast_arrays as Zo,broadcast_shapes as $o,take as rs,put as es,iindex as as,bindex as ns,copyto as ts,choose as os,array_equal as ss,array_equiv as ms,take_along_axis as is,put_along_axis as us,putmask as ps,compress as fs,select as bs,place as ls,fill_diagonal as ds,diag_indices as cs,diag_indices_from as ys,tril_indices as _s,tril_indices_from as gs,triu_indices as xs,triu_indices_from as hs,mask_indices as Ns,indices as As,ix_ as ws,ravel_multi_index as zs,unravel_index as Ss,fill as vs,item as Ds,tolist as ks,tobytes as Cs,byteswap as Ts,view as Os,tofile as Is}from"./full";import{apply_along_axis as Ps,apply_over_axes as Rs,may_share_memory as Es,shares_memory as Ms,ndim as js,shape as Us,size as Hs,geterr as Ls,seterr as Bs}from"./full";import{array2string as Gs,array_repr as Ys,array_str as Fs,base_repr as Js,binary_repr as Ks,format_float_positional as Qs,format_float_scientific as Ws,get_printoptions as Xs,set_printoptions as Zs,printoptions as $s}from"./full";import{can_cast as em,common_type as am,result_type as nm,min_scalar_type as tm,issubdtype as om,typename as sm,mintypecode as mm}from"./full";import{poly as um,polyadd as pm,polyder as fm,polydiv as bm,polyfit as lm,polyint as dm,polymul as cm,polysub as ym,polyval as _m,roots as gm}from"./full";import{UnsupportedDTypeError as hm,InvalidNpyError as Nm,SUPPORTED_DTYPES as Am,DTYPE_TO_DESCR as wm}from"./io/npy/format";import{serializeNpy as Sm}from"./io/npy/serializer";import{serializeNpz as Dm,serializeNpzSync as km}from"./io/npz/serializer";import{serializeTxt as Tm}from"./io/txt/serializer";import{parseNpy as b,parseNpyHeader as l,parseNpyData as d}from"./io/npy/parser";import{parseNpz as c,parseNpzSync as y,loadNpz as _,loadNpzSync as g}from"./io/npz/parser";import{parseTxt as x,genfromtxt as h,fromregex as N}from"./io/txt/parser";function p(r){return s.fromStorage(r.storage)}function v(r){return p(b(r))}const D=l;function k(r,e){return p(d(r,e))}async function C(r,e={}){const a=await c(r,e),t=new Map;for(const[u,f]of a.arrays)t.set(u,p(f));return{arrays:t,skipped:a.skipped,errors:a.errors}}function T(r,e={}){const a=y(r,e),t=new Map;for(const[u,f]of a.arrays)t.set(u,p(f));return{arrays:t,skipped:a.skipped,errors:a.errors}}async function O(r,e={}){const a=await _(r,e),t={};for(const[u,f]of Object.entries(a))t[u]=p(f);return t}function I(r,e={}){const a=g(r,e),t={};for(const[u,f]of Object.entries(a))t[u]=p(f);return t}function q(r,e={}){return p(x(r,e))}function P(r,e={}){return p(h(r,e))}function R(r,e,a="float64"){return p(N(r,e,a))}import*as n from"./common/ops/random";import{NDArray as s}from"./full";function o(r){return r&&typeof r=="object"&&"_data"in r&&"_shape"in r?s.fromStorage(r):r}const L={seed:n.seed,get_state:n.get_state,set_state:n.set_state,get_bit_generator:n.get_bit_generator,set_bit_generator:n.set_bit_generator,default_rng:n.default_rng,Generator:n.Generator,random:r=>o(n.random(r)),rand:(...r)=>o(n.rand(...r)),randn:(...r)=>o(n.randn(...r)),randint:(r,e,a,t)=>o(n.randint(r,e,a,t)),random_sample:r=>o(n.random_sample(r)),ranf:r=>o(n.ranf(r)),sample:r=>o(n.sample(r)),random_integers:(r,e,a)=>o(n.random_integers(r,e,a)),bytes:n.bytes,uniform:(r,e,a)=>o(n.uniform(r,e,a)),normal:(r,e,a)=>o(n.normal(r,e,a)),standard_normal:r=>o(n.standard_normal(r)),exponential:(r,e)=>o(n.exponential(r,e)),standard_exponential:r=>o(n.standard_exponential(r)),gamma:(r,e,a)=>o(n.gamma(r,e,a)),standard_gamma:(r,e)=>o(n.standard_gamma(r,e)),beta:(r,e,a)=>o(n.beta(r,e,a)),chisquare:(r,e)=>o(n.chisquare(r,e)),noncentral_chisquare:(r,e,a)=>o(n.noncentral_chisquare(r,e,a)),f:(r,e,a)=>o(n.f(r,e,a)),noncentral_f:(r,e,a,t)=>o(n.noncentral_f(r,e,a,t)),standard_cauchy:r=>o(n.standard_cauchy(r)),standard_t:(r,e)=>o(n.standard_t(r,e)),laplace:(r,e,a)=>o(n.laplace(r,e,a)),logistic:(r,e,a)=>o(n.logistic(r,e,a)),lognormal:(r,e,a)=>o(n.lognormal(r,e,a)),gumbel:(r,e,a)=>o(n.gumbel(r,e,a)),pareto:(r,e)=>o(n.pareto(r,e)),power:(r,e)=>o(n.power(r,e)),rayleigh:(r,e)=>o(n.rayleigh(r,e)),triangular:(r,e,a,t)=>o(n.triangular(r,e,a,t)),wald:(r,e,a)=>o(n.wald(r,e,a)),weibull:(r,e)=>o(n.weibull(r,e)),poisson:(r,e)=>o(n.poisson(r,e)),binomial:(r,e,a)=>o(n.binomial(r,e,a)),geometric:(r,e)=>o(n.geometric(r,e)),hypergeometric:(r,e,a,t)=>o(n.hypergeometric(r,e,a,t)),logseries:(r,e)=>o(n.logseries(r,e)),negative_binomial:(r,e,a)=>o(n.negative_binomial(r,e,a)),zipf:(r,e)=>o(n.zipf(r,e)),multinomial:(r,e,a)=>o(n.multinomial(r,e,a)),multivariate_normal:(r,e,a,t,u)=>o(n.multivariate_normal(r,e,a,t,u)),dirichlet:(r,e)=>o(n.dirichlet(r,e)),vonmises:(r,e,a)=>o(n.vonmises(r,e,a)),choice:(r,e,a,t)=>o(n.choice(r,e,a,t)),permutation:r=>o(n.permutation(r)),shuffle:n.shuffle};import*as m from"./common/ops/fft";import{NDArrayCore as A}from"./common/ndarray-core";function i(r){return r instanceof s||r instanceof A?r.storage:r}const V={fft:(r,e,a,t)=>s.fromStorage(m.fft(i(r),e,a,t)),ifft:(r,e,a,t)=>s.fromStorage(m.ifft(i(r),e,a,t)),fft2:(r,e,a,t)=>s.fromStorage(m.fft2(i(r),e,a,t)),ifft2:(r,e,a,t)=>s.fromStorage(m.ifft2(i(r),e,a,t)),fftn:(r,e,a,t)=>s.fromStorage(m.fftn(i(r),e,a,t)),ifftn:(r,e,a,t)=>s.fromStorage(m.ifftn(i(r),e,a,t)),rfft:(r,e,a,t)=>s.fromStorage(m.rfft(i(r),e,a,t)),irfft:(r,e,a,t)=>s.fromStorage(m.irfft(i(r),e,a,t)),rfft2:(r,e,a,t)=>s.fromStorage(m.rfft2(i(r),e,a,t)),irfft2:(r,e,a,t)=>s.fromStorage(m.irfft2(i(r),e,a,t)),rfftn:(r,e,a,t)=>s.fromStorage(m.rfftn(i(r),e,a,t)),irfftn:(r,e,a,t)=>s.fromStorage(m.irfftn(i(r),e,a,t)),hfft:(r,e,a,t)=>s.fromStorage(m.hfft(i(r),e,a,t)),ihfft:(r,e,a,t)=>s.fromStorage(m.ihfft(i(r),e,a,t)),fftfreq:(r,e)=>s.fromStorage(m.fftfreq(r,e)),rfftfreq:(r,e)=>s.fromStorage(m.rfftfreq(r,e)),fftshift:(r,e)=>s.fromStorage(m.fftshift(i(r),e)),ifftshift:(r,e)=>s.fromStorage(m.ifftshift(i(r),e))},G="1.0.0";export{J as Complex,wm as DTYPE_TO_DESCR,Nm as InvalidNpyError,Q as NDArray,X as NDArrayCore,Am as SUPPORTED_DTYPES,hm as UnsupportedDTypeError,G as __version__,ke as abs,Zr as absolute,We as acos,ra as acosh,Pr as add,vn as all,Dt as allclose,dn as amax,cn as amin,Jo as angle,Dn as any,an as append,Ps as apply_along_axis,Rs as apply_over_axes,tr as arange,Pe as arccos,Fe as arccosh,qe as arcsin,Ye as arcsinh,Re as arctan,Ee as arctan2,Je as arctanh,gn as argmax,_n as argmin,qt as argpartition,Tt as argsort,Et as argwhere,to as around,nr as array,Gs as array2string,ss as array_equal,ms as array_equiv,Ys as array_repr,Ha as array_split,Fs as array_str,yr as asanyarray,pr as asarray,_r as asarray_chkfinite,gr as ascontiguousarray,xr as asfortranarray,Qe as asin,$e as asinh,Xe as atan,Ze as atan2,ea as atanh,$a as atleast_1d,rn as atleast_2d,en as atleast_3d,Sn as average,Js as base_repr,Ks as binary_repr,ko as bincount,ns as bindex,Vt as bitwise_and,Zt as bitwise_count,ro as bitwise_invert,eo as bitwise_left_shift,Ft as bitwise_not,Gt as bitwise_or,ao as bitwise_right_shift,Yt as bitwise_xor,ja as block,Zo as broadcast_arrays,$o as broadcast_shapes,Xo as broadcast_to,Ts as byteswap,em as can_cast,ne as cbrt,so as ceil,os as choose,ye as clip,Ea as column_stack,am as common_type,fs as compress,un as concat,Oa as concatenate,Fo as conj,Qo as conjugate,Po as convolve,cr as copy,yt as copysign,ts as copyto,Eo as corrcoef,qo as correlate,Oe as cos,Ve as cosh,Lt as count_nonzero,Ro as cov,xa as cross,Cn as cumprod,kn as cumsum,Kn as cumulative_prod,Jn as cumulative_sum,He as deg2rad,je as degrees,tn as delete,nn as delete_,Nr as diag,cs as diag_indices,ys as diag_indices_from,Ar as diagflat,oa as diagonal,Ho as diff,Co as digitize,Mr as divide,oe as divmod,na as dot,Va as dsplit,Ra as dstack,Lo as ediff1d,fa as einsum,ba as einsum_path,er as empty,lr as empty_like,zt as equal,Vr as exp,Gr as exp2,Da as expand_dims,Yr as expm1,Ht as extract,ir as eye,te as fabs,V as fft,vs as fill,ds as fill_diagonal,mo as fix,Mt as flatnonzero,za as flatten,Ja as flip,Ka as fliplr,Qa as flipud,ue as float_power,io as floor,Ur as floor_divide,xe as fmax,he as fmin,pe as fmod,Qs as format_float_positional,Ws as format_float_scientific,fe as frexp,wr as frombuffer,zr as fromfile,Sr as fromfunction,vr as fromiter,R as fromregex,Dr as fromstring,ar as full,dr as full_like,be as gcd,P as genfromtxt,mr as geomspace,Xs as get_printoptions,Ls as geterr,Bo as gradient,ht as greater,Nt as greater_equal,ie as heaviside,To as histogram,Oo as histogram2d,Mo as histogram_bin_edges,Io as histogramdd,Ba as hsplit,Pa as hstack,Me as hypot,Se as i0,ur as identity,as as iindex,Yo as imag,yo as in1d,As as indices,ia as inner,on as insert,Ae as interp,_o as intersect1d,Jt as invert,vt as isclose,st as iscomplex,mt as iscomplexobj,dt as isdtype,rt as isfinite,ft as isfortran,go as isin,et as isinf,at as isnan,nt as isnat,tt as isneginf,ot as isposinf,it as isreal,ut as isrealobj,bt as isscalar,om as issubdtype,Ds as item,lt as iterable,ws as ix_,sa as kron,le as lcm,de as ldexp,Kt as left_shift,At as less,wt as less_equal,Ot as lexsort,Na as linalg,or as linspace,O as loadNpz,I as loadNpzSync,Fr as log,Kr as log10,Qr as log1p,Jr as log2,Wr as logaddexp,Xr as logaddexp2,Wn as logical_and,Zn as logical_not,Xn as logical_or,$n as logical_xor,sr as logspace,Ns as mask_indices,ha as matmul,ca as matrix_transpose,_a as matvec,Yn as max,_e as maximum,Es as may_share_memory,bn as mean,An as median,kr as meshgrid,Fn as min,tm as min_scalar_type,ge as minimum,mm as mintypecode,Hr as mod,ce as modf,Ca as moveaxis,Er as multiply,Ne as nan_to_num,jn as nanargmax,Mn as nanargmin,Hn as nancumprod,Un as nancumsum,En as nanmax,In as nanmean,Ln as nanmedian,Rn as nanmin,Vn as nanpercentile,On as nanprod,Bn as nanquantile,Pn as nanstd,Tn as nansum,qn as nanvar,js as ndim,$r as negative,gt as nextafter,Rt as nonzero,St as not_equal,rr as ones,br as ones_like,ua as outer,Wt as packbits,sn as pad,v as parseNpy,k as parseNpyData,D as parseNpyHeader,C as parseNpz,T as parseNpzSync,q as parseTxt,It as partition,wn as percentile,ya as permute_dims,ls as place,um as poly,pm as polyadd,fm as polyder,bm as polydiv,lm as polyfit,dm as polyint,cm as polymul,ym as polysub,_m as polyval,ee as positive,De as pow,Br as power,$s as printoptions,ln as prod,ct as promote_types,yn as ptp,es as put,us as put_along_axis,ps as putmask,zn as quantile,Le as rad2deg,Ue as radians,L as random,Sa as ravel,zs as ravel_multi_index,Go as real,pt as real_if_close,ae as reciprocal,me as remainder,Fa as repeat,hr as require,wa as reshape,Za as resize,nm as result_type,Qt as right_shift,uo as rint,Xa as roll,Ta as rollaxis,gm as roots,Wa as rot90,bo as round,oo as round_,Ma as row_stack,Ut as searchsorted,bs as select,Sm as serializeNpy,Dm as serializeNpz,km as serializeNpzSync,Tm as serializeTxt,Zs as set_printoptions,xo as setdiff1d,Bs as seterr,ho as setxor1d,Us as shape,Ms as shares_memory,re as sign,_t as signbit,Te as sin,ze as sinc,Be as sinh,Hs as size,Ct as sort,Pt as sort_complex,xt as spacing,Ua as split,Lr as sqrt,se as square,va as squeeze,Ia as stack,xn as std,Rr as subtract,fn as sum,ka as swapaxes,rs as take,is as take_along_axis,Ie as tan,Ge as tanh,pa as tensordot,Ya as tile,Cs as tobytes,Is as tofile,ks as tolist,ta as trace,ma as transpose,jo as trapezoid,Cr as tri,Tr as tril,_s as tril_indices,gs as tril_indices_from,Ao as trim_zeros,Or as triu,xs as triu_indices,hs as triu_indices_from,jr as true_divide,po as trunc,sm as typename,No as union1d,co as unique,wo as unique_all,zo as unique_counts,So as unique_inverse,vo as unique_values,Xt as unpackbits,Ss as unravel_index,Ga as unstack,we as unwrap,Ir as vander,Nn as var,hn as variance,la as vdot,da as vecdot,ga as vecmat,Os as view,La as vsplit,qa as vstack,jt as where,$ as zeros,fr as zeros_like};