diff --git a/extmod/ulab b/extmod/ulab index 9b8cd47640304..8d93ddeaf3548 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 9b8cd47640304929aa4255560d754b3058ddaa95 +Subproject commit 8d93ddeaf3548d5466cee0a392a4ee89f07ce2e5 diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 3a0212d7fba29..e64f3b2519818 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -389,6 +389,7 @@ msgstr "" msgid "All event channels in use" msgstr "" +#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "" @@ -973,7 +974,7 @@ msgstr "" msgid "Expected an alarm" msgstr "" -#: shared-module/_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelBuf.c #, c-format msgid "Expected tuple of length %d, got %d" msgstr "" @@ -1295,7 +1296,7 @@ msgstr "" msgid "Invalid buffer size" msgstr "" -#: shared-bindings/_pixelbuf/PixelBuf.c +#: shared-bindings/adafruit_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" msgstr "" @@ -1501,7 +1502,7 @@ msgstr "" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "" -#: shared-bindings/displayio/Group.c +#: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -2348,7 +2349,7 @@ msgstr "" msgid "Unknown system firmware error: %04x" msgstr "" -#: shared-bindings/_pixelbuf/PixelBuf.c +#: shared-bindings/adafruit_pixelbuf/PixelBuf.c #, c-format msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" @@ -2503,11 +2504,11 @@ msgstr "" msgid "arg must be user-type" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "argsort argument must be an ndarray" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "argsort is not implemented for flattened arrays" msgstr "" @@ -2528,8 +2529,7 @@ msgstr "" msgid "argument should be a '%q' not a '%q'" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c -#: extmod/ulab/code/numpy/transform/transform.c +#: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/numpy/transform.c msgid "arguments must be ndarrays" msgstr "" @@ -2542,11 +2542,11 @@ msgstr "" msgid "array/bytes required on right side" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "attempt to get (arg)min/(arg)max of empty sequence" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "attempt to get argmin/argmax of an empty sequence" msgstr "" @@ -2554,15 +2554,15 @@ msgstr "" msgid "attributes not supported yet" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "axis is out of bounds" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c extmod/ulab/code/ulab_tools.c +#: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c msgid "axis must be None, or an integer" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "axis too long" msgstr "" @@ -2631,7 +2631,7 @@ msgstr "" msgid "buttons must be digitalio.DigitalInOut" msgstr "" -#: shared-bindings/_pixelbuf/PixelBuf.c +#: shared-bindings/adafruit_pixelbuf/PixelBuf.c msgid "byteorder is not a string" msgstr "" @@ -2681,7 +2681,7 @@ msgid "can't cancel self" msgstr "" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c -#: shared-module/_pixelbuf/PixelBuf.c +#: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -2784,6 +2784,10 @@ msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "cannot assign new shape" +msgstr "" + #: extmod/ulab/code/ndarray_operators.c msgid "cannot cast output with casting rule" msgstr "" @@ -2880,19 +2884,19 @@ msgstr "" msgid "conversion to object" msgstr "" -#: extmod/ulab/code/numpy/filter/filter.c +#: extmod/ulab/code/numpy/filter.c msgid "convolve arguments must be linear arrays" msgstr "" -#: extmod/ulab/code/numpy/filter/filter.c +#: extmod/ulab/code/numpy/filter.c msgid "convolve arguments must be ndarrays" msgstr "" -#: extmod/ulab/code/numpy/filter/filter.c +#: extmod/ulab/code/numpy/filter.c msgid "convolve arguments must not be empty" msgstr "" -#: extmod/ulab/code/numpy/poly/poly.c +#: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -2900,7 +2904,7 @@ msgstr "" msgid "couldn't determine SD card version" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "cross is defined for 1D arrays of length 3" msgstr "" @@ -2950,15 +2954,15 @@ msgstr "" msgid "dict update sequence has wrong length" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "diff argument must be an ndarray" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "differentiation order out of range" msgstr "" -#: extmod/ulab/code/numpy/transform/transform.c +#: extmod/ulab/code/numpy/transform.c msgid "dimensions do not match" msgstr "" @@ -3085,7 +3089,7 @@ msgstr "" msgid "filesystem must provide mount method" msgstr "" -#: extmod/ulab/code/numpy/vector/vector.c +#: extmod/ulab/code/numpy/vector.c msgid "first argument must be a callable" msgstr "" @@ -3097,7 +3101,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector/vector.c +#: extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3113,7 +3117,7 @@ msgstr "" msgid "flattening order must be either 'C', or 'F'" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "flip argument must be an ndarray" msgstr "" @@ -3241,7 +3245,7 @@ msgstr "" msgid "index is out of bounds" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c extmod/ulab/code/ulab_tools.c +#: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" @@ -3283,7 +3287,7 @@ msgstr "" msgid "input arrays are not compatible" msgstr "" -#: extmod/ulab/code/numpy/poly/poly.c +#: extmod/ulab/code/numpy/poly.c msgid "input data must be an iterable" msgstr "" @@ -3316,15 +3320,15 @@ msgstr "" msgid "input must be square matrix" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "input must be tuple, list, range, or ndarray" msgstr "" -#: extmod/ulab/code/numpy/poly/poly.c +#: extmod/ulab/code/numpy/poly.c msgid "input vectors must be of equal length" msgstr "" -#: extmod/ulab/code/numpy/poly/poly.c +#: extmod/ulab/code/numpy/poly.c msgid "inputs are not iterable" msgstr "" @@ -3336,7 +3340,7 @@ msgstr "" msgid "integer required" msgstr "" -#: extmod/ulab/code/numpy/approx/approx.c +#: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" msgstr "" @@ -3511,7 +3515,7 @@ msgstr "" msgid "maxiter should be > 0" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "median argument must be an ndarray" msgstr "" @@ -3528,11 +3532,15 @@ msgstr "" msgid "memoryview: length is not a multiple of itemsize" msgstr "" +#: extmod/ulab/code/numpy/linalg/linalg.c +msgid "mode must be complete, or reduced" +msgstr "" + #: py/builtinimport.c msgid "module not found" msgstr "" -#: extmod/ulab/code/numpy/poly/poly.c +#: extmod/ulab/code/numpy/poly.c msgid "more degrees of freedom than data points" msgstr "" @@ -3765,16 +3773,24 @@ msgstr "" msgid "opcode" msgstr "" -#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/compare/compare.c -#: extmod/ulab/code/numpy/vector/vector.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/compare.c +#: extmod/ulab/code/numpy/vector.c msgid "operands could not be broadcast together" msgstr "" +#: extmod/ulab/code/numpy/linalg/linalg.c +msgid "operation is defined for 2D arrays only" +msgstr "" + +#: extmod/ulab/code/numpy/linalg/linalg.c +msgid "operation is defined for ndarrays only" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "operation is implemented for 1D Boolean arrays only" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3966,7 +3982,7 @@ msgstr "" msgid "rgb_pins[%d] is not on the same port as clock" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "roll argument must be an ndarray" msgstr "" @@ -4045,7 +4061,7 @@ msgstr "" msgid "soft reboot\n" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "sort argument must be an ndarray" msgstr "" @@ -4192,11 +4208,11 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" -#: extmod/ulab/code/numpy/approx/approx.c +#: extmod/ulab/code/numpy/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" -#: extmod/ulab/code/numpy/approx/approx.c +#: extmod/ulab/code/numpy/approx.c msgid "trapz is defined for 1D iterables" msgstr "" @@ -4359,7 +4375,7 @@ msgstr "" msgid "window must be <= interval" msgstr "" -#: extmod/ulab/code/numpy/numerical/numerical.c +#: extmod/ulab/code/numpy/numerical.c msgid "wrong axis index" msgstr "" @@ -4367,8 +4383,7 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare/compare.c -#: extmod/ulab/code/numpy/vector/vector.c +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4380,7 +4395,7 @@ msgstr "" msgid "wrong number of values to unpack" msgstr "" -#: extmod/ulab/code/numpy/vector/vector.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong output type" msgstr "" diff --git a/shared-bindings/_typing/__init__.pyi b/shared-bindings/_typing/__init__.pyi index d1bf853f714fa..c854c2a228289 100644 --- a/shared-bindings/_typing/__init__.pyi +++ b/shared-bindings/_typing/__init__.pyi @@ -10,10 +10,10 @@ import audiocore import audiomixer import audiomp3 import rgbmatrix -import ulab +import ulab.numpy ReadableBuffer = Union[ - bytes, bytearray, memoryview, array.array, ulab.ndarray, rgbmatrix.RGBMatrix + bytes, bytearray, memoryview, array.array, ulab.numpy.ndarray, rgbmatrix.RGBMatrix ] """Classes that implement the readable buffer protocol @@ -21,19 +21,19 @@ ReadableBuffer = Union[ - `bytearray` - `memoryview` - `array.array` - - `ulab.ndarray` + - `ulab.numpy.ndarray` - `rgbmatrix.RGBMatrix` """ WriteableBuffer = Union[ - bytearray, memoryview, array.array, ulab.ndarray, rgbmatrix.RGBMatrix + bytearray, memoryview, array.array, ulab.numpy.ndarray, rgbmatrix.RGBMatrix ] """Classes that implement the writeable buffer protocol - `bytearray` - `memoryview` - `array.array` - - `ulab.ndarray` + - `ulab.numpy.ndarray` - `rgbmatrix.RGBMatrix` """ diff --git a/tools/extract_pyi.py b/tools/extract_pyi.py index 7937b95c605cd..1bd51ca7a89fe 100644 --- a/tools/extract_pyi.py +++ b/tools/extract_pyi.py @@ -39,6 +39,7 @@ IMPORTS_TYPING = frozenset( { "Any", + "Dict", "Optional", "Union", "Tuple",