Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
3d00480
add complex utilities
v923z Nov 20, 2021
175c733
fix ndarray_shape for arrays of zero length
v923z Nov 20, 2021
92b3513
ulab can now be compiled with complex support
v923z Nov 23, 2021
58b0db5
add missing newline character
v923z Nov 23, 2021
fc8a9bd
fix uppercase mp_obj_is_type macro calls
v923z Nov 23, 2021
ebcf600
fix macro call in poly.c
v923z Nov 23, 2021
cd70c91
Merge pull request #455 from v923z/shape-fix
v923z Nov 24, 2021
a097744
fix sum() for integer/Boolean types
v923z Nov 30, 2021
e655c94
add simple test for sum()
v923z Nov 30, 2021
c03990c
Merge pull request #458 from v923z/sum-fix
v923z Nov 30, 2021
5512219
add complex utilities
v923z Nov 20, 2021
ee3181a
ulab can now be compiled with complex support
v923z Nov 23, 2021
c603aff
add missing newline character
v923z Nov 23, 2021
6b85ca0
fix uppercase mp_obj_is_type macro calls
v923z Nov 23, 2021
cd7c1de
fix macro call in poly.c
v923z Nov 23, 2021
b9eea41
implement unary operators for complex arrays
v923z Dec 1, 2021
defecb6
Merge branch 'complex2' of github.com:v923z/micropython-ulab into com…
v923z Dec 1, 2021
a1a391b
implement complex exponential
v923z Dec 1, 2021
add4f41
implement iterator for complex arrays
v923z Dec 2, 2021
322145d
simplify binary_get_size function
v923z Dec 2, 2021
9a2449c
implement slicing for complex dtype
v923z Dec 2, 2021
8e5bbe0
fix any/all function
v923z Dec 3, 2021
91c01ef
Merge pull request #460 from v923z/any-fix
v923z Dec 3, 2021
1013daa
add complex utilities
v923z Nov 20, 2021
911fdb4
ulab can now be compiled with complex support
v923z Nov 23, 2021
8db5ee8
add missing newline character
v923z Nov 23, 2021
08313e3
fix uppercase mp_obj_is_type macro calls
v923z Nov 23, 2021
8a6741b
fix macro call in poly.c
v923z Nov 23, 2021
ef8989e
implement unary operators for complex arrays
v923z Dec 1, 2021
316f841
rebasing with any/all fix
v923z Nov 23, 2021
d0b1d40
rebasing on master with any/all fix
v923z Nov 23, 2021
3b3639a
implement complex exponential
v923z Dec 1, 2021
93409e7
implement iterator for complex arrays
v923z Dec 2, 2021
78455af
simplify binary_get_size function
v923z Dec 2, 2021
ce26a0d
implement slicing for complex dtype
v923z Dec 2, 2021
235329c
fix itemsize glitch
v923z Dec 3, 2021
b275fb3
Merge branch 'complex2' of github.com:v923z/micropython-ulab into com…
v923z Dec 3, 2021
3557e16
implement sqrt for complex arrays
v923z Dec 7, 2021
864ab31
implement binary add for complex arrays
v923z Dec 15, 2021
cc06735
fix binary add for 1D
v923z Dec 15, 2021
8a156fe
implement multiplication for complex arrays
v923z Dec 15, 2021
76218f2
fix 3D loop
v923z Dec 15, 2021
13cebfe
add complex subtraction, fix addition
v923z Dec 28, 2021
5b7395d
implement complex divide
v923z Dec 28, 2021
14b5c13
add complex flag to version string
v923z Dec 28, 2021
dbd570a
implement complex scalar binary operations
v923z Dec 28, 2021
ee197ef
bring in a99e0b9 in an attempt to fix the docs error
v923z Dec 28, 2021
7b17796
fix complex sqrt
v923z Dec 30, 2021
4d7e279
fix circuitpython documentation
v923z Dec 30, 2021
e01e547
fix dtype in stubs
v923z Dec 30, 2021
9eebed2
add basic complex tests
v923z Dec 30, 2021
94d6b13
make fft optionally numpy-compatible, when complex is supported
v923z Dec 31, 2021
7e13fab
support ones, zeros, and full for complex dtype
v923z Dec 31, 2021
4855baa
add conjugate function
v923z Dec 31, 2021
c11dac3
fix array initialisation from complex array
v923z Jan 1, 2022
2b578ae
add tolist method to ndarray
v923z Jan 1, 2022
cb3f4b3
add compress function
v923z Jan 2, 2022
d39549e
add sort_complex function
v923z Jan 2, 2022
6a7d20d
add real/imag properties to ndarray
v923z Jan 2, 2022
8efdec7
extend convolve for the complex case
v923z Jan 5, 2022
d1b3d40
add complex support to all/any
v923z Jan 6, 2022
ad9e1e9
fix linspace error, extend to complex dtype, factor out tests
v923z Jan 6, 2022
ecaa355
fix sort_complex, add tests to sort_complex, conjugate
v923z Jan 7, 2022
969afde
implement ==, and != for complex dtypes
v923z Jan 7, 2022
6609afd
update documentation
v923z Jan 7, 2022
665c32d
add documentation for compress
v923z Jan 7, 2022
6552cfd
remove misleading comment from ulab.h
v923z Jan 7, 2022
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
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
[![Documentation Status](https://readthedocs.org/projects/micropython-ulab-robert/badge/?version=latest)](https://micropython-ulab-robert.readthedocs.io/en/latest/?badge=latest)

`ulab` is a `numpy`-like array manipulation library for [micropython](http://micropython.org/) and [CircuitPython](https://circuitpython.org/).
The module is written in C, defines compact containers for numerical data of one to four
The module is written in C, defines compact containers (`ndarray`s) for numerical data of one to four
dimensions, and is fast. The library is a software-only standard `micropython` user module,
i.e., it has no hardware dependencies, and can be compiled for any platform.
The `float` implementation of `micropython` (`float`, or `double`) is automatically detected.
i.e., it has no hardware dependencies, and can be compiled for any platform. 8-, and 16-bit signed
and unsigned integer `dtypes`, as well as `float`, and, optionally, ` complex` are supported.
The `float` implementation of `micropython` (32-bit `float`, or 64-bit `double`) is automatically
detected and handled.

1. [Supported functions and methods](#supported-functions-and-methods)
1. [ndarray methods](#ndarray-methods)
Expand Down Expand Up @@ -38,15 +40,19 @@ iterables via the `array` constructor, or by means of the `arange`, `concatenate
`frombuffer`, `full`, `linspace`, `logspace`, `ones`, or `zeros` functions.

`ndarray`s can be sliced, and iterated on, and have a number of their own methods, and properties, such as `flatten()`, `itemsize`, `reshape()`,
`shape`, `size`, `strides`, `tobytes()`, and `transpose()` and `T`.
`shape`, `size`, `strides`, `tobytes()`, `tolist()`, and `transpose()` and `T`. If the firmware is compiled with `complex` support,
the `imag`, and `real` properties are automatically included.

## `numpy` and `scipy` functions

In addition, `ulab` includes [universal functions](https://micropython-ulab.readthedocs.io/en/latest/numpy-universal.html), [many `numpy` functions](https://micropython-ulab.readthedocs.io/en/latest/numpy-functions.html), and functions from the [`numpy.fft`](https://micropython-ulab.readthedocs.io/en/latest/numpy-fft.html), [`numpy.linalg`](https://micropython-ulab.readthedocs.io/en/latest/numpy-linalg.html), [`scipy.linalg`](https://micropython-ulab.readthedocs.io/en/latest/scipy-linalg.html), [`scipy.optimize`](https://micropython-ulab.readthedocs.io/en/latest/scipy-optimize.html), [`scipy.signal`](https://micropython-ulab.readthedocs.io/en/latest/scipy-signal.html), and [`scipy.special`](https://micropython-ulab.readthedocs.io/en/latest/scipy-special.html) modules. A complete list of available routines can be found under [micropython-ulab](https://micropython-ulab.readthedocs.io/en/latest).

## `ulab` utilities

The [`utils`](https://micropython-ulab.readthedocs.io/en/latest/ulab-utils.html) module contains functions for interfacing with peripheral devices supporting the buffer protocol.
The [`utils`](https://micropython-ulab.readthedocs.io/en/latest/ulab-utils.html) module contains functions for
interfacing with peripheral devices supporting the buffer protocol. These functions do not have an obvious
`numpy` equivalent, but share a similar programming interface, and allow direct data input-output between
numerical arrays and hardware components.

## `user` module

Expand Down Expand Up @@ -84,6 +90,8 @@ Documentation can be found on [readthedocs](https://readthedocs.org/) under
as well as at [circuitpython-ulab](https://circuitpython.readthedocs.io/en/latest/shared-bindings/ulab/__init__.html).
A number of practical examples are listed in Jeff Epler's excellent
[circuitpython-ulab](https://learn.adafruit.com/ulab-crunch-numbers-fast-with-circuitpython/overview) overview.
The [tricks](https://micropython-ulab.readthedocs.io/en/latest/ulab-tricks.html) chapter of the user manual discusses
methods by which RAM and speed can be leveraged in particular numerical problems.

# Benchmarks

Expand Down
4 changes: 3 additions & 1 deletion code/micropython.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ SRC_USERMOD += $(USERMODULES_DIR)/numpy/ndarray/ndarray_iter.c
SRC_USERMOD += $(USERMODULES_DIR)/ndarray_properties.c
SRC_USERMOD += $(USERMODULES_DIR)/numpy/approx.c
SRC_USERMOD += $(USERMODULES_DIR)/numpy/compare.c
SRC_USERMOD += $(USERMODULES_DIR)/ulab_create.c
SRC_USERMOD += $(USERMODULES_DIR)/numpy/carray/carray.c
SRC_USERMOD += $(USERMODULES_DIR)/numpy/carray/carray_tools.c
SRC_USERMOD += $(USERMODULES_DIR)/numpy/create.c
SRC_USERMOD += $(USERMODULES_DIR)/numpy/fft/fft.c
SRC_USERMOD += $(USERMODULES_DIR)/numpy/fft/fft_tools.c
SRC_USERMOD += $(USERMODULES_DIR)/numpy/filter.c
Expand Down
Loading