Skip to content
Permalink
Browse files

refactoring

  • Loading branch information...
sdpython committed Mar 28, 2019
1 parent 5917f94 commit b90157d53b41a62ffeff647306b23b2b60258c97
Showing with 88 additions and 957 deletions.
  1. +3 −0 .circleci/config.yml
  2. +1 −1 .local.jenkins.lin.yml
  3. +1 −1 .local.jenkins.win.yml
  4. +1 −0 .travis.yml
  5. +2 −1 _doc/sphinxdoc/source/conf.py
  6. +0 −18 _unittests/run_unittests.py
  7. +1 −17 _unittests/ut_ai/test_seg_image1.py
  8. +1 −17 _unittests/ut_ai/test_seg_image2.py
  9. +1 −19 _unittests/ut_algorithm/test_classroom.py
  10. +1 −19 _unittests/ut_algorithm/test_classroom36.py
  11. +1 −18 _unittests/ut_algorithm/test_classroom_short1.py
  12. +1 −19 _unittests/ut_algorithm/test_classroom_short2.py
  13. +1 −18 _unittests/ut_algorithm/test_tsp.py
  14. +1 −20 _unittests/ut_art/test_LONG_video_noenv1.py
  15. +1 −20 _unittests/ut_art/test_audio_noenv1.py
  16. +1 −20 _unittests/ut_art/test_check_video.py
  17. +1 −20 _unittests/ut_art/test_drawing_video.py
  18. +1 −20 _unittests/ut_art/test_video_download.py
  19. +2 −21 _unittests/ut_art/test_video_noenv2_audio.py
  20. +1 −20 _unittests/ut_art/test_video_noenv3.py
  21. +2 −21 _unittests/ut_art/test_video_noenv3_frame.py
  22. +1 −20 _unittests/ut_art/test_video_noenv3_modif.py
  23. +2 −21 _unittests/ut_art/test_video_noenv5_audio_bug.py
  24. +1 −25 _unittests/ut_art/test_video_noenv6_text.py
  25. +2 −21 _unittests/ut_art/test_video_noenv7_image_position.py
  26. +2 −21 _unittests/ut_art/test_video_noenv7_image_resize.py
  27. +1 −20 _unittests/ut_art/test_video_noenv7_text_image.py
  28. +1 −20 _unittests/ut_art/test_video_noenv8_placement.py
  29. +1 −20 _unittests/ut_art/test_video_noenvA_check_open_process.py
  30. +2 −18 _unittests/ut_art/test_videodl_noenv4_face.py
  31. +3 −22 _unittests/ut_art/test_videodl_noenv9_people.py
  32. +3 −21 _unittests/ut_documentation/test_LONG_notebook_scratch.py
  33. +3 −21 _unittests/ut_documentation/test_LONG_youtube_devoxx2018.py
  34. +3 −21 _unittests/ut_documentation/test_LONG_youtube_notebook_example.py
  35. +1 −19 _unittests/ut_documentation/test_automation_constant.py
  36. +3 −20 _unittests/ut_documentation/test_notebook_ai.py
  37. +3 −21 _unittests/ut_documentation/test_notebook_algorithm.py
  38. +3 −21 _unittests/ut_documentation/test_notebook_example.py
  39. +3 −21 _unittests/ut_documentation/test_notebook_example_video.py
  40. +3 −21 _unittests/ut_documentation/test_notebook_javascript.py
  41. +1 −26 _unittests/ut_faq/test_pass.py
  42. +1 −25 _unittests/ut_ipythonhelper/test_canvas.py
  43. +1 −24 _unittests/ut_ipythonhelper/test_ipy_path.py
  44. +2 −26 _unittests/ut_ipythonhelper/test_magic_snap.py
  45. +1 −20 _unittests/ut_jsscripts/test_copy_tools.py
  46. +0 −19 _unittests/ut_module/test_code_style.py
  47. +0 −46 _unittests/ut_module/test_version.py
  48. +3 −30 _unittests/ut_module/test_write_script.py
  49. +1 −26 _unittests/ut_scratchs/test_check_files.py
  50. +1 −0 appveyor.yml
  51. +2 −2 build_script.bat
  52. +1 −1 requirements.txt
  53. +2 −2 setup.py
  54. 0 src/__init__.py
  55. +1 −1 src/code_beatrix/__init__.py
  56. +2 −2 src/code_beatrix/ai/image_segmentation.py
  57. +1 −1 src/code_beatrix/art/video.py
  58. +1 −1 src/code_beatrix/art/video_drawing.py
  59. +1 −1 src/code_beatrix/art/videodl.py
