Commit graph

43 commits

Author SHA1 Message Date
Jim Mussared
42f396a992
Update mp_obj_type_t definitions for latest MicroPython. (#549)
* build.sh: Fix unix executable path.

This was updated recently to no longer copy to the ports/unix directory.

Use the version in the build directory instead if available.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>

* Update to new style mp_obj_type_t definitions.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-09-21 19:46:39 +02:00
Damien George
2b4292abcc
Make optimize's bisect,fmin,newton use C stack instead of heap (#536)
Signed-off-by: Damien George <damien.p.george@gmail.com>
2022-07-11 19:18:40 +02:00
Damien George
35b58d0037 Remove MICROPY_FLOAT_CONST from ULAB_DEFINE_FLOAT_CONST
A given use of ULAB_DEFINE_FLOAT_CONST may already have the correct form
of the float constant, so wrapping it in MICROPY_FLOAT_CONST may be the
wrong thing to do.  So let the user of ULAB_DEFINE_FLOAT_CONST control how
the constant is formed.

Signed-off-by: Damien George <damien.p.george@gmail.com>
2022-07-11 15:27:49 +10:00
308627c9aa
Fix several build errors in CircuitPython (#533)
* Properly register submodules of ulab

This is related to
 * https://github.com/adafruit/circuitpython/issues/6066

in which, after the merge of 1.18 into CircuitPython, we lost the ability
to import submodules of built-in modules.

While reconstructing the changes we had made locally to enable this,
I discovered that there was an easier way: simply register the dotted
module names via MP_REGISTER_MODULE.

* Fix finding processor count when no `python` executable is installed

debian likes to install only `python3`, and not `python` (which was,
for many decades, python2).

This was previously done for `build.sh` but not for `build-cp.sh`.

* Only use this submodule feature in CircuitPython

.. as it does not work properly in MicroPython.

Also, modules to be const. This saves a small amount of RAM

* Fix -Werror=undef diagnostic

Most CircuitPython ports build with -Werror=undef, so that use of an
undefined preprocessor flag is an error. Also, CircuitPython's micropython
version is old enough that MICROPY_VERSION is not (ever) defined.

Defensively check for this macro being defined, and use the older style
of MP_REGISTER_MODULE when it is not.

* Fix -Werror=discarded-qualifiers diagnostics

Most CircuitPython ports build with -Werror=discarded-qualifiers.
This detected a problem where string constants were passed to functions
with non-constant parameter types.

* bump version number

* Use MicroPython-compatible registration of submodules

* straggler

* Remove spurious casts

these were build errors for micropython

* Run tests for both nanbox and regular variant during CI
2022-07-07 20:17:49 +02:00
Damien George
1347694672
Fix build for MICROPY_OBJ_REPR_D configurations (#531)
* Fix use of object pointers so code builds with MICROPY_OBJ_REPR_D

Signed-off-by: Damien George <damien.p.george@gmail.com>

* Fix use of float constants so they work with MICROPY_OBJ_REPR_D

Signed-off-by: Damien George <damien.p.george@gmail.com>

* Use new float-const macros to simplify definitions of e,inf,nan,pi.

Signed-off-by: Damien George <damien.p.george@gmail.com>

* Add support for MICROPY_OBJ_REPR_C

Signed-off-by: Damien George <damien.p.george@gmail.com>

* Add unix-nanbox build to build.sh script

Building nanbox requires gcc-multilib because it forces 32-bit mode.

Signed-off-by: Damien George <damien.p.george@gmail.com>

* Bump version to 5.0.8

Signed-off-by: Damien George <damien.p.george@gmail.com>
2022-07-06 20:38:20 +02:00
Zoltán Vörös
67538b0ee0 move spectrogram to utils module 2022-01-29 18:02:48 +01:00
Zoltán Vörös
640a3bf777 do not include sosfilt, if ULAB_MAX_DIMS = 1 2022-01-19 17:49:01 +01:00
Zoltán Vörös
6092d1d406 trying to solve macintosh compilation error 2022-01-19 17:46:41 +01:00
Zoltán Vörös
3f97d7bb84 fix scipy.signal.sosfilt 2022-01-19 17:37:54 +01:00
Zoltán Vörös
94d6b13f8d make fft optionally numpy-compatible, when complex is supported 2021-12-31 23:11:59 +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
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
08313e3f02 fix uppercase mp_obj_is_type macro calls 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
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
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
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
96550c8ed4 re-arrange files, so that circuitpython docs can be generated 2021-07-14 23:15:19 +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
Jeff Epler
deda9d74d8 support circuitpython-style split type objects 2021-07-06 11:20:26 -05:00
Zoltán Vörös
be9fd86f60 fix float comparison in scipy/linalg.c 2021-06-22 07:06:10 +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
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
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
Scott Shawcroft
e3bf07cabb
Lowercase MP macros 2021-04-22 17:54:02 -07: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
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
06bb8348a0 updated docs, removed circuitpython stuff, and fixed diff code 2021-01-14 19:40:18 +01:00
Zoltán Vörös
b8ab59bd84 re-organised code, extended docs 2021-01-08 17:40:44 +01:00
Zoltán Vörös
e50bdea0c7 moved spectrogram code to scipy/signal/signal.c 2020-11-27 07:51:32 +01:00
Zoltán Vörös
42f20bcc67 added the frombuffer function 2020-11-26 17:26:15 +01:00
Zoltán Vörös
1f64d99f6d moved scipy files into their own folder 2020-11-26 06:57:44 +01:00
Zoltán Vörös
b35c1568f3 removed numpy_defs.h, scipy_defs.h 2020-11-25 21:03:35 +01:00
Zoltán Vörös
c7f47819e0 moved sosfilt to scipy/signal.c 2020-11-25 19:46:13 +01:00
Zoltán Vörös
532172f1bc moved 4 functions into optimize 2020-11-25 19:26:26 +01:00
Zoltán Vörös
9cb008a869 arrange all functions into numpy/scipy modules 2020-11-24 22:03:21 +01:00