Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extmod/ulab
Submodule ulab updated 81 files
+2 −2 .github/workflows/build.yml
+2 −1 README.md
+1 −0 code/micropython.mk
+164 −192 code/ndarray.c
+97 −1 code/ndarray.h
+165 −0 code/ndarray_operators.c
+175 −0 code/ndarray_operators.h
+7 −2 code/ndarray_properties.c
+5 −1 code/ndarray_properties.h
+139 −43 code/numpy/compare.c
+2 −1 code/numpy/compare.h
+367 −1 code/numpy/create.c
+10 −0 code/numpy/create.h
+7 −7 code/numpy/fft/fft.c
+13 −34 code/numpy/fft/fft_tools.c
+2 −3 code/numpy/fft/fft_tools.h
+44 −59 code/numpy/io/io.c
+41 −23 code/numpy/numerical.c
+0 −130 code/numpy/numerical.h
+9 −0 code/numpy/numpy.c
+4 −37 code/numpy/poly.c
+8 −25 code/numpy/random/random.c
+47 −275 code/numpy/vector.c
+704 −0 code/scipy/integrate/integrate.c
+34 −0 code/scipy/integrate/integrate.h
+2 −1 code/scipy/linalg/linalg.c
+4 −0 code/scipy/optimize/optimize.c
+5 −1 code/scipy/scipy.c
+4 −0 code/scipy/signal/signal.c
+4 −0 code/scipy/special/special.c
+1 −1 code/ulab.c
+47 −1 code/ulab.h
+80 −24 code/ulab_tools.c
+4 −3 code/ulab_tools.h
+170 −12 code/utils/utils.c
+2 −2 docs/manual/source/conf.py
+1 −0 docs/manual/source/index.rst
+66 −5 docs/manual/source/numpy-functions.rst
+220 −0 docs/manual/source/scipy-integrate.rst
+7 −6 docs/manual/source/ulab-intro.rst
+11 −8 docs/manual/source/ulab-ndarray.rst
+84 −22 docs/manual/source/ulab-utils.rst
+126 −10 docs/numpy-functions.ipynb
+510 −0 docs/scipy-integrate.ipynb
+84 −0 docs/ulab-change-log.md
+20 −12 docs/ulab-convert.ipynb
+4 −11 docs/ulab-intro.ipynb
+65 −7 docs/ulab-ndarray.ipynb
+135 −194 docs/ulab-numerical.ipynb
+80 −22 docs/ulab-utils.ipynb
+12 −4 tests/1d/numpy/fft.py
+32 −0 tests/1d/numpy/sort.py
+46 −0 tests/1d/numpy/sort.py.exp
+79 −127 tests/1d/numpy/universal_functions.py
+81 −12 tests/1d/numpy/universal_functions.py.exp
+82 −0 tests/2d/numpy/bincount.py
+41 −0 tests/2d/numpy/bincount.py.exp
+21 −8 tests/2d/numpy/cholesky.py
+29 −9 tests/2d/numpy/cholesky.py.exp
+14 −2 tests/2d/numpy/logspace.py
+2 −2 tests/2d/numpy/logspace.py.exp
+39 −0 tests/2d/numpy/meshgrid.py
+27 −0 tests/2d/numpy/meshgrid.py.exp
+66 −0 tests/2d/numpy/modulo.py
+111 −0 tests/2d/numpy/modulo.py.exp
+10 −0 tests/2d/numpy/random.py
+3 −0 tests/2d/numpy/random.py.exp
+21 −8 tests/2d/numpy/sort.py
+63 −24 tests/2d/numpy/sort.py.exp
+23 −0 tests/2d/numpy/sum.py
+80 −0 tests/2d/numpy/sum.py.exp
+30 −0 tests/2d/numpy/take.py
+105 −0 tests/2d/numpy/take.py.exp
+58 −0 tests/2d/numpy/transpose.py
+78 −0 tests/2d/numpy/transpose.py.exp
+30 −0 tests/2d/scipy/integrate.py
+11 −0 tests/2d/scipy/integrate.py.exp
+45 −0 tests/3d/numpy/meshgrid.py
+37 −0 tests/3d/numpy/meshgrid.py.exp
+53 −0 tests/4d/numpy/meshgrid.py
+55 −0 tests/4d/numpy/meshgrid.py.exp
176 changes: 150 additions & 26 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ msgstr ""
msgid "ndarray length overflows"
msgstr ""

#: extmod/ulab/code/ndarray.c
msgid "maximum number of dimensions is "
msgstr ""

#: extmod/ulab/code/ndarray.c
msgid "cannot convert complex type"
msgstr ""
Expand Down Expand Up @@ -154,11 +158,23 @@ msgid "operation is not supported for given type"
msgstr ""

#: extmod/ulab/code/ndarray.c
msgid "shape must be integer or tuple of integers"
msgid "keyword argument must be tuple of integers"
msgstr ""

#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/random/random.c
msgid "maximum number of dimensions is "
#: extmod/ulab/code/ndarray.c
msgid "too many axes specified"
msgstr ""

