Commit Graph

425 Commits

Author SHA1 Message Date
Arthur Camouseigt
d6e32594b8 [test/matplotlib.cpp][modpyplot.cpp] Changed matplotlib tests
Modified the tests for pyplot module and added error raisers to module functions

Change-Id: I164feafaf562f16d646841c1f9dfbbe32e6a763b
2020-06-04 14:50:10 +02:00
Arthur Camouseigt
68e3208799 [matplotlib/modpyplot.cpp] Removed function previously used for setting colors
Change-Id: I76bb489d5a5b78162873f68c5e3cca8cebb77aba
2020-06-04 14:50:10 +02:00
Arthur Camouseigt
c39b432dd6 [matplotlib/modpyplot.cpp] Adding keyword arguments support for plot function
plot function can now take into account the following keywords arguments :
- color

Change-Id: I29b82ba25fa68ec4d8e1797112f133440dee22a0
2020-06-04 14:50:10 +02:00
Arthur Camouseigt
b26d448573 [matplotlib/modpyplot.cpp] Adding keyword arguments support for scatter function
scatter function can now take into account the following keywords arguments :
- color

Change-Id: Iaea5a7a46d25e3efe2214368334ce859900d6ae6
2020-06-04 14:50:10 +02:00
Arthur Camouseigt
5daaa2c050 [matplotlib/modpyplot.cpp] Adding keyword arguments support for hist function
hist function can now take into account the following keyword arguments :
- color

Change-Id: I69eca6555d892db958d2bd002f438a40908b2d9d
2020-06-04 14:50:10 +02:00
Arthur Camouseigt
0e3684e137 [matplotlib/modpyplot.cpp] Adding keyword arguments support for bar function
bar function can now take into account the following keywords arguments :
- color

Change-Id: Iefa68cff59986d89c37cfecd7e3750f03c33ca59
2020-06-04 14:50:09 +02:00
Arthur Camouseigt
41da4f2bd5 [matplotlib/modpyplot] Adding keyword argument support for arrow function
Arrow function can now take into account the following keywords arguements :
- head_width
- color

Change-Id: I205dcd5776d53a4efcbf1e6da4edf29d8e399cab
2020-06-04 14:50:09 +02:00
Arthur Camouseigt
985c31920d [matplotlib/plot_store.cpp] Removed useless function
checkFloatType function used to check for an obj type before cast. This is already done by mp_obj_get_float

Change-Id: I745bb3066328678ab0b2a2149c8f38a84f26fbd2
2020-06-04 14:50:09 +02:00
Arthur Camouseigt
68ff71f72a [matplotlib/modpyplot.cpp] Modified the way to add mp_float
To prevent crashes caused by failed casts from char to float, removed optimization.

Change-Id: Ia91aafa007538b6c05f7aace5e5962989d313c98
2020-06-04 14:50:09 +02:00
Arthur
59bf8bbcf4 [matplotlib] Added cyan color to the color palette
Change-Id: I29476d8148ad98285505adc460b90628573518fa
2020-06-04 14:50:09 +02:00
Arthur
fe7c4b1a8a [python/turtle] Added write method
Allows user to print strings with the turtle

Change-Id: I06a3832f6fa36d29506be10c48a1b2fb34cb69fb
2020-06-04 14:50:09 +02:00
Arthur
7cd0b7e0e0 [matplotlib] Removed useless initializers in PlotStore constructor
Change-Id: Idea0ce07cbc800139539f9d3fb27811920645184
2020-06-04 14:50:09 +02:00
Arthur
13d0bcf676 [matplotlib] Modified isEmpty method for showing axis
Added a condition for being considered empty.
Allows axis("on") or axis((0,1,2,3)) to display something with show()
This behavior is the same as the python module

