Zoltán Vörös
4098558a35
docs can be generated from stubs now
2020-10-30 22:11:02 +01:00
Zoltán Vörös
1e69c5fc06
preparing docs for 1.0.0 release
2020-10-25 22:15:33 +01:00
Zoltán Vörös
a5242bb7b3
fixed CP-compatibilty in workflow file
2020-10-25 10:28:50 +01:00
d0f68c8560
Fix doc build problem in CircuitPython
...
CircuitPython doc build fails with this diagnostic:
```
/home/runner/work/circuitpython/circuitpython/shared-bindings/ulab/index.rst:220:'any' reference target not found: List[float]
```
Use double backticks instead of single backticks to differentiate between
a reference to a type and just "show in monospace font".
2020-10-24 15:08:48 -05:00
Zoltán Vörös
ee8b72addd
wrong type in indexing raises TypeError now
2020-10-24 18:43:32 +02:00
Zoltán Vörös
04fa205ece
Merge pull request #182 from v923z/slice-patch
...
Slice patch
2020-10-23 22:12:54 +02:00
Zoltán Vörös
3617b0735e
fixed indexing error
2020-10-23 22:09:49 +02:00
Zoltán Vörös
864d5a68bb
fixed compilation error in approx
2020-10-23 22:00:41 +02:00
Zoltán Vörös
ccb6be5b11
fixed compilation error in eye
2020-10-23 21:55:32 +02:00
Zoltán Vörös
96be400e08
bumped version number
2020-10-23 21:47:43 +02:00
Zoltán Vörös
e2be5a001e
slicing throws an IndexError, if the index is not the proper type
2020-10-23 21:44:54 +02:00
Taku Fukada
1d18ab0381
Update type hints for the new/modified functions
2020-10-23 06:00:38 +09:00
Zoltán Vörös
ddd553f76f
fixed slicing error
2020-10-21 07:12:25 +02:00
Zoltán Vörös
0bfba3bf1b
fixed binary operators for empty arrays
2020-10-17 23:35:24 +02:00
Zoltán Vörös
ca61961d22
fixed test scripts
2020-10-17 21:26:59 +02:00
Zoltán Vörös
e2fd36ed7a
fixed error in eye
2020-10-17 18:23:31 +02:00
Zoltán Vörös
29f1bad2d8
fixed small error in flatten
2020-10-17 17:03:37 +02:00
Zoltán Vörös
16b973d54c
fixed small slicing error
2020-10-17 14:57:57 +02:00
Zoltán Vörös
89801ab12c
restored circuitpython compatibility
2020-10-17 13:47:26 +02:00
Zoltán Vörös
5ab7b1cd3d
re-organised ndarray_properties.h
2020-10-17 10:28:17 +02:00
Zoltán Vörös
511bb5f6c9
added in-place operators for 1, 3, and 4 dimensions
2020-10-16 22:14:13 +02:00
Zoltán Vörös
6529a2ef16
fixed error introduced in the last commit
2020-10-16 08:01:51 +02:00
Zoltán Vörös
ca6e707f66
arrays can now be initialised from arrays
2020-10-16 07:54:43 +02:00
Zoltán Vörös
c29df37e7b
added concatenate
2020-10-15 18:26:12 +02:00
Zoltán Vörös
6723fdb66e
fixed #if/#endif clause
2020-10-14 21:07:54 +02:00
Zoltán Vörös
5389575c07
updated the arctan2 function
2020-10-14 21:03:29 +02:00
Zoltán Vörös
b724c99262
removed debug print
2020-10-14 20:28:39 +02:00
Zoltán Vörös
7af7042572
fixed in-place operators
2020-10-14 20:27:37 +02:00
Zoltán Vörös
c2fac359a5
updated around
2020-10-14 07:20:58 +02:00
Zoltán Vörös
d1c7af3cb5
implemented assignment into Boolean-indexed arrays
2020-10-13 18:15:45 +02:00
Zoltán Vörös
fadc54bd71
implemented Boolean indexing
2020-10-12 20:29:03 +02:00
Zoltán Vörös
a662414ba6
fixed error in numerical sum
2020-10-08 19:44:30 +02:00
Zoltán Vörös
94e4d9e672
fixed some tab <-> spaces oddities
2020-10-07 21:32:50 +02:00
Zoltán Vörös
2e08b2566d
added in-place operators
2020-10-07 21:01:11 +02:00
Zoltán Vörös
ff8d260809
fixed the subscript method
2020-10-06 20:06:51 +02:00
Zoltán Vörös
8dec1328ab
added copy method to ndarray
2020-10-06 07:12:19 +02:00
Zoltán Vörös
b2465a7c16
simplified ndarray code a bit
2020-10-01 19:39:35 +02:00
Zoltán Vörös
0f336ab65b
fixed >=, <= error in binary_op
2020-10-01 07:17:28 +02:00
Zoltán Vörös
0ede57ff42
removed extra if clause from cross product
2020-09-30 19:50:34 +02:00
Zoltán Vörös
6a359e59c8
added cross product to numerical
2020-09-30 19:48:48 +02:00
Zoltán Vörös
3f25cae135
ndarrays can now be unsubscribed
2020-09-30 18:02:04 +02:00
Zoltán Vörös
daed7bf3ce
found and fixed small errors in vectorise and poly
2020-09-30 07:20:57 +02:00
Zoltán Vörös
501663e3fe
added function iterator to ndarray
2020-09-29 18:48:02 +02:00
Zoltán Vörös
dfd4a6729b
added pre-processor switch for unary operators
2020-09-28 21:21:56 +02:00
Zoltán Vörös
7be869fe74
fixed issue with reverse operators in binary_op
2020-09-28 20:53:16 +02:00
Zoltán Vörös
9f917b23c2
added power to binary operators
2020-09-28 19:22:39 +02:00
Zoltán Vörös
2c8faf7680
split binary operators into separate functions
2020-09-26 19:15:43 +02:00
Zoltán Vörös
b7b54cba70
cosmetic changes
2020-09-25 21:12:01 +02:00
Zoltán Vörös
483e9c3dc5
added full
2020-09-24 19:40:58 +02:00
Zoltán Vörös
b7f11232ee
added logscale
2020-09-24 19:11:11 +02:00
Zoltán Vörös
86bed99394
added tobytes method
2020-09-23 20:07:42 +02:00
Zoltán Vörös
32369e56fb
implement numpy compatibility option
2020-09-22 19:08:39 +02:00
Zoltán Vörös
fd7090ce35
added math constants, degrees/radians and defined relevant constants
2020-09-21 21:37:19 +02:00
Zoltán Vörös
c631443971
fixed poly
2020-09-20 21:35:54 +02:00
Zoltán Vörös
58a205aec6
found and fixed error in argsort
2020-09-16 20:35:35 +02:00
Zoltán Vörös
fdd5920f7b
first implementation of argsort (still has small glitch)
2020-09-14 21:50:35 +02:00
Zoltán Vörös
f681f36bc6
fixed sort
2020-08-29 13:19:11 +02:00
Zoltán Vörös
a43e3a45b5
backup commit
2020-08-27 19:24:34 +02:00
Deqing Sun
1061251e06
add MICROPY_FLOAT_CONST for mp_obj_new_float
2020-08-24 14:11:17 -04:00
Deqing Sun
07c7404d95
add name
2020-08-24 07:29:07 -04:00
Deqing Sun
b03d36bcee
add MICROPY_FLOAT_CONST to float numbers
...
other files may need change too.
2020-08-24 07:28:00 -04:00
Deqing Sun
d56a001f16
fix bug for invert with diagonal 0 matrix
...
If there is any diagonal 0 in the process of Gauss-Jordan method, swap that row with a non-0 row below.
2020-08-23 19:36:12 -04:00
Deqing Sun
df0af031f1
fix bug for determinant with diagonal 0 matrix
...
If there is any diagonal 0 in the process of row reduction, swap that row with a non-0 row below.
2020-08-23 19:05:57 -04:00
Zoltán Vörös
8f9fc87dff
implemented roll
2020-08-21 18:27:33 +02:00
Zoltán Vörös
11cd3ac50a
fixed indexing error in flip
2020-08-19 16:50:52 +02:00
Zoltán Vörös
f179a1efc1
re-implemented flip
2020-08-19 16:48:08 +02:00
Zoltán Vörös
798f38a76c
updated the implementation of diff
2020-08-19 16:12:16 +02:00
Zoltán Vörös
b29bf6c0eb
implemented argmin/argmax
2020-08-18 16:42:01 +02:00
Zoltán Vörös
05b2123fbf
backup commit, no functional changes
2020-08-17 22:11:17 +02:00
Zoltán Vörös
115b3da2f6
fixed small error in linalg
2020-08-17 16:48:21 +02:00
Zoltán Vörös
ed4a66938b
backup commit, no functional changes
2020-08-17 16:43:52 +02:00
Zoltán Vörös
00f4cdfe53
cleaned up mean/std functions
2020-08-17 00:15:19 +02:00
Zoltán Vörös
43deb6cc3a
cleaned up numerical sum a bit
2020-08-15 22:25:18 +02:00
Zoltán Vörös
a0396df9b6
tabs to spaces in all files
2020-08-15 19:31:04 +02:00
Zoltán Vörös
6b33c912de
tabs to spaces
2020-08-15 19:24:49 +02:00
Zoltán Vörös
a97d7a7b7e
more linting
2020-08-15 19:02:55 +02:00
Zoltán Vörös
1b9c212899
fixed tabs
2020-08-15 18:57:10 +02:00
Zoltán Vörös
4029c6dd86
fixed tabs
2020-08-15 18:56:07 +02:00
Zoltán Vörös
b24886826f
fixed tabs
2020-08-15 18:54:08 +02:00
Zoltán Vörös
378bd4ebab
fixed tabs
2020-08-15 18:43:52 +02:00
Zoltán Vörös
b95a0816f0
fixed tabs
2020-08-15 18:43:35 +02:00
Zoltán Vörös
1b7dc263e9
fixed tabs
2020-08-15 18:42:55 +02:00
Zoltán Vörös
fe08d5be1b
fixed tabs
2020-08-15 18:42:01 +02:00
Zoltán Vörös
71c73f095a
fixed tabs
2020-08-15 18:39:03 +02:00
Zoltán Vörös
0caf03bd3e
fixed tabs
2020-08-15 18:38:29 +02:00
Zoltán Vörös
eb696d9d91
factored out associative operators
2020-08-15 18:35:28 +02:00
Zoltán Vörös
382d7a613e
numerical sum sort of works now
2020-08-15 00:39:12 +02:00
Zoltán Vörös
a81a77a996
found some flash savings
2020-08-13 22:24:40 +02:00
Zoltán Vörös
506986fcb4
found/fixed bug in iterator
2020-08-13 22:08:12 +02:00
Zoltán Vörös
fca36e6d64
fixed iterator
2020-08-13 22:02:16 +02:00
Zoltán Vörös
76c1a3d242
linalg can now be compiled
2020-08-13 20:16:10 +02:00
Zoltán Vörös
621dca8e3b
fixed filter module
2020-08-13 15:46:23 +02:00
Zoltán Vörös
3428fb8123
moved user settings to ulab.h
2020-08-13 15:17:22 +02:00
Zoltán Vörös
da1d8c2ac1
shaved off 200 bytes for 1D arrays
2020-08-13 15:13:44 +02:00
Zoltán Vörös
80511c13e4
fixed couple of comments
2020-08-13 15:05:26 +02:00
Zoltán Vörös
1b08404975
fixed flatten for views
2020-08-13 14:52:33 +02:00
Zoltán Vörös
d903b0a7d2
fixed functions in compare module
2020-08-13 13:29:56 +02:00
Zoltán Vörös
5ec64d39ee
fft works with views now
2020-08-13 12:45:35 +02:00
Zoltán Vörös
034a8d7b58
fixed unary operators (ndarray_copy_view)
2020-08-13 12:11:12 +02:00
Zoltán Vörös
3be74df891
fixed iteration loops in vectorise
2020-08-12 15:46:59 +02:00
Zoltán Vörös
7e6216a1fc
assignment by slices works
2020-08-11 15:12:16 +02:00
Zoltán Vörös
b212bd4cb9
fixed iterator code
2020-08-11 09:28:44 +02:00
Zoltán Vörös
0268f990d7
added ndinfo function
2020-08-08 12:43:57 +02:00
Zoltán Vörös
b1b93994c2
with the exception of pow, binary operators are functional
2020-08-08 11:20:17 +02:00
Zoltán Vörös
b4527192f5
removed unnecessary pointer shifting in the binary loops
2020-08-07 23:23:32 +02:00
Zoltán Vörös
847c49064b
tensor dimension is displayed in version number
2020-08-07 23:00:36 +02:00
Zoltán Vörös
20796a10b3
tensor dimension can now be configured
2020-08-07 22:34:24 +02:00
Zoltán Vörös
41c3008fdd
removed unused structure from ndarray.h
2020-08-07 20:32:20 +02:00
Zoltán Vörös
63efdbf5a3
proof of concept binary function is working
2020-08-07 20:31:43 +02:00
Zoltán Vörös
d59fc169cd
made code in printout tighter
2020-08-07 17:54:26 +02:00
Zoltán Vörös
44f0c46839
fixed printout
2020-08-07 17:52:41 +02:00
Taku Fukada
f9322380de
Minor fixes on Python stubs
2020-08-06 23:49:51 +09:00
Zoltán Vörös
8c4d02f755
not entirely functional, safety backup
2020-08-05 22:35:21 +02:00
mdaeron
60f6fa6e6b
Remove double parentheses in numerical.c
...
This avoids errors when compiling the unix port on MacOS.
2020-08-04 15:31:19 +02:00
Zoltán Vörös
bb023e267c
pulled in changes from master
2020-08-03 20:58:51 +02:00
Zoltán Vörös
368b23ff8b
fixed small issue in argsort, and updated documentation
2020-08-03 20:41:12 +02:00
Zoltán Vörös
c9b7881add
pulled in most recent changes from master
2020-07-31 23:25:36 +02:00
Zoltán Vörös
5cd5aaba35
approx is compiles
2020-07-30 22:07:53 +02:00
Zoltán Vörös
162b39470d
fft is working
2020-07-30 21:38:31 +02:00
Zoltán Vörös
b4748dc966
fixed a couple of errors in ndarray.c
2020-07-30 21:16:49 +02:00
Zoltán Vörös
4ddbd8b73f
base code can be compiled
2020-07-30 20:49:14 +02:00
Taku Fukada
129ad86b8e
Add type hints to Python stubs
2020-07-31 01:06:48 +09:00
Zoltán Vörös
4e218f9d81
bumped version number to 0.54.1
2020-07-29 18:51:57 +02:00
Zoltán Vörös
4690ef7c2c
fixed error in ulab_create.c
2020-07-29 18:44:51 +02:00
Zoltán Vörös
345b74e3ca
switched to size_t length, and added sanity checks in approx.c
2020-07-29 18:38:08 +02:00
Zoltán Vörös
3a6deef855
switched to size_t length in linspace
2020-07-29 18:22:25 +02:00
Zoltán Vörös
ddfe1754ca
switched to size_t length in reshape
2020-07-29 18:18:42 +02:00
Zoltán Vörös
bae51f8edb
switched to size_t length in poly.c
2020-07-29 18:17:11 +02:00
Zoltán Vörös
a789bd67d0
switched to size_t length in fft
2020-07-29 18:12:27 +02:00
Jonathan Hogg
f41d3eeeb7
Add MICROPY_FLOAT_CONST to all fp constants.
...
In order to get ulab to compile correctly against single floating point
all of the constants need to switch to single format. Conveniently
MicroPython has provided a macro to manage this switch. Use this
througout.
Unfortunately also introduces a bunch of whitespace changes because
there is a mass of trailing whitespace in the codebase and my editor is
(correctly) configured to remove this.
2020-07-24 11:58:45 +01:00
Roberto Colistete Jr
39afe5f2ad
numerical.c : fixed 'out' may be used uninitialized error in function 'numerical_sort_helper'
2020-07-23 18:18:29 -03:00
Zoltán Vörös
f8bf869a45
fixed indentation error in approx.c
2020-07-23 22:08:29 +02:00
Roberto Colistete Jr
c98cdfdb97
lingalg.norm : fixed comments again
2020-07-23 16:57:25 -03:00
Roberto Colistete Jr
2d12162d8f
lingalg.norm : moved after inv and fixed coments
2020-07-23 16:42:35 -03:00
Roberto Colistete Jr
7ad3542de6
lingalg.norm : fixed coments
2020-07-23 16:19:05 -03:00
Roberto Colistete Jr
0064995d2c
lingalg.norm : added coments and v0.54.0 to ulab-change-log
2020-07-23 16:15:51 -03:00
Roberto Colistete Jr
86581222c4
fix lingalg.norm to new folder structure
2020-07-23 16:07:11 -03:00
Zoltán Vörös
ab085333ca
Merge pull request #150 from v923z/create-rename
...
renamed create.c/h, moved stubs from ulab.c to ulab_create.c
2020-07-23 19:13:52 +02:00
Zoltán Vörös
fe8a10dd94
renamed create.c/h, moved stubs from ulab.c to ulab_create.c
2020-07-23 19:10:50 +02:00
20243311e1
Remove trace of 'extras' module
...
.. this caused a build error in circuitpython:
../../extmod/ulab/code/ulab.c:162:9: error: "ULAB_EXTRAS_MODULE" is not defined, evaluates to 0 [-Werror=undef]
162 | #if ULAB_EXTRAS_MODULE
| ^~~~~~~~~~~~~~~~~~
2020-07-23 12:01:58 -05:00
Zoltán Vörös
f6fd605300
Merge pull request #149 from v923z/documentation
...
Documentation
2020-07-23 19:01:15 +02:00
Zoltán Vörös
a3678b0de7
re-arranged functions in compare.c
2020-07-23 18:56:18 +02:00
Zoltán Vörös
e91e2db0dd
re-arranged functions in approx.c
2020-07-23 18:54:03 +02:00
Zoltán Vörös
ac38e8bc5a
re-arranged functions in poly.c
2020-07-23 18:51:57 +02:00
Zoltán Vörös
9cf30ad9f2
re-arranged functions in linalg.c
2020-07-23 18:50:47 +02:00
Zoltán Vörös
2b55b79471
re-arranged functions in numerical.c
2020-07-23 18:47:14 +02:00
Zoltán Vörös
e5341bcf35
added STATIC to create.c
2020-07-23 18:23:52 +02:00
Zoltán Vörös
c93faa9a9c
fixed docs in approx.c
2020-07-22 21:56:06 +02:00
Zoltán Vörös
b6252474e9
fixed docs in fft.c
2020-07-22 21:53:10 +02:00
23e1ef3b11
Add newlines where required in .rst files
2020-07-22 14:05:46 -05:00
Zoltán Vörös
4759264994
added user/ files
2020-07-22 20:34:48 +02:00
Zoltán Vörös
80503300ad
re-organised code, so that circuitpython documentation can automatically be generated
2020-07-22 20:19:14 +02:00
Zoltán Vörös
651f2029af
Merge pull request #147 from v923z/documentation
...
Documentation
2020-07-22 19:18:29 +02:00
Zoltán Vörös
cc721aa216
added stubs to vectorise.c
2020-07-22 19:13:09 +02:00
Zoltán Vörös
d6ae0bcdde
added stubs to poly.c
2020-07-22 18:56:28 +02:00
Zoltán Vörös
f1dab38726
added stubs to numerical.c
2020-07-22 18:52:51 +02:00
Zoltán Vörös
8b268aedd1
added stubs to linalg.c
2020-07-22 18:44:45 +02:00
Zoltán Vörös
b60e14d380
fixed arange
2020-07-22 18:31:40 +02:00
Roberto Colistete Jr
8d439c3332
added linalg.norm : for vector or matrix
2020-07-22 04:45:51 -03:00
Zoltán Vörös
b3e76e1f0a
Merge pull request #143 from rcolistete/dot_vectors
...
linalg.dot : also accepts 2 vectors of same dimension
2020-07-22 08:37:12 +02:00
Roberto Colistete Jr
a68b7daa32
linalg.dot : changed error message: vectors must have same lengths
2020-07-22 03:34:39 -03:00
Roberto Colistete Jr
0d80175933
linalg.dot : also accepts 2 vectors of same dimension
2020-07-21 19:28:55 -03:00
Roberto Colistete Jr
f7358cd65f
fix arange : inserted missing MICROPY_FLOAT_C_FUN(ceil) in code/create.c
2020-07-21 12:35:38 -03:00
Zoltán Vörös
3a5d17c10e
added stubs to filter.c
2020-07-20 22:35:35 +02:00
Zoltán Vörös
3acd543630
added stubs to fft.c
2020-07-20 22:33:36 +02:00
Zoltán Vörös
5e72d76b6e
added stubs to compare.c
2020-07-20 22:27:48 +02:00
Zoltán Vörös
4194cce461
added stubs to approx.c
2020-07-20 22:08:56 +02:00
Zoltán Vörös
3b041e1059
found and fixed small error in create.h
2020-07-20 20:48:38 +02:00
Zoltán Vörös
161d8b0ed0
removed unused one constant in create.c
2020-07-20 20:41:34 +02:00
Zoltán Vörös
eea4c15ad0
found and fixed small bug in dtype assignment
2020-07-20 20:29:55 +02:00
Zoltán Vörös
c6f2c928b6
fixed dtype inconsistency in arange
2020-07-20 20:22:12 +02:00
Zoltán Vörös
e202d38b0e
fixed argument parsing error in arange
2020-07-20 18:31:46 +02:00
Zoltán Vörös
932e0a2b91
first implementation of arange
2020-07-19 22:19:57 +02:00
Zoltán Vörös
4581034325
no functional changes
2020-07-16 22:28:20 +02:00
Zoltán Vörös
13ef14c29a
even more linting
2020-07-16 22:27:49 +02:00
Zoltán Vörös
7739ae21f8
even more linting
2020-07-16 22:27:01 +02:00
Zoltán Vörös
49be9e0ba7
more linting
2020-07-16 22:07:00 +02:00
Zoltán Vörös
bdaa4b3984
fixed linting issues
2020-07-16 22:05:33 +02:00
Zoltán Vörös
33451ee285
Merge branch 'master' into trapz
2020-07-16 21:18:09 +02:00
Zoltán Vörös
dfe560150a
first implementation of trapz
2020-07-16 21:12:46 +02:00
Zoltán Vörös
f5c15f0c4c
reverted changes in master
2020-07-16 21:10:14 +02:00
Zoltán Vörös
0443a2a3ed
fixed small bug in trapz
2020-07-16 20:55:42 +02:00
Zoltán Vörös
059994774d
first implementation of trapz
2020-07-16 20:52:53 +02:00
Zoltán Vörös
f171235a95
Merge pull request #136 from rcolistete/fix_gcc-arm_v10.1
...
Fix Incompatibility between gcc-arm 10.1 and ulab + MicroPython
2020-07-16 08:49:37 +02:00
Roberto Colistete Junior
e75729cb27
Update vectorise.h
2020-07-16 03:38:15 -03:00
Roberto Colistete Junior
3bb1417211
Update extras.h
2020-07-16 03:37:35 -03:00
Roberto Colistete Junior
40503d0f7e
not compatible with '_thread' module
...
ulab not compatible with enabling '_thread' module from the make command :
- building ulab with thread enabled in MicroPython :
`$ make -j8 CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1' BOARD=PYBV11 USER_C_MODULES=../../../ulab all`
yields a firmware with '_thread' module but without 'ulab' module, because 'CFLAGS_EXTRA' is used in the make command and in 'ulab/code/micropython.mk', so the value of the last is ignored;
- the solution is to use 'override' and '+=' in in last line of 'ulab/code/micropython.mk' :
`override CFLAGS_EXTRA += -DMODULE_ULAB_ENABLED=1`
2020-07-14 10:55:10 -03:00
Zoltán Vörös
fe7aa27238
fixed argmin/argmax error in issue #129
2020-06-29 21:46:45 +02:00
Zoltán Vörös
526ffb4c78
updated readme, version number and change log
2020-06-19 22:06:47 +02:00
Zoltán Vörös
17c6d605ca
added zi keyword argument to sosfilt
2020-06-18 22:24:26 +02:00
Zoltán Vörös
f9cf519843
first implementation of sosfilt
2020-06-17 22:24:17 +02:00
Zoltán Vörös
37140d531e
added mp_obj_slice_indices to ndarray.c, so that it compiles for openmv
2020-06-16 19:32:41 +02:00
Zoltán Vörös
1231ac877e
version that actually compiles in openmv
2020-06-15 22:46:46 +02:00
Zoltán Vörös
a73201a5a4
fixes compilation error (compatibility with older versions of micropython) in openmv
2020-06-12 07:50:37 +02:00
Jeff Epler
0394801933
Merge pull request #122 from jepler/circuitpy-is-int
...
Updates needed to build latest code on CircuitPython
2020-06-01 10:26:07 -05:00
cbdd1295c1
Mark parameters as unused
...
As far as I can tell, these are not checked for the sake of efficiency.
This silences compiler diagnostics when building CircuitPython
```
../../extmod/ulab/code/approx.c:25:12: error: no previous prototype for ‘approx_python_call’ [-Werror=missing-prototypes]
mp_float_t approx_python_call(const mp_obj_type_t *type, mp_obj_t fun, mp_float_t x, mp_obj_t *fargs, uint8_t nparams) {
^~~~~~~~~~~~~~~~~~
```
2020-06-01 09:00:42 -05:00
a2aa5d3a58
approx: Mark functions as stat if they are used only in this file
...
This fixes the diagnostic when building circuitpython:
```
../../extmod/ulab/code/approx.c:25:12: error: no previous prototype for ‘approx_python_call’ [-Werror=missing-prototypes]
mp_float_t approx_python_call(const mp_obj_type_t *type, mp_obj_t fun, mp_float_t x, mp_obj_t *fargs, uint8_t nparams) {
^~~~~~~~~~~~~~~~~~
```
2020-06-01 08:59:35 -05:00
1f3836d16f
ndarray: Let mp_obj_is_int work on circuitpython
2020-06-01 08:29:34 -05:00
Zoltán Vörös
666dc77fad
fixes min/max error from adafruit/circuitpython #2984
2020-06-01 08:42:43 +02:00
Zoltán Vörös
077bcc51ab
Merge branch 'master' into approx
2020-05-19 20:53:33 +02:00
Zoltán Vörös
78438727c4
Merge branch 'master' into print
2020-05-19 20:44:54 +02:00
Zoltán Vörös
f00d5dc6de
fix for issue 117
2020-05-19 08:56:34 +02:00
Zoltán Vörös
8631b771d2
cleaned up documentation on approx sub-module
2020-05-18 19:44:26 +02:00
Zoltán Vörös
e2cae23253
vectorize can now take scalars
2020-05-06 23:49:07 +02:00
Zoltán Vörös
6590acc6c4
added vectorisation of generic python function
2020-05-06 23:29:27 +02:00
Zoltán Vörös
d5e59cc21f
no functional change, backup
2020-05-06 21:22:54 +02:00
Zoltán Vörös
8f5edbb808
bumped ulab version number to 0.45
2020-05-05 21:16:10 +02:00
Zoltán Vörös
35cdc9f976
began work with curve_fit
2020-05-05 21:13:53 +02:00
Zoltán Vörös
5c027e44c1
added function wrapper approx_python_call
2020-05-03 17:05:27 +02:00
Zoltán Vörös
2ead6cbc21
added equal/not_equal to compare.c
2020-05-03 11:00:41 +02:00
Zoltán Vörös
70666817ce
added set_printoptions/get_printoptions functions
2020-05-01 11:53:39 +02:00
Zoltán Vörös
6615290fdf
add approx sub-module with fmin, newton, and bisect functions
2020-04-30 22:33:21 +02:00
a7502f6243
ulab.h: Actually allow excluding modules
2020-04-26 20:37:14 -05:00
Zoltán Vörös
a081c28998
Merge branch 'master' into minimax
2020-04-21 23:27:31 +02:00
Zoltán Vörös
855384f579
implemented minimum/maximum and clip in the compare module
2020-04-21 22:35:17 +02:00
Zoltán Vörös
fb05e2585c
pulling in jepler's argument handling improvements
2020-04-20 23:20:30 +02:00
Zoltán Vörös
c9519e59a8
Merge pull request #103 from v923z/revert-101-polyfit-argument-checking
...
Revert "polyfit: Argument handling improvements"
2020-04-20 23:05:01 +02:00
Zoltán Vörös
3c1fb52efb
Merge pull request #104 from v923z/compile
...
fix compilation errors due to casting of floats
2020-04-20 23:03:12 +02:00
Zoltán Vörös
a0e5f3a474
fix compilation errors due to casting of floats
2020-04-20 22:55:21 +02:00
Zoltán Vörös
f014128595
backup commit
2020-04-20 20:54:24 +02:00
Zoltán Vörös
d29cc8632e
Revert "polyfit: Argument handling improvements"
2020-04-20 16:20:44 +02:00
d0b11a6081
polyfit: Argument handling improvements
...
* In the 3-args case, the lengths of the arguments were not checked
* in the 3-args case, the type of the 2nd argument was not checked
* gcc falsely diagnosed a `maybe-uninitialized` variable because it
did not see that the branches of the if() statement were mutually
exclusive
It's this third issue that originally drew my attention to this code,
adafruit/circuitpython#2787
2020-04-20 07:58:30 -05:00
Zoltán Vörös
d1f2d80581
fixed compilation error in issue #98
2020-04-18 09:05:47 +02:00
Zoltán Vörös
2b7d96f25d
fix indexing error in linalg.dot
2020-04-14 09:05:22 +02:00
Jeff Epler
22813d6736
Merge pull request #91 from v923z/argmax
...
fixed argmin/argmax function for iterables
2020-04-13 15:33:48 -05:00
Zoltán Vörös
e83ef7a31d
fixed another indexing error in argmin/argmax
2020-04-13 21:56:55 +02:00
Zoltán Vörös
1a4ac564d4
fixed indexing error in argmin/argmax
2020-04-13 21:27:41 +02:00
Zoltán Vörös
78ae57005c
argmin/argmax raises ValueError with empty iterables
2020-04-12 19:32:08 +02:00
Zoltán Vörös
84150d4166
fix transpose function to conform to numpy
2020-04-09 12:38:19 +02:00
Zoltán Vörös
7ec8a25a84
fixed argmin/argmax function for iterables
2020-04-07 23:06:41 +02:00
Zoltán Vörös
ab9a26dc98
fix error in argsort
2020-04-07 22:34:00 +02:00
86e7155ab7
generate_slice: Properly fix -Wsign-compare diagnostic
...
Instead of making the local unsigned--it must be permitted to
contain negative values--make the function parameter signed.
2020-04-06 16:38:51 -05:00
f1f10c27a8
Fix -Wsign-compare diagnostics
...
.. by adding casts or changing the type of a local variable.
2020-04-06 08:38:43 -05:00
daf4b07ef7
Fix -Wunused-parameter diagnostics
...
Here we actually get bugs fixed! At many sites, mp_parse_arg_all's
first argument was the number of positional arguments required, rather
than the number actually supplied.
This fixes e.g., the bug where the linspace third positional argument
was not used as the "num" argmuent, and where too many positional args
were not treated as an error:
>>> ulab.linspace(0, 1, 9)
array([0.0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0], dtype=float)
>>> ulab.linspace(0, 1, 1, 1)
TypeError: extra positional arguments given
In the case of argmin/argmax of an iterable, it is now signaled to the user
that only the axis=None case is supported, instead of giving a wrong
result.
2020-04-06 08:33:18 -05:00
22605c6fe9
Fix -Wshadow diagnostics
...
A declaration of a local variable can "shadow" a parameter or another
local variable declared in an outer scope.
Since this can create confusion about which variable is referred to, it
is better to fix these diagnostics.
A variety of changes were made:
- Add curly braces to reduce the scope of a variable (ndarray_unary_op)
so that its scope has ended before the next scope where it is used
- be consistent about whether a variable is declared with for-loop scope
or not (ndarray_print_row)
- remove a declaration so that the outer variable is used, after verifying
this will function properly (insert_slice_list)
- rename a variable introduced by a macro (RUN_SUM, RUN_STD) so it does
not shadow another variable
2020-04-06 08:12:47 -05:00
8aebfd9f4e
remove unused function get_nditerable_len
2020-04-06 08:06:33 -05:00
be1e2b28e0
Fix -Wmissing-prototypes diagnostics
...
These functions need prototypes in a header, as they are defined in one
source file and used in another.
2020-04-06 08:05:43 -05:00
11ed69dacf
Fix -Wmissing-prototypes diagnostics
...
This diagnostic flag, enabled by default in CircuitPython, requires that
nonstatic functions have a previous prototype. Since placing prototypes
in header files is the only way that mismatched arguments between function
definition and use sites can be detected, this is a valuable warning.
In the case of ulab, the majority of the changes required were to mark
functions as "static" that were used only in a single C source file.
2020-04-06 08:05:20 -05:00
59cc5ed6c6
circuitpython compatibility
2020-04-06 07:38:12 -05:00
Zoltán Vörös
1001ed44f5
fixed small glitch in == and !=
2020-04-06 09:08:44 +02:00
Zoltán Vörös
c69f2d9256
implemented the ==, and != binary operators
2020-04-04 22:14:36 +02:00
Zoltán Vörös
ceaede8cb8
added trace to linalg, trimmed other code
2020-04-03 12:07:11 +02:00
Zoltán Vörös
32e0bf5bde
Merge branch 'master' into sort
2020-04-02 21:26:06 +02:00
Zoltán Vörös
89d73974e3
another attempt at fixing issue #79
2020-04-02 21:22:45 +02:00
Zoltán Vörös
b4f83997e7
Merge branch 'master' into power
2020-04-02 19:08:00 +02:00
Jeff Epler
0d5dc6b0d4
Merge pull request #78 from v923z/argmax
...
contraction returns scalar, if dimension is 0
2020-04-02 08:56:08 -05:00
Zoltán Vörös
2e27a356f5
added unistd.h to ndarray.c to fix issue #73
2020-04-02 11:04:23 +02:00
Zoltán Vörös
a3d77a3fa1
updated docs for ndarray_make_new_core
2020-04-02 09:52:04 +02:00
Zoltán Vörös
1648325d69
added fast ndarray initialisation option
2020-04-02 09:41:13 +02:00
Zoltán Vörös
04422f3da5
fixed indexing error in sort function
2020-04-01 23:43:31 +02:00