@@ -120,12 +120,14 @@ jobs:
name: run tests
command: |
. venv/bin/activate
export PYTHONPATH=src
python setup.py unittests -g ".*((noenv4_people)|(LONG)).*"
- run:
name: wheel
command: |
. venv/bin/activate
export PYTHONPATH=src
python setup.py bdist_wheel
mkdir -p test-reports/dist
cp dist/*.whl test-reports/dist
@@ -134,6 +136,7 @@ jobs:
name: documentation
command: |
. venv/bin/activate
export PYTHONPATH=src
python setup.py build_sphinx
- run:
@@ -2,7 +2,7 @@
language: python

python:
- { PATH: "{{Python37}}", VERSION: 3.7, DIST: std, PYINT: python3.7 }
- { PATH: "{{Python37}}", VERSION: 3.7, DIST: std, PYINT: python3.7, PYTHONPATH: src }

virtualenv:
- path: {{ospathjoin(root_path, pickname("$NAME_JENKINS", project_name + "_$VERSION_$DIST_$NAME"), "_venv")}}
@@ -2,7 +2,7 @@
language: python

python:
- { PATH: "{{replace(Python37, '\\', '\\\\')}}", VERSION: 3.7, DIST: std }
- { PATH: "{{replace(Python37, '\\', '\\\\')}}", VERSION: 3.7, DIST: std, PYTHONPATH: src }

virtualenv:
- path: {{ospathjoin(root_path, pickname("%NAME_JENKINS%", project_name + "_%VERSION%_%DIST%_%NAME%"), "_venv")}}
@@ -30,5 +30,6 @@ install:
#- conda build build_tools/conda-recipe --quiet
- conda install -q --file=requirements_conda.txt
- pip install -r requirements.txt
- export PYTHONPATH=src
script:
- python setup.py unittests
@@ -2,6 +2,7 @@
import sys
import os
from pyquickhelper.helpgen.default_conf import set_sphinx_variables, get_default_stylesheet
from code_beatrix import __version__ as sversion

sys.path.insert(0, os.path.abspath(os.path.join(os.path.split(__file__)[0])))
import my_hachibee_sphinx_theme as hachibee_sphinx_theme
@@ -13,7 +14,7 @@
custom_style='custom_style.css',
extlinks=dict(
issue=('https://github.com/sdpython/code_beatrix/issues/%s', 'issue')),
book=True, nblayout='table')
book=True, nblayout='table', doc_version=sversion)

html_show_copyright = False
html_title = "lesenfantcodaient.fr"

This file was deleted.

Oops, something went wrong.
@@ -2,29 +2,13 @@
"""
@brief test log(time=14s)
"""

import sys
import os
import unittest
import skimage
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, ExtTestCase


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


class TestSegImage1(ExtTestCase):

def test_seg_image1(self):
@@ -38,7 +22,7 @@ def test_seg_image1(self):
img2 = os.path.join(temp, "..", "data", "Tesla_circa_1890c.jpg")
imgs = [img1, img2]

from src.code_beatrix.ai import DLImageSegmentation
from code_beatrix.ai import DLImageSegmentation
dl = DLImageSegmentation(fLOG=fLOG)

for i, img in enumerate(imgs):
@@ -2,29 +2,13 @@
"""
@brief test log(time=14s)
"""

import sys
import os
import unittest
import skimage
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, ExtTestCase


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


class TestSegImage2(ExtTestCase):

def test_seg_image2(self):
@@ -37,7 +21,7 @@ def test_seg_image2(self):
img1 = os.path.join(temp, "..", "data", "Mona_elephant.jpg")
imgs = [img1]

from src.code_beatrix.ai import DLImageSegmentation
from code_beatrix.ai import DLImageSegmentation
dl = DLImageSegmentation(fLOG=fLOG)

for i, img in enumerate(imgs):
@@ -2,27 +2,9 @@
"""
@brief test log(time=4s)
"""

import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG


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

from src.code_beatrix.algorithm.classroom import find_best_positions_greedy, measure_positions
from code_beatrix.algorithm.classroom import find_best_positions_greedy, measure_positions


class TestClassRoom(unittest.TestCase):
@@ -2,29 +2,11 @@
"""
@brief test log(time=7s)
"""

import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, fix_tkinter_issues_virtualenv


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


from src.code_beatrix.algorithm.classroom import random_positions, plot_positions, optimize_positions
from code_beatrix.algorithm.classroom import random_positions, plot_positions, optimize_positions


class TestClassRoom36(unittest.TestCase):
@@ -2,28 +2,11 @@
"""
@brief test log(time=3s)
"""

import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG, CustomLog
from pyquickhelper.pycode import get_temp_folder, fix_tkinter_issues_virtualenv


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

from src.code_beatrix.algorithm.classroom import random_positions, plot_positions
from code_beatrix.algorithm.classroom import random_positions, plot_positions


class TestClassRoomShort1(unittest.TestCase):
@@ -2,27 +2,9 @@
"""
@brief test log(time=2s)
"""

import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG


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

from src.code_beatrix.algorithm.data import load_prenoms_w
from code_beatrix.algorithm.data import load_prenoms_w


class TestClassRoomShort2(unittest.TestCase):
@@ -2,28 +2,11 @@
"""
@brief test log(time=4s)
"""

import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import fix_tkinter_issues_virtualenv, get_temp_folder


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

from src.code_beatrix.algorithm import voyageur_commerce_simple, distance_circuit, plot_circuit
from code_beatrix.algorithm import voyageur_commerce_simple, distance_circuit, plot_circuit


class TestTsp (unittest.TestCase):
@@ -2,31 +2,12 @@
"""
@brief test log(time=1000s)
"""


import sys
import os
import unittest
import subprocess
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, ExtTestCase


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


from src.code_beatrix.art.video import video_enumerate_frames
from code_beatrix.art.video import video_enumerate_frames


class TestLONGVideo(ExtTestCase):
@@ -7,30 +7,11 @@
with the notebook unittesting (it uses Popen too).
This is true for similar unit tests.
"""


import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, ExtTestCase


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


from src.code_beatrix.art.video import audio_compose, audio_save, audio_extract_audio, audio_concatenate
from code_beatrix.art.video import audio_compose, audio_save, audio_extract_audio, audio_concatenate


class TestAudio(ExtTestCase):
Oops, something went wrong.

0 comments on commit b90157d

Please sign in to comment.
You can’t perform that action at this time.