Commit graph

147 commits

Author SHA1 Message Date
Zoltán Vörös
88ef893540
Random fix (#718)
* fix typo and shape in radnom module

* add random test files

* fix expected file
2025-05-29 19:16:43 +02:00
Zoltán Vörös
903506ca9a
Add keepdims keyword argument (#701)
* add function to deal with keepdims=True

* preliminary keepdims fix

* fux keepdims code

* remove out-commented code
2025-01-15 10:29:27 +01:00
Harald Milz
73ed8cc11f
Add scipy integration (#699)
* adding scipy integrate, initial check-in

* compile unix double-precision, select integrations algos

* bumping ulab version number to 6.7.0

* adding documentation

* documentation fix

* documentation fix

* documentation fix

* rewritten in some places

* complex number error handling

* added test cases

* resolved importing scipy.integrate

* resolved importing scipy.integrate #2

* build integrate only when we have MICROPY_FLOAT_IMPL_DOUBLE

* reverting commit a4c0c0b

* re-pushing failed commit

* Revert "re-pushing failed commit"

This reverts commit a10e89fe14.

* improve tests using math.isclose()

* enabled fp32 builds

* removed conditional includes

* adapted to new function names, corrected importing

* function names similar to in CPython scipy.integrate, some minor corrections

* major rewrite representing the name changes, mapping to CPython scipy.integrate, more background info
2024-12-15 18:49:08 +01:00
Zoltán Vörös
2b74236c8c
Take (#688)
* add numpy.take
2024-10-09 21:10:25 +02:00
Zoltán Vörös
c0b3262be4
Add keyword arguments to spectrogram (#657)
* re-work spectrogram method, so that RAM can be re-used

* update docs with spectrogram changes
2024-09-14 12:18:14 +02:00
Zoltán Vörös
acfec3e9af
fix reshape (#660) 2024-02-10 20:46:34 +01:00
yyyz
7a9370612f
fix the np.delete bug (#653)
* fix the `np.delete` bug

* fix the `np.delete` bug, add unittest code

* increment the version number and update the change log

* update the expected file `delete.py.exp`
2023-12-25 10:56:16 +01:00
sol
e32920645c
Fix (u)int8 upcasting as per docs and numpy (#650)
* fix wrong #if guard in ndarray_inplace_ams

* implement (u)int8 upcasting rules as per documentation

* bump version
2023-12-11 22:34:21 +01:00
Zoltán Vörös
5279de73ab
implement AND, OR, XOR binary operators (#639)
* implement AND, OR, XOR binary operators

* fix unterminated if

* add missing linebreak

* add more linebreaks

* remove leading linebreak
2023-07-21 21:57:31 +02:00
KB Sriram
84f99f17fc
numpy/vector.c: remove usage of fpclassify (#636)
Fixes https://github.com/v923z/micropython-ulab/issues/635

Verified by re-compiling circuitpython with this change.
2023-07-17 22:03:30 +02:00
Derfies
2cde1280a4
Bitwise (#628)
* add bitwise operators

* add build to requirements

* [EDIT] - Tweaked test data and saved test results.

* Tweaked test values for and / or

* [EDIT] - Setting print options to be verbose for test comparisons.

* [EDIT] - Removed call to set_printoptions and added output from ulab instead of numpy. Of note - there seems to be a discrepancy between the numpy and ulab output for one of the left_shift cases.

* [EDIT] - Added newline at end of file for diffing purposes.

* [EDIT] - Added print options back in as output seemed truncated.

---------

Co-authored-by: Zoltán Vörös <zvoros@gmail.com>
Co-authored-by: JamieDouugh <jamie.davies@douugh.com>
2023-06-21 13:46:30 +02:00
Zoltán Vörös
ef248b684d
add bitwise operators (#616)
* add bitwise operators

* add build to requirements
2023-06-20 21:44:58 +02:00
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