From 190ab8c5e1e3802b203895ca6991b5c32c7ccd9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Dupr=C3=A9?= Date: Mon, 21 Oct 2024 00:36:47 +0200 Subject: [PATCH 1/4] Update session 4 (#74) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * menu * latexé * add session 5 * fix style * sess6 * remove tix --- .gitignore | 2 + _doc/algorithm_culture.rst | 3 +- _doc/articles/2024/2024-11-31-route2024.rst | 176 ++++++++++++++++-- _doc/c_expose/finance/finance_autostrat.rst | 2 +- _doc/c_ml/rappel.rst | 9 +- _doc/conf.py | 36 ++-- _doc/examples/prog/plot_burrows_wheeler.py | 65 +++++++ _doc/practice/index_algo.rst | 1 + .../plus_court_chemin_correction.ipynb | 147 ++++++++++----- _doc/py/c_classes/classes.rst | 2 +- _doc/py/c_gui/tkinter.rst | 44 ++--- _latex/ensae/td_note_2017_rattrapage.tex | 48 ++--- pyproject.toml | 3 +- requirements-dev.txt | 3 +- teachpyx/tools/blockdiag_helper.py | 12 +- 15 files changed, 413 insertions(+), 140 deletions(-) create mode 100644 _doc/examples/prog/plot_burrows_wheeler.py diff --git a/.gitignore b/.gitignore index f7e46ea1..9bfcbdec 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,8 @@ _doc/sg_execution_times.rst _doc/CHANGELOGS.rst _doc/LICENSE.txt _doc/auto_examples/* +_doc/articles/2024/pyramide.png +_doc/articles/2024/tsp_simple.png _doc/examples/**/plot_*.png _doc/examples/**/plot_*.xlsx _doc/examples/prog/*.proto diff --git a/_doc/algorithm_culture.rst b/_doc/algorithm_culture.rst index 77aa0c6f..89b982bc 100644 --- a/_doc/algorithm_culture.rst +++ b/_doc/algorithm_culture.rst @@ -178,7 +178,8 @@ Catalogue d'algorithmes * `n-grammes `_ **déf** * `Algorithme d'Aho-Corasick `_ **algo**, voir aussi `Commentz-Walter `_ - * `Transformée de Burrows-Wheeler `_ **algo** + * `Transformée de Burrows-Wheeler `_ **algo**, + voir :ref:`burrowswheelerrst` * `algorithme Apriori `_ : apprentissage de règles d'associations **algo** * `Boyer–Moore string-search algorithm `_ * Optimisation diff --git a/_doc/articles/2024/2024-11-31-route2024.rst b/_doc/articles/2024/2024-11-31-route2024.rst index 83b7101d..5966e458 100644 --- a/_doc/articles/2024/2024-11-31-route2024.rst +++ b/_doc/articles/2024/2024-11-31-route2024.rst @@ -27,10 +27,43 @@ Séance 4 ++++++++ Nous garderons les dames et l'algortithme minimax pour une autre fois peut être. - -* :ref:`Distance d'édition `, -* :ref:`Pivot de Gauss `, - cet algorithme est la première étage pour inverser une matrice +Cette séance à propos de la programmation dynamique. +Le premier exercice consiste à déterminer le nombre minimal de pièces +de monnaie pour écrire un montant et de retrouver la séquence minimale +de pièces. On considère les pièces ``[1, 2, 4, 5]``. + +.. runpython:: + :showcode: + + def ecriture_minimale(n): + pieces = [1, 2, 4, 5] + min_pieces = [None for i in range(n+1)] + predecessor = [None for i in range(n+1)] + min_pieces[0] = 1 + for p in pieces: + min_pieces[p] = 1 + predecessor[p] = p + for i in range(n+1): + if min_pieces[i] is None: + # écriture impossible + continue + for p in pieces: + if i + p > n: + break + m = min_pieces[i] + 1 + if min_pieces[i + p] is None or m < min_pieces[i + p]: + min_pieces[i + p] = m + predecessor[i + p] = p + composition = [] + while n > 0: + composition.append(predecessor[n]) + n -= predecessor[n] + return min_pieces[n], composition + + print(ecriture_minimale(99)) + +On bascule ensuite vers la +:ref:`Distance d'édition `. A propos de la distance d'édition, voir aussi :ref:`Distance d'édition ` ou encore @@ -39,13 +72,8 @@ A propos de la distance d'édition, voir aussi Séance 5 ++++++++ -* :ref:`Le voyageur de commerce ` ou - `problème du sac à dos `_ -* :ref:`Recherche à base de préfixes ` - -Autres variations autour du problème du voyageur de commerce, -ou TSP pour Travelling Salesman Problem -ou encore circuit hamiltonien: :ref:`l-tsp_kohonen`, :ref:`l-tsp_kruskal`. +* :ref:`burrowswheelerrst` +* :ref:`Code de Vigenère ` Séance 6 ++++++++ @@ -53,7 +81,129 @@ Séance 6 * :ref:`Tracer une pyramide bigarrée ` * :ref:`Expressions régulières `, :ref:`Modules, fichiers, expression régulières ` - +* :ref:`Le voyageur de commerce ` ou + `problème du sac à dos `_ + +Evocation de la :ref:`Recherche à base de préfixes ` +en terme algorithmique. + +Autres variations autour du problème du voyageur de commerce, +ou TSP pour Travelling Salesman Problem +ou encore circuit hamiltonien: :ref:`l-tsp_kohonen`, :ref:`l-tsp_kruskal`. +Quelques bouts de code écrit durant la séance. +Tout d'abord les expressions régulières. + +.. runpython:: + :showcode: + + import re + + reg = re.compile("(-?[1-9][ 0-9]{0,16}([.,][0-9]{0,4})? *(€|(euros))?)") + text = "Le montant de 3000 euros auquel on a ôté 5,4 euros." + print(reg.findall(text)) + + reg = re.compile("([0-9]{1,2}[-/][0-9]{1,2}[-/][0-9]{2,4})") + text = "9/10/2024 09-10-24" + print(reg.findall(text)) + +Ensuite la pyramide. + +.. runpython:: + :rst: + :showcode: + + import math + import os + import matplotlib.pyplot as plt + + fig, ax = plt.subplots(1, 1) + x, y, colors = [], [], [] + cs = ["r", "b", "g"] + for i in range(0, 5): + for j in range(0, 5): + x.append(i - j * 0.5) + y.append(j * math.sqrt(3) / 2) + colors.append(cs[(2*i -j) % 3]) + size = [2000 for c in x] + ax.scatter(x, y, s=size, c=colors, alpha=0.5) + fig.savefig(os.path.join(__WD__, "pyramide.png")) + + text = ".. image:: pyramide.png" + print(text) + +Ensuite le voyageur de commerce. + +.. runpython:: + :rst: + :showcode: + + import itertools + import numpy as np + import matplotlib.pyplot as plt + + def show(villes): + fig, ax = plt.subplots(1, 1) + x = villes[:, 0].tolist() + [villes[0, 0]] + y = villes[:, 1].tolist() + [villes[0, 1]] + ax.plot(x, y, "o-") + ax.set_title(f"longueur {distance(villes)}") + return fig, ax + + def distance(villes): + # distance sans boucle + dall = villes[1:, :] - villes[:-1, :] + d = (dall[:, 0] ** 2 + dall[:, 1] ** 2) ** 0.5 + dlast = villes[0, :] - villes[-1, :] + d1 = (dlast[0] ** 2 + dlast[1] ** 2) ** 0.5 + return d.sum() + d1 + + def solution_permutations(villes): + bestp = list(range(villes.shape[0])) + bestd = distance(villes) + for p in itertools.permutations(list(range(villes.shape[0]))): + v2 = villes[list(p), :] + d2 = distance(v2) + if d2 < bestd: + bestd = d2 + bestp = list(p) + return villes[bestp, :] + + def solution_croisement(villes): + bestd = distance(villes) + bestv = villes + for i in range(0, villes.shape[0]): + for j in range(i+2, villes.shape[0]): + p = list(range(villes.shape[0])) + if i > 0: + p[i:j] = p[j-1:i-1:-1] + else: + p[i:j] = p[j-1::-1] + v2 = bestv[p, :] + d2 = distance(v2) + if d2 < bestd: + bestd = d2 + bestv = v2 + return bestv + + villes = np.random.rand(8, 2) + print("distance initiale", distance(villes)) + + # solution naive + print("-- optimisation gourmande...") + optim = solution_permutations(villes) + print("-- optimisation gourmande:", distance(optim)) + + print("-- optimisation plus rapide mais approchée...") + optim = solution_croisement(villes) + print("-- optimisation plus rapide mais approchée", distance(optim)) + + # graph + fig, ax = show(optim) + fig.savefig(os.path.join(__WD__, "tsp_simple.png")) + + text = ".. image:: tsp_simple.png" + print(text) + Séance 7 ++++++++ @@ -68,6 +218,8 @@ Séance 8 ++++++++ * :ref:`Optimisation de la note moyenne ` +* :ref:`Pivot de Gauss `, + cet algorithme est la première étage pour inverser une matrice TD noté 1h30 en seconde partie. Classes et un algorithme. diff --git a/_doc/c_expose/finance/finance_autostrat.rst b/_doc/c_expose/finance/finance_autostrat.rst index 37820115..da82f643 100644 --- a/_doc/c_expose/finance/finance_autostrat.rst +++ b/_doc/c_expose/finance/finance_autostrat.rst @@ -1202,7 +1202,7 @@ Le slippage est ici modélisé comme une constante mais il serait sans doute plus judicieux de l'ajuster en fonction d'une variabilité locale (par rapport à la différence High - Low) qui pourrait pénaliser davantage la stratégie en temps de crise. Par exemple, lors de la vente d'une action -au prix :math:`p`, on considèrera le prix :math:`p - \alpha \abs{p} - \beta`. +au prix :math:`p`, on considèrera le prix :math:`p - \alpha \\left| p \\right| - \beta`. :math:`\alpha` est le coût de transaction est proportionnelle au prix, :math:`\beta` est le slippage qui s'exprime en un multiple entier du tick (donc différent pour chaque action). diff --git a/_doc/c_ml/rappel.rst b/_doc/c_ml/rappel.rst index 669b3c52..60f1ca0c 100644 --- a/_doc/c_ml/rappel.rst +++ b/_doc/c_ml/rappel.rst @@ -42,7 +42,8 @@ On exprime cette propriété comme suit en terme mathématique. .. math:: - \forall \epsilon >0, \exists \eta, \forall x,y \in I, \; \abs{x-y} < \eta \Rightarrow \abs{f(x) -f(y)} < \epsilon + \forall \epsilon >0, \exists \eta, \forall x,y \in I, \; + \left| x - y \right| < \eta \Rightarrow \left| f(x) -f(y) \right| < \epsilon On résume visuellement cette propriété comme suit. La fonction de gauche est continue, celle de droite ne l'est pas. @@ -110,7 +111,7 @@ l'angle qui les sépare. .. math:: - = \sum_{i=1}^n x_i y_i = \norm{X}\norm{Y} \cos(X,Y) + = \sum_{i=1}^n x_i y_i = \left\Vert X \right\Vert \left\Vert Y \right\Vert \cos(X,Y) .. index:: norme, distance @@ -122,13 +123,13 @@ vecteurs. La distance euclidienne est nommé *norme L2* : .. math:: - \norm{X}_2 = \sqrt{} + \\left\\Vert X \\right\\Vert_2 = \sqrt{} La norme L1 utilise les valeurs absolues : .. math:: - \norm{X}_1 = \sum_{i=1}^n \abs{x_i} + \left\Vert X \right\Vert_1 = \sum_{i=1}^n \left | x_i \right | Ce sont les deux principales normes utilisées en :epkg:`machine learning`. diff --git a/_doc/conf.py b/_doc/conf.py index ebc1dfb7..f0d05084 100644 --- a/_doc/conf.py +++ b/_doc/conf.py @@ -126,30 +126,29 @@ # next preamble = """ -\\usepackage{etex} -\\usepackage{fixltx2e} % LaTeX patches, \\textsubscript -\\usepackage{cmap} % fix search and cut-and-paste in Acrobat -\\usepackage[raccourcis]{fast-diagram} -\\usepackage{titlesec} -\\usepackage{amsmath} -\\usepackage{amssymb} -\\usepackage{amsfonts} -\\usepackage{graphics} -\\usepackage{epic} -\\usepackage{eepic} -%\\usepackage{pict2e} +%%% \\usepackage{etex} +%%% \\usepackage{fixltx2e} % LaTeX patches, \\textsubscript +%%% \\usepackage{cmap} % fix search and cut-and-paste in Acrobat +%%% \\usepackage[raccourcis]{fast-diagram} +%%% \\usepackage{titlesec} +%%% \\usepackage{amsmath} +%%% \\usepackage{amssymb} +%%% \\usepackage{amsfonts} +%%% \\usepackage{graphics} +%%% \\usepackage{epic} +%%% \\usepackage{eepic} +%%% \\usepackage{pict2e} %%% Redefined titleformat -\\setlength{\\parindent}{0cm} -\\setlength{\\parskip}{1ex plus 0.5ex minus 0.2ex} +%%% \\setlength{\\parindent}{0cm} +%%% \\setlength{\\parskip}{1ex plus 0.5ex minus 0.2ex} \\newcommand{\\hsp}{\\hspace{20pt}} \\newcommand{\\acc}[1]{\\left\\{#1\\right\\}} \\newcommand{\\cro}[1]{\\left[#1\\right]} \\newcommand{\\pa}[1]{\\left(#1\\right)} \\newcommand{\\R}{\\mathbb{R}} \\newcommand{\\HRule}{\\rule{\\linewidth}{0.5mm}} -%\\titleformat{\\chapter}[hang]{\\Huge\\bfseries\\sffamily}{\\thechapter\\hsp}{0pt}{\\Huge\\bfseries\\sffamily} - -\\usepackage[all]{xy} +%%% \\titleformat{\\chapter}[hang]{\\Huge\\bfseries\\sffamily}{\\thechapter\\hsp}{0pt}{\\Huge\\bfseries\\sffamily} +%%% \\usepackage[all]{xy} \\newcommand{\\vecteur}[2]{\\pa{#1,\\dots,#2}} \\newcommand{\\N}[0]{\\mathbb{N}} \\newcommand{\\indicatrice}[1]{ {1\\!\\!1}_{\\acc{#1}} } @@ -322,6 +321,7 @@ "tkinter.Entry.insert": "https://tkdocs.com/pyref/entry.html", "tkinter.Event": "https://tkdocs.com/tutorial/eventloop.html", "tkinter.Frame": "https://tkdocs.com/tutorial/widgets.html#frame", + "tkinter.filedialog": "https://docs.python.org/3/library/dialog.html#module-tkinter.filedialog", "tkinter.IntVar": "https://tkdocs.com/pyref/intvar.html", "tkinter.Label": "https://tkdocs.com/tutorial/widgets.html#label", "tkinter.Label.after_cancel": "https://tkdocs.com/tutorial/widgets.html#label", @@ -354,8 +354,6 @@ "tkinter.Toplevel.resizable": "https://tkdocs.com/pyref/toplevel.html", "tkinter.Toplevel.title": "https://tkdocs.com/pyref/toplevel.html", "tkinter.Toplevel.withdraw": "https://tkdocs.com/pyref/toplevel.html", - "tkinter.tix.DirTree": "https://pythonbasics.org/tkinter-filedialog/", - "tkinter.tix.FileSelectBox": "https://pythonbasics.org/tkinter-filedialog/", "tkinter.ttk.Combobox": "https://tkdocs.com/pyref/ttk_combobox.html", "tkinter.ttk.Notebook": "https://tkdocs.com/pyref/ttk_notebook.html", "tkinter.ttk.Progressbar": "https://tkdocs.com/pyref/ttk_progressbar.html", diff --git a/_doc/examples/prog/plot_burrows_wheeler.py b/_doc/examples/prog/plot_burrows_wheeler.py new file mode 100644 index 00000000..688598b4 --- /dev/null +++ b/_doc/examples/prog/plot_burrows_wheeler.py @@ -0,0 +1,65 @@ +# coding: utf-8 +""" + +.. _burrowswheelerrst: + +============================== +Transformée de Burrows Wheeler +============================== + +La transformée de `Burrows-Wheeler +`_ +transforme un mot en un autre mot composée des mêmes lettres +mais aux propriétés statistiques différentes. +Les deux fonctions qui suivent implémentent les algorithmes +décrits sur la page Wikipedia. + +Codage +====== +""" + + +def code_burrows(text: str) -> str: + # étape 1: matrice décalée + decalages = ["".join(text[i:] + text[:i]) for i in range(len(text))] + # étape 2: tri + decalages.sort() + # on cherche la position du mot initial + pos = decalages.index(text) + # fin + return pos, "".join(decalages[i][-1] for i in range(len(text))) + + +print(code_burrows("ENSAE")) + +############################################ +# Décodage +# ======== + + +def decode_burrows(pos, last_col): + first_col = sorted(last_col) + two_cols = list(zip(last_col, first_col)) + for _i in range(2, len(last_col)): + two_cols.sort() + two_cols = [(c, *t) for c, t in zip(last_col, two_cols)] + two_cols.sort() + return "".join(two_cols[pos]) + + +print(decode_burrows(2, "SAEEN")) + +############################## +# On vérifie que le code vérifie des tests unitaires simples. + + +def test_burrows(): + for mot in ["AA", "AB", "BA", "ABC", "ACB", "BCA", "BAC", "ENSAE"]: + pos, code = code_burrows(mot) + decode = decode_burrows(pos, code) + assert ( + decode == mot + ), f"problème avec {mot}, decode={decode}, pos={pos}, code={code}" + + +test_burrows() diff --git a/_doc/practice/index_algo.rst b/_doc/practice/index_algo.rst index eb52d91d..9b3c41e2 100644 --- a/_doc/practice/index_algo.rst +++ b/_doc/practice/index_algo.rst @@ -64,6 +64,7 @@ angles d'approches. ../auto_examples/prog/plot_einstein_riddle ../auto_examples/prog/plot_float_and_double_rouding + ../auto_examples/prog/plot_burrows_wheeler ../auto_examples/prog/plot_hypercube algo-compose/paris_parcours algo-compose/vigenere diff --git a/_doc/practice/tds-algo/plus_court_chemin_correction.ipynb b/_doc/practice/tds-algo/plus_court_chemin_correction.ipynb index 3723c84a..b360d03a 100644 --- a/_doc/practice/tds-algo/plus_court_chemin_correction.ipynb +++ b/_doc/practice/tds-algo/plus_court_chemin_correction.ipynb @@ -22,15 +22,14 @@ "metadata": {}, "outputs": [ { - "ename": "ModuleNotFoundError", - "evalue": "No module named 'teachpyx'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[1], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mteachpyx\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mtools\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mdata_helper\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m download_and_unzip\n\u001b[1;32m 3\u001b[0m url \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhttps://github.com/sdpython/teachpyx/raw/main/_data/matrix_distance_7398.zip\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 5\u001b[0m download_and_unzip(url)\n", - "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'teachpyx'" - ] + "data": { + "text/plain": [ + "['./matrix_distance_7398.txt']" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ @@ -43,7 +42,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -80,7 +79,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -111,7 +110,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -133,7 +132,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -162,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -195,7 +194,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -223,7 +222,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -311,14 +310,14 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "0.301415513544109\n" + "0.16268842703187558\n" ] } ], @@ -359,7 +358,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -369,7 +368,7 @@ "" ] }, - "execution_count": 13, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -389,30 +388,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "0.301415513544109\n", + "0.16268842703187558\n", "(9, 14)\n", - "(9, 13)\n", - "(9, 12)\n", - "(9, 11)\n", - "(8, 10)\n", - "(7, 9)\n", - "(6, 8)\n", - "(6, 7)\n", - "(6, 6)\n", - "(5, 5)\n", - "(4, 4)\n", - "(3, 3)\n", - "(2, 2)\n", - "(1, 1)\n", - "(0, 0)\n", - "[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (6, 7), (6, 8), (7, 9), (8, 10), (9, 11), (9, 12), (9, 13), (9, 14)]\n" + "(8, 13)\n", + "(7, 12)\n", + "(6, 11)\n", + "(6, 10)\n", + "(5, 9)\n", + "(4, 8)\n", + "(4, 7)\n", + "(3, 6)\n", + "(2, 5)\n", + "(1, 4)\n", + "(0, 3)\n", + "[(0, 3), (1, 4), (2, 5), (3, 6), (4, 7), (4, 8), (5, 9), (6, 10), (6, 11), (7, 12), (8, 13), (9, 14)]\n" ] } ], @@ -465,19 +461,76 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": {}, "outputs": [ { - "ename": "NameError", - "evalue": "name 'download_and_unzip' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[1], line 5\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mpandas\u001b[39;00m\n\u001b[1;32m 3\u001b[0m url \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhttps://github.com/sdpython/teachpyx/raw/main/_data/facebook.zip\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m----> 5\u001b[0m \u001b[43mdownload_and_unzip\u001b[49m(url)\n\u001b[1;32m 6\u001b[0m df \u001b[38;5;241m=\u001b[39m pandas\u001b[38;5;241m.\u001b[39mread_csv(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfacebook/1912.edges\u001b[39m\u001b[38;5;124m\"\u001b[39m, sep\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m \u001b[39m\u001b[38;5;124m\"\u001b[39m, names\u001b[38;5;241m=\u001b[39m[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mv1\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mv2\u001b[39m\u001b[38;5;124m\"\u001b[39m])\n\u001b[1;32m 7\u001b[0m df\u001b[38;5;241m.\u001b[39mhead()\n", - "\u001b[0;31mNameError\u001b[0m: name 'download_and_unzip' is not defined" - ] + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
v1v2
022902363
123462025
221402428
322012506
424252557
\n", + "
" + ], + "text/plain": [ + " v1 v2\n", + "0 2290 2363\n", + "1 2346 2025\n", + "2 2140 2428\n", + "3 2201 2506\n", + "4 2425 2557" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ diff --git a/_doc/py/c_classes/classes.rst b/_doc/py/c_classes/classes.rst index f0b17dec..4111407d 100644 --- a/_doc/py/c_classes/classes.rst +++ b/_doc/py/c_classes/classes.rst @@ -1552,7 +1552,7 @@ lors de l'appel de la fonction ``help(nom_class)`` ou Pour illustrer l'utilisation des propriétés, on part d'une classe ``nombre_complexe`` qui ne contient que les parties réelle et imaginaire. Le module désigne ici le module d'un nombre complexe qui est égal à sa norme. -On le note :math:`\abs{a+ib} = \sqrt{a^2 + b^2}`. On fait appel à une méthode qui calcule +On le note :math:`\left | a+ib \right | = \sqrt{a^2 + b^2}`. On fait appel à une méthode qui calcule ce module. Lorsqu'on cherche à modifier ce module, on fait appel à une autre méthode qui multiplie les parties réelle et imaginaire par un nombre réel positif de manière à ce que le nombre complexe ait le module demandé. diff --git a/_doc/py/c_gui/tkinter.rst b/_doc/py/c_gui/tkinter.rst index e3790d8f..9dc544b3 100644 --- a/_doc/py/c_gui/tkinter.rst +++ b/_doc/py/c_gui/tkinter.rst @@ -628,7 +628,7 @@ comme dans l'exemple suivant : Il suffit de transposer cet exemple pour ajouter une barre de défilement horizontale. Toutefois, il est préférable d'utiliser un objet prédéfini présent dans le module -:mod:`tkinter.tix` qui est une extension du module :epkg:`tkinter`. +:mod:`tkinter.filedialog` qui est une extension du module :epkg:`tkinter`. Elle est présentée au paragraphe :ref:`chap_interface_exemple_programme`. Lorsqu'on insère plusieurs objets :epkg:`tkinter.ListBox` @@ -680,8 +680,8 @@ C'est une liste avec une barre de défilement incluse qui est présente dans l'e root.mainloop() # idem -Les extensions :mod:`tkinter.ttk` et :mod:`tkinter.tix` -ne sont pas très bien documentés mais il existe de nombreuses +Les extensions :mod:`tkinter.ttk` et :mod:`tkinter.filedialog` +ne sont pas très bien documentées mais il existe de nombreuses réponses sur les forums de discussions. .. list-table:: @@ -1532,7 +1532,7 @@ D'autres fenêtres et contrôles *tkinter* ne propose pas beaucoup de *widgets*, pas autant que la liste étendue qu'on trouve dans la plupart des applications. Deux extensions complètent cette liste -:mod:`tkinter.ttk` et :mod:`tkinter.tix`. +:mod:`tkinter.ttk` et :mod:`tkinter.filedialog`. On trouve notamment : * :epkg:`tkinter.ttk.Combobox` @@ -1540,10 +1540,8 @@ On trouve notamment : * :epkg:`tkinter.ttk.Progressbar` * :epkg:`tkinter.ttk.Treeview` -:mod:`tkinter.tix` propose des widgets un peu plus complexes : - -* :epkg:`tkinter.tix.DirTree` -* :epkg:`tkinter.tix.FileSelectBox` +:mod:`tkinter.filedialog` propose des widgets un peu plus complexes pour +sélectionner des fichiers. Cette liste n'est pas exhaustive. @@ -1641,15 +1639,13 @@ Le programme suivant en est un exemple : Fenêtres standard ----------------- -Le module :mod:`tkinter.tix` -propose une fenêtre de sélection de fichiers identique à celle de -la figure suivante. -:epkg:`tkinter` +Le module :mod:`tkinter.filedialog` +propose une fenêtre de filedialog de fichiers identique à celle de +la figure suivante. :epkg:`tkinter` a l'avantage d'être simple et ne nécessite pas un long apprentissage pour le maîtriser mais il est limité. Pour ce type de fenêtres qu'on retrouve dans la plupart des programmes, il existe presque toujours -des solutions toutes faites, via le module -:mod:`tkinter.tix` +des solutions toutes faites, via le module :mod:`tkinter.filedialog` par exemple. On trouve également de nombreux programmes sur Internet par le biais de moteurs de recherche. Le programme ci-dessous affiche une fenêtre qui permet de sélectionner un fichier. @@ -1830,27 +1826,27 @@ affiche une fenêtre qui permet de sélectionner un fichier. print("fichier sélectionné ", win.chemin) Il faut comparer ce programme à celui qu'on écrirait avec -l'extension :mod:`tkinter.tix` : +l'extension :mod:`tkinter.filedialog` : :: - import tkinter.tix as tix - root = tix.Tk () + import tkinter as tk + import tkinter.filedialog as fd - o = tix.FileSelectBox (root) - o.pack () + root = tk.Tk() - def print_file () : + o = fd.askopenfile(root) + o.pack() + + def print_file(): print(o.cget ("value")) - b = tix.Button (root, text = "print") - b.config (command = print_file) + b = tk.Button(root, text="print") + b.config (command=print_file) b.pack () root.mainloop () -.. image:: images/tixfile.png - Constructions classiques ======================== diff --git a/_latex/ensae/td_note_2017_rattrapage.tex b/_latex/ensae/td_note_2017_rattrapage.tex index 1ccfa2e3..ea4d0195 100644 --- a/_latex/ensae/td_note_2017_rattrapage.tex +++ b/_latex/ensae/td_note_2017_rattrapage.tex @@ -3,10 +3,10 @@ \firstpassagedo{ \newcommand{\sametextforthisinterro}[0]{ -\huge ENSAE TD noté rattrapage, mardi 21 février 2017 +\huge ENSAE TD not� rattrapage, mardi 21 f�vrier 2017 \normalsize -\textit{Le programme devra être imprimé et rendu au chargé de TD. Toutes les questions valent 2 points. Vous êtes libres d'utiliser numpy ou non à toutes les questions.} +\textit{Le programme devra �tre imprim� et rendu au charg� de TD. Toutes les questions valent 2 points. Vous �tes libres d'utiliser numpy ou non � toutes les questions.} \smallskip } @@ -37,9 +37,9 @@ \exosubject{} -\begin{xexercice}\label{td_note_label10_2017}%\indexfrr{énoncé}{pratique} +\begin{xexercice}\label{td_note_label10_2017}%\indexfrr{�nonc�}{pratique} -\exequest A l'aide du module \text{random}, générer un ensemble d'entiers aléatoires compris entre 0 et 100 excepté le premier égal à 1000. +\exequest A l'aide du module \text{random}, g�n�rer un ensemble d'entiers al�atoires compris entre 0 et 100 except� le premier �gal � 1000. \begin{verbatimx} def ensemble_aleatoire(n): @@ -47,13 +47,13 @@ return \end{verbatimx} -\exequest La médiane d'un ensemble de points $\acc{X_1, ..., X_n}$ est une valeur $X_M$ telle que : +\exequest La m�diane d'un ensemble de points $\acc{X_1, ..., X_n}$ est une valeur $X_M$ telle que : $$\sum_i \indicatrice{X_i < X_m} = \sum_i \indicatrice{X_i > X_m}$$ -Autrement dit, il y a autant de valeurs inférieures que supérieures à $X_M$. On obtient cette valeur en triant les éléments par ordre croissant et en prenant celui du milieu. +Autrement dit, il y a autant de valeurs inf�rieures que sup�rieures � $X_M$. On obtient cette valeur en triant les �l�ments par ordre croissant et en prenant celui du milieu. - Ecrire une fonction qui calcule la médiane. + Ecrire une fonction qui calcule la m�diane. \begin{verbatimx} def mediane(ensemble): @@ -61,17 +61,17 @@ return \end{verbatimx} -\exequest Lorsque le nombre de points est pair, la médiane peut être n'importe quelle valeur dans un intervalle. Modifier votre fonction de façon à ce que la fonction précédente retourne le milieu de la fonction. +\exequest Lorsque le nombre de points est pair, la m�diane peut �tre n'importe quelle valeur dans un intervalle. Modifier votre fonction de fa�on � ce que la fonction pr�c�dente retourne le milieu de la fonction. -\exequest Pour un ensemble de points $E=\acc{X_1, ..., X_n}$, on considère la fonction suivante : +\exequest Pour un ensemble de points $E=\acc{X_1, ..., X_n}$, on consid�re la fonction suivante : -$$f(x) = \sum_{i=1}^n \abs{x - X_i}$$. +$$f(x) = \sum_{i=1}^n \left | x - X_i \right |$$. -On suppose que la médiane $X_M$ de l'ensemble $E$ n'appartient pas à $E$ : $X_M \notin E$. Que vaut $f'(X_M)$ ? -On acceptera le fait que la médiane est le seul point dans ce cas. +On suppose que la m�diane $X_M$ de l'ensemble $E$ n'appartient pas � $E$ : $X_M \notin E$. Que vaut $f'(X_M)$ ? +On acceptera le fait que la m�diane est le seul point dans ce cas. \exequest On suppose qu'on dispose d'un ensemble d'observations $\pa{X_i, Y_i}$ avec $X_i, Y_i \in \R$. -La régression linéaire consiste en une relation linéaire $Y_i = a X_i + b + \epsilon_i$ +La r�gression lin�aire consiste en une relation lin�aire $Y_i = a X_i + b + \epsilon_i$ qui minimise la variance du bruit. On pose : $$ @@ -85,14 +85,14 @@ a^*, b^* = \arg \min E(a, b) = \arg \min \sum_i \pa{Y_i - (a X_i + b)}^2 $$ -La fonction est dérivable et on trouve : +La fonction est d�rivable et on trouve : $$ \partialfrac{E(a,b)}{a} = - 2 \sum_i X_i ( Y_i - (a X_i + b)) \text{ et } \partialfrac{E(a,b)}{b} = - 2 \sum_i ( Y_i - (a X_i + b)) $$ -Il suffit alors d'annuler les dérivées. On résoud un système d'équations linéaires. On note : +Il suffit alors d'annuler les d�riv�es. On r�soud un syst�me d'�quations lin�aires. On note : $$ \begin{array}{l} @@ -109,7 +109,7 @@ \end{array} $$ -Lorsqu'on a plusieurs dimensions pour $X$, on écrit le problème d'optimisation, on cherche les coefficients $\beta^*$ qui minimisent : +Lorsqu'on a plusieurs dimensions pour $X$, on �crit le probl�me d'optimisation, on cherche les coefficients $\beta^*$ qui minimisent : $$E(\beta)=\sum_{i=1}^n \pa{y_i - X_i \beta}^2 = \norme{Y - X\beta}^2$$ @@ -134,15 +134,15 @@ \end{verbatimx} -\exequest On considère maintenant que chaque observation est pondérée par un poids $w_i$. On veut maintenant trouver le vecteur $\beta$ qui minimise : +\exequest On consid�re maintenant que chaque observation est pond�r�e par un poids $w_i$. On veut maintenant trouver le vecteur $\beta$ qui minimise : $$E(\beta)=\sum_{i=1}^n w_i \pa{y_i - X_i \beta}^2 = \norme{W^{\frac{1}{2}}(Y - X\beta)}^2$$ -Où $W=diag(w_1, ..., w_n)$ est la matrice diagonale. La solution est : +O� $W=diag(w_1, ..., w_n)$ est la matrice diagonale. La solution est : $$\beta_* = (X'WX)^{-1}X'WY$$. -Ecrire une fonction qui calcule la solution de la régression pondérée. +Ecrire une fonction qui calcule la solution de la r�gression pond�r�e. \begin{verbatimx} def regression_lineaire_ponderee(X, Y, W): @@ -150,9 +150,9 @@ return \end{verbatimx} -\exequest Ecrire une fonction qui calcule les quantités suivantes : +\exequest Ecrire une fonction qui calcule les quantit�s suivantes : -$$z_i = \frac{1}{\max\pa{ \delta, \abs{y_i - X_i \beta}}}$$ +$$z_i = \frac{1}{\max\pa{ \delta, \left | y_i - X_i \beta \right | }}$$ \begin{verbatimx} @@ -166,9 +166,9 @@ \begin{enumerate} \item $w_i^{(1)} = 1$ \item $\beta_{(t)} = (X'W^{(t)}X)^{-1}X'W^{(t)}Y$ -\item $w_i^{(t+1)} = \frac{1}{\max\pa{ \delta, \abs{y_i - X_i \beta^{(t)}}}}$ +\item $w_i^{(t+1)} = \frac{1}{\max\pa{ \delta, \left | y_i - X_i \beta^{(t)} \right | }}$ \item $t = t+1$ -\item Retour à l'étape 2. +\item Retour � l'�tape 2. \end{enumerate} \begin{verbatimx} @@ -177,7 +177,7 @@ return \end{verbatimx} -\exequest On pose $Y$ le vecteur aléatoire de la question 1. $X$ est un vecteur de même dimension constant et égale à 1. Calculer les quatre valeurs suivantes : +\exequest On pose $Y$ le vecteur al�atoire de la question 1. $X$ est un vecteur de m�me dimension constant et �gale � 1. Calculer les quatre valeurs suivantes : \begin{enumerate} \item $algorithm(X,Y)$ diff --git a/pyproject.toml b/pyproject.toml index 0ac380cb..09c0d007 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,6 @@ Issues = "https://github.com/sdpython/teachpyx/issues" dev = [ "black", "black-nb", - "blockdiag", "chardet", "cloudpickle", "coverage", @@ -69,7 +68,7 @@ dev = [ "sphinx-gallery", "sphinx-issues", "sphinxcontrib-blockdiag", - # "git+https://github.com/sdpython/blockdiag.git@pil10", + "pip@https://github.com/yuzutech/blockdiag/archive/refs/tags/v3.3.0.zip", # "git+https://github.com/sdpython/sphinx-runpython.git", "sphinx-runpython", "tqdm", diff --git a/requirements-dev.txt b/requirements-dev.txt index 78c9af5c..67967c2f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,4 @@ black -blockdiag cartopy catboost category-encoders @@ -38,7 +37,7 @@ sphinx sphinx-gallery sphinx-issues sphinxcontrib-blockdiag -git+https://github.com/sdpython/blockdiag.git@pil10 +git+https://github.com/yuzutech/blockdiag.git@v3.3.0 git+https://github.com/sdpython/sphinx-runpython.git statsmodels tqdm diff --git a/teachpyx/tools/blockdiag_helper.py b/teachpyx/tools/blockdiag_helper.py index 37a22451..dcfaca23 100644 --- a/teachpyx/tools/blockdiag_helper.py +++ b/teachpyx/tools/blockdiag_helper.py @@ -99,7 +99,12 @@ def _detectfont(font): return fontpath -def draw_diagram(graph, module="blockdiag", fmt="pillow", **options): +def draw_diagram( + graph, + module: str = "blockdiag", + fmt: str = "pillow", + **options, +): """ Draws a graph based on module :epkg:`blockdiag`. @@ -140,7 +145,8 @@ def draw_diagram(graph, module="blockdiag", fmt="pillow", **options): raise ValueError(f"fmt={fmt!r} should in ['pillow', 'svg', 'png']") fontmap = _create_fontmap( - fontmap=options.get("fontmap", None), font=options.get("font", None) + fontmap=options.get("fontmap", None), # noqa: SIM910 + font=options.get("font", None), # noqa: SIM910 ) tree = parser.parse_string(graph) res = _build_diagram( @@ -154,7 +160,7 @@ def draw_diagram(graph, module="blockdiag", fmt="pillow", **options): antialias=options.get("antialias", True), nodoctype=options.get("nodoctype", False), transparency=options.get("transparency", False), - size=options.get("size", None), + size=options.get("size", None), # noqa: SIM910 ) if fmt == "pillow": from PIL import Image From e7bee7a86bb68caa7bfdef4c374a81d187597c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Dupr=C3=A9?= Date: Sat, 2 Nov 2024 10:22:35 +0100 Subject: [PATCH 2/4] space (#75) --- _doc/articles/2024/2024-11-31-route2024.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_doc/articles/2024/2024-11-31-route2024.rst b/_doc/articles/2024/2024-11-31-route2024.rst index 5966e458..b006319d 100644 --- a/_doc/articles/2024/2024-11-31-route2024.rst +++ b/_doc/articles/2024/2024-11-31-route2024.rst @@ -193,6 +193,7 @@ Ensuite le voyageur de commerce. optim = solution_permutations(villes) print("-- optimisation gourmande:", distance(optim)) + print() print("-- optimisation plus rapide mais approchée...") optim = solution_croisement(villes) print("-- optimisation plus rapide mais approchée", distance(optim)) @@ -202,6 +203,7 @@ Ensuite le voyageur de commerce. fig.savefig(os.path.join(__WD__, "tsp_simple.png")) text = ".. image:: tsp_simple.png" + print("\n\n") print(text) Séance 7 From c6bf8559409426c616af719142e73e90376a75b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Dupr=C3=A9?= Date: Sat, 2 Nov 2024 23:28:29 +0100 Subject: [PATCH 3/4] Sess7 (#76) * space * add session 7 * push --- .gitignore | 1 + _doc/articles/2024/2024-11-31-route2024.rst | 136 +++++++++++++++++++- 2 files changed, 133 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9bfcbdec..581c6863 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ *.pickle *.shp *.shx +*.png .coverage data.* paris*.* diff --git a/_doc/articles/2024/2024-11-31-route2024.rst b/_doc/articles/2024/2024-11-31-route2024.rst index b006319d..68e37df6 100644 --- a/_doc/articles/2024/2024-11-31-route2024.rst +++ b/_doc/articles/2024/2024-11-31-route2024.rst @@ -211,10 +211,130 @@ Séance 7 * :ref:`Classe et héritage ` -Convertir une expression mathématique comme :math:`((34 + 6) - 2) / (7 - 4)` -en `notation polonaise inverse `_. -Voir aussi `Algorithme Shunting-yard -`_. +Bouts de code, un peu d'optimization. + +.. runpython:: + :showcode: + + import numpy as np + + def calcul(h1,h2,v1,v2,x): + t1 = np.sqrt(x ** 2 + h1**2) / v1 + t2 = np.sqrt((1-x) ** 2 + h2**2) / v2 + return t1 + t2 + + h1, h2, v1, v2 = 1, 0.5, 1, 0.8 + p = np.arange(6) / 5 + print(p) + print(calcul(1,1,1,1,p)) + print(calcul(h1,h2,v1,v2,p)) + + def calcul_entrepot(v1,v2,A, B, Es): + # A: [[0, 0]], B: [[1, 1]], Es: [[0.3, 0.4], [...]] + t1 = np.sqrt(((A - Es) ** 2).sum(axis=1)) / v1 + t2 = np.sqrt(((B - Es) ** 2).sum(axis=1)) / v2 + return t1 + t2 + + A = np.array([[0,0]]) + B = np.array([[1,1]]) + Es = np.array([[0.5, 0.5], [0.1, 0.1], [0, 0.1]]) + print("---------") + print(calcul_entrepot(v1,v2,A, B, Es)) + +Jeu de la vie: + +.. runpython:: + :showcode: + + import os + import numpy as np + import matplotlib.pyplot as plt + import tqdm + + + def plateau(n, p=0.5): + return (np.random.rand(n, n) < p).astype(int) + + + def dessin(plat, next_plat): + fig, ax = plt.subplots(1, 2) + ax[0].imshow(plat.astype(float)) + ax[0].get_xaxis().set_visible(False) + ax[0].get_yaxis().set_visible(False) + ax[1].imshow(next_plat.astype(float)) + ax[1].get_xaxis().set_visible(False) + ax[1].get_yaxis().set_visible(False) + return fig, ax + + + def iteration(plat): + voisin = np.zeros(plat.shape, dtype=int) + i, j = plat.shape + # voisin gauche, droite + voisin[:-1, :] += plat[1:, :] + voisin[1:, :] += plat[:-1, :] + # voisin haut,bas + voisin[:, :-1] += plat[:, 1:] + voisin[:, 1:] += plat[:, :-1] + # voisin diagonal + voisin[:-1, :-1] += plat[1:, 1:] + voisin[1:, 1:] += plat[:-1, :-1] + # voisin autre diagonal + voisin[:-1, 1:] += plat[1:, :-1] + voisin[1:, :-1] += plat[-1:, 1:] + # mise à jour + nouveau = np.zeros(plat.shape, dtype=int) + nouveau += ((plat == 1) & (voisin <= 3) & (voisin >= 2)).astype(int) + nouveau += ((plat == 0) & (voisin == 3)).astype(int) + return nouveau + + + def jeu(n, p, n_iter=5, save_intermediate=False): + plat = plateau(10, 0.2) + x, y = [], [] + for i in tqdm.tqdm(list(range(n_iter))): + x.append(i) + y.append(plat.sum()) + next_plat = iteration(plat) + if save_intermediate: + fig, ax = dessin(plat, next_plat) + fig.savefig(os.path.join(__WD__, "anim_vie{i:03d}.png")) + plat = next_plat + fig, ax = plt.subplots(1, 1) + ax.plot(x, y) + ax.set_title(f"{n_iter} itération du jeu de la vie") + fig.savefig(os.path.join(__WD__, "anim_evolution.png")) + return plat + + + plat = plateau(20, 0.4) + next_plat = iteration(plat) + + print("première itération") + print(next_plat) + + fig, ax = dessin(plat, next_plat) + ax[0].set_title("avant") + ax[1].set_title("première itération") + fig.savefig(os.path.join(__WD__, "vie_1.png")) + + print("et le jeu") + plat = jeu(16, 0.2) + print(plat) + +Et visuellement, la première itération : + +.. runpython:: + :rst: + + print("\n\n.. image:: vie_1.png\n\n") + +Et l'évolution du jeu : + +.. runpython:: + :rst: + + print("\n\n.. image:: anim_evolution.png\n\n") Séance 8 ++++++++ @@ -227,3 +347,11 @@ TD noté 1h30 en seconde partie. Classes et un algorithme. Enoncés des années précédentes : :ref:`l-exams`. + +Idées laissées de côté mais autant d'exercices possibles +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Convertir une expression mathématique comme :math:`((34 + 6) - 2) / (7 - 4)` +en `notation polonaise inverse `_. +Voir aussi `Algorithme Shunting-yard +`_. From 8aacd8218cd447946f7ef5420259e0f48301dce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Dupr=C3=A9?= Date: Sun, 3 Nov 2024 13:12:49 +0100 Subject: [PATCH 4/4] Refactoring documentation api (#77) * Refactoring documentation api * fix link --- _doc/api/classique.rst | 14 ------ _doc/api/datasets.rst | 27 ---------- _doc/api/datasets/data/index.rst | 9 ++++ _doc/api/datasets/data_helper.rst | 7 +++ _doc/api/datasets/documentation.rst | 7 +++ _doc/api/datasets/enedis.rst | 7 +++ _doc/api/datasets/gpd_helper.rst | 7 +++ _doc/api/datasets/index.rst | 28 +++++++++++ _doc/api/datasets/wines.rst | 7 +++ _doc/api/examples/classiques.rst | 7 +++ _doc/api/examples/construction_classique.rst | 7 +++ _doc/api/examples/index.rst | 19 +++++++ _doc/api/examples/numpysex.rst | 7 +++ _doc/api/ext_test_case.rst | 7 +++ _doc/api/faq/faq_exception.rst | 7 +++ _doc/api/faq/faq_geo.rst | 7 +++ _doc/api/faq/faq_numpy.rst | 7 +++ _doc/api/faq/faq_python.rst | 7 +++ _doc/api/faq/index.rst | 20 ++++++++ _doc/api/faqs.rst | 27 ---------- _doc/api/index.rst | 38 +++++++------- _doc/api/numpysex.rst | 5 -- _doc/api/practice/index.rst | 20 ++++++++ _doc/api/practice/rues_paris.rst | 3 +- _doc/api/practice/tsp_bresenham.rst | 3 +- _doc/api/practice/tsp_kohonen.rst | 3 +- _doc/api/practice/tsp_kruskal.rst | 3 +- _doc/api/tools.rst | 53 -------------------- _doc/api/tools/blockdiag_helper.rst | 7 +++ _doc/api/tools/data_helper.rst | 7 +++ _doc/api/tools/display/index.rst | 18 +++++++ _doc/api/tools/display/pygame_helper.rst | 7 +++ _doc/api/tools/display/video_helper.rst | 7 +++ _doc/api/tools/graphviz_helper.rst | 7 +++ _doc/api/tools/helpers.rst | 7 +++ _doc/api/tools/index.rst | 28 +++++++++++ _doc/api/tools/profiling.rst | 7 +++ _doc/api/video/index.rst | 18 +++++++ _doc/api/video/tsp_kohonen.rst | 6 --- _doc/api/video/tsp_kohonen_pygame.rst | 7 +++ _doc/api/video/tsp_kruskal.rst | 6 --- _doc/api/video/tsp_kruskal_pygame.rst | 7 +++ _doc/c_ml/regclass.rst | 2 +- _doc/conf.py | 1 + teachpyx/ext_test_case.py | 2 +- 45 files changed, 344 insertions(+), 163 deletions(-) delete mode 100644 _doc/api/classique.rst delete mode 100644 _doc/api/datasets.rst create mode 100644 _doc/api/datasets/data/index.rst create mode 100644 _doc/api/datasets/data_helper.rst create mode 100644 _doc/api/datasets/documentation.rst create mode 100644 _doc/api/datasets/enedis.rst create mode 100644 _doc/api/datasets/gpd_helper.rst create mode 100644 _doc/api/datasets/index.rst create mode 100644 _doc/api/datasets/wines.rst create mode 100644 _doc/api/examples/classiques.rst create mode 100644 _doc/api/examples/construction_classique.rst create mode 100644 _doc/api/examples/index.rst create mode 100644 _doc/api/examples/numpysex.rst create mode 100644 _doc/api/ext_test_case.rst create mode 100644 _doc/api/faq/faq_exception.rst create mode 100644 _doc/api/faq/faq_geo.rst create mode 100644 _doc/api/faq/faq_numpy.rst create mode 100644 _doc/api/faq/faq_python.rst create mode 100644 _doc/api/faq/index.rst delete mode 100644 _doc/api/faqs.rst delete mode 100644 _doc/api/numpysex.rst create mode 100644 _doc/api/practice/index.rst delete mode 100644 _doc/api/tools.rst create mode 100644 _doc/api/tools/blockdiag_helper.rst create mode 100644 _doc/api/tools/data_helper.rst create mode 100644 _doc/api/tools/display/index.rst create mode 100644 _doc/api/tools/display/pygame_helper.rst create mode 100644 _doc/api/tools/display/video_helper.rst create mode 100644 _doc/api/tools/graphviz_helper.rst create mode 100644 _doc/api/tools/helpers.rst create mode 100644 _doc/api/tools/index.rst create mode 100644 _doc/api/tools/profiling.rst create mode 100644 _doc/api/video/index.rst delete mode 100644 _doc/api/video/tsp_kohonen.rst create mode 100644 _doc/api/video/tsp_kohonen_pygame.rst delete mode 100644 _doc/api/video/tsp_kruskal.rst create mode 100644 _doc/api/video/tsp_kruskal_pygame.rst diff --git a/_doc/api/classique.rst b/_doc/api/classique.rst deleted file mode 100644 index 470191e0..00000000 --- a/_doc/api/classique.rst +++ /dev/null @@ -1,14 +0,0 @@ -examples.construction_classique -=============================== - -teachpyx.examples.classiques -++++++++++++++++++++++++++++ - -.. automodule:: teachpyx.examples.classiques - :members: - -teachpyx.examples.construction_classique -++++++++++++++++++++++++++++++++++++++++ - -.. automodule:: teachpyx.examples.construction_classique - :members: diff --git a/_doc/api/datasets.rst b/_doc/api/datasets.rst deleted file mode 100644 index ef8e7c7e..00000000 --- a/_doc/api/datasets.rst +++ /dev/null @@ -1,27 +0,0 @@ -=============== -Jeux de données -=============== - -Cartographie -============ - -.. autofunction:: teachpyx.datasets.get_naturalearth_cities - -.. autofunction:: teachpyx.datasets.get_naturalearth_lowres - -.. autofunction:: teachpyx.datasets.load_enedis_dataset - -Classification -============== - -.. autofunction:: teachpyx.datasets.load_wines_dataset - -Outils -====== - -.. autofunction:: teachpyx.datasets.data_helper.get_data_folder - -Régression -========== - -.. autofunction:: teachpyx.datasets.load_wine_dataset diff --git a/_doc/api/datasets/data/index.rst b/_doc/api/datasets/data/index.rst new file mode 100644 index 00000000..5818ea22 --- /dev/null +++ b/_doc/api/datasets/data/index.rst @@ -0,0 +1,9 @@ + +teachpyx.datasets.data +====================== + + + +.. automodule:: teachpyx.datasets.data + :members: + :no-undoc-members: diff --git a/_doc/api/datasets/data_helper.rst b/_doc/api/datasets/data_helper.rst new file mode 100644 index 00000000..6aefd3be --- /dev/null +++ b/_doc/api/datasets/data_helper.rst @@ -0,0 +1,7 @@ + +teachpyx.datasets.data_helper +============================= + +.. automodule:: teachpyx.datasets.data_helper + :members: + :no-undoc-members: diff --git a/_doc/api/datasets/documentation.rst b/_doc/api/datasets/documentation.rst new file mode 100644 index 00000000..43d79143 --- /dev/null +++ b/_doc/api/datasets/documentation.rst @@ -0,0 +1,7 @@ + +teachpyx.datasets.documentation +=============================== + +.. automodule:: teachpyx.datasets.documentation + :members: + :no-undoc-members: diff --git a/_doc/api/datasets/enedis.rst b/_doc/api/datasets/enedis.rst new file mode 100644 index 00000000..3eb7637c --- /dev/null +++ b/_doc/api/datasets/enedis.rst @@ -0,0 +1,7 @@ + +teachpyx.datasets.enedis +======================== + +.. automodule:: teachpyx.datasets.enedis + :members: + :no-undoc-members: diff --git a/_doc/api/datasets/gpd_helper.rst b/_doc/api/datasets/gpd_helper.rst new file mode 100644 index 00000000..4e895aa6 --- /dev/null +++ b/_doc/api/datasets/gpd_helper.rst @@ -0,0 +1,7 @@ + +teachpyx.datasets.gpd_helper +============================ + +.. automodule:: teachpyx.datasets.gpd_helper + :members: + :no-undoc-members: diff --git a/_doc/api/datasets/index.rst b/_doc/api/datasets/index.rst new file mode 100644 index 00000000..3313dd97 --- /dev/null +++ b/_doc/api/datasets/index.rst @@ -0,0 +1,28 @@ + +teachpyx.datasets +================= + + +.. toctree:: + :maxdepth: 1 + :caption: submodules + + + data/index + + +.. toctree:: + :maxdepth: 1 + :caption: modules + + + data_helper + documentation + enedis + gpd_helper + wines + + +.. automodule:: teachpyx.datasets + :members: + :no-undoc-members: diff --git a/_doc/api/datasets/wines.rst b/_doc/api/datasets/wines.rst new file mode 100644 index 00000000..ac99712a --- /dev/null +++ b/_doc/api/datasets/wines.rst @@ -0,0 +1,7 @@ + +teachpyx.datasets.wines +======================= + +.. automodule:: teachpyx.datasets.wines + :members: + :no-undoc-members: diff --git a/_doc/api/examples/classiques.rst b/_doc/api/examples/classiques.rst new file mode 100644 index 00000000..4a523857 --- /dev/null +++ b/_doc/api/examples/classiques.rst @@ -0,0 +1,7 @@ + +teachpyx.examples.classiques +============================ + +.. automodule:: teachpyx.examples.classiques + :members: + :no-undoc-members: diff --git a/_doc/api/examples/construction_classique.rst b/_doc/api/examples/construction_classique.rst new file mode 100644 index 00000000..14cd0db6 --- /dev/null +++ b/_doc/api/examples/construction_classique.rst @@ -0,0 +1,7 @@ + +teachpyx.examples.construction_classique +======================================== + +.. automodule:: teachpyx.examples.construction_classique + :members: + :no-undoc-members: diff --git a/_doc/api/examples/index.rst b/_doc/api/examples/index.rst new file mode 100644 index 00000000..c1ca0a5f --- /dev/null +++ b/_doc/api/examples/index.rst @@ -0,0 +1,19 @@ + +teachpyx.examples +================= + + + +.. toctree:: + :maxdepth: 1 + :caption: modules + + + classiques + construction_classique + numpysex + + +.. automodule:: teachpyx.examples + :members: + :no-undoc-members: diff --git a/_doc/api/examples/numpysex.rst b/_doc/api/examples/numpysex.rst new file mode 100644 index 00000000..8d74b71d --- /dev/null +++ b/_doc/api/examples/numpysex.rst @@ -0,0 +1,7 @@ + +teachpyx.examples.numpysex +========================== + +.. automodule:: teachpyx.examples.numpysex + :members: + :no-undoc-members: diff --git a/_doc/api/ext_test_case.rst b/_doc/api/ext_test_case.rst new file mode 100644 index 00000000..14cd323b --- /dev/null +++ b/_doc/api/ext_test_case.rst @@ -0,0 +1,7 @@ + +teachpyx.ext_test_case +====================== + +.. automodule:: teachpyx.ext_test_case + :members: + :no-undoc-members: diff --git a/_doc/api/faq/faq_exception.rst b/_doc/api/faq/faq_exception.rst new file mode 100644 index 00000000..6e55433d --- /dev/null +++ b/_doc/api/faq/faq_exception.rst @@ -0,0 +1,7 @@ + +teachpyx.faq.faq_exception +========================== + +.. automodule:: teachpyx.faq.faq_exception + :members: + :no-undoc-members: diff --git a/_doc/api/faq/faq_geo.rst b/_doc/api/faq/faq_geo.rst new file mode 100644 index 00000000..eaf00fd2 --- /dev/null +++ b/_doc/api/faq/faq_geo.rst @@ -0,0 +1,7 @@ + +teachpyx.faq.faq_geo +==================== + +.. automodule:: teachpyx.faq.faq_geo + :members: + :no-undoc-members: diff --git a/_doc/api/faq/faq_numpy.rst b/_doc/api/faq/faq_numpy.rst new file mode 100644 index 00000000..388865e0 --- /dev/null +++ b/_doc/api/faq/faq_numpy.rst @@ -0,0 +1,7 @@ + +teachpyx.faq.faq_numpy +====================== + +.. automodule:: teachpyx.faq.faq_numpy + :members: + :no-undoc-members: diff --git a/_doc/api/faq/faq_python.rst b/_doc/api/faq/faq_python.rst new file mode 100644 index 00000000..36b3754c --- /dev/null +++ b/_doc/api/faq/faq_python.rst @@ -0,0 +1,7 @@ + +teachpyx.faq.faq_python +======================= + +.. automodule:: teachpyx.faq.faq_python + :members: + :no-undoc-members: diff --git a/_doc/api/faq/index.rst b/_doc/api/faq/index.rst new file mode 100644 index 00000000..5b24bacc --- /dev/null +++ b/_doc/api/faq/index.rst @@ -0,0 +1,20 @@ + +teachpyx.faq +============ + + + +.. toctree:: + :maxdepth: 1 + :caption: modules + + + faq_exception + faq_geo + faq_numpy + faq_python + + +.. automodule:: teachpyx.faq + :members: + :no-undoc-members: diff --git a/_doc/api/faqs.rst b/_doc/api/faqs.rst deleted file mode 100644 index e39bed77..00000000 --- a/_doc/api/faqs.rst +++ /dev/null @@ -1,27 +0,0 @@ -faq -=== - -teachpyx.faq.faq_python -+++++++++++++++++++++++ - -.. automodule:: teachpyx.faq.faq_python - :members: - -teachpyx.faq.faq_exception -++++++++++++++++++++++++++ - -.. automodule:: teachpyx.faq.faq_exception - :members: - -teachpyx.faq.faq_geo -++++++++++++++++++++ - -.. automodule:: teachpyx.faq.faq_geo - :members: - -teachpyx.faq.faq_numpy -++++++++++++++++++++++ - -.. automodule:: teachpyx.faq.faq_numpy - :members: - diff --git a/_doc/api/index.rst b/_doc/api/index.rst index 1244d5ce..d271fe58 100644 --- a/_doc/api/index.rst +++ b/_doc/api/index.rst @@ -1,29 +1,29 @@ -Code inclus dans cette librairie -================================ -.. toctree:: - :caption: Constructions classiques +teachpyx +======== - classique - datasets - tools .. toctree:: - :caption: Fonctions illustrant des solutions + :maxdepth: 1 + :caption: submodules - practice/rues_paris - practice/tsp_bresenham - practice/tsp_kohonen - practice/tsp_kruskal -.. toctree:: - :caption: Animations + examples/index + video/index + tools/index + faq/index + practice/index + datasets/index - video/tsp_kohonen - video/tsp_kruskal .. toctree:: - :caption: FAQ + :maxdepth: 1 + :caption: modules + + + ext_test_case + - numpysex - faqs +.. automodule:: teachpyx + :members: + :no-undoc-members: diff --git a/_doc/api/numpysex.rst b/_doc/api/numpysex.rst deleted file mode 100644 index 9dcd1eaf..00000000 --- a/_doc/api/numpysex.rst +++ /dev/null @@ -1,5 +0,0 @@ -examples.numpysex -================= - -.. automodule:: teachpyx.examples.numpysex - :members: diff --git a/_doc/api/practice/index.rst b/_doc/api/practice/index.rst new file mode 100644 index 00000000..a2e23a63 --- /dev/null +++ b/_doc/api/practice/index.rst @@ -0,0 +1,20 @@ + +teachpyx.practice +================= + + + +.. toctree:: + :maxdepth: 1 + :caption: modules + + + rues_paris + tsp_bresenham + tsp_kohonen + tsp_kruskal + + +.. automodule:: teachpyx.practice + :members: + :no-undoc-members: diff --git a/_doc/api/practice/rues_paris.rst b/_doc/api/practice/rues_paris.rst index 790963f2..999536a0 100644 --- a/_doc/api/practice/rues_paris.rst +++ b/_doc/api/practice/rues_paris.rst @@ -1,6 +1,7 @@ -============================ + teachpyx.practice.rues_paris ============================ .. automodule:: teachpyx.practice.rues_paris :members: + :no-undoc-members: diff --git a/_doc/api/practice/tsp_bresenham.rst b/_doc/api/practice/tsp_bresenham.rst index be757107..fe345c3d 100644 --- a/_doc/api/practice/tsp_bresenham.rst +++ b/_doc/api/practice/tsp_bresenham.rst @@ -1,6 +1,7 @@ -=============================== + teachpyx.practice.tsp_bresenham =============================== .. automodule:: teachpyx.practice.tsp_bresenham :members: + :no-undoc-members: diff --git a/_doc/api/practice/tsp_kohonen.rst b/_doc/api/practice/tsp_kohonen.rst index 28009711..858e1c43 100644 --- a/_doc/api/practice/tsp_kohonen.rst +++ b/_doc/api/practice/tsp_kohonen.rst @@ -1,6 +1,7 @@ -============================= + teachpyx.practice.tsp_kohonen ============================= .. automodule:: teachpyx.practice.tsp_kohonen :members: + :no-undoc-members: diff --git a/_doc/api/practice/tsp_kruskal.rst b/_doc/api/practice/tsp_kruskal.rst index a85f353a..4bf9933e 100644 --- a/_doc/api/practice/tsp_kruskal.rst +++ b/_doc/api/practice/tsp_kruskal.rst @@ -1,6 +1,7 @@ -============================= + teachpyx.practice.tsp_kruskal ============================= .. automodule:: teachpyx.practice.tsp_kruskal :members: + :no-undoc-members: diff --git a/_doc/api/tools.rst b/_doc/api/tools.rst deleted file mode 100644 index f5119299..00000000 --- a/_doc/api/tools.rst +++ /dev/null @@ -1,53 +0,0 @@ -tools -===== - -decompress_zip -++++++++++++++ - -.. autofunction:: teachpyx.tools.decompress_zip - -download_and_unzip -++++++++++++++++++ - -.. autofunction:: teachpyx.tools.download_and_unzip - -draw_diagram -++++++++++++ - -.. autofunction:: teachpyx.tools.draw_diagram - -draw_graph_graphviz -+++++++++++++++++++ - -.. autofunction:: teachpyx.tools.graphviz_helper.draw_graph_graphviz - -total_size -++++++++++ - -.. autofunction:: teachpyx.tools.total_size - -profiling -+++++++++ - -.. automodule:: teachpyx.tools.profiling - :members: - -run_graphviz -++++++++++++ - -.. autofunction:: teachpyx.tools.graphviz_helper.run_graphviz - -run_subprocess -++++++++++++++ - -.. autofunction:: teachpyx.tools.graphviz_helper.run_subprocess - -video -+++++ - -.. automodule:: teachpyx.tools.display.pygame_helper - :members: - -.. automodule:: teachpyx.tools.display.video_helper - :members: - diff --git a/_doc/api/tools/blockdiag_helper.rst b/_doc/api/tools/blockdiag_helper.rst new file mode 100644 index 00000000..8515c91f --- /dev/null +++ b/_doc/api/tools/blockdiag_helper.rst @@ -0,0 +1,7 @@ + +teachpyx.tools.blockdiag_helper +=============================== + +.. automodule:: teachpyx.tools.blockdiag_helper + :members: + :no-undoc-members: diff --git a/_doc/api/tools/data_helper.rst b/_doc/api/tools/data_helper.rst new file mode 100644 index 00000000..70d41195 --- /dev/null +++ b/_doc/api/tools/data_helper.rst @@ -0,0 +1,7 @@ + +teachpyx.tools.data_helper +========================== + +.. automodule:: teachpyx.tools.data_helper + :members: + :no-undoc-members: diff --git a/_doc/api/tools/display/index.rst b/_doc/api/tools/display/index.rst new file mode 100644 index 00000000..6e55e292 --- /dev/null +++ b/_doc/api/tools/display/index.rst @@ -0,0 +1,18 @@ + +teachpyx.tools.display +====================== + + + +.. toctree:: + :maxdepth: 1 + :caption: modules + + + pygame_helper + video_helper + + +.. automodule:: teachpyx.tools.display + :members: + :no-undoc-members: diff --git a/_doc/api/tools/display/pygame_helper.rst b/_doc/api/tools/display/pygame_helper.rst new file mode 100644 index 00000000..0ca298be --- /dev/null +++ b/_doc/api/tools/display/pygame_helper.rst @@ -0,0 +1,7 @@ + +teachpyx.tools.display.pygame_helper +==================================== + +.. automodule:: teachpyx.tools.display.pygame_helper + :members: + :no-undoc-members: diff --git a/_doc/api/tools/display/video_helper.rst b/_doc/api/tools/display/video_helper.rst new file mode 100644 index 00000000..7c214938 --- /dev/null +++ b/_doc/api/tools/display/video_helper.rst @@ -0,0 +1,7 @@ + +teachpyx.tools.display.video_helper +=================================== + +.. automodule:: teachpyx.tools.display.video_helper + :members: + :no-undoc-members: diff --git a/_doc/api/tools/graphviz_helper.rst b/_doc/api/tools/graphviz_helper.rst new file mode 100644 index 00000000..85ee0a3a --- /dev/null +++ b/_doc/api/tools/graphviz_helper.rst @@ -0,0 +1,7 @@ + +teachpyx.tools.graphviz_helper +============================== + +.. automodule:: teachpyx.tools.graphviz_helper + :members: + :no-undoc-members: diff --git a/_doc/api/tools/helpers.rst b/_doc/api/tools/helpers.rst new file mode 100644 index 00000000..a83a7310 --- /dev/null +++ b/_doc/api/tools/helpers.rst @@ -0,0 +1,7 @@ + +teachpyx.tools.helpers +====================== + +.. automodule:: teachpyx.tools.helpers + :members: + :no-undoc-members: diff --git a/_doc/api/tools/index.rst b/_doc/api/tools/index.rst new file mode 100644 index 00000000..257b2b81 --- /dev/null +++ b/_doc/api/tools/index.rst @@ -0,0 +1,28 @@ + +teachpyx.tools +============== + + +.. toctree:: + :maxdepth: 1 + :caption: submodules + + + display/index + + +.. toctree:: + :maxdepth: 1 + :caption: modules + + + blockdiag_helper + data_helper + graphviz_helper + helpers + profiling + + +.. automodule:: teachpyx.tools + :members: + :no-undoc-members: diff --git a/_doc/api/tools/profiling.rst b/_doc/api/tools/profiling.rst new file mode 100644 index 00000000..291a9c0b --- /dev/null +++ b/_doc/api/tools/profiling.rst @@ -0,0 +1,7 @@ + +teachpyx.tools.profiling +======================== + +.. automodule:: teachpyx.tools.profiling + :members: + :no-undoc-members: diff --git a/_doc/api/video/index.rst b/_doc/api/video/index.rst new file mode 100644 index 00000000..80ef9c23 --- /dev/null +++ b/_doc/api/video/index.rst @@ -0,0 +1,18 @@ + +teachpyx.video +============== + + + +.. toctree:: + :maxdepth: 1 + :caption: modules + + + tsp_kohonen_pygame + tsp_kruskal_pygame + + +.. automodule:: teachpyx.video + :members: + :no-undoc-members: diff --git a/_doc/api/video/tsp_kohonen.rst b/_doc/api/video/tsp_kohonen.rst deleted file mode 100644 index 288c6f73..00000000 --- a/_doc/api/video/tsp_kohonen.rst +++ /dev/null @@ -1,6 +0,0 @@ - -================================= -teachpyx.video.tsp_kohonen_pygame -================================= - -.. autofunction:: teachpyx.video.tsp_kohonen_pygame.pygame_simulation diff --git a/_doc/api/video/tsp_kohonen_pygame.rst b/_doc/api/video/tsp_kohonen_pygame.rst new file mode 100644 index 00000000..7360ffc6 --- /dev/null +++ b/_doc/api/video/tsp_kohonen_pygame.rst @@ -0,0 +1,7 @@ + +teachpyx.video.tsp_kohonen_pygame +================================= + +.. automodule:: teachpyx.video.tsp_kohonen_pygame + :members: + :no-undoc-members: diff --git a/_doc/api/video/tsp_kruskal.rst b/_doc/api/video/tsp_kruskal.rst deleted file mode 100644 index 6fe78907..00000000 --- a/_doc/api/video/tsp_kruskal.rst +++ /dev/null @@ -1,6 +0,0 @@ - -========================== -teachpyx.video.tsp_kruskal -========================== - -.. autofunction:: teachpyx.video.tsp_kruskal_pygame.pygame_simulation diff --git a/_doc/api/video/tsp_kruskal_pygame.rst b/_doc/api/video/tsp_kruskal_pygame.rst new file mode 100644 index 00000000..a0e582a3 --- /dev/null +++ b/_doc/api/video/tsp_kruskal_pygame.rst @@ -0,0 +1,7 @@ + +teachpyx.video.tsp_kruskal_pygame +================================= + +.. automodule:: teachpyx.video.tsp_kruskal_pygame + :members: + :no-undoc-members: diff --git a/_doc/c_ml/regclass.rst b/_doc/c_ml/regclass.rst index 4432c493..f7a65b2e 100644 --- a/_doc/c_ml/regclass.rst +++ b/_doc/c_ml/regclass.rst @@ -30,7 +30,7 @@ composants. `_ Ce jeu de données peut également être téléchargé avec la fonction -:func:`load_wines_dataset `. +:func:`load_wines_dataset `. Découverte du machine learning ============================== diff --git a/_doc/conf.py b/_doc/conf.py index f0d05084..aaff294b 100644 --- a/_doc/conf.py +++ b/_doc/conf.py @@ -280,6 +280,7 @@ "Regression with confidence interval": "https://sdpython.github.io/doc/mlinsights/dev/auto_examples/plot_regression_confidence_interval.html", "relu": "https://en.wikipedia.org/wiki/Rectifier_(neural_networks)", "ROC": "https://fr.wikipedia.org/wiki/Courbe_ROC", + "rst": "https://fr.wikipedia.org/wiki/ReStructuredText", "scikit-learn": "https://scikit-learn.org/stable/index.html", "scipy": "https://scipy.org/", "sérialisation": "https://fr.wikipedia.org/wiki/S%C3%A9rialisation", diff --git a/teachpyx/ext_test_case.py b/teachpyx/ext_test_case.py index dde0057e..730f6168 100644 --- a/teachpyx/ext_test_case.py +++ b/teachpyx/ext_test_case.py @@ -68,7 +68,7 @@ def measure_time( .. runpython:: :showcode: - from onnx_extended.ext_test_case import measure_time + from teachpyx.ext_test_case import measure_time from math import cos res = measure_time(lambda: cos(0.5))