Skip to content

update to ulab 4.0.0 #5859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2022
Merged
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 99 files
+13 −5 README.md
+3 −1 code/micropython.mk
+404 −134 code/ndarray.c
+15 −4 code/ndarray.h
+33 −1 code/ndarray_operators.c
+15 −0 code/ndarray_properties.c
+6 −0 code/numpy/approx.c
+826 −0 code/numpy/carray/carray.c
+237 −0 code/numpy/carray/carray.h
+28 −0 code/numpy/carray/carray_tools.c
+25 −0 code/numpy/carray/carray_tools.h
+11 −0 code/numpy/compare.c
+238 −23 code/numpy/create.c
+6 −5 code/numpy/create.h
+18 −0 code/numpy/fft/fft.c
+6 −0 code/numpy/fft/fft.h
+129 −7 code/numpy/fft/fft_tools.c
+5 −0 code/numpy/fft/fft_tools.h
+57 −9 code/numpy/filter.c
+6 −0 code/numpy/linalg/linalg.c
+79 −51 code/numpy/numerical.c
+48 −28 code/numpy/numpy.c
+18 −0 code/numpy/poly.c
+2 −0 code/numpy/stats.c
+134 −0 code/numpy/transform.c
+1 −0 code/numpy/transform.h
+256 −48 code/numpy/vector.c
+38 −33 code/numpy/vector.h
+16 −0 code/scipy/signal/signal.c
+4 −4 code/scipy/special/special.c
+10 −2 code/ulab.c
+42 −2 code/ulab.h
+28 −1 code/ulab_tools.c
+9 −1 code/ulab_tools.h
+2 −2 docs/manual/source/conf.py
+36 −0 docs/manual/source/numpy-fft.rst
+227 −32 docs/manual/source/numpy-functions.rst
+78 −7 docs/manual/source/numpy-universal.rst
+3 −1 docs/manual/source/scipy-signal.rst
+50 −15 docs/manual/source/ulab-intro.rst
+157 −18 docs/manual/source/ulab-ndarray.rst
+37 −3 docs/numpy-fft.ipynb
+277 −19 docs/numpy-functions.ipynb
+101 −11 docs/numpy-universal.ipynb
+8 −8 docs/scipy-signal.ipynb
+82 −81 docs/ulab-convert.ipynb
+61 −10 docs/ulab-intro.ipynb
+279 −59 docs/ulab-ndarray.ipynb
+7 −7 docs/ulab-numerical.ipynb
+1 −1 docs/ulab-programming.ipynb
+1 −1 test-common.sh
+17 −0 tests/1d/complex/complex_exp.py
+42 −0 tests/1d/complex/complex_exp.py.exp
+18 −0 tests/1d/complex/complex_sqrt.py
+42 −0 tests/1d/complex/complex_sqrt.py.exp
+19 −0 tests/1d/complex/imag_real.py
+14 −0 tests/1d/complex/imag_real.py.exp
+26 −0 tests/2d/complex/binary_op.py
+21 −0 tests/2d/complex/binary_op.py.exp
+24 −0 tests/2d/complex/complex_exp.py
+98 −0 tests/2d/complex/complex_exp.py.exp
+25 −0 tests/2d/complex/complex_sqrt.py
+98 −0 tests/2d/complex/complex_sqrt.py.exp
+12 −0 tests/2d/complex/conjugate.py
+7 −0 tests/2d/complex/conjugate.py.exp
+28 −0 tests/2d/complex/imag_real.py
+146 −0 tests/2d/complex/imag_real.py.exp
+26 −0 tests/2d/complex/sort_complex.py
+12 −0 tests/2d/complex/sort_complex.py.exp
+11 −0 tests/2d/numpy/arange.py
+15 −0 tests/2d/numpy/arange.py.exp
+18 −0 tests/2d/numpy/concatenate.py
+20 −0 tests/2d/numpy/concatenate.py.exp
+30 −0 tests/2d/numpy/eye.py
+78 −0 tests/2d/numpy/eye.py.exp
+9 −0 tests/2d/numpy/full.py
+10 −0 tests/2d/numpy/full.py.exp
+5 −97 tests/2d/numpy/initialisation.py
+0 −156 tests/2d/numpy/initialisation.py.exp
+10 −0 tests/2d/numpy/linspace.py
+10 −0 tests/2d/numpy/linspace.py.exp
+10 −0 tests/2d/numpy/logspace.py
+10 −0 tests/2d/numpy/logspace.py.exp
+13 −0 tests/2d/numpy/ones.py
+39 −0 tests/2d/numpy/ones.py.exp
+13 −0 tests/2d/numpy/zeros.py
+39 −0 tests/2d/numpy/zeros.py.exp
+24 −0 tests/3d/complex/complex_exp.py
+115 −0 tests/3d/complex/complex_exp.py.exp
+26 −0 tests/3d/complex/complex_sqrt.py
+151 −0 tests/3d/complex/complex_sqrt.py.exp
+28 −0 tests/3d/complex/imag_real.py
+309 −0 tests/3d/complex/imag_real.py.exp
+26 −0 tests/4d/complex/complex_exp.py
+142 −0 tests/4d/complex/complex_exp.py.exp
+27 −0 tests/4d/complex/complex_sqrt.py
+250 −0 tests/4d/complex/complex_sqrt.py.exp
+29 −0 tests/4d/complex/imag_real.py
+625 −0 tests/4d/complex/imag_real.py.exp
68 changes: 54 additions & 14 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2624,7 +2624,7 @@ msgstr ""
msgid "attributes not supported yet"
msgstr ""

