Skip to content

Commit

Permalink
[py] tests from pyibex are now running
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonRohou committed Apr 12, 2022
1 parent 1b3b5b7 commit 1d6b99d
Show file tree
Hide file tree
Showing 85 changed files with 6,711 additions and 160 deletions.
2 changes: 1 addition & 1 deletion examples/linobs/01_paper/main_foreach_dt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ int main()
map<double,Trajectory> m_pol_area;
map<double,double> m_pol_total_area;

vector<double> v_dt = { 0.1, 0.09, 0.08, 0.07, 0.06, 0.05, 0.04, 0.03, 0.02, 0.01, 0.005, 0.0025, 0.001 };
vector<double> v_dt = { 0.1, 0.09, 0.08, 0.07, 0.06, 0.05/*, 0.04, 0.03, 0.02, 0.01, 0.005, 0.0025, 0.001*/ };
// v_dt.push_back(0.0001); // uncomment this in order to exactly obtain the figure of the paper

for(const auto& dt: v_dt)
Expand Down
2 changes: 1 addition & 1 deletion examples/tuto/02_static_rangeonly/02_static_rangeonly.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@


# Checking if this example still works:
sys.exit(0 if x.contains(x_truth[0:1]) else 1)
sys.exit(0 if x.contains(x_truth[0:2]) else 1)
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@


# Checking if this example still works:
sys.exit(0 if x.contains(x_truth[0:1]) else 1)
sys.exit(0 if x.contains(x_truth[0:2]) else 1)
21 changes: 5 additions & 16 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,26 +142,13 @@

pybind11_add_module(unsupported SHARED
codac_py_unsupported.cpp

# Contractors
src/unsupported/contractors/codac_py_Ctc_unsupported.cpp

# Geometry
src/unsupported/geometry/codac_geometry.cpp

# Image
src/unsupported/image/codac_images.cpp

# Paving
src/unsupported/paving/codac_paving.cpp

# Separators
src/unsupported/separators/codac_py_Sep_unsupported.cpp

# Thickets
src/unsupported/thickset/codac_thickset.cpp
src/unsupported/thickset/codac_ThickInterval.cpp
src/unsupported/thickset/codac_GeoImages.cpp
)

add_compile_options(-O3 -Wall)
Expand Down Expand Up @@ -194,8 +181,8 @@

add_custom_target(pip_package)
add_custom_command(TARGET pip_package PRE_BUILD
COMMAND ${PYTHON_EXECUTABLE} ARGS setup.py bdist_wheel -d ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${PYTHON_PACKAGE_DIR}
COMMAND ${PYTHON_EXECUTABLE} ARGS setup.py bdist_wheel -d ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${PYTHON_PACKAGE_DIR}
)


Expand All @@ -205,7 +192,9 @@

if(BUILD_TESTS)

file(GLOB TESTS_FILES "${PYTHON_PACKAGE_DIR}/${PYTHON_PACKAGE_NAME}/tests/test_*.py")
file(GLOB TESTS_FILES
"${PYTHON_PACKAGE_DIR}/${PYTHON_PACKAGE_NAME}/tests/test_*.py"
"${PYTHON_PACKAGE_DIR}/${PYTHON_PACKAGE_NAME}/tests/tests_from_pyibex/test_*.py")
foreach(TEST_FILE ${TESTS_FILES})
get_filename_component(TEST_NAME ${TEST_FILE} NAME_WE)
set(TEST_NAME "python_${TEST_NAME}")
Expand Down
8 changes: 8 additions & 0 deletions python/codac/tests/test_arithmetic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env python

# Codac tests
# ---------------------------------------------------------------------------
# \date 2022
# \author Simon Rohou
# \copyright Copyright 2022 Codac Team
# \license This program is distributed under the terms of
# the GNU Lesser General Public License (LGPL).

import unittest
from codac import *

Expand Down
8 changes: 8 additions & 0 deletions python/codac/tests/test_cn.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env python

