From 0f4502ebce4e6c23456a55b8719ca27d4d8ef248 Mon Sep 17 00:00:00 2001 From: Laury Date: Sun, 5 Sep 2021 16:27:44 +0200 Subject: [PATCH] [code/ulab] Added scipy --- apps/code/catalog.de.i18n | 6 +++++ apps/code/catalog.en.i18n | 6 +++++ apps/code/catalog.es.i18n | 6 +++++ apps/code/catalog.fr.i18n | 6 +++++ apps/code/catalog.hu.i18n | 6 +++++ apps/code/catalog.it.i18n | 6 +++++ apps/code/catalog.nl.i18n | 6 +++++ apps/code/catalog.pt.i18n | 6 +++++ apps/code/catalog.universal.i18n | 22 ++++++++++++++++++ apps/code/python_toolbox.cpp | 38 ++++++++++++++++++++++++++++++++ apps/code/toolbox.universal.i18n | 5 +++++ 11 files changed, 113 insertions(+) diff --git a/apps/code/catalog.de.i18n b/apps/code/catalog.de.i18n index da6c16f99..d168f9c13 100644 --- a/apps/code/catalog.de.i18n +++ b/apps/code/catalog.de.i18n @@ -75,6 +75,7 @@ PythonImportRandom = "Random-Modul importieren" PythonImportMath = "Math-Modul importieren" PythonImportMatplotlibPyplot = "Matplotlib.pyplot-Modul importieren" PythonImportNumpy = "Ulab.numpy-Modul importieren" +PythonImportScipy = "Ulab.scipy-Modul importieren" PythonImportOs = "OS-Modul importieren" PythonOsUname = "Informationen über das System holen" PythonOsGetlogin = "Benutzernamen holen" @@ -108,6 +109,11 @@ PythonMonotonic = "Wert einer monotonen Uhr" PythonNumpyFunction = "numpy Modul-Präfix" PythonNumpyFftFunction = "numpy.fft Modul-Präfix" PythonNumpyLinalgFunction = "numpy.linalg Modul-Präfix" +PythonScipyFunction = "scipy Modul-Präfix" +PythonScipyLinalgFunction = "scipy.linalg Modul-Präfix" +PythonScipyOptimizeFunction = "scipy.optimize Modul-Präfix" +PythonScipySignalFunction = "scipy.signal Modul-Präfix" +PythonScipySpecialFunction = "scipy.special Modul-Präfix" PythonOct = "Ganzzahl in Oktal umwandeln" PythonPhase = "Phase von z" PythonPlot = "Plotten von y gegen x als Linien" diff --git a/apps/code/catalog.en.i18n b/apps/code/catalog.en.i18n index 363dd820e..3b5a707bf 100644 --- a/apps/code/catalog.en.i18n +++ b/apps/code/catalog.en.i18n @@ -75,6 +75,7 @@ PythonImportRandom = "Import random module" PythonImportMath = "Import math module" PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module" PythonImportNumpy = "Import ulab.numpy module" +PythonImportScipy = "Import ulab.scipy module" PythonImportTime = "Import time module" PythonImportTurtle = "Import turtle module" PythonIndex = "Index of the first x occurrence" @@ -102,6 +103,11 @@ PythonMonotonic = "Value of a monotonic clock" PythonNumpyFunction = "numpy module prefix" PythonNumpyFftFunction = "numpy.fft module prefix" PythonNumpyLinalgFunction = "numpy.linalg module prefix" +PythonScipyFunction = "scipy module prefix" +PythonScipyLinalgFunction = "scipy.linalg module prefix" +PythonScipyOptimizeFunction = "scipy.optimize module prefix" +PythonScipySignalFunction = "scipy.signal module prefix" +PythonScipySpecialFunction = "scipy.special module prefix" PythonOct = "Convert integer to octal" PythonPhase = "Phase of z" PythonPlot = "Plot y versus x as lines" diff --git a/apps/code/catalog.es.i18n b/apps/code/catalog.es.i18n index d39456839..09ad6235d 100644 --- a/apps/code/catalog.es.i18n +++ b/apps/code/catalog.es.i18n @@ -75,6 +75,7 @@ PythonImportRandom = "Import random module" PythonImportMath = "Import math module" PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module" PythonImportNumpy = "Import ulab.numpy module" +PythonImportScipy = "Import ulab.scipy module" PythonImportTime = "Import time module" PythonImportTurtle = "Import turtle module" PythonIndex = "Index of the first x occurrence" @@ -102,6 +103,11 @@ PythonMonotonic = "Value of a monotonic clock" PythonNumpyFunction = "numpy module prefix" PythonNumpyFftFunction = "numpy.fft module prefix" PythonNumpyLinalgFunction = "numpy.linalg module prefix" +PythonScipyFunction = "scipy module prefix" +PythonScipyLinalgFunction = "scipy.linalg module prefix" +PythonScipyOptimizeFunction = "scipy.optimize module prefix" +PythonScipySignalFunction = "scipy.signal module prefix" +PythonScipySpecialFunction = "scipy.special module prefix" PythonOct = "Convert integer to octal" PythonPhase = "Phase of z" PythonPlot = "Plot y versus x as lines" diff --git a/apps/code/catalog.fr.i18n b/apps/code/catalog.fr.i18n index d8d9daced..af0676142 100644 --- a/apps/code/catalog.fr.i18n +++ b/apps/code/catalog.fr.i18n @@ -75,6 +75,7 @@ PythonImportRandom = "Importation du module random" PythonImportMath = "Importation du module math" PythonImportMatplotlibPyplot = "Importation de matplotlib.pyplot" PythonImportNumpy = "Importation de ulab.numpy" +PythonImportScipy = "Importation de ulab.scipy" PythonImportTurtle = "Importation du module turtle" PythonImportTime = "Importation du module time" PythonIndex = "Indice première occurrence de x" @@ -102,6 +103,11 @@ PythonMonotonic = "Renvoie la valeur de l'horloge" PythonNumpyFunction = "Préfixe fonction du module numpy" PythonNumpyFftFunction = "Préfixe fonction du module numpy.fft" PythonNumpyLinalgFunction = "Préfixe fonction du module numpy.linalg" +PythonScipyFunction = "Préfixe fonction du module scipy" +PythonScipyLinalgFunction = "Préfixe fonction du module scipy.linalg" +PythonScipyOptimizeFunction = "Préfixe fonction du module scipy.optimize" +PythonScipySignalFunction = "Préfixe fonction du module scipy.signal" +PythonScipySpecialFunction = "Préfixe fonction du module scipy.special" PythonOct = "Conversion en octal" PythonPhase = "Argument de z" PythonPlot = "Trace y en fonction de x" diff --git a/apps/code/catalog.hu.i18n b/apps/code/catalog.hu.i18n index b2011816b..b64a41192 100644 --- a/apps/code/catalog.hu.i18n +++ b/apps/code/catalog.hu.i18n @@ -75,6 +75,7 @@ PythonImportRandom = "Véletlenszerü modul importálása" PythonImportMath = "math modul importálása" PythonImportMatplotlibPyplot = "matplotlib.pyplot modul importálása" PythonImportNumpy = "ulab.numpy modul importálása" +PythonImportScipy = "ulab.scipy modul importálása" PythonImportTurtle = "turtle modul importálása" PythonImportTime = "time modul importálása" PythonIndex = "Az elsö x esemény indexe" @@ -102,6 +103,11 @@ PythonMonotonic = "Az óra értékét adja vissza" PythonNumpyFunction = "numpy elötag" PythonNumpyFftFunction = "numpy.fft elötag" PythonNumpyLinalgFunction = "numpy.linalg elötag" +PythonScipyFunction = "scipy elötag" +PythonScipyLinalgFunction = "scipy.linalg elötag" +PythonScipyOptimizeFunction = "scipy.optimize elötag" +PythonScipySignalFunction = "scipy.signal elötag" +PythonScipySpecialFunction = "scipy.special elötag" PythonOct = "Decimális szám konvertálása octális számra" PythonPhase = "z fázisa" PythonPlot = "y-t jelöli x függvényében" diff --git a/apps/code/catalog.it.i18n b/apps/code/catalog.it.i18n index 8627e679c..2a61d0a5b 100644 --- a/apps/code/catalog.it.i18n +++ b/apps/code/catalog.it.i18n @@ -75,6 +75,7 @@ PythonImportRandom = "Importa modulo random" PythonImportMath = "Importa modulo math" PythonImportMatplotlibPyplot = "Importa modulo matplotlib.pyplot" PythonImportNumpy = "Importa modulo ulab.numpy" +PythonImportScipy = "Importa modulo ulab.scipy" PythonImportTurtle = "Importa del modulo turtle" PythonImportTime = "Importa del modulo time" PythonImportOs = "Importa modulo os" @@ -108,6 +109,11 @@ PythonMonotonic = "Restituisce il valore dell'orologio" PythonNumpyFunction = "Prefisso modulo numpy" PythonNumpyFftFunction = "Prefisso modulo numpy.fft" PythonNumpyLinalgFunction = "Prefisso modulo numpy.linalg" +PythonScipyFunction = "Prefisso modulo scipy" +PythonScipyLinalgFunction = "Prefisso modulo scipy.linalg" +PythonScipyOptimizeFunction = "Prefisso modulo scipy.optimize" +PythonScipySignalFunction = "Prefisso modulo scipy.signal" +PythonScipySpecialFunction = "Prefisso modulo scipy.special" PythonOct = "Conversione in ottale" PythonPhase = "Argomento di z" PythonPlot = "Disegna y in f. di x come linee" diff --git a/apps/code/catalog.nl.i18n b/apps/code/catalog.nl.i18n index f46b4606f..1d8349e24 100644 --- a/apps/code/catalog.nl.i18n +++ b/apps/code/catalog.nl.i18n @@ -75,6 +75,7 @@ PythonImportRandom = "Importeer random module" PythonImportMath = "Importeer math module" PythonImportMatplotlibPyplot = "Importeer matplotlib.pyplot module" PythonImportNumpy = "Importeer ulab.numpy module" +PythonImportScipy = "Importeer ulab.scipy module" PythonImportTime = "Importeer time module" PythonImportOs = "Importeer os module" PythonOsUname = " Krijg systeeminfo" @@ -108,6 +109,11 @@ PythonMonotonic = "Waarde van een monotone klok" PythonNumpyFunction = "numpy module prefix" PythonNumpyFftFunction = "numpy.fft module prefix" PythonNumpyLinalgFunction = "numpy.linalg module prefix" +PythonScipyFunction = "scipy module prefix" +PythonScipyLinalgFunction = "scipy.linalg module prefix" +PythonScipyOptimizeFunction = "scipy.optimize module prefix" +PythonScipySignalFunction = "scipy.signal module prefix" +PythonScipySpecialFunction = "scipy.special module prefix" PythonOct = "Integer omzetten naar octaal" PythonPhase = "Fase van z in radialen" PythonPlot = "Plot y versus x als lijnen" diff --git a/apps/code/catalog.pt.i18n b/apps/code/catalog.pt.i18n index 513297365..394728507 100644 --- a/apps/code/catalog.pt.i18n +++ b/apps/code/catalog.pt.i18n @@ -75,6 +75,7 @@ PythonImportRandom = "Importar módulo random" PythonImportMath = "Importar módulo math" PythonImportMatplotlibPyplot = "Importar módulo matplotlib.pyplot" PythonImportNumpy = "Importar módulo ulab.numpy" +PythonImportScipy = "Importar módulo ulab.scipy" PythonImportTime = "Importar módulo time" PythonImportTurtle = "Importar módulo turtle" PythonIndex = "Índice da primeira ocorrência de x" @@ -102,6 +103,11 @@ PythonMonotonic = "Devolve o valor do relógio" PythonNumpyFunction = "Prefixo do módulo numpy" PythonNumpyFftFunction = "Prefixo do módulo numpy.fft" PythonNumpyLinalgFunction = "Prefixo do módulo numpy.linalg" +PythonScipyFunction = "Prefixo do módulo scipy" +PythonScipyLinalgFunction = "Prefixo do módulo scipy.linalg" +PythonScipyOptimizeFunction = "Prefixo do módulo scipy.optimize" +PythonScipySignalFunction = "Prefixo do módulo scipy.signal" +PythonScipySpecialFunction = "Prefixo do módulo scipy.special" PythonOct = "Converter número inteiro em octal" PythonPhase = "Argumento de z" PythonPlot = "Desenhar y em função de x" diff --git a/apps/code/catalog.universal.i18n b/apps/code/catalog.universal.i18n index 106d57dbb..510fe65a0 100644 --- a/apps/code/catalog.universal.i18n +++ b/apps/code/catalog.universal.i18n @@ -91,6 +91,7 @@ PythonCommandImportKandinsky = "import kandinsky" PythonCommandImportMath = "import math" PythonCommandImportMatplotlibPyplot = "import matplotlib.pyplot" PythonCommandImportFromNumpy = "from ulab import numpy as np" +PythonCommandImportFromScipy = "from ulab import scipy as spy" PythonCommandImportRandom = "import random" PythonCommandImportOs = "import os" PythonCommandImportFromOs = "from os import *" @@ -306,6 +307,27 @@ PythonCommandReverseWithoutArg = ".reverse()" PythonCommandRound = "round(x,n)" PythonCommandScatter = "scatter(x,y)" PythonCommandSeed = "seed(x)" +PythonCommandScipyFunction = "spy.function" +PythonCommandScipyFunctionWithoutArg = "spy.\x11" +PythonCommandScipyLinalgFunction = "spy.linalg.function" +PythonCommandScipyLinalgFunctionWithoutArg = "spy.linalg.\x11" +PythonCommandScipyOptimizeFunction = "spy.optimize.function" +PythonCommandScipyOptimizeFunctionWithoutArg = "spy.optimize.\x11" +PythonCommandScipySignalFunction = "spy.signal.function" +PythonCommandScipySignalFunctionWithoutArg = "spy.signal.\x11" +PythonCommandScipySpecialFunction = "spy.special.function" +PythonCommandScipySpecialFunctionWithoutArg = "spy.special.\x11" +PythonCommandScipyLinalgChoSolve = "spy.linalg.cho_solve(a, b)" +PythonCommandScipyLinalgSolveTriangular = "spy.linalg.solve_triangular(a, b)" +PythonCommandScipyOptimizeBisect = "spy.optimize.bisect(f, a, b)" +PythonCommandScipyOptimizeFmin = "spy.optimize.fmin(f, x0)" +PythonCommandScipyOptimizeNewton = "spy.optimize.newton(f, x0)" +PythonCommandScipySignalSosfilt = "spy.signal.sosfilt(sos, x)" +PythonCommandScipySignalSpectrogram = "spy.signal.spectrogram(y)" +PythonCommandScipySpecialErf = "spy.erf(a)" +PythonCommandScipySpecialErfc = "spy.erfc(a)" +PythonCommandScipySpecialGamma = "spy.gamma(a)" +PythonCommandScipySpecialGammaln = "spy.gammaln(a)" PythonCommandSetPixel = "set_pixel(x,y,color)" PythonCommandShow = "show()" PythonCommandSin = "sin(x)" diff --git a/apps/code/python_toolbox.cpp b/apps/code/python_toolbox.cpp index 2a26f98a7..ef64e1b4d 100644 --- a/apps/code/python_toolbox.cpp +++ b/apps/code/python_toolbox.cpp @@ -252,8 +252,46 @@ const ToolboxMessageTree NumpyModuleChildren[] = { ToolboxMessageTree::Node(I18n::Message::NumpyLinalgModule, NumpyLinalgModuleChildren) }; +const ToolboxMessageTree ScipyLinalgModuleChildren[] = { + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyLinalgFunction, I18n::Message::PythonScipyLinalgFunction, false, I18n::Message::PythonCommandScipyLinalgFunctionWithoutArg), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyLinalgChoSolve), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyLinalgSolveTriangular) +}; + +const ToolboxMessageTree ScipyOptimizeModuleChildren[] = { + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyOptimizeFunction, I18n::Message::PythonScipyOptimizeFunction, false, I18n::Message::PythonCommandScipyOptimizeFunctionWithoutArg), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyOptimizeBisect), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyOptimizeFmin), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyOptimizeNewton) +}; + +const ToolboxMessageTree ScipySignalModuleChildren[] = { + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySignalFunction, I18n::Message::PythonScipySignalFunction, false, I18n::Message::PythonCommandScipySignalFunctionWithoutArg), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySignalSosfilt), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySignalSpectrogram) +}; + +const ToolboxMessageTree ScipySpecialModuleChildren[] = { + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySpecialFunction, I18n::Message::PythonScipySpecialFunction, false, I18n::Message::PythonCommandScipySpecialFunctionWithoutArg), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySpecialErf), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySpecialErfc), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySpecialGamma), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipySpecialGammaln), +}; + +const ToolboxMessageTree ScipyModuleChildren[] = { + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportFromScipy, I18n::Message::PythonImportScipy, false), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandScipyFunction, I18n::Message::PythonScipyFunction, false, I18n::Message::PythonCommandScipyFunctionWithoutArg), + ToolboxMessageTree::Node(I18n::Message::ScipyLinalgModule, ScipyLinalgModuleChildren), + ToolboxMessageTree::Node(I18n::Message::ScipyOptimizeModule, ScipyOptimizeModuleChildren), + ToolboxMessageTree::Node(I18n::Message::ScipySignalModule, ScipySignalModuleChildren), + ToolboxMessageTree::Node(I18n::Message::ScipySpecialModule, ScipySpecialModuleChildren), + +}; + const ToolboxMessageTree UlabModuleChildren[] = { ToolboxMessageTree::Node(I18n::Message::NumpyModule, NumpyModuleChildren), + ToolboxMessageTree::Node(I18n::Message::ScipyModule, ScipyModuleChildren), ToolboxMessageTree::Leaf(I18n::Message::UlabDocumentation, I18n::Message::UlabDocumentationLink) }; diff --git a/apps/code/toolbox.universal.i18n b/apps/code/toolbox.universal.i18n index 5a307394c..99810151a 100644 --- a/apps/code/toolbox.universal.i18n +++ b/apps/code/toolbox.universal.i18n @@ -6,6 +6,11 @@ MatplotlibPyplotModule = "matplotlib.pyplot" NumpyModule = "numpy" NumpyFftModule = "fft" NumpyLinalgModule = "linalg" +ScipyModule = "scipy" +ScipyLinalgModule = "linalg" +ScipyOptimizeModule = "optimize" +ScipySignalModule = "signal" +ScipySpecialModule = "special" NumpyNdarray = "ndarray" OsModule = "os" TimeModule = "time"