Skip to content

Commit

Permalink
Merge pull request #456 from v923z/complex2
Browse files Browse the repository at this point in the history
Complex2
  • Loading branch information
v923z committed Jan 8, 2022
2 parents a99e0b9 + 6552cfd commit 0c7c6b8
Show file tree
Hide file tree
Showing 99 changed files with 6,940 additions and 887 deletions.
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

0 comments on commit 0c7c6b8

Please sign in to comment.