#: extmod/ulab/code/numpy/numerical.c
#: extmod/ulab/code/ulab_tools.c
msgid "axis is out of bounds"
msgstr ""

Expand Down Expand Up @@ -2680,11 +2680,11 @@ msgstr ""
msgid "branch not in range"
msgstr ""

#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c
msgid "buffer is smaller than requested size"
msgstr ""

#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c
msgid "buffer size must be a multiple of element size"
msgstr ""

Expand Down Expand Up @@ -2776,6 +2776,10 @@ msgstr ""
msgid "can't convert '%q' object to %q implicitly"
msgstr ""

#: extmod/ulab/code/numpy/vector.c
msgid "can't convert complex to float"
msgstr ""

#: py/obj.c
msgid "can't convert to %q"
msgstr ""
Expand Down Expand Up @@ -2870,6 +2874,14 @@ msgstr ""
msgid "cannot cast output with casting rule"
msgstr ""

#: extmod/ulab/code/ndarray.c
msgid "cannot convert complex to dtype"
msgstr ""

#: extmod/ulab/code/ndarray.c
msgid "cannot convert complex type"
msgstr ""

#: py/objtype.c
msgid "cannot create '%q' instances"
msgstr ""
Expand Down Expand Up @@ -3061,6 +3073,10 @@ msgstr ""
msgid "divisor must be 4"
msgstr ""

#: extmod/ulab/code/numpy/vector.c
msgid "dtype must be float, or complex"
msgstr ""

#: py/objdeque.c
msgid "empty"
msgstr ""
Expand Down Expand Up @@ -3164,7 +3180,7 @@ msgstr ""
msgid "first argument must be a function"
msgstr ""

#: extmod/ulab/code/ulab_create.c
#: extmod/ulab/code/numpy/create.c
msgid "first argument must be a tuple of ndarrays"
msgstr ""

Expand Down Expand Up @@ -3229,6 +3245,10 @@ msgstr ""
msgid "function is defined for ndarrays only"
msgstr ""

#: extmod/ulab/code/numpy/carray/carray.c
msgid "function is implemented for ndarrays only"
msgstr ""

