FEM: solver frame work, code formating

This commit is contained in:
Bernd Hahnebach
2021-07-26 11:37:51 +02:00
parent 1cc9c88be1
commit e84f0ab609
4 changed files with 12 additions and 12 deletions

View File

@@ -95,8 +95,8 @@ def run_fem_solver(solver, working_dir=None):
:note:
There is some legacy code to execute the old Calculix solver
(pre-framework) which behaives differently because it doesn't use a
:class:`Machine`.
(pre-framework) which behaives differently because it does not
use a :class:`Machine`.
"""
if solver.Proxy.Type == "Fem::SolverCcxTools":

View File

@@ -85,7 +85,7 @@ def get_binary(name):
Return the specific path set by the user in FreeCADs settings/parameter
system if set or the default binary name if no specific path is set. If no
path was found because the solver *name* isn't supported ``None`` is
path was found because the solver *name* is not supported ``None`` is
returned. This method does not check whether the binary actually exists
and is callable.
@@ -93,12 +93,12 @@ def get_binary(name):
"""
if name in _SOLVER_PARAM:
binary = _SOLVER_PARAM[name].get_binary()
FreeCAD.Console.PrintMessage('Solver binary path: {} \n'.format(binary))
FreeCAD.Console.PrintMessage("Solver binary path: {} \n".format(binary))
return binary
else:
FreeCAD.Console.PrintError(
'Settings solver name: {} not found in '
'solver settings modules _SOLVER_PARAM dirctionary.\n'
"Settings solver name: {} not found in "
"solver settings modules _SOLVER_PARAM dirctionary.\n"
.format(name)
)
return None
@@ -108,8 +108,8 @@ def get_write_comments(name):
""" Check whether "write_comments" is set for solver.
Returns ``True`` if the "write_comments" setting/parameter is set for the
solver with the id *name*. Returns ``False`` otherwise. If the solver isn't
supported ``None`` is returned.
solver with the id *name*. Returns ``False`` otherwise. If the solver is
not supported ``None`` is returned.
:param name: solver id as a ``str`` (see :mod:`femsolver.settings`)
"""
@@ -117,8 +117,8 @@ def get_write_comments(name):
return _SOLVER_PARAM[name].get_write_comments()
else:
FreeCAD.Console.PrintError(
'Settings solver name: {} not found in '
'solver settings modules _SOLVER_PARAM dirctionary.\n'
"Settings solver name: {} not found in "
"solver settings modules _SOLVER_PARAM dirctionary.\n"
.format(name)
)
return None

View File

@@ -72,7 +72,7 @@ class ControlTaskPanel(QtCore.QObject):
self.form.abortClicked.connect(self.abort)
self.form.directoryChanged.connect(self.updateMachine)
# Seems that the task panel doesn't get destroyed. Disconnect
# Seems that the task panel does not get destroyed. Disconnect
# as soon as the widget of the task panel gets destroyed.
self.form.destroyed.connect(self._disconnectMachine)
self.form.destroyed.connect(self._timer.stop)

View File

@@ -56,7 +56,7 @@ class FemInputWriter():
self.document = self.analysis.Document
# working dir
self.dir_name = dir_name
# if dir_name was not given or if it exists but isn't empty: create a temporary dir
# if dir_name was not given or if it exists but is not empty: create a temporary dir
# Purpose: makes sure the analysis can be run even on wired situation
if not dir_name:
FreeCAD.Console.PrintWarning(