From 9ecdd193f31f33e0aa5f117cdb413a4f09fd4e60 Mon Sep 17 00:00:00 2001 From: Pia Chancerel Date: Wed, 22 May 2024 10:49:04 +0200 Subject: [PATCH 01/15] [poincare] Beautify two single quotes in a double quote --- poincare/include/poincare/input_beautification.h | 4 ++++ poincare/src/input_beautification.cpp | 3 ++- .../beautification_double_quotes/crc32.txt | 1 + .../beautification_double_quotes/scenario.nws | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 tests/screenshots_dataset/beautification_double_quotes/crc32.txt create mode 100644 tests/screenshots_dataset/beautification_double_quotes/scenario.nws diff --git a/poincare/include/poincare/input_beautification.h b/poincare/include/poincare/input_beautification.h index d97629a13c6..3c9b06d2275 100644 --- a/poincare/include/poincare/input_beautification.h +++ b/poincare/include/poincare/input_beautification.h @@ -95,6 +95,10 @@ class InputBeautification { return static_cast( CodePointLayout::Builder(UCodePointMultiplicationSign)); }}, + {"''", 0, + [](Layout* parameters) { + return static_cast(CodePointLayout::Builder('"')); + }}, }; constexpr static BeautificationRule k_infRule = { diff --git a/poincare/src/input_beautification.cpp b/poincare/src/input_beautification.cpp index 82118924d8c..1e763561384 100644 --- a/poincare/src/input_beautification.cpp +++ b/poincare/src/input_beautification.cpp @@ -18,7 +18,8 @@ InputBeautification::BeautificationMethodWhenInsertingLayout( * = Do not apply any beautfication. * Example: "pi|" -> insert "a" -> "pia|" (do not beautify "pi" yet) * */ - if (LayoutIsIdentifierMaterial(leftMostLayout)) { + if (LayoutIsIdentifierMaterial(leftMostLayout) && + static_cast(leftMostLayout).codePoint() != '\'') { return BeautificationMethod{.beautifyIdentifiersBeforeInserting = false, .beautifyAfterInserting = false}; } diff --git a/tests/screenshots_dataset/beautification_double_quotes/crc32.txt b/tests/screenshots_dataset/beautification_double_quotes/crc32.txt new file mode 100644 index 00000000000..48c42bde003 --- /dev/null +++ b/tests/screenshots_dataset/beautification_double_quotes/crc32.txt @@ -0,0 +1 @@ +C61646A9 \ No newline at end of file diff --git a/tests/screenshots_dataset/beautification_double_quotes/scenario.nws b/tests/screenshots_dataset/beautification_double_quotes/scenario.nws new file mode 100644 index 00000000000..328b24dbd82 --- /dev/null +++ b/tests/screenshots_dataset/beautification_double_quotes/scenario.nws @@ -0,0 +1 @@ +NWSF**.**.**fr4 ||||4 ||| \ No newline at end of file From f8f0a3c50e9ee389a4b5420866727f73a2ac65f4 Mon Sep 17 00:00:00 2001 From: Pia Chancerel Date: Thu, 23 May 2024 10:02:43 +0200 Subject: [PATCH 02/15] Insert single quote when pressing double quotes key in equation app --- apps/solver/list_controller.h | 4 ---- escher/include/escher/layout_field_delegate.h | 4 ---- escher/src/layout_field.cpp | 3 +-- .../beautification_double_quotes/crc32.txt | 2 +- tests/screenshots_dataset/solver_double_quotes_key/crc32.txt | 1 - .../screenshots_dataset/solver_double_quotes_key/scenario.nws | 1 - 6 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 tests/screenshots_dataset/solver_double_quotes_key/crc32.txt delete mode 100644 tests/screenshots_dataset/solver_double_quotes_key/scenario.nws diff --git a/apps/solver/list_controller.h b/apps/solver/list_controller.h index 2807a76f1d7..f57382575ea 100644 --- a/apps/solver/list_controller.h +++ b/apps/solver/list_controller.h @@ -39,10 +39,6 @@ class ListController : public Shared::ExpressionModelListController, Ion::Events::Event event) override; void layoutFieldDidChangeSize(Escher::LayoutField* layoutField) override; void layoutFieldDidAbortEditing(Escher::LayoutField* layoutField) override; - bool shouldInsertSingleQuoteInsteadOfDoubleQuotes( - Escher::LayoutField* layoutField) override { - return false; - } bool isAcceptableExpression(const Poincare::Expression expression, Poincare::Context* context) override; /* ExpressionModelListController */ diff --git a/escher/include/escher/layout_field_delegate.h b/escher/include/escher/layout_field_delegate.h index 439b9920638..0d929e1c1d4 100644 --- a/escher/include/escher/layout_field_delegate.h +++ b/escher/include/escher/layout_field_delegate.h @@ -35,10 +35,6 @@ class LayoutFieldDelegate : public ContextProvider { Escher::LayoutField* layoutField) const { return false; } - virtual bool shouldInsertSingleQuoteInsteadOfDoubleQuotes( - LayoutField* layoutField) { - return true; - } virtual void updateRepetitionIndexes(LayoutField* layoutField, Ion::Events::Event event) {} }; diff --git a/escher/src/layout_field.cpp b/escher/src/layout_field.cpp index 99629546d13..456ec74c357 100644 --- a/escher/src/layout_field.cpp +++ b/escher/src/layout_field.cpp @@ -583,8 +583,7 @@ size_t LayoutField::getTextFromEvent(Ion::Events::Event event, char *buffer, m_delegate->shouldInsertTextForAnsEvent(this)) { return strlcpy(buffer, Symbol::k_ansAliases.mainAlias(), bufferSize); } - if (event == Ion::Events::DoubleQuotes && m_delegate && - m_delegate->shouldInsertSingleQuoteInsteadOfDoubleQuotes(this)) { + if (event == Ion::Events::DoubleQuotes) { return SerializationHelper::CodePoint(buffer, bufferSize, '\''); } return Ion::Events::copyText(static_cast(event), buffer, bufferSize); diff --git a/tests/screenshots_dataset/beautification_double_quotes/crc32.txt b/tests/screenshots_dataset/beautification_double_quotes/crc32.txt index 48c42bde003..73c2a5086e4 100644 --- a/tests/screenshots_dataset/beautification_double_quotes/crc32.txt +++ b/tests/screenshots_dataset/beautification_double_quotes/crc32.txt @@ -1 +1 @@ -C61646A9 \ No newline at end of file +902DE8D1 \ No newline at end of file diff --git a/tests/screenshots_dataset/solver_double_quotes_key/crc32.txt b/tests/screenshots_dataset/solver_double_quotes_key/crc32.txt deleted file mode 100644 index 15f5020c7ad..00000000000 --- a/tests/screenshots_dataset/solver_double_quotes_key/crc32.txt +++ /dev/null @@ -1 +0,0 @@ -FCCF188A \ No newline at end of file diff --git a/tests/screenshots_dataset/solver_double_quotes_key/scenario.nws b/tests/screenshots_dataset/solver_double_quotes_key/scenario.nws deleted file mode 100644 index a9ec2888d6c..00000000000 --- a/tests/screenshots_dataset/solver_double_quotes_key/scenario.nws +++ /dev/null @@ -1 +0,0 @@ -NWSF**.**.**fr4 |ŒŠŠ‚ |- |Œ†‚ |4 \ No newline at end of file From 600ec0e4ef6e352064929a5b0fde626d8d3ad5cb Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Tue, 28 May 2024 16:23:01 +0200 Subject: [PATCH 03/15] [apps/apps_container] Fix DFU communication after setting exam mode --- apps/apps_container.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/apps_container.cpp b/apps/apps_container.cpp index c6e23a83dde..1209e802334 100644 --- a/apps/apps_container.cpp +++ b/apps/apps_container.cpp @@ -169,12 +169,15 @@ bool AppsContainer::processEvent(Ion::Events::Event event) { } if (!Preferences::SharedPreferences()->examMode().isActive()) { openDFU(true); + if (Preferences::SharedPreferences()->examMode().isActive()) { + Ion::USB::enable(); + } } else if (m_firstUSBEnumeration) { displayExamModePopUp(ExamMode(ExamMode::Ruleset::Off)); + m_firstUSBEnumeration = false; // Warning: if the window is dirtied, you need to call window()->redraw() window()->redraw(); } - m_firstUSBEnumeration = false; return true; } if (event == Ion::Events::USBPlug) { @@ -452,6 +455,7 @@ void AppsContainer::openDFU(bool blocking) { } else if (preferences->examMode() != activeExamMode || preferences->forceExamModeReload()) { setExamMode(preferences->examMode(), Ion::ExamMode::get()); + m_firstUSBEnumeration = true; } // Update LED when exiting DFU mode Ion::LED::updateColorWithPlugAndCharge(); From 04dbeba389b6d2d5987faecb3c0cc7265eaa45d3 Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Thu, 30 May 2024 15:52:20 +0200 Subject: [PATCH 04/15] build: Version 23.2.0 --- build/config.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/config.mak b/build/config.mak index f0bb8b9d722..f4472d512c8 100644 --- a/build/config.mak +++ b/build/config.mak @@ -4,7 +4,7 @@ PLATFORM ?= device DEBUG ?= 0 DEVELOPMENT ?= 0 -EPSILON_VERSION ?= 23.1.0 +EPSILON_VERSION ?= 23.2.0 EXTERNAL_APPS_API_LEVEL ?= 0 EPSILON_APPS ?= calculation graph code statistics distributions inference solver sequence regression elements finance settings EPSILON_GETOPT ?= 0 From a9ac0416edfaea50b1ea68ad92d9990cc3e2efdc Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Thu, 20 Jun 2024 10:42:50 +0200 Subject: [PATCH 05/15] chore(epsilon-core): update submodule for new screens --- ion/src/device/epsilon-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ion/src/device/epsilon-core b/ion/src/device/epsilon-core index c7fe4276f64..004fc40171c 160000 --- a/ion/src/device/epsilon-core +++ b/ion/src/device/epsilon-core @@ -1 +1 @@ -Subproject commit c7fe4276f6440c7a3de1dcad4d9f550d144188dd +Subproject commit 004fc40171c046fa35d563af9d05a8f4d67f57da From 0d2caebf9ca56ebfc9dd4e0112f5c433851fa676 Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Thu, 20 Jun 2024 14:01:21 +0200 Subject: [PATCH 06/15] build: version 23.2.1 --- build/config.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/config.mak b/build/config.mak index f4472d512c8..899a1fe5d9a 100644 --- a/build/config.mak +++ b/build/config.mak @@ -4,7 +4,7 @@ PLATFORM ?= device DEBUG ?= 0 DEVELOPMENT ?= 0 -EPSILON_VERSION ?= 23.2.0 +EPSILON_VERSION ?= 23.2.1 EXTERNAL_APPS_API_LEVEL ?= 0 EPSILON_APPS ?= calculation graph code statistics distributions inference solver sequence regression elements finance settings EPSILON_GETOPT ?= 0 From 7d2aa598284f493aa739f69a9d1539d32babf2d1 Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Fri, 5 Jul 2024 18:13:47 +0200 Subject: [PATCH 07/15] chore(epsilon-core): update submodule to fix bulk update --- ion/src/device/epsilon-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ion/src/device/epsilon-core b/ion/src/device/epsilon-core index 004fc40171c..e0db5481a71 160000 --- a/ion/src/device/epsilon-core +++ b/ion/src/device/epsilon-core @@ -1 +1 @@ -Subproject commit 004fc40171c046fa35d563af9d05a8f4d67f57da +Subproject commit e0db5481a71008e4064d98e5b4a6305bb974f681 From 6b9ee4f243aeb220e7eac0347051dd7a06a52ce8 Mon Sep 17 00:00:00 2001 From: Pia Chancerel Date: Mon, 8 Jul 2024 10:07:03 +0200 Subject: [PATCH 08/15] build: Version 23.2.2 --- build/config.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/config.mak b/build/config.mak index 899a1fe5d9a..37669d509c1 100644 --- a/build/config.mak +++ b/build/config.mak @@ -4,7 +4,7 @@ PLATFORM ?= device DEBUG ?= 0 DEVELOPMENT ?= 0 -EPSILON_VERSION ?= 23.2.1 +EPSILON_VERSION ?= 23.2.2 EXTERNAL_APPS_API_LEVEL ?= 0 EPSILON_APPS ?= calculation graph code statistics distributions inference solver sequence regression elements finance settings EPSILON_GETOPT ?= 0 From 945f9d09767612182c667447081073c9ca5bd5aa Mon Sep 17 00:00:00 2001 From: Hugo Saint-Vignes Date: Wed, 10 Jul 2024 16:31:02 +0200 Subject: [PATCH 09/15] test(windows): Deactivate faulty tests on windows --- apps/calculation/test/calculation_store.cpp | 7 ++++--- apps/code/test/python_variable_box.cpp | 2 ++ build/platform.simulator.windows.mak | 2 ++ poincare/test/approximation.cpp | 5 +++++ python/test/basics.cpp | 2 ++ python/test/ion.cpp | 4 ++++ python/test/kandinsky.cpp | 4 ++++ python/test/math.cpp | 4 ++++ python/test/matplotlib.cpp | 18 ++++++++++++++++++ python/test/numpy.cpp | 2 ++ python/test/random.cpp | 2 ++ python/test/time.cpp | 2 ++ python/test/turtle.cpp | 6 ++++++ 13 files changed, 57 insertions(+), 3 deletions(-) diff --git a/apps/calculation/test/calculation_store.cpp b/apps/calculation/test/calculation_store.cpp index 06c64adda36..de6c747f2c9 100644 --- a/apps/calculation/test/calculation_store.cpp +++ b/apps/calculation/test/calculation_store.cpp @@ -912,9 +912,10 @@ QUIZ_CASE(calculation_additional_results) { assertCalculationAdditionalResultTypeHas("√(-1)", {}, &globalContext, &store); assertCalculationAdditionalResultTypeHas("{1}", {}, &globalContext, &store); assertCalculationAdditionalResultTypeHas("{i}", {}, &globalContext, &store); - /* TODO: Not working on windows - * assertCalculationAdditionalResultTypeHas("i^(2×e^(7i^(2×e^322)))", {}, - * &globalContext, &store);*/ +#ifndef PLATFORM_WINDOWS + assertCalculationAdditionalResultTypeHas("i^(2×e^(7i^(2×e^322)))", {}, + &globalContext, &store); +#endif assertCalculationAdditionalResultTypeHas("ln(3+4)", {}, &globalContext, &store); diff --git a/apps/code/test/python_variable_box.cpp b/apps/code/test/python_variable_box.cpp index 2520ee6296b..9e643aa93a9 100644 --- a/apps/code/test/python_variable_box.cpp +++ b/apps/code/test/python_variable_box.cpp @@ -58,8 +58,10 @@ void assert_variables_are(const char *script, } QUIZ_CASE(python_variable_box) { +#ifndef PLATFORM_WINDOWS const char *expectedVariables[] = {"froo", "from", "frozenset()"}; // FIXME This test does not load imported variables for now assert_variables_are("\x01 from math import *\nfroo=3", 21, 2, expectedVariables, std::size(expectedVariables)); +#endif } diff --git a/build/platform.simulator.windows.mak b/build/platform.simulator.windows.mak index ad3e62e435f..1022bc8908c 100644 --- a/build/platform.simulator.windows.mak +++ b/build/platform.simulator.windows.mak @@ -3,3 +3,5 @@ EXE = exe EPSILON_TELEMETRY ?= 0 TERMS_OF_USE ?= 0 + +SFLAGS += -DPLATFORM_WINDOWS diff --git a/poincare/test/approximation.cpp b/poincare/test/approximation.cpp index 7f5f8b5b5f0..f965dc9837e 100644 --- a/poincare/test/approximation.cpp +++ b/poincare/test/approximation.cpp @@ -1125,12 +1125,15 @@ QUIZ_CASE(poincare_approximation_trigonometry_functions) { assert_expression_approximates_to("1/cot(Ï€/2)", Undefined::Name(), Radian); // tan(almost Ï€/2) +#ifndef PLATFORM_WINDOWS assert_expression_approximates_to("tan(1.57079632)", "147169276.57047", Radian); assert_expression_approximates_to("sin(1.57079632)/cos(1.57079632)", "147169276.57047", Radian); assert_expression_approximates_to("1/cot(1.57079632)", "147169276.57047", Radian); +#endif + // Advanced function : cot assert_expression_approximates_to("cot(2)", "-0.45765755436029", Radian); @@ -1145,6 +1148,7 @@ QUIZ_CASE(poincare_approximation_trigonometry_functions) { Radian); assert_expression_approximates_to("cos(Ï€/2)/sin(Ï€/2)", "0", Radian); assert_expression_approximates_to("cot(Ï€/2)", "0", Radian); +#ifndef PLATFORM_WINDOWS // cot(almost Ï€/2) assert_expression_approximates_to("1/tan(1.57079632)", "6.7948964845335á´‡-9", Radian); @@ -1152,6 +1156,7 @@ QUIZ_CASE(poincare_approximation_trigonometry_functions) { "6.7948964845335á´‡-9", Radian); assert_expression_approximates_to("cot(1.57079632)", "6.7948964845335á´‡-9", Radian); +#endif /* acos: [-1,1] -> R * ]-inf,-1[ -> Ï€+R×i (odd imaginary) diff --git a/python/test/basics.cpp b/python/test/basics.cpp index 8bbd7cc4d6d..652a3254f0a 100644 --- a/python/test/basics.cpp +++ b/python/test/basics.cpp @@ -64,7 +64,9 @@ QUIZ_CASE(python_template) { } QUIZ_CASE(python_fixes) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_fails(env, "'abcd'*2**62"); deinit_environment(); +#endif } diff --git a/python/test/ion.cpp b/python/test/ion.cpp index 3e1d00f808b..802b845f78d 100644 --- a/python/test/ion.cpp +++ b/python/test/ion.cpp @@ -3,6 +3,7 @@ #include "execution_environment.h" QUIZ_CASE(python_ion_import) { +#ifndef PLATFORM_WINDOWS // Test "from ion import *" TestExecutionEnvironment env = init_environement(); assert_command_execution_fails(env, "keydown(KEY_LEFT)"); @@ -16,11 +17,14 @@ QUIZ_CASE(python_ion_import) { assert_command_execution_succeeds(env, "import ion"); assert_command_execution_succeeds(env, "ion.keydown(ion.KEY_LEFT)"); deinit_environment(); +#endif } QUIZ_CASE(python_ion_keydown) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from ion import *"); assert_command_execution_succeeds(env, "keydown(KEY_LEFT)", "False\n"); deinit_environment(); +#endif } diff --git a/python/test/kandinsky.cpp b/python/test/kandinsky.cpp index ed98741019c..92c405dabd3 100644 --- a/python/test/kandinsky.cpp +++ b/python/test/kandinsky.cpp @@ -3,6 +3,7 @@ #include "execution_environment.h" QUIZ_CASE(python_kandinsky_import) { +#ifndef PLATFORM_WINDOWS // Test "from kandinsky import *" TestExecutionEnvironment env = init_environement(); assert_command_execution_fails(env, "get_pixel(0,0)"); @@ -16,9 +17,11 @@ QUIZ_CASE(python_kandinsky_import) { assert_command_execution_succeeds(env, "import kandinsky"); assert_command_execution_succeeds(env, "kandinsky.get_pixel(0,0)"); deinit_environment(); +#endif } QUIZ_CASE(python_kandinsky_basics) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from kandinsky import *"); assert_command_execution_succeeds(env, "set_pixel(0,0,color(12,12,12))"); @@ -26,4 +29,5 @@ QUIZ_CASE(python_kandinsky_basics) { assert_command_execution_succeeds(env, "fill_rect(0,0,10,10,color(2,3,2))"); assert_command_execution_succeeds(env, "draw_string('hello',0,0)"); deinit_environment(); +#endif } diff --git a/python/test/math.cpp b/python/test/math.cpp index 7c99731fbb0..3756be322a5 100644 --- a/python/test/math.cpp +++ b/python/test/math.cpp @@ -3,6 +3,7 @@ #include "execution_environment.h" QUIZ_CASE(python_math) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from math import *"); assert_command_execution_succeeds(env, "e", "2.718281828459045\n"); @@ -59,9 +60,11 @@ QUIZ_CASE(python_math) { "9000000009000000009\n"); assert_command_execution_succeeds(env, "gcd()", "0\n"); deinit_environment(); +#endif } QUIZ_CASE(python_cmath) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from cmath import *"); assert_command_execution_succeeds(env, "cos(0)", "(1+-0j)\n"); @@ -88,4 +91,5 @@ QUIZ_CASE(python_cmath) { */ // clang-format on deinit_environment(); +#endif } diff --git a/python/test/matplotlib.cpp b/python/test/matplotlib.cpp index 628befa853b..2ae4470c07f 100644 --- a/python/test/matplotlib.cpp +++ b/python/test/matplotlib.cpp @@ -3,6 +3,7 @@ #include "execution_environment.h" QUIZ_CASE(python_matplotlib_pyplot_import) { +#ifndef PLATFORM_WINDOWS // Test "from matplotlib.pyplot import *" TestExecutionEnvironment env = init_environement(); assert_command_execution_fails(env, "arrow(2,3,4,5)"); @@ -30,9 +31,11 @@ QUIZ_CASE(python_matplotlib_pyplot_import) { assert_command_execution_succeeds(env, "import matplotlib.pyplot"); assert_command_execution_succeeds(env, "matplotlib.pyplot.arrow(2,3,4,5)"); deinit_environment(); +#endif } QUIZ_CASE(python_matplotlib_pyplot_arrow) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from matplotlib.pyplot import *"); assert_command_execution_succeeds(env, "arrow(2,3,4,5)"); @@ -43,9 +46,11 @@ QUIZ_CASE(python_matplotlib_pyplot_arrow) { assert_command_execution_succeeds(env, "arrow(2,3,4,5,color=\"red\")"); assert_command_execution_succeeds(env, "show()"); deinit_environment(); +#endif } QUIZ_CASE(python_matplotlib_pyplot_axis) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from matplotlib.pyplot import *"); assert_command_execution_succeeds(env, "axis((2,3,4,5))"); @@ -54,9 +59,11 @@ QUIZ_CASE(python_matplotlib_pyplot_axis) { assert_command_execution_succeeds(env, "show()"); assert_command_execution_fails(env, "axis(2,3,4,5)"); deinit_environment(); +#endif } QUIZ_CASE(python_matplotlib_pyplot_bar) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from matplotlib.pyplot import *"); assert_command_execution_succeeds(env, "bar([0,2,3],[10,12,23])"); @@ -75,17 +82,21 @@ QUIZ_CASE(python_matplotlib_pyplot_bar) { assert_command_execution_fails(env, "bar(1,[])"); assert_command_execution_fails(env, "bar(1,[1,2,3],[])"); deinit_environment(); +#endif } QUIZ_CASE(python_matplotlib_pyplot_grid) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from matplotlib.pyplot import *"); assert_command_execution_succeeds(env, "grid(True)"); assert_command_execution_succeeds(env, "grid()"); deinit_environment(); +#endif } QUIZ_CASE(python_matplotlib_pyplot_hist) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from matplotlib.pyplot import *"); assert_command_execution_succeeds(env, "hist(0)"); @@ -97,9 +108,11 @@ QUIZ_CASE(python_matplotlib_pyplot_hist) { env, "hist([2,3,4,5,6],[0,2,3, 4,5,6,7], color=(0,255,0))"); assert_command_execution_succeeds(env, "show()"); deinit_environment(); +#endif } QUIZ_CASE(python_matplotlib_pyplot_plot) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from matplotlib.pyplot import *"); assert_command_execution_succeeds(env, "plot([2,3,4,5,6])"); @@ -110,9 +123,11 @@ QUIZ_CASE(python_matplotlib_pyplot_plot) { assert_command_execution_succeeds(env, "show()"); assert_command_execution_fails(env, "plot([2,3,4,5,6],2)"); deinit_environment(); +#endif } QUIZ_CASE(python_matplotlib_pyplot_scatter) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from matplotlib.pyplot import *"); assert_command_execution_succeeds(env, "scatter(2,3)"); @@ -124,12 +139,15 @@ QUIZ_CASE(python_matplotlib_pyplot_scatter) { assert_command_execution_fails(env, "scatter(2)"); assert_command_execution_succeeds(env, "scatter(2,3,4)"); deinit_environment(); +#endif } QUIZ_CASE(python_matplotlib_pyplot_text) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from matplotlib.pyplot import *"); assert_command_execution_succeeds(env, "text(2,3,'hello')"); assert_command_execution_succeeds(env, "show()"); deinit_environment(); +#endif } diff --git a/python/test/numpy.cpp b/python/test/numpy.cpp index 6ed2c71403c..e01e541bf2d 100644 --- a/python/test/numpy.cpp +++ b/python/test/numpy.cpp @@ -3,6 +3,7 @@ #include "execution_environment.h" QUIZ_CASE(python_numpy) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); // Test "from matplotlib.pyplot import *" assert_command_execution_fails(env, "np.array([1,3,4])"); @@ -64,4 +65,5 @@ QUIZ_CASE(python_numpy) { assert_command_execution_succeeds(env, "np.arange(0,0)", "array([])\n"); assert_command_execution_fails(env, "np.arange(0,3,0)"); assert_command_execution_fails(env, "np.concatenate((0,0))"); +#endif } diff --git a/python/test/random.cpp b/python/test/random.cpp index 93df0224bbe..1df2f73da1e 100644 --- a/python/test/random.cpp +++ b/python/test/random.cpp @@ -3,6 +3,7 @@ #include "execution_environment.h" QUIZ_CASE(python_random) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_fails(env, "random()"); assert_command_execution_succeeds(env, "from random import *"); @@ -15,4 +16,5 @@ QUIZ_CASE(python_random) { assert_command_execution_succeeds(env, "uniform(0.3,2.1)", "1.509734470828188\n"); deinit_environment(); +#endif } diff --git a/python/test/time.cpp b/python/test/time.cpp index d14354d185e..a6d89b6d67d 100644 --- a/python/test/time.cpp +++ b/python/test/time.cpp @@ -3,10 +3,12 @@ #include "execution_environment.h" QUIZ_CASE(python_time) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_fails(env, "monotonic()"); assert_command_execution_succeeds(env, "from time import *"); assert_command_execution_succeeds(env, "monotonic()"); assert_command_execution_succeeds(env, "sleep(23)"); deinit_environment(); +#endif } diff --git a/python/test/turtle.cpp b/python/test/turtle.cpp index d98c8584860..6f3191446ea 100644 --- a/python/test/turtle.cpp +++ b/python/test/turtle.cpp @@ -5,6 +5,7 @@ // TODO: to be completed QUIZ_CASE(python_turtle) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_fails(env, "forward(3)"); assert_command_execution_succeeds(env, "from turtle import *"); @@ -25,9 +26,11 @@ QUIZ_CASE(python_turtle) { assert_command_execution_succeeds(env, "isdown()", "False\n"); assert_command_execution_succeeds(env, "showturtle()"); deinit_environment(); +#endif } QUIZ_CASE(python_turtle_circle) { +#ifndef PLATFORM_WINDOWS // Turtle position should be unchanged after a complete circle TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from turtle import *"); @@ -36,9 +39,11 @@ QUIZ_CASE(python_turtle_circle) { // FIXME: this is actually not true // assert_command_execution_succeeds(env, "position()", "(0.0, 0.0)\n"); deinit_environment(); +#endif } QUIZ_CASE(python_turtle_distance) { +#ifndef PLATFORM_WINDOWS TestExecutionEnvironment env = init_environement(); assert_command_execution_succeeds(env, "from turtle import *"); assert_command_execution_succeeds(env, "goto(10,10)"); @@ -53,4 +58,5 @@ QUIZ_CASE(python_turtle_distance) { assert_command_execution_fails(env, "distance(,10)"); assert_command_execution_fails(env, "distance(10,)"); deinit_environment(); +#endif } From 70f257a9920531fd73f0c3f80d97337382d876eb Mon Sep 17 00:00:00 2001 From: Hugo Saint-Vignes Date: Wed, 10 Jul 2024 17:22:45 +0200 Subject: [PATCH 10/15] ci: Add more options for platforms --- .github/workflows/ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bc7b47c60f..121dba1483e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,15 @@ on: ios: type: boolean default: 'true' + web: + type: boolean + default: 'true' + device: + type: boolean + default: 'true' + linux: + type: boolean + default: 'true' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -43,6 +52,7 @@ jobs: path: output/release/simulator/android/epsilon.apk device: runs-on: ${{ (github.repository == 'numworks/epsilon-internal') && 'self-hosted' || 'ubuntu-latest' }} + if: ${{ github.event.inputs.device == 'true' }} strategy: matrix: model: [n0110, n0115, n0120] @@ -99,6 +109,7 @@ jobs: path: output/release/simulator/windows/epsilon.exe web: runs-on: ${{ (github.repository == 'numworks/epsilon-internal') && 'self-hosted' || 'ubuntu-latest' }} + if: ${{ github.event.inputs.web == 'true' }} steps: - uses: numworks/setup-emscripten@latest with: @@ -114,6 +125,7 @@ jobs: retention-days: 7 linux: runs-on: ${{ (github.repository == 'numworks/epsilon-internal') && 'self-hosted' || 'ubuntu-latest' }} + if: ${{ github.event.inputs.linux == 'true' }} steps: - uses: numworks/setup-llvm@latest - uses: actions/checkout@v3 From 42b5cc1996672a3123079fd23bac00b78324c2f1 Mon Sep 17 00:00:00 2001 From: Hugo Saint-Vignes Date: Thu, 11 Jul 2024 11:19:28 +0200 Subject: [PATCH 11/15] ci: Faster public CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 121dba1483e..19dd8d54449 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ concurrency: cancel-in-progress: true env: - MAKEFLAGS: ${{ (github.repository == 'numworks/epsilon-internal') && '-j32' || '-j2' }} + MAKEFLAGS: ${{ (github.repository == 'numworks/epsilon-internal') && '-j32' || '-j4' }} jobs: android: From 35a8a17ba25b118d5e448c5273d803e16681071a Mon Sep 17 00:00:00 2001 From: Hugo Saint-Vignes Date: Thu, 11 Jul 2024 15:27:36 +0200 Subject: [PATCH 12/15] ci: Reactivate simple jobs on push or pull_request --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19dd8d54449..c54682366ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: path: output/release/simulator/android/epsilon.apk device: runs-on: ${{ (github.repository == 'numworks/epsilon-internal') && 'self-hosted' || 'ubuntu-latest' }} - if: ${{ github.event.inputs.device == 'true' }} + if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.device == 'true' }} strategy: matrix: model: [n0110, n0115, n0120] @@ -109,7 +109,7 @@ jobs: path: output/release/simulator/windows/epsilon.exe web: runs-on: ${{ (github.repository == 'numworks/epsilon-internal') && 'self-hosted' || 'ubuntu-latest' }} - if: ${{ github.event.inputs.web == 'true' }} + if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.web == 'true' }} steps: - uses: numworks/setup-emscripten@latest with: @@ -125,7 +125,7 @@ jobs: retention-days: 7 linux: runs-on: ${{ (github.repository == 'numworks/epsilon-internal') && 'self-hosted' || 'ubuntu-latest' }} - if: ${{ github.event.inputs.linux == 'true' }} + if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.linux == 'true' }} steps: - uses: numworks/setup-llvm@latest - uses: actions/checkout@v3 From 78a7d23ea8c91d4901d5336f7c39bbdcda30510e Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Mon, 15 Jul 2024 10:35:22 +0200 Subject: [PATCH 13/15] chore(epsilon-internal): update submodule to fix charging led --- ion/src/device/epsilon-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ion/src/device/epsilon-core b/ion/src/device/epsilon-core index e0db5481a71..d87a374ea37 160000 --- a/ion/src/device/epsilon-core +++ b/ion/src/device/epsilon-core @@ -1 +1 @@ -Subproject commit e0db5481a71008e4064d98e5b4a6305bb974f681 +Subproject commit d87a374ea3780190fe37af4acb411bd0e7185513 From 9072ab80a16d4c15222699f73896282a65eecd54 Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Mon, 15 Jul 2024 10:37:22 +0200 Subject: [PATCH 14/15] build: version 23.2.3 --- build/config.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/config.mak b/build/config.mak index 37669d509c1..4e08e65dd2e 100644 --- a/build/config.mak +++ b/build/config.mak @@ -4,7 +4,7 @@ PLATFORM ?= device DEBUG ?= 0 DEVELOPMENT ?= 0 -EPSILON_VERSION ?= 23.2.2 +EPSILON_VERSION ?= 23.2.3 EXTERNAL_APPS_API_LEVEL ?= 0 EPSILON_APPS ?= calculation graph code statistics distributions inference solver sequence regression elements finance settings EPSILON_GETOPT ?= 0 From b5348c370556d7bcabbbf3b0ec0d2b992d45a372 Mon Sep 17 00:00:00 2001 From: mpv <119410972+MartiPuigV@users.noreply.github.com> Date: Fri, 3 Oct 2025 09:19:29 +0200 Subject: [PATCH 15/15] Update script_template.cpp Optimized the Mandelbrot default script. The Mandelbrot set is symmetric around the x-axis. We only need to compute the upper (or lower) half and copy that over. --- apps/code/script_template.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/code/script_template.cpp b/apps/code/script_template.cpp index 0cd78c98193..6ec3b7c5e39 100644 --- a/apps/code/script_template.cpp +++ b/apps/code/script_template.cpp @@ -27,7 +27,7 @@ constexpr ScriptTemplate mandelbrotScriptTemplate( import kandinsky def mandelbrot(N_iteration): for x in range(320): - for y in range(222): + for y in range(112): # Compute the mandelbrot sequence for the point c = (c_r, c_i) with start value z = (z_r, z_i) z = complex(0,0) # Rescale to fit the drawing screen 320x222 @@ -40,7 +40,8 @@ def mandelbrot(N_iteration): rgb = int(255*i/N_iteration) col = kandinsky.color(int(rgb),int(rgb*0.75),int(rgb*0.25)) # Draw a pixel colored in 'col' at position (x,y) - kandinsky.set_pixel(x,y,col))"); + kandinsky.set_pixel(x,y,col) + kandinsky.set_pixel(x,222-y,col))"); constexpr ScriptTemplate polynomialScriptTemplate("polynomial.py", R"(from math import *