#: py/argcheck.c
#, c-format
msgid "function missing %d required positional arguments"
Expand Down Expand Up @@ -3342,22 +3362,26 @@ msgstr ""
msgid "input and output shapes are not compatible"
msgstr ""

#: extmod/ulab/code/ulab_create.c
#: extmod/ulab/code/numpy/create.c
msgid "input argument must be an integer, a tuple, or a list"
msgstr ""

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

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

#: extmod/ulab/code/numpy/poly.c
msgid "input data must be an iterable"
msgstr ""

#: extmod/ulab/code/numpy/vector.c
msgid "input dtype must be float or complex"
msgstr ""

#: extmod/ulab/code/numpy/linalg/linalg.c
msgid "input matrix is asymmetric"
msgstr ""
Expand All @@ -3367,18 +3391,26 @@ msgstr ""
msgid "input matrix is singular"
msgstr ""

#: extmod/ulab/code/numpy/carray/carray.c
msgid "input must be a 1D ndarray"
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/ulab_create.c
#: extmod/ulab/code/numpy/create.c
msgid "input must be a tensor of rank 2"
msgstr ""

#: extmod/ulab/code/ulab_create.c extmod/ulab/code/user/user.c
#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c
msgid "input must be an ndarray"
msgstr ""

#: extmod/ulab/code/numpy/carray/carray.c
msgid "input must be an ndarray, or a scalar"
msgstr ""

#: extmod/ulab/code/scipy/signal/signal.c
msgid "input must be one-dimensional"
msgstr ""
Expand Down Expand Up @@ -3749,7 +3781,11 @@ msgstr ""
msgid "not enough arguments for format string"
msgstr ""

#: extmod/ulab/code/ulab_create.c
#: extmod/ulab/code/numpy/carray/carray_tools.c
msgid "not implemented for complex dtype"
msgstr ""

#: extmod/ulab/code/numpy/create.c
msgid "number of points must be at least 2"
msgstr ""

Expand Down Expand Up @@ -3807,15 +3843,15 @@ msgstr ""
msgid "odd-length string"
msgstr ""

#: extmod/ulab/code/ulab_create.c extmod/ulab/code/utils/utils.c
#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c
msgid "offset is too large"
msgstr ""

#: shared-bindings/dualbank/__init__.c
msgid "offset must be >= 0"
msgstr ""

#: extmod/ulab/code/ulab_create.c
#: extmod/ulab/code/numpy/create.c
msgid "offset must be non-negative and no greater than buffer length"
msgstr ""

Expand Down Expand Up @@ -4294,7 +4330,7 @@ msgstr ""
msgid "too many arguments provided with the given format"
msgstr ""

#: extmod/ulab/code/ndarray.c extmod/ulab/code/ulab_create.c
#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c
msgid "too many dimensions"
msgstr ""

Expand Down Expand Up @@ -4495,15 +4531,19 @@ msgstr ""
msgid "wrong axis index"
msgstr ""

#: extmod/ulab/code/ulab_create.c
#: extmod/ulab/code/numpy/create.c
msgid "wrong axis specified"
msgstr ""

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

#: extmod/ulab/code/ulab_create.c py/objarray.c py/objstr.c
#: extmod/ulab/code/numpy/transform.c
msgid "wrong length of condition array"
msgstr ""

#: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c
msgid "wrong number of arguments"
msgstr ""

Expand Down
4 changes: 4 additions & 0 deletions py/circuitpy_mpconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ extern const struct _mp_obj_module_t nvm_module;
#endif
#endif

#ifndef ULAB_SUPPORTS_COMPLEX
#define ULAB_SUPPORTS_COMPLEX (0)
#endif

#if CIRCUITPY_ULAB
// ulab requires reverse special methods
#if defined(MICROPY_PY_REVERSE_SPECIAL_METHODS) && !MICROPY_PY_REVERSE_SPECIAL_METHODS
Expand Down