#: extmod/ulab/code/ndarray.c
msgid "axis index out of bounds"
msgstr ""

#: extmod/ulab/code/ndarray.c
msgid "repeated indices"
msgstr ""

#: extmod/ulab/code/ndarray.c
msgid "shape must be integer or tuple of integers"
msgstr ""

#: extmod/ulab/code/ndarray.c
Expand Down Expand Up @@ -225,6 +241,31 @@ msgstr ""
msgid "not implemented for complex dtype"
msgstr ""

#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/user/user.c
#: shared-bindings/_eve/__init__.c
msgid "input must be an ndarray"
msgstr ""

#: extmod/ulab/code/numpy/compare.c
msgid "object too deep for desired array"
msgstr ""

#: extmod/ulab/code/numpy/compare.c
msgid "cannot cast array data from dtype"
msgstr ""

#: extmod/ulab/code/numpy/compare.c
msgid "minlength must not be negative"
msgstr ""

#: extmod/ulab/code/numpy/compare.c
msgid "the weights and list don't have the same length"
msgstr ""

#: extmod/ulab/code/numpy/compare.c
msgid "cannot cast weigths to float"
msgstr ""

#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c
#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c
#: extmod/ulab/code/numpy/vector.c
Expand Down Expand Up @@ -259,7 +300,7 @@ msgstr ""
msgid "wrong axis specified"
msgstr ""

#: extmod/ulab/code/numpy/create.c
#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c
msgid "input arrays are not compatible"
msgstr ""

Expand All @@ -271,6 +312,45 @@ msgstr ""
msgid "number of points must be at least 2"
msgstr ""

#: extmod/ulab/code/numpy/create.c
msgid "indexing should be 'xy' or 'ij'"
msgstr ""

#: extmod/ulab/code/numpy/create.c
msgid "indexing must be 'xy' or 'ij'"
msgstr ""

#: extmod/ulab/code/numpy/create.c
msgid "too many input arrays"
msgstr ""

#: extmod/ulab/code/numpy/create.c extmod/ulab/code/numpy/numerical.c
#: extmod/ulab/code/numpy/transform.c
msgid "arguments must be ndarrays"
msgstr ""

#: extmod/ulab/code/numpy/create.c
msgid "arguments must be 1D arrays"
msgstr ""

#: extmod/ulab/code/numpy/create.c
msgid "input is not an array"
msgstr ""

#: extmod/ulab/code/numpy/create.c extmod/ulab/code/numpy/numerical.c
#: ports/espressif/common-hal/pulseio/PulseIn.c
#: shared-bindings/bitmaptools/__init__.c
msgid "index out of range"
msgstr ""

#: extmod/ulab/code/numpy/create.c
msgid "mode should be raise, wrap or clip"
msgstr ""

#: extmod/ulab/code/numpy/create.c
msgid "index must not be negative"
msgstr ""

#: extmod/ulab/code/numpy/create.c
msgid "offset must be non-negative and no greater than buffer length"
msgstr ""
Expand All @@ -291,7 +371,7 @@ msgstr ""
msgid "FFT is implemented for linear arrays only"
msgstr ""

#: extmod/ulab/code/numpy/fft/fft_tools.c
#: extmod/ulab/code/numpy/fft/fft_tools.c extmod/ulab/code/utils/utils.c
msgid "input array length must be power of 2"
msgstr ""

Expand Down Expand Up @@ -400,10 +480,6 @@ msgstr ""
msgid "axis too long"
msgstr ""

#: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/numpy/transform.c
msgid "arguments must be ndarrays"
msgstr ""

#: extmod/ulab/code/numpy/numerical.c
msgid "cross is defined for 1D arrays of length 3"
msgstr ""
Expand All @@ -412,12 +488,6 @@ msgstr ""
msgid "diff argument must be an ndarray"
msgstr ""

#: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c
#: ports/espressif/common-hal/pulseio/PulseIn.c
#: shared-bindings/bitmaptools/__init__.c
msgid "index out of range"
msgstr ""

#: extmod/ulab/code/numpy/numerical.c
msgid "differentiation order out of range"
msgstr ""
Expand Down Expand Up @@ -463,10 +533,10 @@ msgid "argument must be None, an integer or a tuple of integers"
msgstr ""

#: extmod/ulab/code/numpy/random/random.c
msgid "shape must be None, and integer or a tuple of integers"
msgid "shape must be None, an integer or a tuple of integers"
msgstr ""

#: extmod/ulab/code/numpy/random/random.c
#: extmod/ulab/code/numpy/random/random.c extmod/ulab/code/ulab_tools.c
msgid "out has wrong type"
msgstr ""

Expand All @@ -478,7 +548,7 @@ msgstr ""
msgid "size must match out.shape when used together"
msgstr ""

#: extmod/ulab/code/numpy/random/random.c
#: extmod/ulab/code/numpy/random/random.c extmod/ulab/code/ulab_tools.c
msgid "output array must be contiguous"
msgstr ""

Expand All @@ -502,7 +572,7 @@ msgstr ""
msgid "dimensions do not match"
msgstr ""

