numpy2 1.0.0__tar.gz → 2.0.1__tar.gz

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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: numpy2
3
- Version: 1.0.0
4
- Summary: Advanced NumPy for Web Applications - JSON serialization, type conversion, framework integration
3
+ Version: 2.0.1
4
+ Summary: Pure-Python NumPy drop-in: full NumPy API + JSON serialization, FastAPI/Flask/Django integration, zero dependencies
5
5
  Home-page: https://github.com/maheshmakvana/numpy2
6
6
  Author: Mahesh Makvana
7
7
  Author-email: Mahesh Makvana <mahesh.makvana@example.com>
@@ -10,7 +10,7 @@ Project-URL: Homepage, https://github.com/maheshmakvana/numpy2
10
10
  Project-URL: Bug Tracker, https://github.com/maheshmakvana/numpy2/issues
11
11
  Project-URL: Documentation, https://github.com/maheshmakvana/numpy2/wiki
12
12
  Project-URL: Source Code, https://github.com/maheshmakvana/numpy2
13
- Keywords: numpy,json,serialization,fastapi,flask,django,web,api,pandas,data-science
13
+ Keywords: numpy,numpy2,numpy drop-in,pure python numpy,json serialization,numpy json,fastapi numpy,flask numpy,django numpy,pandas,data-science,ndarray,linear algebra,fft,random,numerical computing,scientific computing,int64 json,numpy serializable,rest-api
14
14
  Classifier: Development Status :: 5 - Production/Stable
15
15
  Classifier: Environment :: Web Environment
16
16
  Classifier: Intended Audience :: Developers
@@ -30,8 +30,6 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
30
30
  Requires-Python: >=3.8
31
31
  Description-Content-Type: text/markdown
32
32
  License-File: LICENSE
33
- Requires-Dist: numpy>=1.20.0
34
- Requires-Dist: pandas>=1.3.0
35
33
  Provides-Extra: fastapi
36
34
  Requires-Dist: fastapi>=0.95.0; extra == "fastapi"
37
35
  Requires-Dist: starlette>=0.26.0; extra == "fastapi"
@@ -54,10 +52,12 @@ Dynamic: requires-python
54
52
 
