Commit graph

719 commits

Author SHA1 Message Date
Zoltán Vörös
e01e547b62 fix dtype in stubs 2021-12-30 09:09:41 +01:00
Zoltán Vörös
4d7e279996 fix circuitpython documentation 2021-12-30 08:54:52 +01:00
Zoltán Vörös
7b17796c91 fix complex sqrt 2021-12-30 08:10:54 +01:00
Zoltán Vörös
ee197ef03f bring in a99e0b9 in an attempt to fix the docs error 2021-12-28 22:30:17 +01:00
Zoltán Vörös
dbd570a9fb implement complex scalar binary operations 2021-12-28 22:18:37 +01:00
Zoltán Vörös
14b5c13d50 add complex flag to version string 2021-12-28 21:55:00 +01:00
Zoltán Vörös
5b7395d6df implement complex divide 2021-12-28 21:51:32 +01:00
Zoltán Vörös
13cebfeccc add complex subtraction, fix addition 2021-12-28 20:42:00 +01:00
Zoltán Vörös
76218f2386 fix 3D loop 2021-12-15 18:54:14 +01:00
Zoltán Vörös
8a156fe505 implement multiplication for complex arrays 2021-12-15 18:52:07 +01:00
Zoltán Vörös
cc06735cff fix binary add for 1D 2021-12-15 08:02:26 +01:00
Zoltán Vörös
864ab31766 implement binary add for complex arrays 2021-12-15 06:52:42 +01:00
Zoltán Vörös
3557e16cd1 implement sqrt for complex arrays 2021-12-07 19:55:15 +01:00
Zoltán Vörös
235329c3fb fix itemsize glitch 2021-12-03 09:11:41 +01:00
Zoltán Vörös
ce26a0d76b implement slicing for complex dtype 2021-12-03 09:06:49 +01:00
Zoltán Vörös
78455afa5d simplify binary_get_size function 2021-12-03 09:06:49 +01:00
Zoltán Vörös
93409e759a implement iterator for complex arrays 2021-12-03 09:06:49 +01:00
Zoltán Vörös
3b3639a560 implement complex exponential 2021-12-03 09:06:49 +01:00
Zoltán Vörös
d0b1d40cf1 rebasing on master with any/all fix 2021-12-03 09:06:05 +01:00
Zoltán Vörös
316f84174d rebasing with any/all fix 2021-12-03 09:04:04 +01:00
Zoltán Vörös
ef8989ecff implement unary operators for complex arrays 2021-12-03 08:59:23 +01:00
Zoltán Vörös
8a6741b350 fix macro call in poly.c 2021-12-03 08:59:23 +01:00
Zoltán Vörös
08313e3f02 fix uppercase mp_obj_is_type macro calls 2021-12-03 08:59:23 +01:00
Zoltán Vörös
8db5ee897e add missing newline character 2021-12-03 08:59:23 +01:00
Zoltán Vörös
911fdb4587 ulab can now be compiled with complex support 2021-12-03 08:59:23 +01:00
Zoltán Vörös
1013daa902 add complex utilities 2021-12-03 08:59:23 +01:00
Zoltán Vörös
8e5bbe0955 fix any/all function 2021-12-03 08:42:56 +01:00
Zoltán Vörös
a097744455 fix sum() for integer/Boolean types 2021-11-30 20:29:22 +01:00
Zoltán Vörös
175c7337bb fix ndarray_shape for arrays of zero length 2021-11-20 12:11:21 +01:00
Tsutomu IKEGAMI
4d2a11ed00 Up version to 3.3.5. 2021-11-07 20:49:16 +09:00
Tsutomu IKEGAMI
14b39d5dbd Fix compare between (uint16|int16) vs float. 2021-11-05 12:09:18 +09:00
Jeff Epler
d68171bb46
Merge pull request #439 from jepler/circuitpython-make-new-compat
ndarray: drop compat workaround for circuitpython
2021-10-16 16:02:16 -05:00
b913d064e5 ndarray: drop compat workaround for circuitpython
It's anticipated that circuitpython will no longer need this compat code
after merging 1.17.
2021-10-14 14:26:38 -05:00
Zoltán Vörös
04629f5521 add docs for linalg.qr 2021-08-07 07:21:55 +02:00
Jeff Epler
548aaba97d
Merge pull request #433 from jepler/remove-compat-alias
remove temporary workaround
2021-08-03 14:37:34 -05:00
7dec159981 show where to find ulab.numpy.ndarray
.. interestingly, this error only showed up on macos, not ubuntu!
2021-07-23 10:26:06 -05:00
0b62231d56 show where to find ulab.numpy.ndarray
.. interestingly, this error only showed up on macos, not ubuntu!
2021-07-23 10:12:15 -05:00
5ff8bd662f remove temporary workaround 2021-07-23 09:57:17 -05:00
8b3b4d1829 Merge commit 'refs/pull/431/head' of https://github.com/v923z/micropython-ulab into build-all-dimensions 2021-07-23 09:05:25 -05:00
Zoltán Vörös
ba0cd7c661 re-set the value of ULAB_MAX 2021-07-23 08:29:37 +02:00
Zoltán Vörös
3817d7698a fix compilation for 1D 2021-07-23 07:28:17 +02:00
81d78fe23f micropython build: Build & test in a selected number of dimensions 2021-07-22 14:14:08 -05:00
Zoltán Vörös
91e08c8679
Merge branch 'master' into samd-fix 2021-07-22 20:28:34 +02:00
Zoltán Vörös
593a33df5d
Merge branch 'master' into fix-4d 2021-07-22 20:09:59 +02:00
Zoltán Vörös
18bb09da45 fix sum for 4D arrays 2021-07-22 20:08:09 +02:00
Zoltán Vörös
a3ce0ce29a add qr implementation 2021-07-22 19:40:57 +02:00
Jeff Epler
8ef203f21b Only use the _float alias for the float built-in type in ulab.numpy proper
Otherwise, an error occurred, but only on the macos build(!)
```
ulab/scipy/optimize/__init__.pyi:7: error: Name "_float" is not defined
```
It's not clear why `_float` was apparently defined on Linux in this
context.
2021-07-22 08:37:12 -05:00
Jeff Epler
cbe4c7499b docs: A workaround for the problem where ndarray can't be in two places
This allows the build to be green in ulab before the changes in
circuitpython. After circuitpython's _typing/__init__.py is fixed to
use the new canonical location, this temporary alias can be removed.
2021-07-22 08:15:23 -05:00
Jeff Epler
7032a92339 Fix documentation build
* Move most documentation out of the ulab base module.
 * float -> _float
 * ulab.ndarray -> ulab.numpy.ndarray

