numpy-ts 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- 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 -0
- package/dist/esm/common/wasm/add.js +1 -0
- package/dist/esm/common/wasm/arccos.js +1 -0
- package/dist/esm/common/wasm/arcsin.js +1 -0
- package/dist/esm/common/wasm/arctan.js +1 -0
- package/dist/esm/common/wasm/argpartition.js +1 -0
- package/dist/esm/common/wasm/argsort.js +1 -0
- package/dist/esm/common/wasm/bins/abs.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/add.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/arccos.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/arcsin.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/arctan.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/argpartition.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/argsort.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/bitwise_and.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/bitwise_count.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/bitwise_not.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/bitwise_or.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/bitwise_xor.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/cholesky.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/clip.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/convolve.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/copysign.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/correlate.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/cos.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/cosh.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/cross.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/diff.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/divide.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/dot.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/exp.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/exp2.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/fft.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/flip.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/frexp.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/gather.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/gcd.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/gradient.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/heaviside.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/hypot.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/indices.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/inner.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/kron.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/ldexp.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/left_shift.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/lexsort.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/logaddexp.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/logical_and.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/logical_not.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/logical_or.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/logical_xor.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matmul.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/matvec.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/max.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/min.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/mul.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/neg.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/outer.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/pad.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/partition.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/power.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/qr.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reciprocal.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_all.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_any.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_argmax.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_argmin.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_count_nz.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_max.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_mean.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_min.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_nanmax.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_nanmin.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_nansum.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_prod.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_quantile.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_std.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_sum.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/reduce_var.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/repeat.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/right_shift.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/rng.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/roll.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/rot90.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/searchsorted.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/sign.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/sinh.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/sort.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/sqrt.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/square.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/sub.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/svd.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/tan.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/tanh.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/tile.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vdot.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vecdot.wasm.js +1 -0
- package/dist/esm/common/wasm/bins/vecmat.wasm.js +1 -0
- package/dist/esm/common/wasm/bitwise_and.js +1 -0
- package/dist/esm/common/wasm/bitwise_count.js +1 -0
- package/dist/esm/common/wasm/bitwise_not.js +1 -0
- package/dist/esm/common/wasm/bitwise_or.js +1 -0
- package/dist/esm/common/wasm/bitwise_xor.js +1 -0
- package/dist/esm/common/wasm/cholesky.js +1 -0
- package/dist/esm/common/wasm/clip.js +1 -0
- package/dist/esm/common/wasm/config.js +1 -0
- package/dist/esm/common/wasm/convolve.js +1 -0
- package/dist/esm/common/wasm/copysign.js +1 -0
- package/dist/esm/common/wasm/correlate.js +1 -0
- package/dist/esm/common/wasm/cos.js +1 -0
- package/dist/esm/common/wasm/cosh.js +1 -0
- package/dist/esm/common/wasm/cross.js +1 -0
- package/dist/esm/common/wasm/diff.js +1 -0
- package/dist/esm/common/wasm/divide.js +1 -0
- package/dist/esm/common/wasm/dot.js +1 -0
- package/dist/esm/common/wasm/exp.js +1 -0
- package/dist/esm/common/wasm/exp2.js +1 -0
- package/dist/esm/common/wasm/fft.js +1 -0
- package/dist/esm/common/wasm/flip.js +1 -0
- package/dist/esm/common/wasm/frexp.js +1 -0
- package/dist/esm/common/wasm/gather.js +1 -0
- package/dist/esm/common/wasm/gcd.js +1 -0
- package/dist/esm/common/wasm/gradient.js +1 -0
- package/dist/esm/common/wasm/heaviside.js +1 -0
- package/dist/esm/common/wasm/hypot.js +1 -0
- package/dist/esm/common/wasm/indices.js +1 -0
- package/dist/esm/common/wasm/inner.js +1 -0
- package/dist/esm/common/wasm/kron.js +1 -0
- package/dist/esm/common/wasm/ldexp.js +1 -0
- package/dist/esm/common/wasm/left_shift.js +1 -0
- package/dist/esm/common/wasm/lexsort.js +1 -0
- package/dist/esm/common/wasm/logaddexp.js +1 -0
- package/dist/esm/common/wasm/logical_and.js +1 -0
- package/dist/esm/common/wasm/logical_not.js +1 -0
- package/dist/esm/common/wasm/logical_or.js +1 -0
- package/dist/esm/common/wasm/logical_xor.js +1 -0
- package/dist/esm/common/wasm/matmul.js +1 -0
- package/dist/esm/common/wasm/matvec.js +1 -0
- package/dist/esm/common/wasm/max.js +1 -0
- package/dist/esm/common/wasm/min.js +1 -0
- package/dist/esm/common/wasm/mul.js +1 -0
- package/dist/esm/common/wasm/neg.js +1 -0
- package/dist/esm/common/wasm/outer.js +1 -0
- package/dist/esm/common/wasm/pad.js +1 -0
- package/dist/esm/common/wasm/partition.js +1 -0
- package/dist/esm/common/wasm/power.js +1 -0
- package/dist/esm/common/wasm/qr.js +1 -0
- package/dist/esm/common/wasm/reciprocal.js +1 -0
- package/dist/esm/common/wasm/reduce_all.js +1 -0
- package/dist/esm/common/wasm/reduce_any.js +1 -0
- package/dist/esm/common/wasm/reduce_argmax.js +1 -0
- package/dist/esm/common/wasm/reduce_argmin.js +1 -0
- package/dist/esm/common/wasm/reduce_count_nz.js +1 -0
- package/dist/esm/common/wasm/reduce_max.js +1 -0
- package/dist/esm/common/wasm/reduce_mean.js +1 -0
- package/dist/esm/common/wasm/reduce_min.js +1 -0
- package/dist/esm/common/wasm/reduce_nanmax.js +1 -0
- package/dist/esm/common/wasm/reduce_nanmin.js +1 -0
- package/dist/esm/common/wasm/reduce_nansum.js +1 -0
- package/dist/esm/common/wasm/reduce_prod.js +1 -0
- package/dist/esm/common/wasm/reduce_quantile.js +1 -0
- package/dist/esm/common/wasm/reduce_std.js +1 -0
- package/dist/esm/common/wasm/reduce_sum.js +1 -0
- package/dist/esm/common/wasm/reduce_var.js +1 -0
- package/dist/esm/common/wasm/repeat.js +1 -0
- package/dist/esm/common/wasm/right_shift.js +1 -0
- package/dist/esm/common/wasm/rng.js +1 -0
- package/dist/esm/common/wasm/roll.js +1 -0
- package/dist/esm/common/wasm/rot90.js +1 -0
- package/dist/esm/common/wasm/runtime.js +1 -0
- package/dist/esm/common/wasm/searchsorted.js +1 -0
- package/dist/esm/common/wasm/sign.js +1 -0
- package/dist/esm/common/wasm/sinh.js +1 -0
- package/dist/esm/common/wasm/sort.js +1 -0
- package/dist/esm/common/wasm/sqrt.js +1 -0
- package/dist/esm/common/wasm/square.js +1 -0
- package/dist/esm/common/wasm/sub.js +1 -0
- package/dist/esm/common/wasm/svd.js +1 -0
- package/dist/esm/common/wasm/tan.js +1 -0
- package/dist/esm/common/wasm/tanh.js +1 -0
- package/dist/esm/common/wasm/tile.js +1 -0
- package/dist/esm/common/wasm/vdot.js +1 -0
- package/dist/esm/common/wasm/vecdot.js +1 -0
- package/dist/esm/common/wasm/vecmat.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/types.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 +9 -4
- package/dist/types/common/float16-conv.d.ts +27 -0
- package/dist/types/common/internal/indexing.d.ts +15 -18
- package/dist/types/common/ndarray-core.d.ts +3 -13
- package/dist/types/common/ops/linalg.d.ts +13 -12
- package/dist/types/common/ops/random.d.ts +10 -5
- package/dist/types/common/ops/sets.d.ts +1 -1
- package/dist/types/common/ops/shape.d.ts +11 -0
- package/dist/types/common/storage.d.ts +4 -0
- package/dist/types/common/wasm/abs.d.ts +14 -0
- package/dist/types/common/wasm/add.d.ts +19 -0
- package/dist/types/common/wasm/arccos.d.ts +15 -0
- package/dist/types/common/wasm/arcsin.d.ts +15 -0
- package/dist/types/common/wasm/arctan.d.ts +15 -0
- package/dist/types/common/wasm/argpartition.d.ts +18 -0
- package/dist/types/common/wasm/argsort.d.ts +18 -0
- package/dist/types/common/wasm/bins/abs.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/add.wasm.d.ts +17 -0
- package/dist/types/common/wasm/bins/arccos.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/arcsin.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/arctan.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/argpartition.wasm.d.ts +21 -0
- package/dist/types/common/wasm/bins/argsort.wasm.d.ts +25 -0
- package/dist/types/common/wasm/bins/bitwise_and.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/bitwise_count.wasm.d.ts +9 -0
- package/dist/types/common/wasm/bins/bitwise_not.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/bitwise_or.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/bitwise_xor.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/cholesky.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/clip.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/convolve.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/copysign.wasm.d.ts +21 -0
- package/dist/types/common/wasm/bins/correlate.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/cos.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/cosh.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/cross.wasm.d.ts +9 -0
- package/dist/types/common/wasm/bins/diff.wasm.d.ts +13 -0
- package/dist/types/common/wasm/bins/divide.wasm.d.ts +23 -0
- package/dist/types/common/wasm/bins/dot.wasm.d.ts +9 -0
- package/dist/types/common/wasm/bins/exp.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/exp2.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/fft.wasm.d.ts +22 -0
- package/dist/types/common/wasm/bins/flip.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/frexp.wasm.d.ts +2 -0
- package/dist/types/common/wasm/bins/gather.wasm.d.ts +32 -0
- package/dist/types/common/wasm/bins/gcd.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/gradient.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/heaviside.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/hypot.wasm.d.ts +13 -0
- package/dist/types/common/wasm/bins/indices.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/inner.wasm.d.ts +9 -0
- package/dist/types/common/wasm/bins/kron.wasm.d.ts +9 -0
- package/dist/types/common/wasm/bins/ldexp.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/left_shift.wasm.d.ts +9 -0
- package/dist/types/common/wasm/bins/lexsort.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/logaddexp.wasm.d.ts +21 -0
- package/dist/types/common/wasm/bins/logical_and.wasm.d.ts +13 -0
- package/dist/types/common/wasm/bins/logical_not.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/logical_or.wasm.d.ts +13 -0
- package/dist/types/common/wasm/bins/logical_xor.wasm.d.ts +13 -0
- package/dist/types/common/wasm/bins/matmul.wasm.d.ts +9 -0
- package/dist/types/common/wasm/bins/matvec.wasm.d.ts +9 -0
- package/dist/types/common/wasm/bins/max.wasm.d.ts +21 -0
- package/dist/types/common/wasm/bins/min.wasm.d.ts +21 -0
- package/dist/types/common/wasm/bins/mul.wasm.d.ts +17 -0
- package/dist/types/common/wasm/bins/neg.wasm.d.ts +9 -0
- package/dist/types/common/wasm/bins/outer.wasm.d.ts +9 -0
- package/dist/types/common/wasm/bins/pad.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/partition.wasm.d.ts +21 -0
- package/dist/types/common/wasm/bins/power.wasm.d.ts +13 -0
- package/dist/types/common/wasm/bins/qr.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/reciprocal.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/reduce_all.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/reduce_any.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/reduce_argmax.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/reduce_argmin.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/reduce_count_nz.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/reduce_max.wasm.d.ts +20 -0
- package/dist/types/common/wasm/bins/reduce_mean.wasm.d.ts +21 -0
- package/dist/types/common/wasm/bins/reduce_min.wasm.d.ts +20 -0
- package/dist/types/common/wasm/bins/reduce_nanmax.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/reduce_nanmin.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/reduce_nansum.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/reduce_prod.wasm.d.ts +19 -0
- package/dist/types/common/wasm/bins/reduce_quantile.wasm.d.ts +2 -0
- package/dist/types/common/wasm/bins/reduce_std.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/reduce_sum.wasm.d.ts +17 -0
- package/dist/types/common/wasm/bins/reduce_var.wasm.d.ts +11 -0
- package/dist/types/common/wasm/bins/repeat.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/right_shift.wasm.d.ts +17 -0
- package/dist/types/common/wasm/bins/rng.wasm.d.ts +60 -0
- package/dist/types/common/wasm/bins/roll.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/rot90.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/searchsorted.wasm.d.ts +21 -0
- package/dist/types/common/wasm/bins/sign.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/sinh.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/sort.wasm.d.ts +27 -0
- package/dist/types/common/wasm/bins/sqrt.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/square.wasm.d.ts +9 -0
- package/dist/types/common/wasm/bins/sub.wasm.d.ts +17 -0
- package/dist/types/common/wasm/bins/svd.wasm.d.ts +2 -0
- package/dist/types/common/wasm/bins/tan.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/tanh.wasm.d.ts +5 -0
- package/dist/types/common/wasm/bins/tile.wasm.d.ts +7 -0
- package/dist/types/common/wasm/bins/vdot.wasm.d.ts +3 -0
- package/dist/types/common/wasm/bins/vecdot.wasm.d.ts +9 -0
- package/dist/types/common/wasm/bins/vecmat.wasm.d.ts +9 -0
- package/dist/types/common/wasm/bitwise_and.d.ts +9 -0
- package/dist/types/common/wasm/bitwise_count.d.ts +11 -0
- package/dist/types/common/wasm/bitwise_not.d.ts +9 -0
- package/dist/types/common/wasm/bitwise_or.d.ts +9 -0
- package/dist/types/common/wasm/bitwise_xor.d.ts +9 -0
- package/dist/types/common/wasm/cholesky.d.ts +20 -0
- package/dist/types/common/wasm/clip.d.ts +13 -0
- package/dist/types/common/wasm/config.d.ts +21 -0
- package/dist/types/common/wasm/convolve.d.ts +14 -0
- package/dist/types/common/wasm/copysign.d.ts +19 -0
- package/dist/types/common/wasm/correlate.d.ts +14 -0
- package/dist/types/common/wasm/cos.d.ts +15 -0
- package/dist/types/common/wasm/cosh.d.ts +15 -0
- package/dist/types/common/wasm/cross.d.ts +15 -0
- package/dist/types/common/wasm/diff.d.ts +15 -0
- package/dist/types/common/wasm/divide.d.ts +11 -0
- package/dist/types/common/wasm/dot.d.ts +14 -0
- package/dist/types/common/wasm/exp.d.ts +15 -0
- package/dist/types/common/wasm/exp2.d.ts +15 -0
- package/dist/types/common/wasm/fft.d.ts +65 -0
- package/dist/types/common/wasm/flip.d.ts +13 -0
- package/dist/types/common/wasm/frexp.d.ts +9 -0
- package/dist/types/common/wasm/gather.d.ts +23 -0
- package/dist/types/common/wasm/gcd.d.ts +11 -0
- package/dist/types/common/wasm/gradient.d.ts +13 -0
- package/dist/types/common/wasm/heaviside.d.ts +11 -0
- package/dist/types/common/wasm/hypot.d.ts +21 -0
- package/dist/types/common/wasm/indices.d.ts +10 -0
- package/dist/types/common/wasm/inner.d.ts +20 -0
- package/dist/types/common/wasm/kron.d.ts +13 -0
- package/dist/types/common/wasm/ldexp.d.ts +9 -0
- package/dist/types/common/wasm/left_shift.d.ts +11 -0
- package/dist/types/common/wasm/lexsort.d.ts +14 -0
- package/dist/types/common/wasm/logaddexp.d.ts +21 -0
- package/dist/types/common/wasm/logical_and.d.ts +19 -0
- package/dist/types/common/wasm/logical_not.d.ts +13 -0
- package/dist/types/common/wasm/logical_or.d.ts +19 -0
- package/dist/types/common/wasm/logical_xor.d.ts +19 -0
- package/dist/types/common/wasm/matmul.d.ts +18 -0
- package/dist/types/common/wasm/matvec.d.ts +13 -0
- package/dist/types/common/wasm/max.d.ts +11 -0
- package/dist/types/common/wasm/min.d.ts +11 -0
- package/dist/types/common/wasm/mul.d.ts +19 -0
- package/dist/types/common/wasm/neg.d.ts +13 -0
- package/dist/types/common/wasm/outer.d.ts +13 -0
- package/dist/types/common/wasm/pad.d.ts +14 -0
- package/dist/types/common/wasm/partition.d.ts +20 -0
- package/dist/types/common/wasm/power.d.ts +19 -0
- package/dist/types/common/wasm/qr.d.ts +17 -0
- package/dist/types/common/wasm/reciprocal.d.ts +9 -0
- package/dist/types/common/wasm/reduce_all.d.ts +14 -0
- package/dist/types/common/wasm/reduce_any.d.ts +14 -0
- package/dist/types/common/wasm/reduce_argmax.d.ts +14 -0
- package/dist/types/common/wasm/reduce_argmin.d.ts +14 -0
- package/dist/types/common/wasm/reduce_count_nz.d.ts +14 -0
- package/dist/types/common/wasm/reduce_max.d.ts +19 -0
- package/dist/types/common/wasm/reduce_mean.d.ts +19 -0
- package/dist/types/common/wasm/reduce_min.d.ts +19 -0
- package/dist/types/common/wasm/reduce_nanmax.d.ts +14 -0
- package/dist/types/common/wasm/reduce_nanmin.d.ts +14 -0
- package/dist/types/common/wasm/reduce_nansum.d.ts +14 -0
- package/dist/types/common/wasm/reduce_prod.d.ts +20 -0
- package/dist/types/common/wasm/reduce_quantile.d.ts +15 -0
- package/dist/types/common/wasm/reduce_std.d.ts +14 -0
- package/dist/types/common/wasm/reduce_sum.d.ts +20 -0
- package/dist/types/common/wasm/reduce_var.d.ts +14 -0
- package/dist/types/common/wasm/repeat.d.ts +14 -0
- package/dist/types/common/wasm/right_shift.d.ts +11 -0
- package/dist/types/common/wasm/rng.d.ts +65 -0
- package/dist/types/common/wasm/roll.d.ts +13 -0
- package/dist/types/common/wasm/rot90.d.ts +14 -0
- package/dist/types/common/wasm/runtime.d.ts +55 -0
- package/dist/types/common/wasm/searchsorted.d.ts +12 -0
- package/dist/types/common/wasm/sign.d.ts +14 -0
- package/dist/types/common/wasm/sinh.d.ts +15 -0
- package/dist/types/common/wasm/sort.d.ts +20 -0
- package/dist/types/common/wasm/sqrt.d.ts +15 -0
- package/dist/types/common/wasm/square.d.ts +13 -0
- package/dist/types/common/wasm/sub.d.ts +19 -0
- package/dist/types/common/wasm/svd.d.ts +18 -0
- package/dist/types/common/wasm/tan.d.ts +15 -0
- package/dist/types/common/wasm/tanh.d.ts +15 -0
- package/dist/types/common/wasm/tile.d.ts +14 -0
- package/dist/types/common/wasm/vdot.d.ts +16 -0
- package/dist/types/common/wasm/vecdot.d.ts +15 -0
- package/dist/types/common/wasm/vecmat.d.ts +13 -0
- package/dist/types/core/index.d.ts +94 -1
- package/dist/types/core/linalg.d.ts +10 -10
- package/dist/types/core/reduction.d.ts +17 -17
- package/dist/types/core/rounding.d.ts +0 -2
- package/dist/types/core/sets.d.ts +1 -1
- package/dist/types/core/sorting.d.ts +1 -1
- package/dist/types/full/index.d.ts +20 -18
- package/dist/types/full/ndarray.d.ts +16 -22
- package/dist/types/index.d.ts +18 -3
- package/dist/types/io/file-ops.d.ts +269 -0
- package/dist/types/io/filesystem.d.ts +21 -0
- package/dist/types/io/zip/types.d.ts +2 -1
- package/dist/types/node.d.ts +3 -275
- package/package.json +54 -35
- 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
|
@@ -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
|
|
@@ -53,7 +53,8 @@ export interface RawZipEntry {
|
|
|
53
53
|
uncompressedSize: number;
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* Calculate CRC-32 checksum
|
|
56
|
+
* Calculate CRC-32 checksum using slice-by-8.
|
|
57
|
+
* Processes 8 bytes per iteration, then finishes byte-at-a-time.
|
|
57
58
|
*/
|
|
58
59
|
export declare function crc32(data: Uint8Array): number;
|
|
59
60
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types/node.d.ts
CHANGED
|
@@ -1,280 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Deprecated: use `import from 'numpy-ts'` instead.
|
|
3
3
|
*
|
|
4
|
-
* This module
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* import * as np from 'numpy-ts/node';
|
|
9
|
-
* // Has everything from numpy-ts + file I/O
|
|
10
|
-
* const arr = await np.loadNpy('data.npy');
|
|
11
|
-
* await np.saveNpz('output.npz', { x: arr });
|
|
12
|
-
*
|
|
13
|
-
* For browser usage, use the main entry point (no file I/O).
|
|
4
|
+
* This module re-exports everything from the main entry point.
|
|
5
|
+
* File IO functions (loadNpy, saveNpy, etc.) are now available directly from 'numpy-ts'.
|
|
14
6
|
*/
|
|
15
|
-
import { NDArray } from './full/ndarray';
|
|
16
|
-
import type { NpzParseOptions } from './io/npz/parser';
|
|
17
|
-
import { type NpzSerializeOptions, type NpzArraysInput } from './io/npz/serializer';
|
|
18
|
-
import { type ParseTxtOptions, type SerializeTxtOptions } from './io/txt';
|
|
19
|
-
import type { DType } from './common/dtype';
|
|
20
|
-
interface NpzParseResultNDArray {
|
|
21
|
-
arrays: Map<string, NDArray>;
|
|
22
|
-
skipped: string[];
|
|
23
|
-
errors: Map<string, string>;
|
|
24
|
-
}
|
|
25
7
|
export * from './index';
|
|
26
|
-
/**
|
|
27
|
-
* Options for loading NPY/NPZ files
|
|
28
|
-
*/
|
|
29
|
-
export interface LoadOptions extends NpzParseOptions {
|
|
30
|
-
/**
|
|
31
|
-
* If true, allow loading .npy files.
|
|
32
|
-
* Default: true
|
|
33
|
-
*/
|
|
34
|
-
allowNpy?: boolean;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Options for saving NPZ files
|
|
38
|
-
*/
|
|
39
|
-
export interface SaveNpzOptions extends NpzSerializeOptions {
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Load an NDArray from a .npy file
|
|
43
|
-
*
|
|
44
|
-
* @param path - Path to the .npy file
|
|
45
|
-
* @returns The loaded NDArray
|
|
46
|
-
*/
|
|
47
|
-
export declare function loadNpy(path: string): Promise<NDArray>;
|
|
48
|
-
/**
|
|
49
|
-
* Synchronously load an NDArray from a .npy file
|
|
50
|
-
*
|
|
51
|
-
* @param path - Path to the .npy file
|
|
52
|
-
* @returns The loaded NDArray
|
|
53
|
-
*/
|
|
54
|
-
export declare function loadNpySync(path: string): NDArray;
|
|
55
|
-
/**
|
|
56
|
-
* Save an NDArray to a .npy file
|
|
57
|
-
*
|
|
58
|
-
* @param path - Path to save the .npy file
|
|
59
|
-
* @param arr - The NDArray to save
|
|
60
|
-
*/
|
|
61
|
-
export declare function saveNpy(path: string, arr: NDArray): Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* Synchronously save an NDArray to a .npy file
|
|
64
|
-
*
|
|
65
|
-
* @param path - Path to save the .npy file
|
|
66
|
-
* @param arr - The NDArray to save
|
|
67
|
-
*/
|
|
68
|
-
export declare function saveNpySync(path: string, arr: NDArray): void;
|
|
69
|
-
/**
|
|
70
|
-
* Load arrays from a .npz file
|
|
71
|
-
*
|
|
72
|
-
* @param path - Path to the .npz file
|
|
73
|
-
* @param options - Load options
|
|
74
|
-
* @returns Object with array names as keys
|
|
75
|
-
*/
|
|
76
|
-
export declare function loadNpzFile(path: string, options?: NpzParseOptions): Promise<NpzParseResultNDArray>;
|
|
77
|
-
/**
|
|
78
|
-
* Synchronously load arrays from a .npz file
|
|
79
|
-
*
|
|
80
|
-
* Note: Only works if the NPZ file is not DEFLATE compressed.
|
|
81
|
-
*
|
|
82
|
-
* @param path - Path to the .npz file
|
|
83
|
-
* @param options - Load options
|
|
84
|
-
* @returns Object with array names as keys
|
|
85
|
-
*/
|
|
86
|
-
export declare function loadNpzFileSync(path: string, options?: NpzParseOptions): NpzParseResultNDArray;
|
|
87
|
-
/**
|
|
88
|
-
* Save arrays to a .npz file
|
|
89
|
-
*
|
|
90
|
-
* @param path - Path to save the .npz file
|
|
91
|
-
* @param arrays - Arrays to save:
|
|
92
|
-
* - Array of NDArrays (positional, named arr_0, arr_1, etc.)
|
|
93
|
-
* - Map of names to NDArrays
|
|
94
|
-
* - Object with names as keys
|
|
95
|
-
* @param options - Save options
|
|
96
|
-
*/
|
|
97
|
-
export declare function saveNpz(path: string, arrays: NpzArraysInput, options?: SaveNpzOptions): Promise<void>;
|
|
98
|
-
/**
|
|
99
|
-
* Synchronously save arrays to a .npz file (no compression)
|
|
100
|
-
*
|
|
101
|
-
* @param path - Path to save the .npz file
|
|
102
|
-
* @param arrays - Arrays to save (same types as saveNpz)
|
|
103
|
-
*/
|
|
104
|
-
export declare function saveNpzSync(path: string, arrays: NpzArraysInput): void;
|
|
105
|
-
/**
|
|
106
|
-
* Load an array or arrays from a .npy or .npz file
|
|
107
|
-
*
|
|
108
|
-
* This is a convenience function that auto-detects the file format based on extension.
|
|
109
|
-
*
|
|
110
|
-
* @param path - Path to the file
|
|
111
|
-
* @param options - Load options
|
|
112
|
-
* @returns NDArray for .npy files, or NpzParseResult for .npz files
|
|
113
|
-
*/
|
|
114
|
-
export declare function load(path: string, options?: LoadOptions): Promise<NDArray | NpzParseResultNDArray>;
|
|
115
|
-
/**
|
|
116
|
-
* Synchronously load an array or arrays from a .npy or .npz file
|
|
117
|
-
*
|
|
118
|
-
* @param path - Path to the file
|
|
119
|
-
* @param options - Load options
|
|
120
|
-
* @returns NDArray for .npy files, or NpzParseResult for .npz files
|
|
121
|
-
*/
|
|
122
|
-
export declare function loadSync(path: string, options?: LoadOptions): NDArray | NpzParseResultNDArray;
|
|
123
|
-
/**
|
|
124
|
-
* Save an array to a .npy file
|
|
125
|
-
*
|
|
126
|
-
* @param path - Path to save the file (should end with .npy)
|
|
127
|
-
* @param arr - The NDArray to save
|
|
128
|
-
*/
|
|
129
|
-
export declare function save(path: string, arr: NDArray): Promise<void>;
|
|
130
|
-
/**
|
|
131
|
-
* Synchronously save an array to a .npy file
|
|
132
|
-
*
|
|
133
|
-
* @param path - Path to save the file (should end with .npy)
|
|
134
|
-
* @param arr - The NDArray to save
|
|
135
|
-
*/
|
|
136
|
-
export declare function saveSync(path: string, arr: NDArray): void;
|
|
137
|
-
/**
|
|
138
|
-
* Save multiple arrays to a .npz file (like np.savez)
|
|
139
|
-
*
|
|
140
|
-
* @param path - Path to save the .npz file
|
|
141
|
-
* @param arrays - Arrays to save:
|
|
142
|
-
* - Array of NDArrays: named arr_0, arr_1, etc. (like np.savez positional args)
|
|
143
|
-
* - Object/Map with names as keys (like np.savez keyword args)
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
* // Positional arrays
|
|
147
|
-
* await savez('data.npz', [arr1, arr2]) // saved as arr_0, arr_1
|
|
148
|
-
*
|
|
149
|
-
* // Named arrays
|
|
150
|
-
* await savez('data.npz', { x: arr1, y: arr2 })
|
|
151
|
-
*/
|
|
152
|
-
export declare function savez(path: string, arrays: NpzArraysInput): Promise<void>;
|
|
153
|
-
/**
|
|
154
|
-
* Save multiple arrays to a compressed .npz file (like np.savez_compressed)
|
|
155
|
-
*
|
|
156
|
-
* @param path - Path to save the .npz file
|
|
157
|
-
* @param arrays - Arrays to save (same input types as savez)
|
|
158
|
-
*/
|
|
159
|
-
export declare function savez_compressed(path: string, arrays: NpzArraysInput): Promise<void>;
|
|
160
|
-
/**
|
|
161
|
-
* Options for loadtxt
|
|
162
|
-
*/
|
|
163
|
-
export interface LoadTxtOptions extends ParseTxtOptions {
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Options for savetxt
|
|
167
|
-
*/
|
|
168
|
-
export interface SaveTxtOptions extends SerializeTxtOptions {
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Load data from a text file.
|
|
172
|
-
*
|
|
173
|
-
* Each row in the text file must have the same number of values.
|
|
174
|
-
*
|
|
175
|
-
* @param path - Path to the text file
|
|
176
|
-
* @param options - Load options
|
|
177
|
-
* @returns NDArray with the loaded data
|
|
178
|
-
*
|
|
179
|
-
* @example
|
|
180
|
-
* ```typescript
|
|
181
|
-
* // Load a CSV file
|
|
182
|
-
* const arr = await loadtxt('data.csv', { delimiter: ',' });
|
|
183
|
-
*
|
|
184
|
-
* // Load with specific columns
|
|
185
|
-
* const arr = await loadtxt('data.txt', { usecols: [0, 2] });
|
|
186
|
-
*
|
|
187
|
-
* // Skip header rows
|
|
188
|
-
* const arr = await loadtxt('data.txt', { skiprows: 1 });
|
|
189
|
-
* ```
|
|
190
|
-
*/
|
|
191
|
-
export declare function loadtxt(path: string, options?: LoadTxtOptions): Promise<NDArray>;
|
|
192
|
-
/**
|
|
193
|
-
* Synchronously load data from a text file.
|
|
194
|
-
*
|
|
195
|
-
* @param path - Path to the text file
|
|
196
|
-
* @param options - Load options
|
|
197
|
-
* @returns NDArray with the loaded data
|
|
198
|
-
*/
|
|
199
|
-
export declare function loadtxtSync(path: string, options?: LoadTxtOptions): NDArray;
|
|
200
|
-
/**
|
|
201
|
-
* Save an array to a text file.
|
|
202
|
-
*
|
|
203
|
-
* @param path - Path to save the text file
|
|
204
|
-
* @param arr - The array to save (must be 1D or 2D)
|
|
205
|
-
* @param options - Save options
|
|
206
|
-
*
|
|
207
|
-
* @example
|
|
208
|
-
* ```typescript
|
|
209
|
-
* // Save as CSV
|
|
210
|
-
* await savetxt('data.csv', arr, { delimiter: ',' });
|
|
211
|
-
*
|
|
212
|
-
* // Save with custom format
|
|
213
|
-
* await savetxt('data.txt', arr, { fmt: '%.2f', delimiter: '\t' });
|
|
214
|
-
*
|
|
215
|
-
* // Save with header
|
|
216
|
-
* await savetxt('data.txt', arr, { header: 'x y z' });
|
|
217
|
-
* ```
|
|
218
|
-
*/
|
|
219
|
-
export declare function savetxt(path: string, arr: NDArray, options?: SaveTxtOptions): Promise<void>;
|
|
220
|
-
/**
|
|
221
|
-
* Synchronously save an array to a text file.
|
|
222
|
-
*
|
|
223
|
-
* @param path - Path to save the text file
|
|
224
|
-
* @param arr - The array to save (must be 1D or 2D)
|
|
225
|
-
* @param options - Save options
|
|
226
|
-
*/
|
|
227
|
-
export declare function savetxtSync(path: string, arr: NDArray, options?: SaveTxtOptions): void;
|
|
228
|
-
/**
|
|
229
|
-
* Load data from a text file with more flexible handling.
|
|
230
|
-
*
|
|
231
|
-
* Similar to loadtxt but handles missing values more gracefully.
|
|
232
|
-
*
|
|
233
|
-
* @param path - Path to the text file
|
|
234
|
-
* @param options - Load options
|
|
235
|
-
* @returns NDArray with the loaded data
|
|
236
|
-
*
|
|
237
|
-
* @example
|
|
238
|
-
* ```typescript
|
|
239
|
-
* // Load file with missing values
|
|
240
|
-
* const arr = await genfromtxt('data.csv', {
|
|
241
|
-
* delimiter: ',',
|
|
242
|
-
* missing_values: ['NA', ''],
|
|
243
|
-
* filling_values: 0
|
|
244
|
-
* });
|
|
245
|
-
* ```
|
|
246
|
-
*/
|
|
247
|
-
export declare function genfromtxt(path: string, options?: LoadTxtOptions): Promise<NDArray>;
|
|
248
|
-
/**
|
|
249
|
-
* Synchronously load data from a text file with more flexible handling.
|
|
250
|
-
*
|
|
251
|
-
* @param path - Path to the text file
|
|
252
|
-
* @param options - Load options
|
|
253
|
-
* @returns NDArray with the loaded data
|
|
254
|
-
*/
|
|
255
|
-
export declare function genfromtxtSync(path: string, options?: LoadTxtOptions): NDArray;
|
|
256
|
-
/**
|
|
257
|
-
* Load data from a text file using regular expressions.
|
|
258
|
-
*
|
|
259
|
-
* @param path - Path to the text file
|
|
260
|
-
* @param regexp - Regular expression with capture groups for extracting values
|
|
261
|
-
* @param dtype - Data type of the resulting array (default: 'float64')
|
|
262
|
-
* @returns NDArray with the extracted data
|
|
263
|
-
*
|
|
264
|
-
* @example
|
|
265
|
-
* ```typescript
|
|
266
|
-
* // Extract x,y pairs from "Point: x=1.0, y=2.0" format
|
|
267
|
-
* const arr = await fromregex('points.txt', /x=([\d.]+), y=([\d.]+)/);
|
|
268
|
-
* ```
|
|
269
|
-
*/
|
|
270
|
-
export declare function fromregex(path: string, regexp: RegExp | string, dtype?: DType): Promise<NDArray>;
|
|
271
|
-
/**
|
|
272
|
-
* Synchronously load data from a text file using regular expressions.
|
|
273
|
-
*
|
|
274
|
-
* @param path - Path to the text file
|
|
275
|
-
* @param regexp - Regular expression with capture groups for extracting values
|
|
276
|
-
* @param dtype - Data type of the resulting array (default: 'float64')
|
|
277
|
-
* @returns NDArray with the extracted data
|
|
278
|
-
*/
|
|
279
|
-
export declare function fromregexSync(path: string, regexp: RegExp | string, dtype?: DType): NDArray;
|
|
280
8
|
//# sourceMappingURL=node.d.ts.map
|