Skip to content

Commit 0c7c6b8

Browse files
authored
Merge pull request #456 from v923z/complex2
Complex2
2 parents a99e0b9 + 6552cfd commit 0c7c6b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+6940
-887
lines changed

README.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
[![Documentation Status](https://readthedocs.org/projects/micropython-ulab-robert/badge/?version=latest)](https://micropython-ulab-robert.readthedocs.io/en/latest/?badge=latest)
44

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

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

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

4346
## `numpy` and `scipy` functions
4447

4548
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).
4649

4750
## `ulab` utilities
4851

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

5157
## `user` module
5258

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

8896
# Benchmarks
8997

code/micropython.mk

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ SRC_USERMOD += $(USERMODULES_DIR)/numpy/ndarray/ndarray_iter.c
1313
SRC_USERMOD += $(USERMODULES_DIR)/ndarray_properties.c
1414
SRC_USERMOD += $(USERMODULES_DIR)/numpy/approx.c
1515
SRC_USERMOD += $(USERMODULES_DIR)/numpy/compare.c
16-
SRC_USERMOD += $(USERMODULES_DIR)/ulab_create.c
16+
SRC_USERMOD += $(USERMODULES_DIR)/numpy/carray/carray.c
17+
SRC_USERMOD += $(USERMODULES_DIR)/numpy/carray/carray_tools.c
18+
SRC_USERMOD += $(USERMODULES_DIR)/numpy/create.c
1719
SRC_USERMOD += $(USERMODULES_DIR)/numpy/fft/fft.c
1820
SRC_USERMOD += $(USERMODULES_DIR)/numpy/fft/fft_tools.c
1921
SRC_USERMOD += $(USERMODULES_DIR)/numpy/filter.c

0 commit comments

Comments
 (0)