FreeCAD/use-python-time-process_time.patch
Stefan Brüns 9e9ca9b7a0 Accepting request 785385 from home:StefanBruens:branches:science
- Fix runtime errors with Python 3.8:
  * 0001-fem-use-time.process_time-instead-of-removed-time.cl.patch
- Fix last python2 she-bang remainders, fix imports:
  * fix_unittestgui_tkinter_py3.patch
- Remove unnecessary opencv build dependency
- update to current 0.18 branch:
  * Fem: fix segmentation fault when opening contraint transform
    panel. Fix Python code
  * Part: the number of domains returned by TopoShape::getDomains
    must match with number of faces
  * apply fixes from master when building with occt 7.4
    + Drop 0002-fix-compile.patch
- Fix build with Python 3.8:
  Add update-swigpyrunin-for-python-3.8.patch
- Spec file cleanup
  * Drop xpm FreeCAD icon
  * Install PNGs/SVG icons in correct paths
  * Remove obsolete update_mime_database calls in %post
  * Remove obsolete conditionals for Leap 42.x

OBS-URL: https://build.opensuse.org/request/show/785385
OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=105
2020-03-15 19:39:25 +00:00

78 lines
3.2 KiB
Diff

From 60ca94d7c2ff070631189216d2991ea8d59f80c7 Mon Sep 17 00:00:00 2001
From: looooo <sppedflyer@gmail.com>
Date: Tue, 14 Jan 2020 13:45:35 +0100
Subject: [PATCH] fem: use time.process_time instead of removed time.clock()
---
src/Mod/Fem/femmesh/femmesh2mesh.py | 4 ++--
src/Mod/Fem/femsolver/calculix/writer.py | 4 ++--
src/Mod/Fem/femsolver/z88/writer.py | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/Mod/Fem/femmesh/femmesh2mesh.py b/src/Mod/Fem/femmesh/femmesh2mesh.py
index 52303f4f5de..9a3750e1468 100644
--- a/src/Mod/Fem/femmesh/femmesh2mesh.py
+++ b/src/Mod/Fem/femmesh/femmesh2mesh.py
@@ -92,7 +92,7 @@ def femmesh_2_mesh(myFemMesh, myResults=None):
# This code generates a dict and a faceCode for each face of all elements
# All faceCodes are than sorted.
- start_time = time.clock()
+ start_time = time.process_time()
faceCodeList = []
faceCodeDict = {}
@@ -196,7 +196,7 @@ def femmesh_2_mesh(myFemMesh, myResults=None):
output_mesh.extend(triangle)
# print("my 2. triangle: ", triangle)
- end_time = time.clock()
+ end_time = time.process_time()
FreeCAD.Console.PrintMessage(
"Mesh by surface search method: {}\n".format(end_time - start_time)
)
diff --git a/src/Mod/Fem/femsolver/calculix/writer.py b/src/Mod/Fem/femsolver/calculix/writer.py
index 72abff35a92..42acd7b282e 100644
--- a/src/Mod/Fem/femsolver/calculix/writer.py
+++ b/src/Mod/Fem/femsolver/calculix/writer.py
@@ -97,7 +97,7 @@ def __init__(
)
def write_calculix_input_file(self):
- timestart = time.clock()
+ timestart = time.process_time()
FreeCAD.Console.PrintMessage("Start writing CalculiX input file\n")
FreeCAD.Console.PrintMessage("Write ccx input file to: {}\n".format(self.file_name))
FreeCAD.Console.PrintLog(
@@ -115,7 +115,7 @@ def write_calculix_input_file(self):
self.write_calculix_one_input_file()
writing_time_string = (
"Writing time CalculiX input file: {} seconds"
- .format(round((time.clock() - timestart), 2))
+ .format(round((time.process_time() - timestart), 2))
)
if self.femelement_count_test is True:
FreeCAD.Console.PrintMessage(writing_time_string + " \n\n")
diff --git a/src/Mod/Fem/femsolver/z88/writer.py b/src/Mod/Fem/femsolver/z88/writer.py
index 57ac8be2f62..40229fd53e7 100644
--- a/src/Mod/Fem/femsolver/z88/writer.py
+++ b/src/Mod/Fem/femsolver/z88/writer.py
@@ -92,7 +92,7 @@ def __init__(
)
def write_z88_input(self):
- timestart = time.clock()
+ timestart = time.process_time()
if not self.femnodes_mesh:
self.femnodes_mesh = self.femmesh.Nodes
if not self.femelement_table:
@@ -109,7 +109,7 @@ def write_z88_input(self):
self.write_z88_solver_parameter()
writing_time_string = (
"Writing time input file: {} seconds"
- .format(round((time.clock() - timestart), 2))
+ .format(round((time.process_time() - timestart), 2))
)
FreeCAD.Console.PrintMessage(writing_time_string + " \n\n")
return self.dir_name