This still does not build unless it is taken together with a modification
to CircuitPython that _also_ moves references to ulab.numpy.
Because of this, this PR will continue to show red.  The suitability of
the changes can be gaged by looking at the related CircuitPython PR build
or by running locally the build-cp.sh script with the right ref checked
out in circuitpython/
2021-07-20 17:26:43 -05:00
Zoltán Vörös
70e8b548ba fix compile error on SAMD devices 2021-07-16 10:03:34 +02:00
Zoltán Vörös
96550c8ed4 re-arrange files, so that circuitpython docs can be generated 2021-07-14 23:15:19 +02:00
69d3c20c7b fix build on circuitpython 2021-07-14 08:42:51 -05:00
Zoltán Vörös
c152871dba insert circuitpython hooks for flatiter 2021-07-13 22:38:01 +02:00
Zoltán Vörös
af34d8fe2a fix assertion 2021-07-13 21:35:01 +02:00
Zoltán Vörös
6ed12969d3 implement flat iterator 2021-07-13 21:35:01 +02:00
Jeff Epler
e881ccb30c
Merge pull request #418 from jepler/split-type-objects
support circuitpython-style split type objects
2021-07-12 19:53:38 -05:00
9b8cd47640 Rename mp_type_call -> mp_type_get_call_slot 2021-07-12 08:47:15 -05:00
1214afd9ce Rename EXTENDED_FIELDS -> MP_TYPE_EXTENDED_FIELDS 2021-07-12 08:47:15 -05:00
Jeff Epler
75c7e05eac rename the type flag to EXTENDED for consistency 2021-07-09 14:56:20 -05:00
Jeff Epler
deda9d74d8 support circuitpython-style split type objects 2021-07-06 11:20:26 -05:00
Zoltán Vörös
14b1ab88f1 remove unused header imports 2021-06-22 22:06:27 +02:00
Zoltán Vörös
be9fd86f60 fix float comparison in scipy/linalg.c 2021-06-22 07:06:10 +02:00
Zoltán Vörös
7f38ad9315 implement ndarray.shape assigment 2021-06-19 15:58:56 +02:00
Zoltán Vörös
947ef80f9f add the .T ndarray property 2021-06-17 21:52:19 +02:00
Zoltán Vörös
cd3d479b30 remove redudant cases from ndarray_set_value 2021-06-10 19:01:31 +02:00
Zoltán Vörös
f946abd2ee patch circuitpython 2021-06-09 07:34:18 +02:00
Zoltán Vörös
02acbe4ec3 fix circuitpython properties 2021-06-08 21:59:26 +02:00
Zoltán Vörös
b9a4d5a2db fix attribute functions 2021-06-08 20:56:55 +02:00
Zoltán Vörös
1196526182 implement ndarray properties 2021-06-08 07:34:44 +02:00
Zoltán Vörös
4b2ab160b6 add empty, update docs 2021-06-03 11:39:26 +02:00
Zoltán Vörös
0609da8dae change version number 2021-06-03 09:53:12 +02:00
Zoltán Vörös
58cde9a4b1 allow approx functions to take iterable arguments 2021-06-03 09:43:18 +02:00
Zoltán Vörös
8493f8ed98 add type specifier to pointer 2021-06-03 08:32:10 +02:00
Zoltán Vörös
9aefb4242d vectorised functions work nested iterables now 2021-06-03 08:27:23 +02:00
Zoltán Vörös
e01ddaca0b add ndarray_from_iterable to ndarray_from_mp_obj 2021-06-02 07:50:35 +02:00
Zoltán Vörös
53f644a44b factor out array creation from iterables 2021-06-02 07:37:15 +02:00
Zoltán Vörös
8e365eca62 Merge branch 'upcasting' of github.com:v923z/micropython-ulab into upcasting 2021-06-01 18:19:49 +02:00
Zoltán Vörös
f91411da95 fix version number 2021-06-01 18:19:31 +02:00
Zoltán Vörös
a6def3d20e
Merge branch 'master' into upcasting 2021-06-01 18:19:08 +02:00
Zoltán Vörös
8979b8a67d fix endianness problem in ndarray_from_mp_obj 2021-06-01 18:17:19 +02:00
Zoltán Vörös
4edb6aa318 fix upcasting rules for ndarray + scalar 2021-06-01 17:32:18 +02:00
Zoltán Vörös
8bb9951fdd change version number to 2.8.4 2021-05-31 19:27:16 +02:00
Zoltán Vörös
1196e2f3ed initialise arange values via macro 2021-05-31 19:25:18 +02:00
Zoltán Vörös
370d6c9bed fix nan return value 2021-05-24 20:02:38 +02:00
Zoltán Vörös
52795a86ed fix nan for macintosh 2021-05-22 14:46:10 +02:00
Zoltán Vörös
2c84309139 fix all/any/median for empty arrays 2021-05-22 14:31:13 +02:00
Zoltán Vörös
bfe672532d fix all/any for empty arrays 2021-05-22 14:20:57 +02:00
Zoltán Vörös
6420ec9c45 fix array initialisation with empty iterables 2021-05-18 22:02:42 +02:00
vikas-udupa
b0679e6d16 implemented cho_solve function in scipy.linalg 2021-05-15 23:42:02 -04:00
Zoltán Vörös
f1a2aadc6e fix garbage collection problem 2021-05-13 21:54:50 +02:00
Zoltán Vörös
1c027267e2
fix circuitpython CI
change to lowercase macro style, so that `circuitpython` can automatically build
2021-05-07 07:31:19 +02:00
vikas-udupa
e52fa96c23 removed redundant function pointers, added copyright note 2021-05-05 18:47:15 -04:00
vikas-udupa
f9b0e4381b corrections to solve_triangular, moved solve_triangular to scipy.linalg module 2021-05-05 11:24:05 -04:00
vikas-udupa
3e63c8e144 implemented solve_triangular and syncing with original repo 2021-04-29 09:26:33 -04:00
vikas-udupa
ab60c5c98c implemented solve_triangular function in numpy.linalg module along with two tests 2021-04-29 09:20:17 -04:00
Zoltán Vörös
3b2d7ddf04
Merge pull request #370 from adafruit/lowercase_macros
Lowercase MP macros
2021-04-27 21:43:12 +02:00
Zoltán Vörös
f3753597ff fix small glitch in optimize 2021-04-26 21:52:51 +02:00
Zoltán Vörös
8a7f7a7934
increment version number 2021-04-23 17:15:38 +02:00
Tsutomu IKEGAMI
93cb294765 Fix implementation of math constants (e, inf, nan, pi).
Originally, math constants are implemented for MICROPY_OBJ_REPR = A and B.
Modify float object representations to work with MICROPY_OBJ_REPR = C and D.
2021-04-23 15:54:16 +09:00
Scott Shawcroft
e3bf07cabb
Lowercase MP macros 2021-04-22 17:54:02 -07:00
ef65415b55 CircuitPython make check-stubs fixes 2021-04-03 12:10:08 -05:00
4666bbd4de Fix diagnostics in CircuitPython 2021-04-03 12:07:12 -05:00
9cd13000b7 ulab.array -> ulab.ndarray
This was flagged as an error in building circuitpython, since ulab.array
doesn't name a type object.

