Commit graph

34 commits

Author SHA1 Message Date
Zoltán Vörös
1398a8606f
loadtxt can deal with multi-line comments (#720)
* loadtxt can deal with multi-line comments

* multiline headers/footers are treated correctly

* add macro to traverse arrays
2025-06-06 20:58:31 +02:00
Zoltán Vörös
65c941a805
fix loadtxt for the case, when built-in complexes are not supported (#666) 2024-03-06 18:59:32 +01:00
9c9e9532ac
Switch to using MP_ERROR_TEXT in CircuitPython, change ulab accordingly 2023-10-30 09:50:39 +01: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
53bc8d6b0e
replace m_new with m_new0, wherever reasonable (#521)
replace m_new with m_new0, wherever reasonable, and remove dangling memory fragments created by m_new0
2022-04-22 22:10:01 +02:00
Zoltán Vörös
9ba136acd4 fix savetxt comments default value 2022-01-31 22:28:50 +01:00
Zoltán Vörös
f5f42c3643 add skiprows keyword 2022-01-31 22:12:00 +01:00
Zoltán Vörös
65d6f8e947 fix buffer alignment error 2022-01-30 22:47:44 +01:00
Zoltán Vörös
e980564d64 assign array elements via function 2022-01-29 22:41:03 +01:00
Zoltán Vörös
19282b47d1 add dtype keyword to loadtxt 2022-01-29 22:30:11 +01:00
Zoltán Vörös
089000df30
Merge branch 'master' into io-savetxt 2022-01-28 19:28:43 +01:00
Zoltán Vörös
bb07482efc implement max_roas keyword 2022-01-27 23:44:29 +01:00
Zoltán Vörös
f31555044a implement loadtxt keywords 2022-01-26 22:31:36 +01:00
Zoltán Vörös
f7b557c6b0 get rid of unnecessary counter in loadtxt 2022-01-26 08:09:05 +01:00
Zoltán Vörös
9f444dd718 use mp_builtin_open_obj.fun.kw instead of mp_builtin_open 2022-01-26 07:43:17 +01:00
Zoltán Vörös
a39869c43c remove redundant includes 2022-01-25 23:09:10 +01:00
Zoltán Vörös
5395c76d98 first implementation of loadtxt 2022-01-25 23:00:08 +01:00
Zoltán Vörös
77a856e84e fix compilation problem on the rp2 port 2022-01-25 18:10:06 +01:00
Zoltán Vörös
d56dd2f921 add io_sprint for systems that don't have sprintf 2022-01-24 20:37:33 +01:00
Zoltán Vörös
957ae1c50a fix macintosh compilation 2022-01-19 20:04:41 +01:00
Zoltán Vörös
932060afcc fully implement savetxt 2022-01-19 19:52:50 +01:00
Zoltán Vörös
209e7ff251 add savetxt implementation 2022-01-18 21:20:57 +01:00
Zoltán Vörös
7672ab9d44 change npy, fin, fout to stream, stream_p for consistency 2022-01-14 14:10:04 +01:00
Zoltán Vörös
66189452ac always close file before exception, change exception type 2022-01-14 14:01:39 +01:00
Zoltán Vörös
eecd72de04 try to fix uninitialised variable issue 2022-01-12 21:24:19 +01:00
Zoltán Vörös
ca3bbca1b1 Merge branch 'io-load' into io 2022-01-12 20:18:06 +01:00
Zoltán Vörös
17afe29124 implement load 2022-01-12 20:17:24 +01:00
Zoltán Vörös
8e42afe72e attempt to fix eps32 compilation error 2022-01-12 18:10:34 +01:00
Zoltán Vörös
9d84125232 close file in save implementation 2022-01-11 19:18:48 +01:00
Zoltán Vörös
3fd60dedf9 fix loop index in numpy.save 2022-01-09 20:12:09 +01:00
Zoltán Vörös
78ba99f009 add input type checking 2022-01-08 20:48:30 +01:00
Zoltán Vörös
68f8098016 include stdio.h for mac 2022-01-08 20:31:00 +01:00
Zoltán Vörös
a0dcd1ebab implement numpy.save 2022-01-08 20:27:02 +01:00