From ec29682e88ac2bbce9ac5b8639445ef810c3dfde Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Fri, 7 Jul 2023 23:40:45 -0500 Subject: [PATCH] PythonWrappers: fall back to Release if Debug is unavailable --- .../python-bindings/tests/cell_accessor_wrapper.py | 6 +++++- contrib/python-bindings/tests/manifold_wrapper.py | 6 +++++- contrib/python-bindings/tests/mapping_wrapper.py | 6 +++++- contrib/python-bindings/tests/point_wrapper.py | 6 +++++- .../python-bindings/tests/quadrature_wrapper.py | 14 +++++++++----- .../python-bindings/tests/triangulation_wrapper.py | 6 +++++- 6 files changed, 34 insertions(+), 10 deletions(-) diff --git a/contrib/python-bindings/tests/cell_accessor_wrapper.py b/contrib/python-bindings/tests/cell_accessor_wrapper.py index 826170380f..0f82379016 100644 --- a/contrib/python-bindings/tests/cell_accessor_wrapper.py +++ b/contrib/python-bindings/tests/cell_accessor_wrapper.py @@ -14,7 +14,11 @@ # --------------------------------------------------------------------- import unittest -from PyDealII.Debug import * + +try: + from PyDealII.Debug import * +except ImportError: + from PyDealII.Release import * class TestCellAccessorWrapper(unittest.TestCase): diff --git a/contrib/python-bindings/tests/manifold_wrapper.py b/contrib/python-bindings/tests/manifold_wrapper.py index 3ce9ef7cd0..98b2c0bc29 100644 --- a/contrib/python-bindings/tests/manifold_wrapper.py +++ b/contrib/python-bindings/tests/manifold_wrapper.py @@ -16,7 +16,11 @@ import math import os import unittest -from PyDealII.Debug import * + +try: + from PyDealII.Debug import * +except ImportError: + from PyDealII.Release import * class TestManifoldWrapperShell(unittest.TestCase): diff --git a/contrib/python-bindings/tests/mapping_wrapper.py b/contrib/python-bindings/tests/mapping_wrapper.py index 4f403d091f..7094242bdf 100644 --- a/contrib/python-bindings/tests/mapping_wrapper.py +++ b/contrib/python-bindings/tests/mapping_wrapper.py @@ -14,7 +14,11 @@ # --------------------------------------------------------------------- import unittest -from PyDealII.Debug import * + +try: + from PyDealII.Debug import * +except ImportError: + from PyDealII.Release import * class TestMappingWrapperCube(unittest.TestCase): diff --git a/contrib/python-bindings/tests/point_wrapper.py b/contrib/python-bindings/tests/point_wrapper.py index 4c5a9390d8..794b7c68b2 100644 --- a/contrib/python-bindings/tests/point_wrapper.py +++ b/contrib/python-bindings/tests/point_wrapper.py @@ -15,7 +15,11 @@ import unittest import math -from PyDealII.Debug import * + +try: + from PyDealII.Debug import * +except ImportError: + from PyDealII.Release import * class TestPointWrapper(unittest.TestCase): diff --git a/contrib/python-bindings/tests/quadrature_wrapper.py b/contrib/python-bindings/tests/quadrature_wrapper.py index 258f6b00d5..b93bc7055f 100644 --- a/contrib/python-bindings/tests/quadrature_wrapper.py +++ b/contrib/python-bindings/tests/quadrature_wrapper.py @@ -14,28 +14,32 @@ # --------------------------------------------------------------------- import unittest -from PyDealII.Debug import * + +try: + from PyDealII.Debug import * +except ImportError: + from PyDealII.Release import * class TestQuadratureWrapper(unittest.TestCase): def test_gauss(self): quadrature = Quadrature(dim = 3) quadrature.create_gauss(n = 1); - + w_sum = 0. for weight in quadrature.weights(): w_sum += weight - + self.assertTrue(abs(1. - w_sum) < 1e-10) def test_gauss_lobatto(self): quadrature = Quadrature(dim = 3) quadrature.create_gauss_lobatto(n = 2); - + w_sum = 0. for weight in quadrature.weights(): w_sum += weight - + self.assertTrue(abs(1. - w_sum) < 1e-10) if __name__ == '__main__': diff --git a/contrib/python-bindings/tests/triangulation_wrapper.py b/contrib/python-bindings/tests/triangulation_wrapper.py index fea7fc5b57..800be864e1 100644 --- a/contrib/python-bindings/tests/triangulation_wrapper.py +++ b/contrib/python-bindings/tests/triangulation_wrapper.py @@ -14,7 +14,11 @@ # --------------------------------------------------------------------- import unittest -from PyDealII.Debug import * + +try: + from PyDealII.Debug import * +except ImportError: + from PyDealII.Release import * class TestTriangulationWrapper(unittest.TestCase): -- 2.39.5