# Conflicts:
#	code/numpy/linalg/linalg.c
2021-04-03 12:06:07 -05:00
fe6677335f code: Add a docstring for numpy, scipy packages
.. this fixes a problem in CircuitPython where building the docs would say
"../shared-bindings/ulab/numpy/approx/index.rst: WARNING: document isn't included in any toctree"
2021-04-03 12:05:42 -05:00
Zoltán Vörös
c1b8f9d687
updated version number 2021-04-02 13:00:10 +02:00
Stephan Hartl
da9eb89e9a Changed define OPENMV to micropython version check
The issue with is solved only coresponed to micropython v1.11
2021-04-01 09:49:42 +02:00
Stephan Hartl
04f6fd68f9 Readd some OPENMV code
I used the OPENMV define to get ulab 1.6.1 under ArduPy (Mircopython v1.11) running.
To update to 2.1.5 i have readded the missing code
2021-03-31 16:18:30 +02:00
Stephan Hartl
07545f5156 add relativ path for ulab.h and ndarray.h
Some header files didn't had relative path.
Compiling Ardupy didn't finde the files.
In C files ist the path right
2021-03-31 16:11:09 +02:00
Zoltán Vörös
7a183e1fa0
Merge pull request #353 from v923z/where
add where
2021-03-31 08:04:47 +02:00
Zoltán Vörös
2407d5e289 fix trivial error in ndarray_from_mp_object 2021-03-31 07:24:52 +02:00
Phil Howard
571286a10e code/micropython.cmake: drop redundant -D 2021-03-25 21:11:13 +00:00
Phil Howard
74371a8acb Move code/usermod.cmake to code/micropython.cmake 2021-03-25 21:11:13 +00:00
Phil Howard
655aa2ccd1 Remove debug output from code/usermod.cmake 2021-03-25 21:11:13 +00:00
Zoltán Vörös
6668bb3060 add where implementation 2021-03-23 17:09:27 +01:00
Zoltán Vörös
db71303fb0 fix ESP32 compilation error and instructions 2021-03-21 18:43:18 +01:00
Phil Howard
51b5f8b930 USER_C_MODULES cmake support for rp2 and esp32
This change introduces `usermod.cmake`, the CMake configuration required to make
this library compatible with the CMake build systems for the rp2 (Raspberry Pi Pico/RP2040)
and esp32 ports of MicroPython.

