numpy-ts 1.1.0 → 1.3.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 +3 -11
- package/dist/esm/common/broadcasting.js +1 -1
- package/dist/esm/common/dtype.js +1 -1
- package/dist/esm/common/float16-conv.js +1 -0
- package/dist/esm/common/internal/compute.js +1 -1
- package/dist/esm/common/internal/indexing.js +1 -1
- package/dist/esm/common/ndarray-core.js +1 -1
- package/dist/esm/common/ops/advanced.js +1 -1
- package/dist/esm/common/ops/arithmetic.js +1 -1
- package/dist/esm/common/ops/bitwise.js +1 -1
- package/dist/esm/common/ops/comparison.js +1 -1
- package/dist/esm/common/ops/complex.js +1 -1
- package/dist/esm/common/ops/exponential.js +1 -1
- package/dist/esm/common/ops/fft.js +1 -1
- package/dist/esm/common/ops/formatting.js +1 -1
- package/dist/esm/common/ops/gradient.js +1 -1
- package/dist/esm/common/ops/hyperbolic.js +1 -1
- package/dist/esm/common/ops/linalg.js +2 -2
- package/dist/esm/common/ops/logic.js +1 -1
- package/dist/esm/common/ops/random.js +1 -1
- package/dist/esm/common/ops/reduction.js +1 -1
- package/dist/esm/common/ops/rounding.js +1 -1
- package/dist/esm/common/ops/sets.js +1 -1
- package/dist/esm/common/ops/shape.js +1 -1
- package/dist/esm/common/ops/sorting.js +1 -1
- package/dist/esm/common/ops/statistics.js +1 -1
- package/dist/esm/common/ops/trig.js +1 -1
- package/dist/esm/common/storage.js +1 -1
- package/dist/esm/common/wasm/abs.js +1 -1
- package/dist/esm/common/wasm/add.js +1 -1
- package/dist/esm/common/wasm/all_finite.js +1 -0
- package/dist/esm/common/wasm/arccos.js +1 -1
- package/dist/esm/common/wasm/arcsin.js +1 -1
- package/dist/esm/common/wasm/arctan.js +1 -1
- package/dist/esm/common/wasm/arctan2.js +1 -0
- package/dist/esm/common/wasm/argpartition.js +1 -1
- package/dist/esm/common/wasm/argsort.js +1 -1
- package/dist/esm/common/wasm/bins/abs.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/add.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/all_finite.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/alloc.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/arccos.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/arcsin.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/arctan.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/arctan2.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/argpartition.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/argsort.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/bitwise_and.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/bitwise_count.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/bitwise_not.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/bitwise_or.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/bitwise_xor.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/cholesky.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/clip.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/convolve.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/copysign.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/correlate.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/cos.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/cosh.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/cross.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/diff.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/divide.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/divmod.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/dot_float-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/dot_float.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/dot_int.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/exp.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/exp2.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/fft.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/frexp.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/gather.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/gcd.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/gradient.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/heaviside.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/hypot.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/indices.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/inner_float-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/inner_float.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/inner_int.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/isfinite.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/isnan.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/kron.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/ldexp.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/left_shift.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/lexsort.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/logaddexp.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/logical_and.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/logical_not.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/logical_or.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/logical_xor.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/lu.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matmul_float-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matmul_float.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matmul_int.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matvec_float-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matvec_float.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matvec_int.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/max.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/min.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/mul.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/neg.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/outer.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/pad.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/partition.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/power.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/qr.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reciprocal.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_all.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_any.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_argmax.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_argmin.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_count_nz.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_max.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_mean.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_min.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_nanmax.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_nanmin.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_nansum.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_prod.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_std.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_sum.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/reduce_var.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/repeat.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/right_shift.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/rng.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/roll.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/searchsorted.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/sign.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/signbit.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/sin.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/sinh.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/sort.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/sqrt.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/square.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/sub.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/svd.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/tan.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/tanh.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/tile.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/unravel_index.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vdot.wasm.js +1 -1
- package/dist/esm/common/wasm/bins/vecdot_float-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vecdot_float.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vecdot_int.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vecmat_float-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vecmat_float.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vecmat_int.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vector_norm-relaxed.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vector_norm.wasm.js +1 -0
- package/dist/esm/common/wasm/bitwise_and.js +1 -1
- package/dist/esm/common/wasm/bitwise_count.js +1 -1
- package/dist/esm/common/wasm/bitwise_not.js +1 -1
- package/dist/esm/common/wasm/bitwise_or.js +1 -1
- package/dist/esm/common/wasm/bitwise_xor.js +1 -1
- package/dist/esm/common/wasm/cholesky.js +1 -1
- package/dist/esm/common/wasm/clip.js +1 -1
- package/dist/esm/common/wasm/config.js +1 -1
- package/dist/esm/common/wasm/convolve.js +1 -1
- package/dist/esm/common/wasm/copysign.js +1 -1
- package/dist/esm/common/wasm/correlate.js +1 -1
- package/dist/esm/common/wasm/cos.js +1 -1
- package/dist/esm/common/wasm/cosh.js +1 -1
- package/dist/esm/common/wasm/cross.js +1 -1
- package/dist/esm/common/wasm/detect.js +1 -0
- package/dist/esm/common/wasm/diff.js +1 -1
- package/dist/esm/common/wasm/divide.js +1 -1
- package/dist/esm/common/wasm/divmod.js +1 -0
- package/dist/esm/common/wasm/dot.js +1 -1
- package/dist/esm/common/wasm/exp.js +1 -1
- package/dist/esm/common/wasm/exp2.js +1 -1
- package/dist/esm/common/wasm/fft.js +1 -1
- package/dist/esm/common/wasm/frexp.js +1 -1
- package/dist/esm/common/wasm/gather.js +1 -1
- package/dist/esm/common/wasm/gcd.js +1 -1
- package/dist/esm/common/wasm/gradient.js +1 -1
- package/dist/esm/common/wasm/heaviside.js +1 -1
- package/dist/esm/common/wasm/hypot.js +1 -1
- package/dist/esm/common/wasm/indices.js +1 -1
- package/dist/esm/common/wasm/inner.js +1 -1
- package/dist/esm/common/wasm/isfinite.js +1 -0
- package/dist/esm/common/wasm/isnan.js +1 -0
- package/dist/esm/common/wasm/kron.js +1 -1
- package/dist/esm/common/wasm/ldexp.js +1 -1
- package/dist/esm/common/wasm/left_shift.js +1 -1
- package/dist/esm/common/wasm/lexsort.js +1 -1
- package/dist/esm/common/wasm/logaddexp.js +1 -1
- package/dist/esm/common/wasm/logical_and.js +1 -1
- package/dist/esm/common/wasm/logical_not.js +1 -1
- package/dist/esm/common/wasm/logical_or.js +1 -1
- package/dist/esm/common/wasm/logical_xor.js +1 -1
- package/dist/esm/common/wasm/lu.js +1 -0
- package/dist/esm/common/wasm/matmul.js +1 -1
- package/dist/esm/common/wasm/matvec.js +1 -1
- package/dist/esm/common/wasm/max.js +1 -1
- package/dist/esm/common/wasm/min.js +1 -1
- package/dist/esm/common/wasm/mul.js +1 -1
- package/dist/esm/common/wasm/neg.js +1 -1
- package/dist/esm/common/wasm/outer.js +1 -1
- package/dist/esm/common/wasm/pad.js +1 -1
- package/dist/esm/common/wasm/partition.js +1 -1
- package/dist/esm/common/wasm/power.js +1 -1
- package/dist/esm/common/wasm/qr.js +1 -1
- package/dist/esm/common/wasm/reciprocal.js +1 -1
- package/dist/esm/common/wasm/reduce_all.js +1 -1
- package/dist/esm/common/wasm/reduce_any.js +1 -1
- package/dist/esm/common/wasm/reduce_argmax.js +1 -1
- package/dist/esm/common/wasm/reduce_argmin.js +1 -1
- package/dist/esm/common/wasm/reduce_count_nz.js +1 -1
- package/dist/esm/common/wasm/reduce_max.js +1 -1
- package/dist/esm/common/wasm/reduce_mean.js +1 -1
- package/dist/esm/common/wasm/reduce_min.js +1 -1
- package/dist/esm/common/wasm/reduce_nanmax.js +1 -1
- package/dist/esm/common/wasm/reduce_nanmin.js +1 -1
- package/dist/esm/common/wasm/reduce_nansum.js +1 -1
- package/dist/esm/common/wasm/reduce_prod.js +1 -1
- package/dist/esm/common/wasm/reduce_quantile.js +1 -1
- package/dist/esm/common/wasm/reduce_std.js +1 -1
- package/dist/esm/common/wasm/reduce_sum.js +1 -1
- package/dist/esm/common/wasm/reduce_var.js +1 -1
- package/dist/esm/common/wasm/repeat.js +1 -1
- package/dist/esm/common/wasm/right_shift.js +1 -1
- package/dist/esm/common/wasm/rng.js +1 -0
- package/dist/esm/common/wasm/roll.js +1 -1
- package/dist/esm/common/wasm/runtime.js +1 -1
- package/dist/esm/common/wasm/searchsorted.js +1 -1
- package/dist/esm/common/wasm/sign.js +1 -1
- package/dist/esm/common/wasm/signbit.js +1 -0
- package/dist/esm/common/wasm/sin.js +1 -0
- package/dist/esm/common/wasm/sinh.js +1 -1
- package/dist/esm/common/wasm/sort.js +1 -1
- package/dist/esm/common/wasm/sqrt.js +1 -1
- package/dist/esm/common/wasm/square.js +1 -1
- package/dist/esm/common/wasm/sub.js +1 -1
- package/dist/esm/common/wasm/svd.js +1 -1
- package/dist/esm/common/wasm/tan.js +1 -1
- package/dist/esm/common/wasm/tanh.js +1 -1
- package/dist/esm/common/wasm/tile.js +1 -1
- package/dist/esm/common/wasm/unravel_index.js +1 -0
- package/dist/esm/common/wasm/vdot.js +1 -1
- package/dist/esm/common/wasm/vecdot.js +1 -1
- package/dist/esm/common/wasm/vecmat.js +1 -1
- package/dist/esm/common/wasm/vector_norm.js +1 -0
- package/dist/esm/core/advanced.js +1 -1
- package/dist/esm/core/arithmetic.js +1 -1
- package/dist/esm/core/bitwise.js +1 -1
- package/dist/esm/core/complex.js +1 -1
- package/dist/esm/core/creation.js +1 -1
- package/dist/esm/core/formatting.js +1 -1
- package/dist/esm/core/gradient.js +1 -1
- package/dist/esm/core/index.js +1 -1
- package/dist/esm/core/linalg.js +1 -1
- package/dist/esm/core/logic.js +1 -1
- package/dist/esm/core/polynomial.js +1 -1
- package/dist/esm/core/reduction.js +1 -1
- package/dist/esm/core/rounding.js +1 -1
- package/dist/esm/core/sets.js +1 -1
- package/dist/esm/core/shape-extra.js +1 -1
- package/dist/esm/core/shape.js +1 -1
- package/dist/esm/core/sorting.js +1 -1
- package/dist/esm/core/statistics.js +1 -1
- package/dist/esm/core/trig.js +1 -1
- package/dist/esm/core/typechecking.js +1 -1
- package/dist/esm/core/types.js +1 -1
- package/dist/esm/core/utility.js +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/full/index.js +1 -1
- package/dist/esm/full/ndarray.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/io/file-ops.js +1 -0
- package/dist/esm/io/filesystem.js +1 -0
- package/dist/esm/io/index.js +1 -1
- package/dist/esm/io/npy/format.js +1 -1
- package/dist/esm/io/npy/index.js +1 -1
- package/dist/esm/io/npy/parser.js +1 -1
- package/dist/esm/io/npy/serializer.js +2 -2
- package/dist/esm/io/npz/index.js +1 -1
- package/dist/esm/io/npz/parser.js +1 -1
- package/dist/esm/io/npz/serializer.js +1 -1
- package/dist/esm/io/txt/index.js +1 -1
- package/dist/esm/io/txt/parser.js +1 -1
- package/dist/esm/io/zip/index.js +1 -1
- package/dist/esm/io/zip/reader.js +1 -1
- package/dist/esm/io/zip/writer.js +1 -1
- package/dist/esm/node.js +1 -1
- package/dist/numpy-ts.browser.js +6 -6
- package/dist/types/common/dtype.d.ts +55 -4
- package/dist/types/common/float16-conv.d.ts +27 -0
- package/dist/types/common/internal/indexing.d.ts +9 -21
- package/dist/types/common/ndarray-core.d.ts +20 -0
- package/dist/types/common/ops/advanced.d.ts +17 -2
- package/dist/types/common/ops/complex.d.ts +19 -1
- package/dist/types/common/ops/linalg.d.ts +1 -1
- package/dist/types/common/ops/random.d.ts +10 -5
- package/dist/types/common/ops/reduction.d.ts +2 -2
- package/dist/types/common/ops/sets.d.ts +2 -1
- package/dist/types/common/ops/shape.d.ts +2 -2
- package/dist/types/common/ops/statistics.d.ts +2 -1
- package/dist/types/common/storage.d.ts +54 -2
- package/dist/types/common/wasm/all_finite.d.ts +8 -0
- package/dist/types/common/wasm/arccos.d.ts +4 -2
- package/dist/types/common/wasm/arcsin.d.ts +4 -2
- package/dist/types/common/wasm/arctan.d.ts +4 -2
- package/dist/types/common/wasm/arctan2.d.ts +17 -0
- package/dist/types/common/wasm/argpartition.d.ts +8 -3
- package/dist/types/common/wasm/argsort.d.ts +8 -3
- package/dist/types/common/wasm/bins/abs.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/all_finite.wasm.d.ts +4 -0
- package/dist/types/common/wasm/bins/alloc.wasm.d.ts +6 -0
- package/dist/types/common/wasm/bins/arccos.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/arcsin.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/arctan.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/arctan2.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/convolve.wasm.d.ts +6 -0
- package/dist/types/common/wasm/bins/copysign.wasm.d.ts +2 -0
- package/dist/types/common/wasm/bins/correlate.wasm.d.ts +6 -0
- package/dist/types/common/wasm/bins/cos.wasm.d.ts +8 -0
- package/dist/types/common/wasm/bins/cosh.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/divmod.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/dot_float-relaxed.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/dot_float.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/dot_int.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/exp.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/exp2.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/fft.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/frexp.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/gather.wasm.d.ts +0 -1
- package/dist/types/common/wasm/bins/gcd.wasm.d.ts +8 -0
- package/dist/types/common/wasm/bins/indices.wasm.d.ts +6 -2
- package/dist/types/common/wasm/bins/inner_float-relaxed.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/inner_float.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/inner_int.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/isfinite.wasm.d.ts +4 -0
- package/dist/types/common/wasm/bins/isnan.wasm.d.ts +4 -0
- package/dist/types/common/wasm/bins/lexsort.wasm.d.ts +4 -4
- package/dist/types/common/wasm/bins/logical_and.wasm.d.ts +2 -0
- package/dist/types/common/wasm/bins/logical_not.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/logical_or.wasm.d.ts +2 -0
- package/dist/types/common/wasm/bins/logical_xor.wasm.d.ts +2 -0
- package/dist/types/common/wasm/bins/lu.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/matmul_float-relaxed.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/matmul_float.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/matmul_int.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/matvec_float-relaxed.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/matvec_float.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/matvec_int.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/neg.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/qr.wasm.d.ts +0 -1
- package/dist/types/common/wasm/bins/reciprocal.wasm.d.ts +8 -4
- package/dist/types/common/wasm/bins/reduce_argmax.wasm.d.ts +8 -0
- package/dist/types/common/wasm/bins/reduce_argmin.wasm.d.ts +8 -0
- package/dist/types/common/wasm/bins/reduce_max.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/reduce_min.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/reduce_prod.wasm.d.ts +2 -0
- package/dist/types/common/wasm/bins/reduce_sum.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/rng.wasm.d.ts +57 -0
- package/dist/types/common/wasm/bins/sign.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/signbit.wasm.d.ts +8 -0
- package/dist/types/common/wasm/bins/sin.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/sinh.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/sort.wasm.d.ts +6 -4
- package/dist/types/common/wasm/bins/sqrt.wasm.d.ts +2 -2
- package/dist/types/common/wasm/bins/svd.wasm.d.ts +1 -0
- package/dist/types/common/wasm/bins/tan.wasm.d.ts +8 -0
- package/dist/types/common/wasm/bins/tanh.wasm.d.ts +8 -2
- package/dist/types/common/wasm/bins/unravel_index.wasm.d.ts +4 -0
- package/dist/types/common/wasm/bins/vecdot_float-relaxed.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/vecdot_float.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/vecdot_int.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/vecmat_float-relaxed.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/vecmat_float.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/vecmat_int.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/vector_norm-relaxed.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/vector_norm.wasm.d.ts +3 -0
- package/dist/types/common/wasm/config.d.ts +25 -0
- package/dist/types/common/wasm/convolve.d.ts +1 -1
- package/dist/types/common/wasm/cos.d.ts +4 -2
- package/dist/types/common/wasm/cosh.d.ts +4 -2
- package/dist/types/common/wasm/detect.d.ts +17 -0
- package/dist/types/common/wasm/divide.d.ts +4 -0
- package/dist/types/common/wasm/divmod.d.ts +13 -0
- package/dist/types/common/wasm/exp.d.ts +4 -2
- package/dist/types/common/wasm/exp2.d.ts +4 -2
- package/dist/types/common/wasm/fft.d.ts +36 -0
- package/dist/types/common/wasm/frexp.d.ts +1 -0
- package/dist/types/common/wasm/gather.d.ts +4 -0
- package/dist/types/common/wasm/gcd.d.ts +1 -0
- package/dist/types/common/wasm/heaviside.d.ts +2 -2
- package/dist/types/common/wasm/hypot.d.ts +4 -2
- package/dist/types/common/wasm/indices.d.ts +2 -1
- package/dist/types/common/wasm/isfinite.d.ts +7 -0
- package/dist/types/common/wasm/isnan.d.ts +7 -0
- package/dist/types/common/wasm/lexsort.d.ts +3 -1
- package/dist/types/common/wasm/logaddexp.d.ts +4 -2
- package/dist/types/common/wasm/lu.d.ts +27 -0
- package/dist/types/common/wasm/partition.d.ts +3 -1
- package/dist/types/common/wasm/reduce_argmax.d.ts +5 -0
- package/dist/types/common/wasm/reduce_argmin.d.ts +5 -0
- package/dist/types/common/wasm/reduce_prod.d.ts +4 -0
- package/dist/types/common/wasm/reduce_quantile.d.ts +11 -3
- package/dist/types/common/wasm/reduce_sum.d.ts +10 -0
- package/dist/types/common/wasm/rng.d.ts +75 -0
- package/dist/types/common/wasm/runtime.d.ts +117 -23
- package/dist/types/common/wasm/searchsorted.d.ts +3 -1
- package/dist/types/common/wasm/signbit.d.ts +14 -0
- package/dist/types/common/wasm/sin.d.ts +17 -0
- package/dist/types/common/wasm/sinh.d.ts +4 -2
- package/dist/types/common/wasm/sort.d.ts +4 -1
- package/dist/types/common/wasm/sqrt.d.ts +4 -2
- package/dist/types/common/wasm/svd.d.ts +6 -0
- package/dist/types/common/wasm/tan.d.ts +4 -2
- package/dist/types/common/wasm/tanh.d.ts +4 -2
- package/dist/types/common/wasm/unravel_index.d.ts +12 -0
- package/dist/types/common/wasm/vector_norm.d.ts +11 -0
- package/dist/types/core/advanced.d.ts +10 -2
- package/dist/types/core/creation.d.ts +1 -1
- package/dist/types/core/index.d.ts +96 -2
- package/dist/types/core/linalg.d.ts +1 -1
- package/dist/types/core/rounding.d.ts +0 -2
- package/dist/types/core/sets.d.ts +4 -1
- package/dist/types/core/statistics.d.ts +2 -1
- package/dist/types/full/index.d.ts +19 -6
- package/dist/types/index.d.ts +20 -4
- package/dist/types/io/file-ops.d.ts +269 -0
- package/dist/types/io/filesystem.d.ts +21 -0
- package/dist/types/node.d.ts +3 -275
- package/package.json +52 -62
- package/dist/esm/common/wasm/bins/dot.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/flip.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/inner.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/matmul.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/matvec.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/reduce_quantile.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/rot90.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/vecdot.wasm.js +0 -1
- package/dist/esm/common/wasm/bins/vecmat.wasm.js +0 -1
- package/dist/esm/common/wasm/flip.js +0 -1
- package/dist/esm/common/wasm/lstsq.js +0 -1
- package/dist/esm/common/wasm/rot90.js +0 -1
- package/dist/numpy-ts.node-io.cjs +0 -8
- package/dist/numpy-ts.node-io.cjs.map +0 -7
- package/dist/numpy-ts.node-io.mjs +0 -8
- package/dist/numpy-ts.node-io.mjs.map +0 -7
- package/dist/numpy-ts.node.cjs +0 -8
- package/dist/numpy-ts.node.cjs.map +0 -7
- package/dist/types/common/wasm/bins/dot.wasm.d.ts +0 -9
- package/dist/types/common/wasm/bins/flip.wasm.d.ts +0 -7
- package/dist/types/common/wasm/bins/inner.wasm.d.ts +0 -9
- package/dist/types/common/wasm/bins/matmul.wasm.d.ts +0 -9
- package/dist/types/common/wasm/bins/matvec.wasm.d.ts +0 -9
- package/dist/types/common/wasm/bins/reduce_quantile.wasm.d.ts +0 -2
- package/dist/types/common/wasm/bins/rot90.wasm.d.ts +0 -7
- package/dist/types/common/wasm/bins/vecdot.wasm.d.ts +0 -9
- package/dist/types/common/wasm/bins/vecmat.wasm.d.ts +0 -9
- package/dist/types/common/wasm/flip.d.ts +0 -13
- package/dist/types/common/wasm/lstsq.d.ts +0 -14
- package/dist/types/common/wasm/rot90.d.ts +0 -14
|
@@ -3,6 +3,7 @@ import { NDArrayCore } from '../common/ndarray-core';
|
|
|
3
3
|
import { Complex } from '../common/complex';
|
|
4
4
|
import type { DType, TypedArray } from '../core/types';
|
|
5
5
|
export type { DType, TypedArray } from '../core/types';
|
|
6
|
+
export type { NDIndex } from '../core/advanced';
|
|
6
7
|
export { NDArray, meshgrid } from './ndarray';
|
|
7
8
|
export { NDArrayCore } from '../common/ndarray-core';
|
|
8
9
|
export { Complex } from '../common/complex';
|
|
@@ -25,7 +26,7 @@ export declare function iindex(a: NDArrayCore, indices: NDArrayCore | number[] |
|
|
|
25
26
|
*/
|
|
26
27
|
export declare function bindex(a: NDArrayCore, mask: NDArrayCore, axis?: number): NDArray;
|
|
27
28
|
export declare function select(condlist: NDArrayCore[], choicelist: NDArrayCore[], defaultVal?: number): NDArray;
|
|
28
|
-
export declare function indices(dimensions: number[], dtype?:
|
|
29
|
+
export declare function indices(dimensions: number[], dtype?: string): NDArray;
|
|
29
30
|
export declare function ravel_multi_index(multi_index: NDArrayCore[], dims: number[], mode?: 'raise' | 'wrap' | 'clip'): NDArray;
|
|
30
31
|
export declare function unravel_index(indices: NDArrayCore | number, shape: number[]): NDArray[];
|
|
31
32
|
export declare function diag_indices(n: number, ndim?: number): NDArray[];
|
|
@@ -34,9 +35,16 @@ export declare function tril_indices(n: number, k?: number, m?: number): NDArray
|
|
|
34
35
|
export declare function tril_indices_from(a: NDArrayCore, k?: number): NDArray[];
|
|
35
36
|
export declare function triu_indices(n: number, k?: number, m?: number): NDArray[];
|
|
36
37
|
export declare function triu_indices_from(a: NDArrayCore, k?: number): NDArray[];
|
|
37
|
-
export declare function mask_indices(n: number, mask_func: (
|
|
38
|
+
export declare function mask_indices(n: number, mask_func: (m: NDArrayCore, k: number) => NDArrayCore, k?: number): NDArray[];
|
|
38
39
|
export declare function apply_along_axis(func1d: (arr: NDArrayCore) => NDArrayCore | number, axis: number, arr: NDArrayCore): NDArray;
|
|
39
40
|
export declare function apply_over_axes(func: (arr: NDArrayCore, axis: number) => NDArrayCore, a: NDArrayCore, axes: number[]): NDArray;
|
|
41
|
+
/**
|
|
42
|
+
* Vectorized multi-dimensional indexing (dask.vindex semantics).
|
|
43
|
+
*
|
|
44
|
+
* Integer-array subspace dimensions come first in the output, followed by
|
|
45
|
+
* slice dimensions in their original order.
|
|
46
|
+
*/
|
|
47
|
+
export declare function vindex(a: NDArrayCore, ...indices: (number | string | number[] | NDArrayCore)[]): NDArray;
|
|
40
48
|
/** Add arguments element-wise */
|
|
41
49
|
export declare function add(x1: NDArrayCore, x2: NDArrayCore | number): NDArray;
|
|
42
50
|
/** Subtract arguments element-wise */
|
|
@@ -170,7 +178,7 @@ export declare function zeros(shape: number[], dtype?: DType): NDArray;
|
|
|
170
178
|
*/
|
|
171
179
|
export declare function ones(shape: number[], dtype?: DType): NDArray;
|
|
172
180
|
/**
|
|
173
|
-
* Create an uninitialized array
|
|
181
|
+
* Create an uninitialized array
|
|
174
182
|
*/
|
|
175
183
|
export declare function empty(shape: number[], dtype?: DType): NDArray;
|
|
176
184
|
/**
|
|
@@ -449,7 +457,10 @@ export declare function floor(x: NDArrayCore): NDArray;
|
|
|
449
457
|
export declare function rint(x: NDArrayCore): NDArray;
|
|
450
458
|
/** Truncate toward zero */
|
|
451
459
|
export declare function trunc(x: NDArrayCore): NDArray;
|
|
452
|
-
/**
|
|
460
|
+
/**
|
|
461
|
+
* Test if elements in ar1 are in ar2.
|
|
462
|
+
* @deprecated Use {@link isin} instead. `in1d` follows NumPy's deprecation and will be removed in a future release.
|
|
463
|
+
*/
|
|
453
464
|
export declare function in1d(ar1: NDArrayCore, ar2: NDArrayCore): NDArray;
|
|
454
465
|
/** Find intersection of two arrays */
|
|
455
466
|
export declare function intersect1d(ar1: NDArrayCore, ar2: NDArrayCore): NDArray;
|
|
@@ -564,7 +575,7 @@ export declare function cov(m: NDArrayCore, y?: NDArrayCore, rowvar?: boolean, b
|
|
|
564
575
|
/** Correlation coefficients */
|
|
565
576
|
export declare function corrcoef(x: NDArrayCore, y?: NDArrayCore, rowvar?: boolean): NDArray;
|
|
566
577
|
/** Integrate using trapezoidal rule */
|
|
567
|
-
export declare function trapezoid(y: NDArrayCore, x?: NDArrayCore, dx?: number, axis?: number): NDArray | number;
|
|
578
|
+
export declare function trapezoid(y: NDArrayCore, x?: NDArrayCore, dx?: number, axis?: number): NDArray | number | Complex;
|
|
568
579
|
/** Sine of array elements */
|
|
569
580
|
export declare function sin(x: NDArrayCore): NDArray;
|
|
570
581
|
/** Cosine of array elements */
|
|
@@ -601,5 +612,7 @@ export declare function arcsinh(x: NDArrayCore): NDArray;
|
|
|
601
612
|
export declare function arccosh(x: NDArrayCore): NDArray;
|
|
602
613
|
/** Inverse hyperbolic tangent */
|
|
603
614
|
export declare function arctanh(x: NDArrayCore): NDArray;
|
|
604
|
-
export { broadcast_arrays, broadcast_shapes, put, put_along_axis, place, putmask, copyto, ix_, fill_diagonal, array_equal, array_equiv, may_share_memory, shares_memory, geterr, seterr, pow, abs, true_divide, conjugate, array2string, array_repr, array_str, set_printoptions, get_printoptions, printoptions, format_float_positional, format_float_scientific, base_repr, binary_repr, gradient, einsum, einsum_path, vdot, linalg, iscomplexobj, isrealobj, isfortran, isscalar, iterable, isdtype, promote_types, allclose, amax, amin, var_, cumulative_sum, cumulative_prod,
|
|
615
|
+
export { broadcast_arrays, broadcast_shapes, put, put_along_axis, place, putmask, copyto, ix_, fill_diagonal, array_equal, array_equiv, may_share_memory, shares_memory, geterr, seterr, pow, abs, true_divide, conjugate, array2string, array_repr, array_str, set_printoptions, get_printoptions, printoptions, format_float_positional, format_float_scientific, base_repr, binary_repr, gradient, einsum, einsum_path, vdot, linalg, iscomplexobj, isrealobj, isfortran, isscalar, iterable, isdtype, promote_types, allclose, amax, amin, var_, cumulative_sum, cumulative_prod, unique, unique_all, unique_counts, unique_inverse, split, array_split, vsplit, hsplit, dsplit, atleast_1d, atleast_2d, atleast_3d, row_stack, where, searchsorted, count_nonzero, histogram, histogram2d, histogramdd, histogram_bin_edges, asin, acos, atan, atan2, asinh, acosh, atanh, can_cast, common_type, result_type, min_scalar_type, issubdtype, typename, mintypecode, ndim, shape, size, item, tolist, tobytes, byteswap, view, tofile, fill, } from '../core';
|
|
616
|
+
export { wasmConfig } from '../common/wasm/config';
|
|
617
|
+
export { configureWasm } from '../common/wasm/runtime';
|
|
605
618
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/types/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
export { Complex, type ComplexInput } from './common/complex';
|
|
23
23
|
export { NDArray } from './full';
|
|
24
24
|
export { NDArrayCore } from './common/ndarray-core';
|
|
25
|
+
export { hasFloat16 } from './common/dtype';
|
|
25
26
|
export { zeros, ones, empty, full, array, arange, linspace, logspace, geomspace, eye, identity, asarray, zeros_like, ones_like, empty_like, full_like, copy, asanyarray, asarray_chkfinite, ascontiguousarray, asfortranarray, require, diag, diagflat, frombuffer, fromfile, fromfunction, fromiter, fromstring, meshgrid, tri, tril, triu, vander, } from './full';
|
|
26
27
|
export { add, subtract, multiply, divide, true_divide, floor_divide, mod, sqrt, power, exp, exp2, expm1, log, log2, log10, log1p, logaddexp, logaddexp2, absolute, negative, sign, positive, reciprocal, cbrt, fabs, divmod, square, remainder, heaviside, float_power, fmod, frexp, gcd, lcm, ldexp, modf, clip, maximum, minimum, fmax, fmin, nan_to_num, interp, unwrap, sinc, i0, } from './full';
|
|
27
28
|
export { power as pow, absolute as abs } from './full';
|
|
@@ -36,14 +37,15 @@ export { logical_and, logical_or, logical_not, logical_xor, isfinite, isinf, isn
|
|
|
36
37
|
export { sort, argsort, lexsort, partition, argpartition, sort_complex, nonzero, argwhere, flatnonzero, where, searchsorted, extract, count_nonzero, } from './full';
|
|
37
38
|
export { bitwise_and, bitwise_or, bitwise_xor, bitwise_not, invert, left_shift, right_shift, packbits, unpackbits, bitwise_count, } from './full';
|
|
38
39
|
export { bitwise_not as bitwise_invert, left_shift as bitwise_left_shift, right_shift as bitwise_right_shift, } from './full';
|
|
39
|
-
export { around,
|
|
40
|
+
export { around, ceil, fix, floor, rint, trunc } from './full';
|
|
40
41
|
export { around as round } from './full';
|
|
41
42
|
export { unique, in1d, intersect1d, isin, setdiff1d, setxor1d, union1d, trim_zeros, unique_all, unique_counts, unique_inverse, unique_values, } from './full';
|
|
42
43
|
export { bincount, digitize, histogram, histogram2d, histogramdd, correlate, convolve, cov, corrcoef, histogram_bin_edges, trapezoid, } from './full';
|
|
43
44
|
export { diff, ediff1d, gradient } from './full';
|
|
44
45
|
export { real, imag, conj, angle } from './full';
|
|
45
46
|
export { conj as conjugate } from './full';
|
|
46
|
-
export { broadcast_to, broadcast_arrays, broadcast_shapes, take, put, iindex, bindex, copyto, choose, array_equal, array_equiv, take_along_axis, put_along_axis, putmask, compress, select, place, fill_diagonal, diag_indices, diag_indices_from, tril_indices, tril_indices_from, triu_indices, triu_indices_from, mask_indices, indices, ix_, ravel_multi_index, unravel_index, fill, item, tolist, tobytes, byteswap, view, tofile, } from './full';
|
|
47
|
+
export { broadcast_to, broadcast_arrays, broadcast_shapes, take, put, iindex, bindex, vindex, copyto, choose, array_equal, array_equiv, take_along_axis, put_along_axis, putmask, compress, select, place, fill_diagonal, diag_indices, diag_indices_from, tril_indices, tril_indices_from, triu_indices, triu_indices_from, mask_indices, indices, ix_, ravel_multi_index, unravel_index, fill, item, tolist, tobytes, byteswap, view, tofile, } from './full';
|
|
48
|
+
export type { NDIndex } from './full';
|
|
47
49
|
export { apply_along_axis, apply_over_axes, may_share_memory, shares_memory, ndim, shape, size, geterr, seterr, } from './full';
|
|
48
50
|
export { array2string, array_repr, array_str, base_repr, binary_repr, format_float_positional, format_float_scientific, get_printoptions, set_printoptions, printoptions, } from './full';
|
|
49
51
|
export { can_cast, common_type, result_type, min_scalar_type, issubdtype, typename, mintypecode, } from './full';
|
|
@@ -54,6 +56,7 @@ export type { NpzSerializeOptions } from './io/npz/serializer';
|
|
|
54
56
|
export type { ParseTxtOptions } from './io/txt/parser';
|
|
55
57
|
export type { SerializeTxtOptions } from './io/txt/serializer';
|
|
56
58
|
export { wasmConfig } from './common/wasm/config';
|
|
59
|
+
export { configureWasm } from './common/wasm/runtime';
|
|
57
60
|
export { serializeNpy } from './io/npy/serializer';
|
|
58
61
|
export { serializeNpz, serializeNpzSync } from './io/npz/serializer';
|
|
59
62
|
export { serializeTxt } from './io/txt/serializer';
|
|
@@ -78,6 +81,7 @@ export declare function loadNpzSync(buffer: ArrayBuffer | Uint8Array, options?:
|
|
|
78
81
|
export declare function parseTxt(text: string, options?: ParseTxtOptionsType): NDArrayClass;
|
|
79
82
|
export declare function genfromtxt(text: string, options?: ParseTxtOptionsType): NDArrayClass;
|
|
80
83
|
export declare function fromregex(text: string, regexp: RegExp | string, dtype?: DTypeIO): NDArrayClass;
|
|
84
|
+
export { type LoadOptions, type SaveNpzOptions, type LoadTxtOptions, type SaveTxtOptions, loadNpy, loadNpySync, saveNpy, saveNpySync, loadNpzFile, loadNpzFileSync, saveNpz as saveNpzFile, saveNpzSync as saveNpzFileSync, savez, savez_compressed, load, loadSync, save, saveSync, loadtxt, loadtxtSync, savetxt, savetxtSync, genfromtxt as genfromtxtFile, genfromtxtSync as genfromtxtFileSync, fromregex as fromregexFile, fromregexSync as fromregexFileSync, } from './io/file-ops';
|
|
81
85
|
import * as randomOps from './common/ops/random';
|
|
82
86
|
import { ArrayStorage } from './common/storage';
|
|
83
87
|
import { NDArray as NDArrayClass } from './full';
|
|
@@ -88,7 +92,19 @@ export declare const random: {
|
|
|
88
92
|
set_state: typeof randomOps.set_state;
|
|
89
93
|
get_bit_generator: typeof randomOps.get_bit_generator;
|
|
90
94
|
set_bit_generator: typeof randomOps.set_bit_generator;
|
|
91
|
-
default_rng:
|
|
95
|
+
default_rng: (seedValue?: number) => {
|
|
96
|
+
random: (size?: number | number[]) => number | ArrayStorage | NDArrayClass;
|
|
97
|
+
integers: (low: number, high?: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
|
|
98
|
+
standard_normal: (size?: number | number[]) => number | ArrayStorage | NDArrayClass;
|
|
99
|
+
normal: (loc?: number, scale?: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
|
|
100
|
+
uniform: (low?: number, high?: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
|
|
101
|
+
choice: (a: number | (ArrayStorage | NDArrayCore | NDArrayClass), size?: number | number[], replace?: boolean, p?: (ArrayStorage | NDArrayCore | NDArrayClass) | number[]) => number | ArrayStorage | NDArrayClass;
|
|
102
|
+
permutation: (x: number | (ArrayStorage | NDArrayCore | NDArrayClass)) => ArrayStorage | NDArrayClass;
|
|
103
|
+
shuffle: (x: ArrayStorage | NDArrayCore | NDArrayClass) => void;
|
|
104
|
+
exponential: (scale?: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
|
|
105
|
+
poisson: (lam?: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
|
|
106
|
+
binomial: (n: number, p: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
|
|
107
|
+
};
|
|
92
108
|
Generator: typeof randomOps.Generator;
|
|
93
109
|
random: (size?: number | number[]) => number | ArrayStorage | NDArrayClass;
|
|
94
110
|
rand: (...shape: number[]) => number | ArrayStorage | NDArrayClass;
|
|
@@ -136,7 +152,7 @@ export declare const random: {
|
|
|
136
152
|
vonmises: (mu: number, kappa: number, size?: number | number[]) => number | ArrayStorage | NDArrayClass;
|
|
137
153
|
choice: (a: number | ArrayStorage, size?: number | number[], replace?: boolean, p?: ArrayStorage | number[]) => number | ArrayStorage | NDArrayClass;
|
|
138
154
|
permutation: (x: number | ArrayStorage) => ArrayStorage | NDArrayClass;
|
|
139
|
-
shuffle:
|
|
155
|
+
shuffle: (x: NDArrayClass | NDArrayCore | ArrayStorage) => void;
|
|
140
156
|
};
|
|
141
157
|
import { NDArrayCore } from './common/ndarray-core';
|
|
142
158
|
type ArrayInput = NDArrayClass | NDArrayCore | ArrayStorage;
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File IO operations for numpy-ts.
|
|
3
|
+
*
|
|
4
|
+
* These functions read/write files using the runtime fs abstraction from filesystem.ts.
|
|
5
|
+
* They work in Node.js, Bun, and Deno, and throw clear errors in the browser.
|
|
6
|
+
*/
|
|
7
|
+
import { NDArray } from '../full/ndarray';
|
|
8
|
+
import type { NpzParseOptions } from './npz/parser';
|
|
9
|
+
import { type NpzSerializeOptions, type NpzArraysInput } from './npz/serializer';
|
|
10
|
+
import { type ParseTxtOptions, type SerializeTxtOptions } from './txt';
|
|
11
|
+
import type { DType } from '../common/dtype';
|
|
12
|
+
interface NpzParseResultNDArray {
|
|
13
|
+
arrays: Map<string, NDArray>;
|
|
14
|
+
skipped: string[];
|
|
15
|
+
errors: Map<string, string>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Options for loading NPY/NPZ files
|
|
19
|
+
*/
|
|
20
|
+
export interface LoadOptions extends NpzParseOptions {
|
|
21
|
+
/**
|
|
22
|
+
* If true, allow loading .npy files.
|
|
23
|
+
* Default: true
|
|
24
|
+
*/
|
|
25
|
+
allowNpy?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Options for saving NPZ files
|
|
29
|
+
*/
|
|
30
|
+
export type SaveNpzOptions = NpzSerializeOptions;
|
|
31
|
+
/**
|
|
32
|
+
* Options for loadtxt
|
|
33
|
+
*/
|
|
34
|
+
export type LoadTxtOptions = ParseTxtOptions;
|
|
35
|
+
/**
|
|
36
|
+
* Options for savetxt
|
|
37
|
+
*/
|
|
38
|
+
export type SaveTxtOptions = SerializeTxtOptions;
|
|
39
|
+
/**
|
|
40
|
+
* Load an NDArray from a .npy file
|
|
41
|
+
*
|
|
42
|
+
* @param path - Path to the .npy file
|
|
43
|
+
* @returns The loaded NDArray
|
|
44
|
+
*/
|
|
45
|
+
export declare function loadNpy(path: string): Promise<NDArray>;
|
|
46
|
+
/**
|
|
47
|
+
* Synchronously load an NDArray from a .npy file
|
|
48
|
+
*
|
|
49
|
+
* @param path - Path to the .npy file
|
|
50
|
+
* @returns The loaded NDArray
|
|
51
|
+
*/
|
|
52
|
+
export declare function loadNpySync(path: string): NDArray;
|
|
53
|
+
/**
|
|
54
|
+
* Save an NDArray to a .npy file
|
|
55
|
+
*
|
|
56
|
+
* @param path - Path to save the .npy file
|
|
57
|
+
* @param arr - The NDArray to save
|
|
58
|
+
*/
|
|
59
|
+
export declare function saveNpy(path: string, arr: NDArray): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Synchronously save an NDArray to a .npy file
|
|
62
|
+
*
|
|
63
|
+
* @param path - Path to save the .npy file
|
|
64
|
+
* @param arr - The NDArray to save
|
|
65
|
+
*/
|
|
66
|
+
export declare function saveNpySync(path: string, arr: NDArray): void;
|
|
67
|
+
/**
|
|
68
|
+
* Load arrays from a .npz file
|
|
69
|
+
*
|
|
70
|
+
* @param path - Path to the .npz file
|
|
71
|
+
* @param options - Load options
|
|
72
|
+
* @returns Object with array names as keys
|
|
73
|
+
*/
|
|
74
|
+
export declare function loadNpzFile(path: string, options?: NpzParseOptions): Promise<NpzParseResultNDArray>;
|
|
75
|
+
/**
|
|
76
|
+
* Synchronously load arrays from a .npz file
|
|
77
|
+
*
|
|
78
|
+
* Note: Only works if the NPZ file is not DEFLATE compressed.
|
|
79
|
+
*
|
|
80
|
+
* @param path - Path to the .npz file
|
|
81
|
+
* @param options - Load options
|
|
82
|
+
* @returns Object with array names as keys
|
|
83
|
+
*/
|
|
84
|
+
export declare function loadNpzFileSync(path: string, options?: NpzParseOptions): NpzParseResultNDArray;
|
|
85
|
+
/**
|
|
86
|
+
* Save arrays to a .npz file
|
|
87
|
+
*
|
|
88
|
+
* @param path - Path to save the .npz file
|
|
89
|
+
* @param arrays - Arrays to save:
|
|
90
|
+
* - Array of NDArrays (positional, named arr_0, arr_1, etc.)
|
|
91
|
+
* - Map of names to NDArrays
|
|
92
|
+
* - Object with names as keys
|
|
93
|
+
* @param options - Save options
|
|
94
|
+
*/
|
|
95
|
+
export declare function saveNpz(path: string, arrays: NpzArraysInput, options?: SaveNpzOptions): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Synchronously save arrays to a .npz file (no compression)
|
|
98
|
+
*
|
|
99
|
+
* @param path - Path to save the .npz file
|
|
100
|
+
* @param arrays - Arrays to save (same types as saveNpz)
|
|
101
|
+
*/
|
|
102
|
+
export declare function saveNpzSync(path: string, arrays: NpzArraysInput): void;
|
|
103
|
+
/**
|
|
104
|
+
* Load an array or arrays from a .npy or .npz file
|
|
105
|
+
*
|
|
106
|
+
* This is a convenience function that auto-detects the file format based on extension.
|
|
107
|
+
*
|
|
108
|
+
* @param path - Path to the file
|
|
109
|
+
* @param options - Load options
|
|
110
|
+
* @returns NDArray for .npy files, or NpzParseResult for .npz files
|
|
111
|
+
*/
|
|
112
|
+
export declare function load(path: string, options?: LoadOptions): Promise<NDArray | NpzParseResultNDArray>;
|
|
113
|
+
/**
|
|
114
|
+
* Synchronously load an array or arrays from a .npy or .npz file
|
|
115
|
+
*
|
|
116
|
+
* @param path - Path to the file
|
|
117
|
+
* @param options - Load options
|
|
118
|
+
* @returns NDArray for .npy files, or NpzParseResult for .npz files
|
|
119
|
+
*/
|
|
120
|
+
export declare function loadSync(path: string, options?: LoadOptions): NDArray | NpzParseResultNDArray;
|
|
121
|
+
/**
|
|
122
|
+
* Save an array to a .npy file
|
|
123
|
+
*
|
|
124
|
+
* @param path - Path to save the file (should end with .npy)
|
|
125
|
+
* @param arr - The NDArray to save
|
|
126
|
+
*/
|
|
127
|
+
export declare function save(path: string, arr: NDArray): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Synchronously save an array to a .npy file
|
|
130
|
+
*
|
|
131
|
+
* @param path - Path to save the file (should end with .npy)
|
|
132
|
+
* @param arr - The NDArray to save
|
|
133
|
+
*/
|
|
134
|
+
export declare function saveSync(path: string, arr: NDArray): void;
|
|
135
|
+
/**
|
|
136
|
+
* Save multiple arrays to a .npz file (like np.savez)
|
|
137
|
+
*
|
|
138
|
+
* @param path - Path to save the .npz file
|
|
139
|
+
* @param arrays - Arrays to save:
|
|
140
|
+
* - Array of NDArrays: named arr_0, arr_1, etc. (like np.savez positional args)
|
|
141
|
+
* - Object/Map with names as keys (like np.savez keyword args)
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* // Positional arrays
|
|
145
|
+
* await savez('data.npz', [arr1, arr2]) // saved as arr_0, arr_1
|
|
146
|
+
*
|
|
147
|
+
* // Named arrays
|
|
148
|
+
* await savez('data.npz', { x: arr1, y: arr2 })
|
|
149
|
+
*/
|
|
150
|
+
export declare function savez(path: string, arrays: NpzArraysInput): Promise<void>;
|
|
151
|
+
/**
|
|
152
|
+
* Save multiple arrays to a compressed .npz file (like np.savez_compressed)
|
|
153
|
+
*
|
|
154
|
+
* @param path - Path to save the .npz file
|
|
155
|
+
* @param arrays - Arrays to save (same input types as savez)
|
|
156
|
+
*/
|
|
157
|
+
export declare function savez_compressed(path: string, arrays: NpzArraysInput): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Load data from a text file.
|
|
160
|
+
*
|
|
161
|
+
* Each row in the text file must have the same number of values.
|
|
162
|
+
*
|
|
163
|
+
* @param path - Path to the text file
|
|
164
|
+
* @param options - Load options
|
|
165
|
+
* @returns NDArray with the loaded data
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```typescript
|
|
169
|
+
* // Load a CSV file
|
|
170
|
+
* const arr = await loadtxt('data.csv', { delimiter: ',' });
|
|
171
|
+
*
|
|
172
|
+
* // Load with specific columns
|
|
173
|
+
* const arr = await loadtxt('data.txt', { usecols: [0, 2] });
|
|
174
|
+
*
|
|
175
|
+
* // Skip header rows
|
|
176
|
+
* const arr = await loadtxt('data.txt', { skiprows: 1 });
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
export declare function loadtxt(path: string, options?: LoadTxtOptions): Promise<NDArray>;
|
|
180
|
+
/**
|
|
181
|
+
* Synchronously load data from a text file.
|
|
182
|
+
*
|
|
183
|
+
* @param path - Path to the text file
|
|
184
|
+
* @param options - Load options
|
|
185
|
+
* @returns NDArray with the loaded data
|
|
186
|
+
*/
|
|
187
|
+
export declare function loadtxtSync(path: string, options?: LoadTxtOptions): NDArray;
|
|
188
|
+
/**
|
|
189
|
+
* Save an array to a text file.
|
|
190
|
+
*
|
|
191
|
+
* @param path - Path to save the text file
|
|
192
|
+
* @param arr - The array to save (must be 1D or 2D)
|
|
193
|
+
* @param options - Save options
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```typescript
|
|
197
|
+
* // Save as CSV
|
|
198
|
+
* await savetxt('data.csv', arr, { delimiter: ',' });
|
|
199
|
+
*
|
|
200
|
+
* // Save with custom format
|
|
201
|
+
* await savetxt('data.txt', arr, { fmt: '%.2f', delimiter: '\t' });
|
|
202
|
+
*
|
|
203
|
+
* // Save with header
|
|
204
|
+
* await savetxt('data.txt', arr, { header: 'x y z' });
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
export declare function savetxt(path: string, arr: NDArray, options?: SaveTxtOptions): Promise<void>;
|
|
208
|
+
/**
|
|
209
|
+
* Synchronously save an array to a text file.
|
|
210
|
+
*
|
|
211
|
+
* @param path - Path to save the text file
|
|
212
|
+
* @param arr - The array to save (must be 1D or 2D)
|
|
213
|
+
* @param options - Save options
|
|
214
|
+
*/
|
|
215
|
+
export declare function savetxtSync(path: string, arr: NDArray, options?: SaveTxtOptions): void;
|
|
216
|
+
/**
|
|
217
|
+
* Load data from a text file with more flexible handling.
|
|
218
|
+
*
|
|
219
|
+
* Similar to loadtxt but handles missing values more gracefully.
|
|
220
|
+
*
|
|
221
|
+
* @param path - Path to the text file
|
|
222
|
+
* @param options - Load options
|
|
223
|
+
* @returns NDArray with the loaded data
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```typescript
|
|
227
|
+
* // Load file with missing values
|
|
228
|
+
* const arr = await genfromtxt('data.csv', {
|
|
229
|
+
* delimiter: ',',
|
|
230
|
+
* missing_values: ['NA', ''],
|
|
231
|
+
* filling_values: 0
|
|
232
|
+
* });
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
export declare function genfromtxt(path: string, options?: LoadTxtOptions): Promise<NDArray>;
|
|
236
|
+
/**
|
|
237
|
+
* Synchronously load data from a text file with more flexible handling.
|
|
238
|
+
*
|
|
239
|
+
* @param path - Path to the text file
|
|
240
|
+
* @param options - Load options
|
|
241
|
+
* @returns NDArray with the loaded data
|
|
242
|
+
*/
|
|
243
|
+
export declare function genfromtxtSync(path: string, options?: LoadTxtOptions): NDArray;
|
|
244
|
+
/**
|
|
245
|
+
* Load data from a text file using regular expressions.
|
|
246
|
+
*
|
|
247
|
+
* @param path - Path to the text file
|
|
248
|
+
* @param regexp - Regular expression with capture groups for extracting values
|
|
249
|
+
* @param dtype - Data type of the resulting array (default: 'float64')
|
|
250
|
+
* @returns NDArray with the extracted data
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* ```typescript
|
|
254
|
+
* // Extract x,y pairs from "Point: x=1.0, y=2.0" format
|
|
255
|
+
* const arr = await fromregex('points.txt', /x=([\d.]+), y=([\d.]+)/);
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
export declare function fromregex(path: string, regexp: RegExp | string, dtype?: DType): Promise<NDArray>;
|
|
259
|
+
/**
|
|
260
|
+
* Synchronously load data from a text file using regular expressions.
|
|
261
|
+
*
|
|
262
|
+
* @param path - Path to the text file
|
|
263
|
+
* @param regexp - Regular expression with capture groups for extracting values
|
|
264
|
+
* @param dtype - Data type of the resulting array (default: 'float64')
|
|
265
|
+
* @returns NDArray with the extracted data
|
|
266
|
+
*/
|
|
267
|
+
export declare function fromregexSync(path: string, regexp: RegExp | string, dtype?: DType): NDArray;
|
|
268
|
+
export {};
|
|
269
|
+
//# sourceMappingURL=file-ops.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime filesystem abstraction for cross-platform file IO.
|
|
3
|
+
*
|
|
4
|
+
* Pre-loads `node:fs` and `node:fs/promises` asynchronously at module load
|
|
5
|
+
* in Node-like environments. Both getFs() and getFsSync() read from this cache.
|
|
6
|
+
* In browsers, all IO functions throw a helpful error.
|
|
7
|
+
*/
|
|
8
|
+
type FsPromises = typeof import('node:fs/promises');
|
|
9
|
+
type FsSync = typeof import('node:fs');
|
|
10
|
+
/**
|
|
11
|
+
* Get the async fs module (`node:fs/promises`).
|
|
12
|
+
* Caches the result after the first successful resolution.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getFs(): Promise<FsPromises>;
|
|
15
|
+
/**
|
|
16
|
+
* Get the sync fs module (`node:fs`).
|
|
17
|
+
* Reads from the cache populated at module load time or by a prior getFs() call.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getFsSync(): FsSync;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=filesystem.d.ts.map
|