#: extmod/ulab/code/numpy/vector.c
#: extmod/ulab/code/numpy/vector.c extmod/ulab/code/utils/utils.c
msgid "out must be an ndarray"
msgstr ""

Expand Down Expand Up @@ -538,26 +608,44 @@ msgstr ""
msgid "input dtype must be float or complex"
msgstr ""

#: extmod/ulab/code/numpy/vector.c
#: extmod/ulab/code/numpy/vector.c extmod/ulab/code/scipy/integrate/integrate.c
msgid "first argument must be a callable"
msgstr ""

#: extmod/ulab/code/numpy/vector.c
msgid "wrong output type"
msgstr ""

#: extmod/ulab/code/scipy/linalg/linalg.c
msgid "first two arguments must be ndarrays"
#: extmod/ulab/code/scipy/integrate/integrate.c
#, c-format
msgid "can't convert arg %d from %s to float"
msgstr ""

#: extmod/ulab/code/scipy/linalg/linalg.c extmod/ulab/code/user/user.c
msgid "input must be a dense ndarray"
#: extmod/ulab/code/scipy/integrate/integrate.c
msgid "levels needs to be a positive integer"
msgstr ""

#: extmod/ulab/code/scipy/integrate/integrate.c
msgid "steps needs to be a positive integer"
msgstr ""

#: extmod/ulab/code/scipy/integrate/integrate.c
#: extmod/ulab/code/scipy/optimize/optimize.c
msgid "first argument must be a function"
msgstr ""

#: extmod/ulab/code/scipy/integrate/integrate.c
msgid "order needs to be a positive integer"
msgstr ""

#: extmod/ulab/code/scipy/linalg/linalg.c
msgid "first two arguments must be ndarrays"
msgstr ""

#: extmod/ulab/code/scipy/linalg/linalg.c extmod/ulab/code/user/user.c
msgid "input must be a dense ndarray"
msgstr ""

#: extmod/ulab/code/scipy/optimize/optimize.c
msgid "function has the same sign at the ends of interval"
msgstr ""
Expand Down Expand Up @@ -622,8 +710,16 @@ msgstr ""
msgid "input must be square matrix"
msgstr ""

#: extmod/ulab/code/user/user.c shared-bindings/_eve/__init__.c
msgid "input must be an ndarray"
#: extmod/ulab/code/ulab_tools.c
msgid "out array has wrong dtype"
msgstr ""

#: extmod/ulab/code/ulab_tools.c
msgid "out array has wrong dimension"
msgstr ""

#: extmod/ulab/code/ulab_tools.c
msgid "out array has wrong shape"
msgstr ""

#: extmod/ulab/code/utils/utils.c
Expand All @@ -638,6 +734,34 @@ msgstr ""
msgid "out array is too small"
msgstr ""

#: extmod/ulab/code/utils/utils.c
msgid "spectrogram is defined for ndarrays only"
msgstr ""

#: extmod/ulab/code/utils/utils.c
msgid "spectrogram is implemented for 1D arrays only"
msgstr ""

#: extmod/ulab/code/utils/utils.c
msgid "out array must be a 1D array of float type"
msgstr ""

#: extmod/ulab/code/utils/utils.c
msgid "input and out arrays must have same length"
msgstr ""

#: extmod/ulab/code/utils/utils.c
msgid "scratchpad must be an ndarray"
msgstr ""

#: extmod/ulab/code/utils/utils.c
msgid "scratchpad must be a 1D dense float array"
msgstr ""

#: extmod/ulab/code/utils/utils.c
msgid "scratchpad must be twice as long as input"
msgstr ""

#: extmod/vfs_fat.c py/moderrno.c
msgid "Read-only filesystem"
msgstr ""
Expand Down
20 changes: 17 additions & 3 deletions py/circuitpy_mpconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,23 @@ extern const struct _mp_obj_module_t nvm_module;
#define ULAB_SUPPORTS_COMPLEX (0)
#endif

// The random module is fairly large.
#ifndef ULAB_NUMPY_HAS_RANDOM_MODULE
#define ULAB_NUMPY_HAS_RANDOM_MODULE (0)
// TEMPORARY TO SEE WHAT OVERFLOWS
// // Disable some ulab modules to make it fit on SAMD51x19 boards
// // Consider turning on these modules on boards with more flash.

// #ifndef ULAB_NUMPY_HAS_RANDOM_MODULE
// #define ULAB_NUMPY_HAS_RANDOM_MODULE (0)
// #endif

// #ifndef NDARRAY_HAS_BINARY_OP_MODULO
// #define NDARRAY_HAS_BINARY_OP_MODULO (0)
// #endif
// #ifndef NDARRAY_HAS_INPLACE_MODULO
// #define NDARRAY_HAS_INPLACE_MODULO (0)
// #endif

#ifndef ULAB_SCIPY_HAS_INTEGRATE_MODULE
#define ULAB_SCIPY_HAS_INTEGRATE_MODULE (0)
#endif

#if CIRCUITPY_ULAB
Expand Down
Loading