Commit graph

135 commits

Author SHA1 Message Date
FelixNumworks
8c3e1058d4
Fix arange crashing when start, stop or step is nan (#605) 2023-04-27 13:26:04 +02:00
FelixNumworks
ad1a1c54aa
Fix create_arange empty range (#604)
* Fix create_arange crashing when stop == start

This is due to len being equal to zero, which made (len - 1) equal to MAX_UINT16

* trailing whitespaces
2023-04-24 18:46:48 +02:00
Zoltán Vörös
47ad73ab57
Floordiv (#593)
* implement floor division

* fix 3D, 4D loops

* add missing array declaration in 3D, and 4D

* Add test cases for floor division and fix it for ints (#599)

* Add test cases for floor division

* Fix define name in comment

* Fix floor division of ints

---------

Co-authored-by: Maciej Sokołowski <matemaciek@gmail.com>
2023-04-23 21:14:59 +02:00
Zoltán Vörös
f2dd2230c4
fix sorting of empty arrays in sort_complex (#583) 2023-01-23 21:53:41 +01:00
Zoltán Vörös
578ca6670d
raise exception in arange, if step size is 0 (#582) 2023-01-23 21:52:37 +01:00
315c988393
Check that array size doesn't overflow at construction time
Now, requesting to allocate an array that is too big gives the exception
'array is too big', like numpy.

This does depend on a gcc extension, `__builtin_mul_overflow`, present
since at least version 5. This extension is also supported in clang.
msvc is probably the only compiler of note that does not support it.

Closes: #576
2023-01-19 07:15:58 -06:00
Zoltán Vörös
7124eaac74
fix concatenate (#575) 2023-01-14 11:02:33 +01:00
Zoltán Vörös
e68bb707b2
fix vectorize (#568) 2023-01-04 00:27:41 +01:00
Damien George
1a440d7d12
Fix sort when dtype is uint16 (#563)
Prior to this fix the code was using the mp_float_t data type for uint16
and producing incorrect sort results.

Signed-off-by: Damien George <damien@micropython.org>

Signed-off-by: Damien George <damien@micropython.org>
2022-11-29 08:02:35 +01:00
Damien George
41fcf1d4cf
Minor compile fixes: comma and new-line at end of files (#550)
* Fix missing comma in type definition

Signed-off-by: Damien George <damien@micropython.org>

* Make sure all files have a new-line at the end

Some very old compilers don't like files without a new-line at the end.

Signed-off-by: Damien George <damien@micropython.org>

* Use math.isclose for universal_functions expm1 test

Signed-off-by: Damien George <damien@micropython.org>

Signed-off-by: Damien George <damien@micropython.org>
2022-09-30 10:42:49 +02:00
Zoltán Vörös
0c807bd912 remove comments from methods.py 2022-09-21 20:00:03 +02:00
Zoltán Vörös
294f9d9ef2 fix test script, bring ulab in line with micropython, bump version number to 6.0.0 2022-09-21 19:59:34 +02:00
Zoltán Vörös
dfed7a844a
implement nonzero (#540)
* implement nonzero for Boolean arrays

* remove axtls from build script

* extend nonzero to ndarrays of arbitrary dtype, and iterable, fix float tests

* temporarily disable circuitpython tests

* add nonzero documentation

* Added test script for np.nonzero()

Co-authored-by: Tejal Ashwini Barnwal <64950661+tejalbarnwal@users.noreply.github.com>
2022-08-03 20:56:45 +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
dde8d24461 add sort tests 2022-04-18 10:34:02 +02:00
Zoltán Vörös
4705c95fb2 add diag tests 2022-02-09 07:45:15 +01: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
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
2530fc7e8b update savetxt test script 2022-01-27 23:46:50 +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
8d39e5a430 update test for savetxt 2022-01-24 20:40:33 +01:00
Zoltán Vörös
26d28166f8
Merge branch 'master' into sosfilt-fix 2022-01-21 17:29:28 +01:00
Zoltán Vörös
932060afcc fully implement savetxt 2022-01-19 19:52:50 +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
a1f1cd255b rebasing from master 2022-01-15 09:54:15 +01:00
Zoltán Vörös
74533d18ff add asarray, and tests for asarray and size 2022-01-14 20:45:14 +01:00
Zoltán Vörös
fdf23c9956
Merge branch 'master' into complex-fix 2022-01-12 21:25:31 +01:00
Zoltán Vörös
923cb823a3 add documentation for delete, extend test script, handle negative scalars 2022-01-12 18:05:23 +01:00
Zoltán Vörös
6eda5ec53c update delete test 2022-01-11 22:11:43 +01:00
Zoltán Vörös
faaae7d2f2 update test scripts 2022-01-10 23:34:33 +01:00
Zoltán Vörös
e5020f8d57 add numpy.delete 2022-01-10 22:54:09 +01:00
Zoltán Vörös
969afdec7f implement ==, and != for complex dtypes 2022-01-07 14:05:38 +01:00
Zoltán Vörös
ecaa355bab fix sort_complex, add tests to sort_complex, conjugate 2022-01-07 12:47:42 +01:00
Zoltán Vörös
ad9e1e9950 fix linspace error, extend to complex dtype, factor out tests 2022-01-06 19:55:34 +01:00
Zoltán Vörös
9eebed2d3a add basic complex tests 2021-12-30 11:32:07 +01:00
Zoltán Vörös
e655c94108 add simple test for sum() 2021-11-30 20:38:43 +01:00
69011c8696 Re-organize tests 2021-07-23 09:19:10 -05:00
Zoltán Vörös
dd8b404c14 re-organise test scripts 2021-06-08 21:18:33 +02:00
Zoltán Vörös
b9c4d3b026 remove redundant flag 2021-06-08 21:02:12 +02:00
Zoltán Vörös
9f6787b2bc update test script 2021-06-08 20:59:28 +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
c08cba3cdf add simple garbage collector test 2021-05-13 22:10:34 +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
2407d5e289 fix trivial error in ndarray_from_mp_object 2021-03-31 07:24:52 +02:00