Salome HOME
updated copyright message
[modules/shaper.git] / src / SketchPlugin / Test / Test1966.py
index 42a11c4418d26926d640f4a7a897cd9b1c64219c..4b726321e54b3ab6dc7a331bf4d6e180722a90d9 100644 (file)
@@ -1,3 +1,22 @@
+# Copyright (C) 2014-2023  CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
 """
     Test1966.py
     Test case for issue #1966 "Sketch solving is 25 times slower between two studies with middle point"
@@ -8,7 +27,7 @@ from timeit import default_timer as timer
 import math
 
 # convenient ratio of time moving point to time creating sketch
-MOVE_BUILD_RATIO = 0.1
+MOVE_BUILD_RATIO = 0.2
 # tolerance for comparison of reals
 TOLERANCE = 1.e-7
 
@@ -268,7 +287,7 @@ SketchConstraintLength_8 = Sketch_1.setLength(SketchLine_37.result(), 0.088)
 model.do()
 
 sketchTime = timer() - sketchTime
-print "Sketch creation time: {0}".format(sketchTime)
+print("Sketch creation time: {0}".format(sketchTime))
 expectedTime = MOVE_BUILD_RATIO * sketchTime
 averageTime = 0
 nbMoves = 0
@@ -290,7 +309,7 @@ for deltaX, deltaY in deltas:
     assert math.fabs(aPoint.x() - X) < TOLERANCE and math.fabs(aPoint.y() - Y) < TOLERANCE, "({0}, {1}) != ({2}, {3})".format(aPoint.x(), aPoint.y(), X, Y)
     averageTime += movementTime
     nbMoves += 1
-print "Movement average time: {0}".format(averageTime / nbMoves)
+print("Movement average time: {0}".format(averageTime / nbMoves))
 
 #=========================================================================
 # Change value of SketchConstraintAngle_6 and check execution time.
@@ -309,7 +328,7 @@ for ang in range(12, 30):
     assert math.fabs(curAngle - ang) < TOLERANCE, "angle {0} != {1} expected".format(curAngle, ang)
     averageTime += movementTime
     nbMoves += 1
-print "Changing angle average time: {0}".format(averageTime / nbMoves)
+print("Changing angle average time: {0}".format(averageTime / nbMoves))
 
 model.end()