8000 Update ulab from upstream again · gregdavill/circuitpython@39cfe32 · GitHub
[go: up one dir, main page]

Skip to content

Commit 39cfe32

Browse files
committed
Update ulab from upstream again
1 parent 645df93 commit 39cfe32

File tree

4 files changed

+35
-43
lines changed

4 files changed

+35
-43
lines changed

py/py.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,15 @@ endif
107107

108108
ifeq ($(MICROPY_PY_ULAB),1)
109109
SRC_MOD += $(addprefix extmod/ulab/code/, \
110-
filter.c \
110+
create.c \
111111
fft.c \
112+
filter.c \
112113
linalg.c \
113114
ndarray.c \
114115
numerical.c \
115116
poly.c \
116-
vectorise.c \
117117
ulab.c \
118+
vectorise.c \
118119
)
119120
CFLAGS_MOD += -DMICROPY_PY_ULAB=1 -DMODULE_ULAB_ENABLED=1
120121
$(BUILD)/extmod/ulab/code/%.o: CFLAGS += -Wno-sign-compare -Wno-missing-prototypes -Wno-unused-parameter -Wno-missing-declarations -Wno-error -Wno-shadow -Wno-maybe-uninitialized -DCIRCUITPY

shared-bindings/ulab/__init__.rst

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ Array type codes
129129

130130
Basic Array defining functions
131131
------------------------------
132-
See also `ulab.linalg.eye` and `ulab.numerical.linspace` for other useful
133-
array defining functions.
134132

135133
.. method:: ones(shape, \*, dtype=float)
136134

@@ -158,6 +156,33 @@ array defining functions.
158156
Return a new square array of size, with the diagonal elements set to 1
159157
and the other elements set to 0.
160158

159+
.. method:: linspace(start, stop, \*, dtype=float, num=50, endpoint=True)
160+
161+
.. param: start
162+
163+
First value in the array
164+
165+
.. param: stop
166+
167+
Final value in the array
168+
169+
.. param int: num
170+
171+
Count of values in the array
172+
173+
.. param: dtype
174+
175+
Type of values in the array
176+
177+
.. param bool: endpoint
178+
179+
Whether the ``stop`` value is included. Note that even when
180+
endpoint=True, the exact ``stop`` value may not be included due to the
181+
inaccuracy of floating point arithmetic.
182+
183+
E7EE Return a new 1-D array with ``num`` elements ranging from ``start`` to ``stop`` linearly.
184+
185+
161186

162187
:mod:`ulab.vector` --- Element-by-element functions
163188
===================================================
@@ -288,14 +313,6 @@ much more efficient than expressing the same operation as a Python loop.
288313

289314
Computes the eigenvalues and eigenvectors of a square matrix
290315

291-
292-
.. method:: eye(size, \*, dtype=float)
293-
294-
:param int: size - The number of rows and columns in the matrix
295-
296-
Returns a square matrix with all the diagonal elements set to 1 and all
297-
other elements set to 0
298-
299316
.. method:: inv(m)
300317

301318
:param ~ulab.array m: a square matrix
@@ -387,32 +404,6 @@ operate over the flattened array (None), rows (0), or columns (1).
387404
Returns a new array that reverses the order of the elements along the
388405
given axis, or along all axes if axis is None.
389406

390-
.. method:: linspace(start, stop, \*, dtype=float, num=50, endpoint=True)
391-
392-
.. param: start
393-
394-
First value in the array
395-
396-
.. param: stop
397-
398-
Final value in the array
399-
400-
.. param int: num
401-
402-
Count of values in the array
403-
404-
.. param: dtype
405-
406-
Type of values in the array
407-
408-
.. param bool: endpoint
409-
410-
Whether the ``stop`` value is included. Note that even when
411-
endpoint=True, the exact ``stop`` value may not be included due to the
412-
inaccuracy of floating point arithmetic.
413-
414-
Return a new 1-D array with ``num`` elements ranging from ``start`` to ``stop`` linearly.
415-
416407
.. method:: max(array, \*, axis=None)
417408

418409
Return the maximum element of the 1D array, as an array with 1 element

tests/ulab/smoke.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
ulab.array([1,2,3], dtype=ulab.float)
1313
ulab.zeros(3)
1414
ulab.ones(3)
15-
a = ulab.linalg.eye(3)
15+
a = ulab.eye(3)
1616
a.shape
1717
a.size
1818
a.itemsize
@@ -33,7 +33,7 @@
3333
a[:]
3434
a[0] = 0
3535
a[:] = ulab.zeros((3,3))
36-
a = ulab.linalg.eye(3)
36+
a = ulab.eye(3)
3737
ulab.vector.acos(a)
3838
ulab.vector.acosh(a)
3939
ulab.vector.asin(a)
@@ -62,8 +62,8 @@
6262
ulab.linalg.eig(a)
6363
ulab.linalg.det(a)
6464
ulab.filter.convolve(ulab.array([1,2,3]), ulab.array([1,10,100,1000]))
65-
ulab.numerical.linspace(0, 10, num=3)
66-
a = ulab.numerical.linspace(0, 10, num=256, endpoint=True)
65+
ulab.linspace(0, 10, num=3)
66+
a = ulab.linspace(0, 10, num=256, endpoint=True)
6767
ulab.fft.spectrum(a)
6868
p, q = ulab.fft.fft(a)
6969
ulab.fft.ifft(p)

0 commit comments

Comments
 (0)
0