This is effectively 1:1 in functionality with `micropython.mk` and defines the source files,
include directories and compile arguments needed to build the module.

See https://github.com/micropython/micropython/pull/6960 for discussion.
2021-03-12 20:53:33 +00:00
Zoltán Vörös
e0b65442a5
Merge branch 'master' into linspace-fix 2021-03-08 18:42:47 +01:00
Zoltán Vörös
779cd3c5a0 fix linspace/logspace/arange for Boolean dtypes 2021-03-08 18:41:19 +01:00
Zoltán Vörös
663a7d2fe0 add from_int16_buffer, from_uint16_buffer functions 2021-03-05 15:25:46 +01:00
Zoltán Vörös
48418d46ab fix header constants 2021-03-05 08:03:56 +01:00
Zoltán Vörös
e6ac55a142 change function names to from_int32_buffer, from_uint32_buffer 2021-03-05 07:59:39 +01:00
Zoltán Vörös
9a78b59ab5 fix loop counter 2021-03-05 07:39:37 +01:00
Zoltán Vörös
ebf2cc4bc1 wrote docs for the utils module 2021-03-04 20:11:22 +01:00
Zoltán Vörös
3929e6b49d added from_uintbuffer function 2021-03-04 19:16:34 +01:00
Zoltán Vörös
c84bf46d7e added first implementation of utils sub-module 2021-03-03 20:15:06 +01:00
Zoltán Vörös
3fb04aedac fix dot function 2021-02-23 23:17:45 +01:00
Zoltán Vörös
6fb6f2383f re-introduce ndarray_get_buffer, and buffer protocol 2021-02-21 21:06:02 +01:00
Zoltán Vörös
54ff3f30dd fix ndarray_is_dense, eye, ones, full, and zeros for Boolean type 2021-02-21 18:02:40 +01:00
Zoltán Vörös
74f819e5fb
Merge branch 'master' into dot-fix 2021-02-15 18:08:45 +01:00
Zoltán Vörös
2c69328303
Merge pull request #322 from v923z/frombuffer-fix
removed dangling byte from frombuffer
2021-02-14 09:53:22 +01:00
Zoltán Vörös
efcfeff790
Merge branch 'master' into byteswap 2021-02-14 09:36:07 +01:00
Zoltán Vörös
281b8da84a removed dangling byte from frombuffer 2021-02-14 09:32:37 +01:00
Zoltán Vörös
60d017d3f6 fixes frombuffer implementation glitch 2021-02-14 09:04:42 +01:00
Zoltán Vörös
18f3b180b3 fixed faulty dot function 2021-02-13 10:19:46 +01:00
Zoltán Vörös
317943b970 moved trace to numpy 2021-02-13 09:25:08 +01:00
Zoltán Vörös
701ad767c8 moved the dot function to numpy 2021-02-13 09:06:02 +01:00
Zoltán Vörös
27bc5b2e79 implemented byteswap 2021-02-12 21:10:08 +01:00
Zoltán Vörös
7de1d0947e fixed small glitch in all/any 2021-02-12 18:23:53 +01:00
Zoltán Vörös
8046888d99 simplified array contraction algorithm 2021-02-12 18:15:42 +01:00
Zoltán Vörös
0b20b30af6 combined macros for std and mean 2021-02-11 08:03:41 +01:00
Zoltán Vörös
6499453d32 removed redundant code from numerical.c 2021-02-10 20:27:48 +01:00
Zoltán Vörös
93f70d16bc rationalised code in sum/mean/std 2021-02-10 20:21:24 +01:00
Zoltán Vörös
fd8a2256a6 improved accuracy of sum on iterables 2021-02-10 17:17:49 +01:00
Zoltán Vörös
0acf90433e simplified all/any implementation, fixed tools_reduce_axes function 2021-02-10 07:28:09 +01:00
Zoltán Vörös
93822e6e13 removed redundant exception from linalg.norm 2021-02-09 19:23:51 +01:00
Zoltán Vörös
6867951ab4 fixed indexing glitch in tools_reduce_axes 2021-02-09 18:53:43 +01:00
Zoltán Vörös
cacb1b66bd fixed linalg.norm for a special case 2021-02-09 18:26:57 +01:00
Zoltán Vörös
674220c959 updated change log 2021-02-09 17:34:14 +01:00
Zoltán Vörös
0d1379d62b linalg.norm should not work with the axis keyword argument 2021-02-09 17:32:41 +01:00
Zoltán Vörös
2c71434eab moved the reduce_axes helper function to ulab_tools 2021-02-09 07:00:47 +01:00