# Codac tests
# ---------------------------------------------------------------------------
# \date 2022
# \author Simon Rohou
# \copyright Copyright 2022 Codac Team
# \license This program is distributed under the terms of
# the GNU Lesser General Public License (LGPL).

import unittest
from codac import *
import codac as codac
Expand Down
8 changes: 8 additions & 0 deletions python/codac/tests/test_ctc_constell.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env python

# Codac tests
# ---------------------------------------------------------------------------
# \date 2022
# \author Simon Rohou
# \copyright Copyright 2022 Codac Team
# \license This program is distributed under the terms of
# the GNU Lesser General Public License (LGPL).

import unittest
from codac import *
import codac as codac
Expand Down
8 changes: 8 additions & 0 deletions python/codac/tests/test_ctcdelay.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env python

# Codac tests
# ---------------------------------------------------------------------------
# \date 2022
# \author Simon Rohou
# \copyright Copyright 2022 Codac Team
# \license This program is distributed under the terms of
# the GNU Lesser General Public License (LGPL).

import unittest
import math
from codac import *
Expand Down
8 changes: 8 additions & 0 deletions python/codac/tests/test_ctceval.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env python

# Codac tests
# ---------------------------------------------------------------------------
# \date 2022
# \author Simon Rohou
# \copyright Copyright 2022 Codac Team
# \license This program is distributed under the terms of
# the GNU Lesser General Public License (LGPL).

import unittest
from codac import *

Expand Down
8 changes: 8 additions & 0 deletions python/codac/tests/test_ctcstatic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env python

# Codac tests
# ---------------------------------------------------------------------------
# \date 2022
# \author Simon Rohou
# \copyright Copyright 2022 Codac Team
# \license This program is distributed under the terms of
# the GNU Lesser General Public License (LGPL).

import unittest
from codac import *

Expand Down
8 changes: 8 additions & 0 deletions python/codac/tests/test_definition.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env python

# Codac tests
# ---------------------------------------------------------------------------
# \date 2022
# \author Simon Rohou
# \copyright Copyright 2022 Codac Team
# \license This program is distributed under the terms of
# the GNU Lesser General Public License (LGPL).

import unittest
from codac import *
import codac as codac
Expand Down
8 changes: 8 additions & 0 deletions python/codac/tests/test_function.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env python

# Codac tests
# ---------------------------------------------------------------------------
# \date 2022
# \author Simon Rohou
# \copyright Copyright 2022 Codac Team
# \license This program is distributed under the terms of
# the GNU Lesser General Public License (LGPL).

import unittest
from codac import *
import codac as codac
Expand Down
8 changes: 8 additions & 0 deletions python/codac/tests/test_multi_arithmetic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env python

# Codac tests
# ---------------------------------------------------------------------------
# \date 2022
# \author Simon Rohou
# \copyright Copyright 2022 Codac Team
# \license This program is distributed under the terms of
# the GNU Lesser General Public License (LGPL).

import unittest
from codac import *

Expand Down
6 changes: 2 additions & 4 deletions python/codac/tests/tests_from_pyibex/nok/test_SepPaving.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
# Created : Dec 28, 2015
#============================================================================
import unittest
import codac
from codac import Interval, IntervalVector, LargestFirst, Function, SepFwdBwd
from codac.unsupported import SepToVibes
from codac.unsupported import SepPaving
from codac import *
from codac.unsupported import *
import math
from vibes import vibes

Expand Down
10 changes: 5 additions & 5 deletions python/codac/tests/tests_from_pyibex/test_Bsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Codac tests
# Originated from the former pyIbex library (Benoît Desrochers)
# ---------------------------------------------------------------------------
# \date 2022
# \author Benoît Desrochers
# \copyright Copyright 2021 Codac Team
# \license This program is distributed under the terms of
# the GNU Lesser General Public License (LGPL).
# \date 2022
# \author Benoît Desrochers
# \copyright Copyright 2022 Codac Team
# \license This program is distributed under the terms of
# the GNU Lesser General Public License (LGPL).

import unittest
from codac import *
Expand Down
Loading

0 comments on commit 1d6b99d

Please sign in to comment.