-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
index, notebook, canvas in notebooks...
- Loading branch information
Showing
29 changed files
with
667 additions
and
27 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
_doc/sphinxdoc/source/donnees/correcteur_orthographe_solution.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
_doc/sphinxdoc/source/programmation/parcours_echiquier_correction.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#-*- coding: utf-8 -*- | ||
""" | ||
@brief test log(time=4s) | ||
""" | ||
|
||
import sys | ||
import os | ||
import unittest | ||
import re | ||
|
||
try: | ||
import src | ||
except ImportError: | ||
path = os.path.normpath( | ||
os.path.abspath( | ||
os.path.join( | ||
os.path.split(__file__)[0], | ||
"..", | ||
".."))) | ||
if path not in sys.path: | ||
sys.path.append(path) | ||
import src | ||
|
||
try: | ||
import pyquickhelper | ||
except ImportError: | ||
path = os.path.normpath( | ||
os.path.abspath( | ||
os.path.join( | ||
os.path.split(__file__)[0], | ||
"..", | ||
"..", | ||
"..", | ||
"pyquickhelper", | ||
"src"))) | ||
if path not in sys.path: | ||
sys.path.append(path) | ||
import pyquickhelper | ||
|
||
from pyquickhelper import fLOG, get_temp_folder | ||
from src.code_beatrix.algorithm import voyageur_commerce_simple, distance_circuit, plot_circuit | ||
|
||
|
||
class TestTsp (unittest.TestCase): | ||
|
||
def test_voyageur_commerce_simple(self): | ||
fLOG( | ||
__file__, | ||
self._testMethodName, | ||
OutputPrint=__name__ == "__main__") | ||
|
||
points = [(105.61666870117188, 69.01666259765625), | ||
(192.61666870117188, 92.01666259765625), | ||
(372.6166687011719, 123.01666259765625), | ||
(360.6166687011719, 249.01666259765625), | ||
(190.61666870117188, 213.01666259765625), | ||
(102.61666870117188, 166.01666259765625), | ||
(104.61666870117188, 271.01666259765625), | ||
(209.61666870117188, 278.01666259765625), | ||
(321.6166687011719, 198.01666259765625), | ||
(261.6166687011719, 153.01666259765625), | ||
(196.61666870117188, 162.01666259765625), | ||
(317.6166687011719, 306.01666259765625)] | ||
|
||
d0 = distance_circuit(points) | ||
|
||
newp = voyageur_commerce_simple(points) | ||
|
||
d1 = distance_circuit(newp) | ||
|
||
fLOG(d0, d1) | ||
assert d1 < d0 | ||
|
||
if __name__ == "__main__": | ||
import matplotlib.pyplot as plt | ||
ax = plot_circuit(newp) | ||
plt.show() | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#-*- coding: utf-8 -*- | ||
""" | ||
@brief test log(time=60s) | ||
""" | ||
|
||
import sys | ||
import os | ||
import unittest | ||
import re | ||
|
||
try: | ||
import src | ||
except ImportError: | ||
path = os.path.normpath( | ||
os.path.abspath( | ||
os.path.join( | ||
os.path.split(__file__)[0], | ||
"..", | ||
".."))) | ||
if path not in sys.path: | ||
sys.path.append(path) | ||
import src | ||
|
||
try: | ||
import pyquickhelper | ||
except ImportError: | ||
path = os.path.normpath( | ||
os.path.abspath( | ||
os.path.join( | ||
os.path.split(__file__)[0], | ||
"..", | ||
"..", | ||
"..", | ||
"pyquickhelper", | ||
"src"))) | ||
if path not in sys.path: | ||
sys.path.append(path) | ||
import pyquickhelper | ||
|
||
from pyquickhelper import fLOG, get_temp_folder | ||
from src.code_beatrix.automation.notebook_test_helper import ls_notebooks, execute_notebooks, clean_function_notebook | ||
|
||
|
||
class TestNotebookAlgorithm (unittest.TestCase): | ||
|
||
def test_notebook_algorithm(self): | ||
fLOG( | ||
__file__, | ||
self._testMethodName, | ||
OutputPrint=__name__ == "__main__") | ||
temp = get_temp_folder(__file__, "temp_algorithm") | ||
keepnote = ls_notebooks("algorithmes") | ||
assert len(keepnote) > 0 | ||
res = execute_notebooks(temp, keepnote, | ||
lambda i, n: "deviner" not in n, | ||
fLOG=fLOG, | ||
clean_function=clean_function_notebook) | ||
assert len(res) > 0 | ||
fails = [(os.path.split(k)[-1], v) | ||
for k, v in sorted(res.items()) if not v[0]] | ||
for f in fails: | ||
fLOG(f) | ||
if len(fails) > 0: | ||
raise fails[0][1][1] | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |
Oops, something went wrong.