Commit graph

194 commits

Author SHA1 Message Date
Zoltán Vörös
434ea7b04c
Merge branch 'master' into dtype2 2020-11-11 19:27:25 +01:00
Zoltán Vörös
a5c439b127 transpose fix 2020-11-11 07:35:14 +01:00
Zoltán Vörös
2ec3a422ce dtype is exposed in circuitpython, too 2020-11-11 07:23:59 +01:00
Zoltán Vörös
1ca41e5d80 fixed slicing issues 2020-11-10 19:43:09 +01:00
Zoltán Vörös
24fe1dcbe1 fixes array casting glitch 2020-11-09 21:03:18 +01:00
Zoltán Vörös
b7c135faf7 added function pointer tools 2020-11-06 17:49:56 +01:00
Zoltán Vörös
ca99f2f0e1 fixed iteration loop in norm, shape 2020-11-03 17:04:40 +01:00
Zoltán Vörös
db1a822c3b fixed initialisation error in ndarray_make_new_core 2020-11-02 23:01:07 +01:00
Zoltán Vörös
b7f95c4122 added an implementation of dtype 2020-11-02 21:52:12 +01:00
Zoltán Vörös
984ddf51b4 added dtype implementation 2020-11-02 18:06:29 +01:00
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
a5242bb7b3 fixed CP-compatibilty in workflow file 2020-10-25 10:28:50 +01: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
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
ca6e707f66 arrays can now be initialised from arrays 2020-10-16 07:54:43 +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
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
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
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
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
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
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
c631443971 fixed poly 2020-09-20 21:35:54 +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
8f9fc87dff implemented roll 2020-08-21 18:27:33 +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
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
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
20796a10b3 tensor dimension can now be configured 2020-08-07 22:34:24 +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
Zoltán Vörös
8c4d02f755 not entirely functional, safety backup 2020-08-05 22:35:21 +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
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
Zoltán Vörös
ddfe1754ca switched to size_t length in reshape 2020-07-29 18:18:42 +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
23e1ef3b11 Add newlines where required in .rst files 2020-07-22 14:05:46 -05: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
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
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
d5e59cc21f no functional change, backup 2020-05-06 21:22:54 +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
855384f579 implemented minimum/maximum and clip in the compare module 2020-04-21 22:35:17 +02:00
Zoltán Vörös
f014128595 backup commit 2020-04-20 20:54:24 +02:00
Zoltán Vörös
84150d4166 fix transpose function to conform to numpy 2020-04-09 12:38:19 +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
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
Zoltán Vörös
c69f2d9256 implemented the ==, and != binary operators 2020-04-04 22:14:36 +02:00
Zoltán Vörös
b4f83997e7
Merge branch 'master' into power 2020-04-02 19:08:00 +02: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
1648325d69 added fast ndarray initialisation option 2020-04-02 09:41:13 +02:00