55
53
  **Built by [Mahesh Makvana](https://github.com/maheshmakvana)**
56
54
 
57
- ![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)
58
- ![PyPI version](https://img.shields.io/badge/pypi-1.0.0-brightgreen.svg)
59
- ![License](https://img.shields.io/badge/license-MIT-green.svg)
60
- ![NumPy Compatible](https://img.shields.io/badge/numpy-compatible-brightgreen.svg)
55
+ [![PyPI version](https://img.shields.io/pypi/v/numpy2.svg)](https://pypi.org/project/numpy2/)
56
+ [![Python Version](https://img.shields.io/pypi/pyversions/numpy2.svg)](https://pypi.org/project/numpy2/)
57
+ [![Downloads](https://img.shields.io/pypi/dm/numpy2.svg)](https://pypi.org/project/numpy2/)
58
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
59
+ [![NumPy Compatible](https://img.shields.io/badge/numpy-compatible-brightgreen.svg)](https://pypi.org/project/numpy2/)
60
+ [![Pure Python](https://img.shields.io/badge/pure-python-blue.svg)](https://pypi.org/project/numpy2/)
61
61
 
62
62
  ---
63
63
 
@@ -2,10 +2,12 @@
2
2
 
3
3
  **Built by [Mahesh Makvana](https://github.com/maheshmakvana)**
4
4
 
5
- ![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)
6
- ![PyPI version](https://img.shields.io/badge/pypi-1.0.0-brightgreen.svg)
7
- ![License](https://img.shields.io/badge/license-MIT-green.svg)
8
- ![NumPy Compatible](https://img.shields.io/badge/numpy-compatible-brightgreen.svg)
5
+ [![PyPI version](https://img.shields.io/pypi/v/numpy2.svg)](https://pypi.org/project/numpy2/)
6
+ [![Python Version](https://img.shields.io/pypi/pyversions/numpy2.svg)](https://pypi.org/project/numpy2/)
7
+ [![Downloads](https://img.shields.io/pypi/dm/numpy2.svg)](https://pypi.org/project/numpy2/)
8
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
9
+ [![NumPy Compatible](https://img.shields.io/badge/numpy-compatible-brightgreen.svg)](https://pypi.org/project/numpy2/)
10
+ [![Pure Python](https://img.shields.io/badge/pure-python-blue.svg)](https://pypi.org/project/numpy2/)
9
11
 
10
12
  ---
11
13
 
@@ -0,0 +1,463 @@
1
+ """
2
+ numpy2 - Drop-in NumPy replacement, pure Python, no NumPy required
3
+ ====================================================================
4
+
5
+ Replace every ``import numpy as np`` with ``import numpy2 as np`` and
6
+ everything works identically — PLUS built-in JSON serialization and
7
+ web framework integration.
8
+
9
+ >>> import numpy2 as np # replaces: import numpy as np
10
+ >>> arr = np.array([1, 2, 3]) # identical API
11
+ >>> arr.mean() # 2.0
12
+ >>> np.to_json(arr) # '[1, 2, 3]'
13
+
14
+ NumPy is used as an optional accelerator when installed; if it is absent
15
+ every operation runs in pure Python.
16
+ """
17
+
18
+ __version__ = "2.0.1"
19
+ __author__ = "Mahesh Makvana"
20
+ __email__ = "mahesh.makvana@example.com"
21
+ __license__ = "MIT"
22
+
23
+ # ── 1. dtype system ───────────────────────────────────────────────────────────
24
+ from .dtypes import (
25
+ dtype,
26
+ bool_, bool8,
27
+ int8, int16, int32, int64,
28
+ int_, intp, intc,
29
+ uint8, uint16, uint32, uint64,
30
+ float16, float32, float64,
31
+ float_, double, single, half,
32
+ complex64, complex128,
33
+ object_, str_, bytes_,
34
+ longdouble, clongdouble,
35
+ result_type,
36
+ )
37
+ # extra aliases
38
+ bool8 = bool_
39
+ csingle = complex64
40
+ cdouble = complex128
41
+ longfloat = longdouble
42
+
43
+ # ── 2. ndarray & array creation ───────────────────────────────────────────────
44
+ from .array import (
45
+ ndarray,
46
+ array, asarray, ascontiguousarray, asfortranarray,
47
+ zeros, ones, full, empty,
48
+ zeros_like, ones_like, full_like, empty_like,
49
+ eye, identity,
50
+ arange, linspace, logspace, geomspace,
51
+ diag, diagflat, tril, triu, vander,
52
+ meshgrid,
53
+ indices, fromiter, frombuffer, fromfunction, fromstring,
54
+ loadtxt, savetxt, load, save, savez,
55
+ concatenate, stack, vstack, hstack, dstack, column_stack, row_stack,
56
+ split, hsplit, vsplit, dsplit,
57
+ tile, repeat, unique,
58
+ flip, fliplr, flipud, rot90, roll, pad,
59
+ broadcast_to, broadcast_arrays,
60
+ expand_dims, squeeze,
61
+ atleast_1d, atleast_2d, atleast_3d,
62
+ where, select, argwhere,
63
+ argmax, argmin, argsort, sort, lexsort, searchsorted,
64
+ count_nonzero, flatnonzero, nonzero,
65
+ isnan, isinf, isfinite, isneginf, isposinf,
66
+ isreal, iscomplex, isscalar, isclose, allclose,
67
+ array_equal, array_equiv,
68
+ may_share_memory, shares_memory,
69
+ can_cast, common_type, min_scalar_type, promote_types,
70
+ shape, ndim, size,
71
+ copyto, iterable,
72
+ unravel_index, ravel_multi_index,
73
+ ix_, ndindex, ndenumerate,
74
+ apply_along_axis, apply_over_axes,
75
+ vectorize, frompyfunc,
76
+ # constants
77
+ nan, inf, pi, e, newaxis,
78
+ # matrix ops
79
+ matmul,
80
+ # broadcast helper (internal but useful)
81
+ _broadcast_shapes as _broadcast_shapes_internal,
82
+ )
83
+ PINF = inf
84
+ NINF = -inf
85
+ Inf = inf
86
+ Infinity = inf
87
+ NaN = nan
88
+ False_ = False
89
+ True_ = True
90
+ PZERO = 0.0
91
+ NZERO = -0.0
92
+
93
+ # mgrid / ogrid stubs
94
+ class _MGridClass:
95
+ def __getitem__(self, key):
96
+ raise NotImplementedError("Use meshgrid or arange in numpy2 pure mode")
97
+ mgrid = _MGridClass()
98
+ ogrid = _MGridClass()
99
+
100
+ # index_exp / s_ stubs
101
+ class _IndexExpClass:
102
+ def __getitem__(self, key):
103
+ return key
104
+ index_exp = _IndexExpClass()
105
+ s_ = _IndexExpClass()
106
+
107
+ c_ = None # not yet implemented
108
+ r_ = None
109
+
110
+ # ── 3. math / ufuncs ──────────────────────────────────────────────────────────
111
+ from .math_ops import (
112
+ # trig
113
+ sin, cos, tan,
114
+ arcsin, arccos, arctan, arctan2,
115
+ hypot, deg2rad, rad2deg, degrees, radians, unwrap,
116
+ # hyperbolic
117
+ sinh, cosh, tanh, arcsinh, arccosh, arctanh,
118
+ # exp / log
119
+ exp, exp2, expm1, log, log2, log10, log1p,
120
+ # rounding
121
+ floor, ceil, trunc, rint, fix, around, round_,
122
+ # arithmetic ufuncs
123
+ add, subtract, multiply, divide, true_divide, floor_divide,
124
+ negative, positive, power, float_power,
125
+ remainder, mod, fmod,
126
+ absolute, fabs, sign, heaviside,
127
+ sqrt, cbrt, square, reciprocal,
128
+ # logical
129
+ logical_and, logical_or, logical_xor, logical_not,
130
+ # bitwise
131
+ bitwise_and, bitwise_or, bitwise_xor, bitwise_not, invert,
132
+ left_shift, right_shift,
133
+ # comparison
134
+ greater, greater_equal, less, less_equal, equal, not_equal,
135
+ maximum, minimum, fmax, fmin,
136
+ # complex
137
+ real, imag, conj, conjugate, angle,
138
+ # reductions
139
+ sum, prod, nansum, nanprod,
140
+ mean, nanmean, std, nanstd, var, nanvar,
141
+ min, max, nanmin, nanmax,
142
+ ptp, cumsum, cumprod, nancumsum, nancumprod,
143
+ diff, gradient, ediff1d,
144
+ # linear algebra
145
+ cross, dot, vdot, inner, outer, kron, tensordot, einsum,
146
+ # stats
147
+ median, nanmedian,
148
+ percentile, nanpercentile, quantile, nanquantile,
149
+ average, correlate, convolve,
150
+ cov, corrcoef,
151
+ histogram, histogram2d, histogramdd,
152
+ bincount, digitize, interp, trapz,
153
+ i0, sinc,
154
+ lcm, gcd, modf, frexp, ldexp, spacing, nextafter,
155
+ # abs alias
156
+ abs as absolute_fn,
157
+ )
158
+ # shadow Python builtins with numpy2 versions
159
+ abs = absolute
160
+ round = around
161
+
162
+ # ── 4. submodules ─────────────────────────────────────────────────────────────
163
+ from . import linalg
164
+ from . import fft
165
+ from . import random
166
+
167
+ # make polynomial, ma, lib stubs (users can still use them via numpy if installed)
168
+ try:
169
+ import numpy as _np_opt
170
+ polynomial = _np_opt.polynomial
171
+ ma = _np_opt.ma
172
+ lib = _np_opt.lib
173
+ char = _np_opt.char
174
+ try:
175
+ strings = _np_opt.strings
176
+ except AttributeError:
177
+ pass
178
+ try:
179
+ exceptions = _np_opt.exceptions
180
+ except AttributeError:
181
+ pass
182
+ # also expose numpy's testing module
183
+ testing = _np_opt.testing
184
+ except ImportError:
185
+ # provide minimal stubs so imports don't crash
186
+ class _Stub:
187
+ def __getattr__(self, name):
188
+ raise ImportError(f"numpy2: 'numpy.{name}' requires NumPy to be installed")
189
+ polynomial = _Stub()
190
+ ma = _Stub()
191
+ lib = _Stub()
192
+ char = _Stub()
193
+ testing = _Stub()
194
+
195
+ # ── 5. numpy2 web extras ──────────────────────────────────────────────────────
196
+ from .core import (
197
+ to_json, from_json,
198
+ serialize, deserialize,
199
+ JSONEncoder, JSONDecoder,
200
+ )
201
+
202
+ from .converters import (
203
+ numpy_to_python, pandas_to_json,
204
+ python_to_numpy, infer_dtype,
205
+ safe_cast, batch_convert,
206
+ )
207
+
208
+ from .integrations import (
209
+ FastAPIResponse, FlaskResponse, DjangoResponse,
210
+ setup_json_encoder, create_response_handler,
211
+ )
212
+
213
+ # ── 6. nditer / ndenumerate compatibility ────────────────────────────────────
214
+ class nditer:
215
+ """Minimal nditer stub."""
216
+ def __init__(self, op, flags=None, op_flags=None, op_dtypes=None,
217
+ order='K', casting='safe', op_axes=None, itershape=None,
218
+ buffersize=0):
219
+ from .array import asarray
220
+ self._arr = asarray(op) if not isinstance(op, (list, tuple)) else [asarray(o) for o in op]
221
+ self._idx = 0
222
+ if isinstance(self._arr, list):
223
+ self._data = list(zip(*[a._data for a in self._arr]))
224
+ else:
225
+ self._data = self._arr._data
226
+
227
+ def __iter__(self):
228
+ return self
229
+
230
+ def __next__(self):
231
+ if self._idx >= len(self._data):
232
+ raise StopIteration
233
+ val = self._data[self._idx]
234
+ self._idx += 1
235
+ return val
236
+
237
+ def __len__(self):
238
+ return len(self._data)
239
+
240
+ @property
241
+ def finished(self):
242
+ return self._idx >= len(self._data)
243
+
244
+ def iternext(self):
245
+ if self._idx < len(self._data):
246
+ self._idx += 1
247
+ return True
248
+ return False
249
+
250
+ # ── 7. poly functions ─────────────────────────────────────────────────────────
251
+ from .math_ops import interp as _interp
252
+
253
+ def polyval(p, x):
254
+ """Evaluate polynomial with coefficients p at points x."""
255
+ from .array import asarray
256
+ p = asarray(p)
257
+ x = asarray(x)
258
+ result = zeros_like(x, dtype='float64')
259
+ for coef in p._data:
260
+ result = result * x + coef
261
+ return result
262
+
263
+ def polyfit(x, y, deg):
264
+ """Least-squares polynomial fit. Returns coefficients."""
265
+ from .array import asarray
266
+ from .linalg import lstsq
267
+ x = asarray(x, dtype='float64')
268
+ y = asarray(y, dtype='float64')
269
+ # Vandermonde matrix
270
+ V = vander(x, deg + 1)
271
+ coeffs, _, _, _ = lstsq(V, y)
272
+ return coeffs
273
+
274
+ def polyadd(a1, a2):
275
+ from .array import asarray
276
+ a1, a2 = asarray(a1, dtype='float64'), asarray(a2, dtype='float64')
277
+ n1, n2 = len(a1._data), len(a2._data)
278
+ if n1 < n2:
279
+ a1 = concatenate([zeros(n2 - n1, dtype='float64'), a1])
280
+ elif n2 < n1:
281
+ a2 = concatenate([zeros(n1 - n2, dtype='float64'), a2])
282
+ return a1 + a2
283
+
284
+ def polysub(a1, a2):
285
+ return polyadd(a1, -asarray(a2, dtype='float64'))
286
+
287
+ def polymul(a1, a2):
288
+ return convolve(a1, a2)
289
+
290
+ def polydiv(u, v):
291
+ u = list(asarray(u, dtype='float64')._data)
292
+ v = list(asarray(v, dtype='float64')._data)
293
+ # polynomial long division
294
+ q, r = [], list(u)
295
+ while len(r) >= len(v):
296
+ coef = r[0] / v[0]
297
+ q.append(coef)
298
+ for i in range(len(v)):
299
+ r[i] -= coef * v[i]
300
+ r.pop(0)
301
+ return array(q, dtype='float64'), array(r, dtype='float64')
302
+
303
+ def polyder(p, m=1):
304
+ p = list(asarray(p, dtype='float64')._data)
305
+ for _ in range(m):
306
+ n = len(p) - 1
307
+ p = [(n - i) * p[i] for i in range(n)]
308
+ return array(p, dtype='float64')
309
+
310
+ def polyint(p, m=1, k=None):
311
+ p = list(asarray(p, dtype='float64')._data)
312
+ for _ in range(m):
313
+ n = len(p)
314
+ p = [p[i] / (n - i) for i in range(n)] + [0.0]
315
+ return array(p, dtype='float64')
316
+
317
+ def poly(seq_of_zeros):
318
+ """Return polynomial with given roots."""
319
+ seq = asarray(seq_of_zeros, dtype='float64')
320
+ result = array([1.0])
321
+ for root in seq._data:
322
+ result = polymul(result, array([1.0, -root]))
323
+ return result
324
+
325
+ class poly1d:
326
+ """1-D polynomial class."""
327
+ def __init__(self, c_or_r, r=False, variable=None):
328
+ c = asarray(c_or_r, dtype='float64')
329
+ if r:
330
+ self.coeffs = poly(c)
331
+ else:
332
+ self.coeffs = c
333
+
334
+ def __call__(self, val):
335
+ return polyval(self.coeffs, asarray(val, dtype='float64'))
336
+
337
+ @property
338
+ def order(self):
339
+ return len(self.coeffs._data) - 1
340
+
341
+ def __repr__(self):
342
+ return f"poly1d({self.coeffs.tolist()})"
343
+
344
+
345
+ # ── 8. seterr / errstate (stubs) ──────────────────────────────────────────────
346
+ _err_state = {'divide': 'warn', 'over': 'warn', 'under': 'ignore', 'invalid': 'warn'}
347
+
348
+ def seterr(divide=None, over=None, under=None, invalid=None, all=None):
349
+ old = dict(_err_state)
350
+ for key, val in [('divide', divide), ('over', over), ('under', under), ('invalid', invalid)]:
351
+ if val is not None:
352
+ _err_state[key] = val
353
+ if all is not None:
354
+ for key in _err_state:
355
+ _err_state[key] = all
356
+ return old
357
+
358
+ def geterr():
359
+ return dict(_err_state)
360
+
361
+ class errstate:
362
+ def __init__(self, **kwargs):
363
+ self._kwargs = kwargs
364
+ self._old = {}
365
+ def __enter__(self):
366
+ self._old = seterr(**self._kwargs)
367
+ def __exit__(self, *args):
368
+ seterr(**self._old)
369
+
370
+ def seterrcall(func):
371
+ pass
372
+
373
+ def geterrcall():
374
+ return None
375
+
376
+
377
+ # ── 9. __all__ ────────────────────────────────────────────────────────────────
378
+ __all__ = [
379
+ # dtype
380
+ 'dtype',
381
+ 'bool_', 'bool8', 'int8', 'int16', 'int32', 'int64',
382
+ 'int_', 'intp', 'intc',
383
+ 'uint8', 'uint16', 'uint32', 'uint64',
384
+ 'float16', 'float32', 'float64', 'float_', 'double', 'single', 'half',
385
+ 'complex64', 'complex128', 'csingle', 'cdouble',
386
+ 'object_', 'str_', 'bytes_',
387
+ 'longdouble', 'longfloat', 'clongdouble',
388
+ 'result_type',
389
+ # ndarray & creation
390
+ 'ndarray', 'matrix',
391
+ 'array', 'asarray', 'ascontiguousarray', 'asfortranarray',
392
+ 'zeros', 'ones', 'full', 'empty',
393
+ 'zeros_like', 'ones_like', 'full_like', 'empty_like',
394
+ 'eye', 'identity', 'arange', 'linspace', 'logspace', 'geomspace',
395
+ 'diag', 'diagflat', 'tril', 'triu', 'vander',
396
+ 'meshgrid', 'mgrid', 'ogrid', 'indices',
397
+ 'fromiter', 'frombuffer', 'fromfunction', 'fromstring',
398
+ 'loadtxt', 'savetxt', 'load', 'save', 'savez',
399
+ 'concatenate', 'stack', 'vstack', 'hstack', 'dstack', 'column_stack', 'row_stack',
400
+ 'split', 'hsplit', 'vsplit', 'dsplit',
401
+ 'tile', 'repeat', 'unique',
402
+ 'flip', 'fliplr', 'flipud', 'rot90', 'roll', 'pad',
403
+ 'broadcast_to', 'broadcast_arrays', 'expand_dims', 'squeeze',
404
+ 'atleast_1d', 'atleast_2d', 'atleast_3d',
405
+ 'where', 'select', 'argwhere', 'argmax', 'argmin', 'argsort', 'sort', 'lexsort',
406
+ 'searchsorted', 'count_nonzero', 'flatnonzero', 'nonzero',
407
+ 'isnan', 'isinf', 'isfinite', 'isneginf', 'isposinf',
408
+ 'isreal', 'iscomplex', 'isscalar', 'isclose', 'allclose',
409
+ 'array_equal', 'array_equiv',
410
+ 'may_share_memory', 'shares_memory',
411
+ 'can_cast', 'common_type', 'min_scalar_type', 'promote_types',
412
+ 'shape', 'ndim', 'size', 'copyto', 'iterable',
413
+ 'unravel_index', 'ravel_multi_index', 'ix_', 'ndindex', 'ndenumerate',
414
+ 'apply_along_axis', 'apply_over_axes', 'vectorize', 'frompyfunc',
415
+ 'nan', 'inf', 'pi', 'e', 'newaxis', 'nan', 'inf',
416
+ 'NaN', 'Inf', 'Infinity', 'PINF', 'NINF',
417
+ 'matmul', 'nditer', 'index_exp', 's_',
418
+ # math
419
+ 'sin', 'cos', 'tan', 'arcsin', 'arccos', 'arctan', 'arctan2',
420
+ 'hypot', 'deg2rad', 'rad2deg', 'degrees', 'radians', 'unwrap',
421
+ 'sinh', 'cosh', 'tanh', 'arcsinh', 'arccosh', 'arctanh',
422
+ 'exp', 'exp2', 'expm1', 'log', 'log2', 'log10', 'log1p',
423
+ 'floor', 'ceil', 'trunc', 'rint', 'fix', 'around', 'round_',
424
+ 'add', 'subtract', 'multiply', 'divide', 'true_divide', 'floor_divide',
425
+ 'negative', 'positive', 'power', 'float_power',
426
+ 'remainder', 'mod', 'fmod',
427
+ 'absolute', 'fabs', 'sign', 'heaviside',
428
+ 'sqrt', 'cbrt', 'square', 'reciprocal',
429
+ 'logical_and', 'logical_or', 'logical_xor', 'logical_not',
430
+ 'bitwise_and', 'bitwise_or', 'bitwise_xor', 'bitwise_not', 'invert',
431
+ 'left_shift', 'right_shift',
432
+ 'greater', 'greater_equal', 'less', 'less_equal', 'equal', 'not_equal',
433
+ 'maximum', 'minimum', 'fmax', 'fmin',
434
+ 'real', 'imag', 'conj', 'conjugate', 'angle',
435
+ 'sum', 'prod', 'nansum', 'nanprod',
436
+ 'mean', 'nanmean', 'std', 'nanstd', 'var', 'nanvar',
437
+ 'min', 'max', 'nanmin', 'nanmax',
438
+ 'ptp', 'cumsum', 'cumprod', 'nancumsum', 'nancumprod',
439
+ 'diff', 'gradient', 'ediff1d',
440
+ 'cross', 'dot', 'vdot', 'inner', 'outer', 'kron', 'tensordot', 'einsum',
441
+ 'median', 'nanmedian', 'percentile', 'nanpercentile', 'quantile', 'nanquantile',
442
+ 'average', 'correlate', 'convolve', 'cov', 'corrcoef',
443
+ 'histogram', 'histogram2d', 'histogramdd',
444
+ 'bincount', 'digitize', 'interp', 'trapz',
445
+ 'i0', 'sinc', 'lcm', 'gcd', 'modf', 'frexp', 'ldexp', 'spacing', 'nextafter',
446
+ # poly
447
+ 'polyval', 'polyfit', 'polyadd', 'polysub', 'polymul', 'polydiv',
448
+ 'polyder', 'polyint', 'poly', 'poly1d',
449
+ # err state
450
+ 'seterr', 'geterr', 'errstate', 'seterrcall', 'geterrcall',
451
+ # submodules
452
+ 'linalg', 'fft', 'random', 'polynomial', 'ma', 'lib', 'testing', 'char',
453
+ # web extras
454
+ 'to_json', 'from_json', 'serialize', 'deserialize',
455
+ 'JSONEncoder', 'JSONDecoder',
456
+ 'numpy_to_python', 'pandas_to_json', 'python_to_numpy',
457
+ 'infer_dtype', 'safe_cast', 'batch_convert',
458
+ 'FastAPIResponse', 'FlaskResponse', 'DjangoResponse',
459
+ 'setup_json_encoder', 'create_response_handler',
460
+ ]
461
+
462
+ # matrix alias (2-D array subclass stub)
463
+ matrix = ndarray