From: Jean-Philippe ARGAUD Date: Mon, 4 Jan 2021 20:43:44 +0000 (+0100) Subject: Updating version test and compatibility X-Git-Tag: V9_7_0b1~52 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a6b01256e90c9a55f3c898214a370db4990759d1;p=modules%2Fadao.git Updating version test and compatibility --- diff --git a/src/daComposant/daCore/BasicObjects.py b/src/daComposant/daCore/BasicObjects.py index 87f20a2..7a97326 100644 --- a/src/daComposant/daCore/BasicObjects.py +++ b/src/daComposant/daCore/BasicObjects.py @@ -963,6 +963,20 @@ class Algorithm(object): self.__elapsed_time = time.perf_counter() - self.__initial_elapsed_time return self.__cpu_time, self.__elapsed_time + def _StopOnTimeLimit(self, X=None, withReason=False): + "Stop criteria on time limit: True/False [+ Reason]" + c, e = self._getTimeState() + if "MaximumCpuTime" in self._parameters and c > self._parameters["MaximumCpuTime"]: + __SC, __SR = True, "Reached maximum CPU time (%.1fs > %.1fs)"%(c, self._parameters["MaximumCpuTime"]) + elif "MaximumElapsedTime" in self._parameters and e > self._parameters["MaximumElapsedTime"]: + __SC, __SR = True, "Reached maximum elapsed time (%.1fs > %.1fs)"%(e, self._parameters["MaximumElapsedTime"]) + else: + __SC, __SR = False, "" + if withReason: + return __SC, __SR + else: + return __SC + # ============================================================================== class AlgorithmAndParameters(object): """ diff --git a/test/test1001/Versions.py b/test/test1001/Versions.py index bb8c514..158974d 100644 --- a/test/test1001/Versions.py +++ b/test/test1001/Versions.py @@ -94,15 +94,19 @@ class Test_Adao(unittest.TestCase): backends_KO = [] backend_now = matplotlib.get_backend() - for backend in ['bidon', 'pdf', 'pgf', 'Qt4Agg', 'GTK', 'GTKAgg', 'ps', - 'agg', 'cairo', 'MacOSX', 'GTKCairo', 'WXAgg', - 'template', 'TkAgg', 'GTK3Cairo', 'GTK3Agg', 'svg', - 'WebAgg', 'CocoaAgg', 'emf', 'gdk', 'WX']: + for backend in ['bidon', 'MacOSX', 'Qt5Agg', 'GTK3Agg', 'TkAgg', 'WxAgg', 'Agg', + 'Qt5', 'Qt5Cairo', 'GTK3Cairo', 'TkCairo', 'WxCairo', 'Cairo', + 'ps', 'pdf', 'svg', 'Template', 'WebAgg', + 'Qt4', 'Qt4Agg', 'Qt4Cairo', 'Wx', 'pgf', 'GTK', + 'GTKAgg', 'GTKCairo', 'Cocoa', 'CocoaAgg', 'emf', 'gdk', + ]: try: matplotlib.use(backend) backends_OK.append(backend) except ValueError: backends_KO.append(backend) + backends_OK.sort() + backends_KO.sort() # print(" Backends disponibles pour Matplotlib %s :"%mplversion) print(" Defaut initial......: '%s'"%backend_now) diff --git a/test/test6905/Verification_de_conversion_de_COMM_en_SCD.py b/test/test6905/Verification_de_conversion_de_COMM_en_SCD.py index b0572ef..35e693d 100644 --- a/test/test6905/Verification_de_conversion_de_COMM_en_SCD.py +++ b/test/test6905/Verification_de_conversion_de_COMM_en_SCD.py @@ -25,7 +25,7 @@ import sys, glob import unittest import numpy -fichiers = glob.glob("*.comm") +fichiers = glob.glob("*.comm")+glob.glob("snippets*_Convert_XXX_to_YYY/*.comm") # ============================================================================== class Test_Adao(unittest.TestCase): diff --git a/test/test6905/Verification_de_conversion_de_COMM_en_TUI.py b/test/test6905/Verification_de_conversion_de_COMM_en_TUI.py index 54c9878..ab1ccbc 100644 --- a/test/test6905/Verification_de_conversion_de_COMM_en_TUI.py +++ b/test/test6905/Verification_de_conversion_de_COMM_en_TUI.py @@ -25,7 +25,7 @@ import sys, glob import unittest import numpy -fichiers = glob.glob("*.comm") +fichiers = glob.glob("*.comm")+glob.glob("snippets*_Convert_XXX_to_YYY/*.comm") # ============================================================================== class Test_Adao(unittest.TestCase):