{"id":13470457,"url":"https://github.com/v923z/micropython-ulab","last_synced_at":"2025-10-07T09:16:59.877Z","repository":{"id":39615828,"uuid":"205409848","full_name":"v923z/micropython-ulab","owner":"v923z","description":"a numpy-like fast vector module for micropython, circuitpython, and their derivatives","archived":false,"fork":false,"pushed_at":"2025-09-03T18:27:30.000Z","size":3551,"stargazers_count":478,"open_issues_count":49,"forks_count":127,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-09-16T11:52:47.048Z","etag":null,"topics":["circuitpython","circuitpython-ulab","firmware","iterables","micropython","micropython-ulab","module","numpy","openmv","scipy","ulab"],"latest_commit_sha":null,"homepage":"https://micropython-ulab.readthedocs.io/en/latest","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/v923z.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-08-30T15:33:30.000Z","updated_at":"2025-09-05T02:37:17.000Z","dependencies_parsed_at":"2023-02-13T03:05:40.613Z","dependency_job_id":"e1aed4dd-11ba-46ff-9607-7f03cc49fb5f","html_url":"https://github.com/v923z/micropython-ulab","commit_stats":{"total_commits":1061,"total_committers":46,"mean_commits":"23.065217391304348","dds":"0.24128180961357215","last_synced_commit":"c0b3262be49de3162c9c0a7082bcd2d52907012e"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/v923z/micropython-ulab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v923z%2Fmicropython-ulab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v923z%2Fmicropython-ulab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v923z%2Fmicropython-ulab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v923z%2Fmicropython-ulab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/v923z","download_url":"https://codeload.github.com/v923z/micropython-ulab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v923z%2Fmicropython-ulab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278748124,"owners_count":26038854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circuitpython","circuitpython-ulab","firmware","iterables","micropython","micropython-ulab","module","numpy","openmv","scipy","ulab"],"created_at":"2024-07-31T16:00:30.678Z","updated_at":"2025-10-07T09:16:59.869Z","avatar_url":"https://github.com/v923z.png","language":"C","readme":"# ulab\n\n[![Documentation Status](https://readthedocs.org/projects/micropython-ulab/badge/?version=latest)](https://micropython-ulab.readthedocs.io/en/latest/index.html)\n\n`ulab` is a `numpy`-like array manipulation library for [micropython](http://micropython.org/) and [CircuitPython](https://circuitpython.org/).\nThe module is written in C, defines compact containers (`ndarray`s) for numerical data of one to four\ndimensions, and is fast. The library is a software-only standard `micropython` user module,\ni.e., it has no hardware dependencies, and can be compiled for any platform. 8-, and 16-bit signed\nand unsigned integer `dtypes`, as well as `float`, and, optionally, ` complex` are supported.\nThe `float` implementation of `micropython` (32-bit `float`, or 64-bit `double`) is automatically\ndetected and handled.\n\n1. [Supported functions and methods](#supported-functions-and-methods)\n    1. [ndarray methods](#ndarray-methods)\n    2. [numpy and scipy functions](#numpy-and-scipy-functions)\n    3. [ulab utilities](#ulab-utilities)\n    4. [user module](#user-module)\n4. [Usage](#usage)\n5. [Finding help](#finding-help)\n6. [Benchmarks](#benchmarks)\n7. [Firmware](#firmware)\n    1. [Customising the firmware](#customising-the-firmware)\n    1. [Platforms including ulab](#platforms-including-ulab)\n    1. [Compiling](#compiling)\n        1. [UNIX](#unix-port)\n        1. [STM-based boards](#stm-based-boards)\n        1. [ESP32-based boards](#esp32-based-boards)\n        1. [RP2-based boards](#rp2-based-boards)\n        1. [Compiling for CircuitPython](#compiling-for-circuitpython)\n8. [Issues, contributing, and testing](#issues-contributing-and-testing)\n    1. [Testing](#testing)\n\n# Supported functions and methods\n\n\n## ndarray methods\n\n`ulab` implements `numpy`'s `ndarray` with the `==`, `!=`, `\u003c`, `\u003c=`, `\u003e`, `\u003e=`, `+`, `-`, `/`, `*`, `**`,\n`%`, `+=`, `-=`, `*=`, `/=`, `**=`, `%=` binary operators, and the `len`, `~`, `-`, `+`, `abs` unary operators that\noperate element-wise. Type-aware `ndarray`s can be initialised from any `micropython` iterable, lists of\niterables via the `array` constructor, or by means of the `arange`, `concatenate`, `diag`, `eye`,\n`frombuffer`, `full`, `linspace`, `logspace`, `ones`, or `zeros`  functions.\n\n`ndarray`s can be sliced, and iterated on, and have a number of their own methods, and properties, such as `flatten()`, `itemsize`, `reshape()`,\n`shape`, `size`, `strides`, `tobytes()`, `tolist()`, and `transpose()` and `T`. If the firmware is compiled with `complex` support,\nthe `imag`, and `real` properties are automatically included.\n\n## `numpy` and `scipy` functions\n\nIn 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), [`numpy.random`](https://micropython-ulab.readthedocs.io/en/latest/numpy-random.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).\n\n## `ulab` utilities\n\nThe [`utils`](https://micropython-ulab.readthedocs.io/en/latest/ulab-utils.html) module contains functions for\ninterfacing with peripheral devices supporting the buffer protocol. These functions do not have an obvious\n`numpy` equivalent, but share a similar programming interface, and allow direct data input-output between\nnumerical arrays and hardware components.\n\n## `user` module\n\nUser-defined functions operating on numerical data can easily be added via the `user` module. This allows for transparent extensions, without having to change anything in the core. Hints as to how to work with `ndarray`s at the C level can be found in the [programming manual](https://micropython-ulab.readthedocs.io/en/latest/ulab-programming.html).\n\n# Usage\n\n`ulab` sports a `numpy/scipy`-compatible interface, which makes porting of `CPython` code straightforward. The following\nsnippet should run equally well in `micropython`, or on a PC.\n\n```python\ntry:\n    from ulab import numpy\n    from ulab import scipy\nexcept ImportError:\n    import numpy\n    import scipy.special\n\nx = numpy.array([1, 2, 3])\nscipy.special.erf(x)\n```\n\n# Finding help\n\nDocumentation can be found on [readthedocs](https://readthedocs.org/) under\n[micropython-ulab](https://micropython-ulab.readthedocs.io/en/latest),\nas well as at [circuitpython-ulab](https://circuitpython.readthedocs.io/en/latest/shared-bindings/ulab/__init__.html).\nA number of practical examples are listed in Jeff Epler's excellent\n[circuitpython-ulab](https://learn.adafruit.com/ulab-crunch-numbers-fast-with-circuitpython/overview) overview.\nThe [tricks](https://micropython-ulab.readthedocs.io/en/latest/ulab-tricks.html) chapter of the user manual discusses\nmethods by which RAM and speed can be leveraged in particular numerical problems.\n\n# Benchmarks\n\nRepresentative numbers on performance can be found under [ulab samples](https://github.com/thiagofe/ulab_samples).\n\n# Firmware\n\nPre-built, and up-to-date firmware files for select platforms can be downloaded\nfrom [micropython-builder](https://github.com/v923z/micropython-builder).\n## Customising the firmware\n\nIf flash space is a concern, unnecessary functions can be excluded from the compiled firmware with\npre-processor switches. In addition, `ulab` also has options for trading execution speed for firmware size.\nA thorough discussion on how the firmware can be customised can be found in the\n[corresponding section](https://micropython-ulab.readthedocs.io/en/latest/ulab-intro.html#customising-the-firmware)\nof the user manual.\n\n## Platforms including ulab\n\n`ulab` is also included in the following compiled `micropython` variants and derivatives:\n\n1. `CircuitPython` for SAMD51 and nRF microcontrollers https://github.com/adafruit/circuitpython\n1. `MicroPython for K210` https://github.com/loboris/MicroPython_K210_LoBo\n1. `MaixPy` https://github.com/sipeed/MaixPy\n1. `OpenMV` https://github.com/openmv/openmv\n1. `pimoroni-pico` https://github.com/pimoroni/pimoroni-pico\n1. `Tulip Creative Computer` https://github.com/shorepine/tulipcc \n\n## Compiling\n\nIf you want to try the latest version of `ulab` on `micropython` or one of its forks, the firmware can be compiled\nfrom the source by following these steps:\n\n### UNIX port\n\nSimply clone the `ulab` repository with\n\n```bash\ngit clone https://github.com/v923z/micropython-ulab.git ulab\n```\nand then run\n\n```bash\n./build.sh [matrix.dims] # Dimensions is 2 by default\n```\nThis command will clone `micropython`, and build the `unix` port automatically, as well as run the test scripts. If you want an interactive `unix` session, you can launch it in\n\n```bash\nulab/micropython/ports/unix\n```\n\n### STM-based boards\n\nFirst, you have to clone the `micropython` repository by running\n\n```bash\ngit clone https://github.com/micropython/micropython.git\n```\non the command line. This will create a new repository with the name `micropython`. Staying there, clone the `ulab` repository with\n\n```bash\ngit clone https://github.com/v923z/micropython-ulab.git ulab\n```\nIf you don't have the cross-compiler installed, your might want to do that now, for instance on Linux by executing\n\n```bash\nsudo apt-get install gcc-arm-none-eabi\n```\n\nIf this step was successful, you can try to run the `make` command in the port's directory as\n\n```bash\nmake BOARD=PYBV11 USER_C_MODULES=../../../ulab all\n```\nwhich will prepare the firmware for pyboard.v.11. Similarly,\n\n```bash\nmake BOARD=PYBD_SF6 USER_C_MODULES=../../../ulab all\n```\nwill compile for the SF6 member of the PYBD series. If your target is `unix`, you don't need to specify the `BOARD` parameter.\n\nProvided that you managed to compile the firmware, you would upload that by running either\n\n```bash\ndfu-util --alt 0 -D firmware.dfu\n```\nor\n\n```bash\npython pydfu.py -u firmware.dfu\n```\n\nIn case you got stuck somewhere in the process, a bit more detailed instructions can be found under https://github.com/micropython/micropython/wiki/Getting-Started, and https://github.com/micropython/micropython/wiki/Pyboard-Firmware-Update.\n\n\n### ESP32-based boards\n\n`ulab` can be tested on the ESP32 in [wokwi's micropython emulator](https://wokwi.com/arduino/projects/322114140704342610) without having to compile the C code. This utility also offers the possibility to save and share your `micropython` code.\n\nFirmware for `Espressif` hardware can be built in two different ways, which are discussed in the next two paragraphs. A solution for issues with the firmware size is outlined in the [last paragraph](#what-to-do-if-the-firmware-is-too-large) of this section.\n\n#### Compiling with cmake\n\nBeginning with version 1.15, `micropython` switched to `cmake` on the ESP32 port. If your operating system supports `CMake \u003e 3.12`, you can either simply download, and run the single [build script](https://github.com/v923z/micropython-ulab/blob/master/build/esp32-cmake.sh), or follow the step in this section. Otherwise, you should skip to the [next one](#compiling-with-make), where the old, `make`-based approach is discussed.\n\nIn case you encounter difficulties during the build process, you can consult the (general instructions for the ESP32)[https://github.com/micropython/micropython/tree/master/ports/esp32#micropython-port-to-the-esp32].\n\nFirst, clone the `ulab`, the `micropython`, as well as the `espressif` repositories:\n\n```bash\nexport BUILD_DIR=$(pwd)\n\ngit clone https://github.com/v923z/micropython-ulab.git ulab\ngit clone https://github.com/micropython/micropython.git\n\ncd $BUILD_DIR/micropython/\n\ngit clone -b v4.0.2 --recursive https://github.com/espressif/esp-idf.git\n\n```\nAlso later releases of `esp-idf` are possible (e.g. `v4.2.1`).\n\nThen install the `ESP-IDF` tools:\n\n```bash\ncd esp-idf\n./install.sh\n. ./export.sh\n```\n\nNext, build the `micropython` cross-compiler, and the `ESP` sub-modules:\n\n```bash\ncd $BUILD_DIR/micropython/mpy-cross\nmake\ncd $BUILD_DIR/micropython/ports/esp32\nmake submodules\n```\nAt this point, all requirements are installed and built. We can now compile the firmware with `ulab`. In `$BUILD_DIR/micropython/ports/esp32` create a `makefile` with the following content:\n\n```bash\nBOARD = GENERIC\nUSER_C_MODULES = $(BUILD_DIR)/ulab/code/micropython.cmake\n\ninclude Makefile\n```\nYou specify with the `BOARD` variable, what you want to compile for, a generic board, or `TINYPICO` (for `micropython` version \u003e1.1.5, use `UM_TINYPICO`), etc. Still in `$BUILD_DIR/micropython/ports/esp32`, you can now run `make`.\n\n#### Compiling with make\n\nIf your operating system does not support a recent enough version of `CMake`, you have to stay with `micropython` version 1.14. The firmware can be compiled either by downloading and running the [build script](https://github.com/v923z/micropython-ulab/blob/master/build/esp32.sh), or following the steps below:\n\nFirst, clone `ulab` with\n\n```bash\ngit clone https://github.com/v923z/micropython-ulab.git ulab\n```\n\nand then, in the same directory, `micropython`\n\n```bash\ngit clone https://github.com/micropython/micropython.git\n```\n\nAt this point, you should have `ulab`, and `micropython` side by side.\n\nWith version 1.14, `micropython` switched to `cmake` on the `ESP32` port, thus breaking compatibility with user modules. `ulab` can, however, still be compiled with version 1.14. You can check out a particular version by pinning the release tag as\n\n```bash\n\ncd ./micropython/\ngit checkout tags/v1.14\n\n```\nNext, update the submodules,\n\n```bash\ngit submodule update --init\ncd ./mpy-cross \u0026\u0026 make # build cross-compiler (required)\n```\nand find the ESP commit hash\n\n```bash\ncd ./micropython/ports/esp32\nmake ESPIDF= # will display supported ESP-IDF commit hashes\n# output should look like: \"\"\"\n# ...\n# Supported git hash (v3.3): 9e70825d1e1cbf7988cf36981774300066580ea7\n# Supported git hash (v4.0) (experimental): 4c81978a3e2220674a432a588292a4c860eef27b\n```\n\nChoose an ESPIDF version from one of the options printed by the previous command:\n\n```bash\nESPIDF_VER=9e70825d1e1cbf7988cf36981774300066580ea7\n```\n\nIn the `micropython` directory, create a new directory with\n```bash\nmkdir esp32\n```\nYour `micropython` directory should now look like\n\n```bash\nls\nACKNOWLEDGEMENTS    CONTRIBUTING.md  esp32     lib      mpy-cross  README.md\nCODECONVENTIONS.md  docs             examples  LICENSE  ports      tests\nCODEOFCONDUCT.md    drivers          extmod    logo     py         tools\n```\n\nIn `./micropython/esp32`, download the software development kit with\n\n```bash\ngit clone https://github.com/espressif/esp-idf.git esp-idf\ncd ./esp-idf\ngit checkout $ESPIDF_VER\ngit submodule update --init --recursive # get idf submodules\npip install -r ./requirements.txt # install python reqs\n```\n\nNext, still staying in `./micropython/eps32/esd-idf/`, install the ESP32 compiler. If using an ESP-IDF version \u003e= 4.x (chosen by `$ESPIDF_VER` above), this can be done by running `. $BUILD_DIR/esp-idf/install.sh`. Otherwise, for version 3.x, run the following commands in in `.micropython/esp32/esp-idf`:\n\n```bash\n# for 64 bit linux\ncurl https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz | tar xvz\n\n# for 32 bit\n# curl https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-80-g6c4433a-5.2.0.tar.gz | tar xvz\n\n# don't worry about adding to path; we'll specify that later\n\n# also, see https://docs.espressif.com/projects/esp-idf/en/v3.3.2/get-started for more info\n```\n\nFinally, build the firmware:\n\n```bash\ncd ./micropython/ports/esp32\n# temporarily add esp32 compiler to path\nexport PATH=../../esp32/esp-idf/xtensa-esp32-elf/bin:$PATH\nexport ESPIDF=../../esp32/esp-idf # req'd by Makefile\nexport BOARD=GENERIC # options are dirs in ./boards\nexport USER_C_MODULES=../../../ulab # include ulab in firmware\n\nmake submodules \u0026 make all\n```\n\nIf it compiles without error, you can plug in your ESP32 via USB and then flash it with:\n\n```bash\nmake erase \u0026\u0026 make deploy\n```\n\n#### What to do, if the firmware is too large?\n\nWhen selecting `BOARD=TINYPICO`, the firmware is built but fails to deploy, because it is too large for the standard partitions. We can rectify the problem by creating a new partition table. In order to do so, in `$BUILD_DIR/micropython/ports/esp32/`, copy the following 8 lines to a file named `partitions_ulab.cvs`:\n\n```\n# Notes: the offset of the partition table itself is set in\n# $ESPIDF/components/partition_table/Kconfig.projbuild and the\n# offset of the factory/ota_0 partition is set in makeimg.py\n# Name,   Type, SubType, Offset,  Size, Flags\nnvs,      data, nvs,     0x9000,  0x6000,\nphy_init, data, phy,     0xf000,  0x1000,\nfactory,  app,  factory, 0x10000, 0x200000,\nvfs,      data, fat,     0x220000, 0x180000,\n```\nThis expands the `factory` partition by 128 kB, and reduces the size of `vfs` by the same amount. Having defined the new partition table, we should extend `sdkconfig.board` by adding the following two lines:\n\n```\nCONFIG_PARTITION_TABLE_CUSTOM=y\nCONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions_ulab.csv\"\n```\nThis file can be found in `$BUILD_DIR/micropython/ports/esp32/boards/TINYPICO/`. Finally, run `make clean`, and `make`. The new firmware contains the modified partition table, and should fit on the microcontroller.\n\n### RP2-based boards\n\nRP2 firmware can be compiled either by downloading and running the single [build script](https://github.com/v923z/micropython-ulab/blob/master/build/rp2.sh)/[build script for Pico W](https://github.com/v923z/micropython-ulab/blob/master/build/rp2w.sh), or executing the commands below.\n\nFirst, clone `micropython`:\n\n```bash\ngit clone https://github.com/micropython/micropython.git\n```\n\nThen, setup the required submodules:\n\n```bash\ncd micropython\ngit submodule update --init lib/tinyusb\ngit submodule update --init lib/pico-sdk\ncd lib/pico-sdk\ngit submodule update --init lib/tinyusb\n```\n\nYou'll also need to compile `mpy-cross`:\n\n```bash\ncd ../../mpy-cross\nmake\n```\n\nThat's all you need to do for the `micropython` repository. Now, let us clone `ulab` (in a directory outside the micropython repository):\n\n```bash\ncd ../../\ngit clone https://github.com/v923z/micropython-ulab ulab\n```\n\nWith this setup, we can now build the firmware. Back in the `micropython` repository, use these commands:\n\n```bash\ncd ports/rp2\nmake USER_C_MODULES=/path/to/ulab/code/micropython.cmake\n```\n\nIf `micropython` and `ulab` were in the same folder on the computer, you can set `USER_C_MODULES=../../../ulab/code/micropython.cmake`. The compiled firmware will be placed in `micropython/ports/rp2/build`.\n\n# Compiling for CircuitPython\n\n[Adafruit Industries](www.adafruit.com) always include a relatively recent version of `ulab` in their nightly builds. However, if you really need the bleeding edge, you can easily compile the firmware from the source. Simply clone `circuitpython`, and move the commit pointer to the latest version of `ulab` (`ulab` will automatically be cloned with `circuitpython`):\n\n```bash\ngit clone https://github.com/adafruit/circuitpython.git\n\ncd circuitpyton/extmod/ulab\n\n# update ulab here\ngit checkout master\ngit pull\n```\nYou might have to check, whether the `CIRCUITPY_ULAB` variable is set to `1` for the port that you want to compile for. You find this piece of information in the `make` fragment:\n\n```bash\ncircuitpython/ports/port_of_your_choice/mpconfigport.mk\n```\nAfter this, you would run `make` with the single `BOARD` argument, e.g.:\n\n```bash\nmake BOARD=mini_sam_m4\n```\n\n# Issues, contributing, and testing\n\nIf you find a problem with the code, please, raise an [issue](https://github.com/v923z/micropython-ulab/issues)! An issue should address a single problem, and should contain a minimal code snippet that demonstrates the difference from the expected behaviour. Reducing a problem to the bare minimum significantly increases the chances of a quick fix.\n\nFeature requests (porting a particular function from `numpy` or `scipy`) should also be posted at [ulab issue](https://github.com/v923z/micropython-ulab/issues).\n\nContributions of any kind are always welcome. If you feel like adding to the code, you can simply issue a pull request. If you do so, please, try to adhere to `micropython`'s [coding conventions](https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md#c-code-conventions).\n\nHowever, you can also contribute to the documentation (preferably via the [jupyter notebooks](https://github.com/v923z/micropython-ulab/tree/master/docs), or improve the [tests](https://github.com/v923z/micropython-ulab/tree/master/tests).\n\n## Testing\n\nIf you decide to lend a hand with testing, here are the steps:\n\n1. Write a test script that checks a particular function, or a set of related functions!\n1. Drop this script in one of the folders in [ulab tests](https://github.com/v923z/micropython-ulab/tree/master/tests)!\n1. Run the [./build.sh](https://github.com/v923z/micropython-ulab/blob/master/build.sh) script in the root directory of `ulab`! This will clone the latest `micropython`, compile the firmware for `unix`, execute all scripts in the `ulab/tests`, and compare the results to those in the expected results files, which are also in `ulab/tests`, and have an extension `.exp`. In case you have a new snippet, i.e., you have no expected results file, or if the results differ from those in the expected file, a new expected file will be generated in the root directory. You should inspect the contents of this file, and if they are satisfactory, then the file can be moved to the `ulab/tests` folder, alongside your snippet.\n","funding_links":[],"categories":["C","Libraries"],"sub_categories":["Mathematics"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv923z%2Fmicropython-ulab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fv923z%2Fmicropython-ulab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv923z%2Fmicropython-ulab/lists"}