Change-Id: If5f3b07c280ee9ead2bc23d23cbbb4f01da7eae5
2020-06-04 14:50:09 +02:00
Émilie Feral
d8666a52d3 [python] matplotlib: fix tests about arrow function 2020-06-04 14:50:09 +02:00
Émilie Feral
0c9fb57b33 [python] matplotlib: check float type of the head_width arg of arrow function 2020-06-04 14:50:09 +02:00
Émilie Feral
9b7c47a7f0 [python] matplotlib: arrow can have up to 6 args 2020-06-04 14:50:09 +02:00
Émilie Feral
083f959b7b [python] matplotlib: Enable to change the arrow shape via the head_width
arg
2020-06-04 14:50:09 +02:00
Émilie Feral
0f8f82b94b [python] matplotlib: Add a parameter to to arrow to set the arrow width 2020-06-04 14:50:09 +02:00
Émilie Feral
e2c06cbb44 [python] matplotlib: add color argument to plot, scatter, hist, bar and
arrow
2020-06-04 14:50:08 +02:00
Émilie Feral
a22990943b [python] matplotlib: missing static keyword 2020-06-04 14:50:08 +02:00
Émilie Feral
273d10dc26 [python] Change names: ColorParse::ParseColor --> Color::Parse 2020-06-04 14:50:08 +02:00
Émilie Feral
ab69c0069c [python] Fix alignement issues in MicroPython::collectRootsAtAddress 2020-06-04 14:50:08 +02:00
Léa Saviot
d1c8bbdaf7 [apps/code] The console marks imported script for the var box
After lauching the console, if we fetch a script we mark it as fetched.
When the variable box displays variables from imported scripts, it scans
all the variables from the scripts marked as fetched.
2020-06-04 14:50:06 +02:00
Émilie Feral
7f3f67aba0 [python] Clean type confusion 2020-05-18 14:39:46 +02:00
Émilie Feral
4e1f7c1cb8 [python] Fix comment 2020-05-18 14:39:46 +02:00
Émilie Feral
3f6647f3ae [ion][python] Implement an architecture-dependant collect_registers.
setjmp is not guaranteed to collect all registers without modification
on all platforms.

This fixes the following bug: when the pointer of a newly allocated
object on the Python heap is stored in rpb registers on x86_64 arch, it
was not collected by the garbarge collector.
2020-05-18 14:39:46 +02:00
Émilie Feral
5a32006dcd [python] Revert: collectRoots does not need to look for unaligned
pointers as they should not exist
2020-05-18 14:39:46 +02:00
Émilie Feral
3f5487ca90 [python] Forbid inlining on gc_collect to avoid missing some roots 2020-05-18 14:39:46 +02:00
Émilie Feral
9b419acf40 [python] kandinsky port: rename TupleForRGB to TupleForKDColor 2020-04-30 14:12:32 +02:00
Émilie Feral
4bca330f0d [python] Coding style 2020-04-30 14:12:32 +02:00
Émilie Feral
0811221943 [python] Clean port ColorParser 2020-04-30 14:12:32 +02:00
Émilie Feral
7c24f2fc28 [python] Coding style 2020-04-30 14:12:32 +02:00
Émilie Feral
ba15415847 [python] modturtle: avoid unexpected cast 2020-04-30 14:12:32 +02:00
Émilie Feral
686a1493e5 [python] Coding style 2020-04-30 14:12:32 +02:00
Émilie Feral
e7df25d558 [python] Kandinsky module: color accepts "#FF0000", "red" kinds of
arguments
2020-04-30 14:12:32 +02:00
Émilie Feral
af0cdbcc1b Coding style 2020-04-30 14:12:32 +02:00
Émilie Feral
1b0b9e48f5 [python] ColorParser: add a TODO 2020-04-30 14:12:32 +02:00
Émilie Feral
8f5fa50f22 [python] Color: avoid magic number 255, clean code of ColorParser and
Turtle::colormode
2020-04-30 14:12:32 +02:00
Émilie Feral
c920df1f76 [python] Change enum class name: ColorModes --> ColorMode 2020-04-30 14:12:32 +02:00
Émilie Feral
995cc04533 [python] Use of mp_obj_is_str instead of MP_OBJ_IS_STR for more
consistency
2020-04-30 14:12:32 +02:00
Émilie Feral
a564efcaa5 [python] Fix bug in ParseColor 2020-04-30 14:12:32 +02:00
Émilie Feral
3d1b3f9a0b [python] Factorize implementation of pencode (Turtle module) 2020-04-30 14:12:32 +02:00
Émilie Feral
f5e8d4d9bb [python] Avoid modifying micropython external source, use parsenum.h methods directly 2020-04-30 14:12:32 +02:00
Joachim LF
e76abcf67e [Python] universal colors 2020-04-30 14:12:32 +02:00
Quentin
f37040dc8a [Fix] Conflicts 2020-04-16 14:04:56 +02:00
Émilie Feral
61399d07eb [python] Turtle: use std::fabs std::copysign when possible 2020-04-16 09:44:37 +02:00
Joachim LF
c15bb3d893 Negative diameter circle turtle support 2020-04-15 06:15:28 -07:00
Romain Goyet
644c44e069 Misc cleanups 2020-04-14 09:31:02 -04:00
Romain Goyet
950862f8d0 Use std::min and std::max 2020-04-14 09:31:02 -04:00
Romain Goyet
56f4b275a5 [python] Turn a warning into a error when appropriate 2020-04-14 01:17:25 -07:00