From 8d5fbd947b643a2059fc4807f97f4aa6c6b827e6 Mon Sep 17 00:00:00 2001 From: "luz.paz" Date: Sun, 12 May 2019 09:07:18 -0400 Subject: [PATCH] FIx some user and non-user facing typos Found via ` codespell -q 3 -I ../fc-word-whitelist.txt -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig* -L pard,wallthicknessOn` codespell version 1.15.0.dev0 --- src/Mod/Fem/TestFem.py | 2 +- src/Mod/Fem/feminout/importToolsFem.py | 2 +- src/Mod/Fem/femsolver/writerbase.py | 6 +++--- src/Mod/Material/materialtools/cardutils.py | 6 +++--- src/Mod/Path/PathScripts/PathSurface.py | 12 ++++++------ src/Mod/Robot/App/Trajectory.cpp | 9 ++------- src/Tools/updatets.py | 2 +- 7 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/Mod/Fem/TestFem.py b/src/Mod/Fem/TestFem.py index 377e77a6b4..06eae37a5b 100644 --- a/src/Mod/Fem/TestFem.py +++ b/src/Mod/Fem/TestFem.py @@ -201,7 +201,7 @@ unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.t # open files from FEM test suite source code -# be careful on updating these files, they consist the original results! +# be careful on updating these files, they contain the original results! # TODO update files, because some of them have non-existing FEM object classes doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'Mod/Fem/femtest/testfiles/ccx/cube.FCStd') doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'Mod/Fem/femtest/testfiles/ccx/cube_frequency.FCStd') diff --git a/src/Mod/Fem/feminout/importToolsFem.py b/src/Mod/Fem/feminout/importToolsFem.py index f3fee214e5..2779e4f3b3 100644 --- a/src/Mod/Fem/feminout/importToolsFem.py +++ b/src/Mod/Fem/feminout/importToolsFem.py @@ -223,7 +223,7 @@ def fill_femresult_mechanical(res_obj, result_set): # fill res_obj.NodeStressXX etc if they exist in result_set # list values are just added - # Should we gone check if the key in stress and strain dict is the same as the number in NodeNumbers? + # Should we check if the key in stress and strain dict is the same as the number in NodeNumbers? if 'stress' in result_set: stress = result_set['stress'] Sxx = [] diff --git a/src/Mod/Fem/femsolver/writerbase.py b/src/Mod/Fem/femsolver/writerbase.py index 0d513dfa11..acadeaf41f 100644 --- a/src/Mod/Fem/femsolver/writerbase.py +++ b/src/Mod/Fem/femsolver/writerbase.py @@ -79,8 +79,8 @@ class FemInputWriter(): self.fluidsection_objects = fluidsection_obj self.shellthickness_objects = shellthickness_obj self.dir_name = dir_name - # if dir_name was not given or does not exist empty we gone create a temporary one - # this makes sure the analysis can be run even on wired situation + # if dir_name was not given or if it exists but isn't empty: create a temporary dir + # Purpose: makes sure the analysis can be run even on wired situation if not dir_name: FreeCAD.Console.PrintError('Error: FemInputWriter has no working_dir --> we are going to make a temporary one!\n') self.dir_name = FreeCAD.ActiveDocument.TransientDir.replace('\\', '/') + '/FemAnl_' + analysis_obj.Uid[-4:] @@ -200,7 +200,7 @@ class FemInputWriter(): frc_obj = femobj['Object'] if frc_obj.Force == 0: FreeCAD.Console.PrintMessage(' Warning --> Force = 0\n') - if femobj['RefShapeType'] == 'Vertex': # point load on vertieces + if femobj['RefShapeType'] == 'Vertex': # point load on vertices femobj['NodeLoadTable'] = FemMeshTools.get_force_obj_vertex_nodeload_table(self.femmesh, frc_obj) elif femobj['RefShapeType'] == 'Edge': # line load on edges femobj['NodeLoadTable'] = FemMeshTools.get_force_obj_edge_nodeload_table(self.femmesh, self.femelement_table, self.femnodes_mesh, frc_obj) diff --git a/src/Mod/Material/materialtools/cardutils.py b/src/Mod/Material/materialtools/cardutils.py index 34075112f4..9f82a92ab0 100644 --- a/src/Mod/Material/materialtools/cardutils.py +++ b/src/Mod/Material/materialtools/cardutils.py @@ -109,7 +109,7 @@ def get_material_resources(category='Solid'): def output_resources(resources): - FreeCAD.Console.PrintMessage('Directories we gone look for material cards:\n') + FreeCAD.Console.PrintMessage('Directories in which we will look for material cards:\n') for path in resources.keys(): FreeCAD.Console.PrintMessage(' {}\n'.format(path)) @@ -459,8 +459,8 @@ getsrc() # generate all cards ********** # run tools in source dir -./make_ods.sh -./make_FCMats.sh +./make_ods.sh +./make_FCMats.sh # read cards from materialtools.cardutils import read_cards_from_path as readcards diff --git a/src/Mod/Path/PathScripts/PathSurface.py b/src/Mod/Path/PathScripts/PathSurface.py index f7745e76e6..d0135fb1df 100644 --- a/src/Mod/Path/PathScripts/PathSurface.py +++ b/src/Mod/Path/PathScripts/PathSurface.py @@ -526,7 +526,7 @@ class ObjectSurface(PathOp.ObjectOp): cOut = (self.cutter.getDiameter() / 2) y = ymax - cOut else: - y = ymin - (self.cutter.getDiameter() / 2) + ((n + 1) * cOut) # all lines are offest by 1/2 cutter diameter + y = ymin - (self.cutter.getDiameter() / 2) + ((n + 1) * cOut) # all lines are offset by 1/2 cutter diameter p1 = ocl.Point(xmin, y, 0) # start-point of line p2 = ocl.Point(xmax, y, 0) # end-point of line @@ -540,7 +540,7 @@ class ObjectSurface(PathOp.ObjectOp): cOut = (self.cutter.getDiameter() / 2) x = xmax - cOut else: - x = xmin - (self.cutter.getDiameter() / 2) + ((n + 1) * cOut) # all lines are offest by 1/2 cutter diameter + x = xmin - (self.cutter.getDiameter() / 2) + ((n + 1) * cOut) # all lines are offset by 1/2 cutter diameter p1 = ocl.Point(x, ymin, 0) # start-point of line p2 = ocl.Point(x, ymax, 0) # end-point of line @@ -817,7 +817,7 @@ class ObjectSurface(PathOp.ObjectOp): lenHP = len(self.holdStartPnts) commands = [Path.Command('G0', {'Z': obj.SafeHeight.Value, 'F': self.vertRapid})] self.reportThis("--Processing " + str(lenHP) + " HOLD optimizations---") - # cycle throug hold points + # cycle through hold points if lenHP > 0: hdCnt = 0 lenGC = len(self.gcodeCmds) @@ -1148,7 +1148,7 @@ class ObjectSurface(PathOp.ObjectOp): nxt = ocl.Point(float("inf"), float("inf"), float("inf")) pnt = ocl.Point(float("inf"), float("inf"), float("inf")) - # Create frist point + # Create first point pnt.x = CLP[0].x pnt.y = CLP[0].y pnt.z = CLP[0].z + float(obj.DepthOffset.Value) @@ -1256,7 +1256,7 @@ class ObjectSurface(PathOp.ObjectOp): if obj.RotationAxis == 'Y': axisOfRot = 'B' - # Create frist point + # Create first point ang = 0.0 + obj.CutterTilt pnt.x = RNG[0].x pnt.y = RNG[0].y @@ -1623,7 +1623,7 @@ class ObjectSurface(PathOp.ObjectOp): nxt = ocl.Point(float("inf"), float("inf"), float("inf")) pnt = ocl.Point(float("inf"), float("inf"), float("inf")) - # Create frist point + # Create first point pnt.x = loop[0].x pnt.y = loop[0].y pnt.z = layDep diff --git a/src/Mod/Robot/App/Trajectory.cpp b/src/Mod/Robot/App/Trajectory.cpp index c4f04e6a09..6af82e053e 100644 --- a/src/Mod/Robot/App/Trajectory.cpp +++ b/src/Mod/Robot/App/Trajectory.cpp @@ -177,7 +177,7 @@ void Trajectory::generateTrajectory(void) case Waypoint::LINE: case Waypoint::PTP:{ KDL::Frame Next = toFrame((*it)->EndPos); - // continues the movement until no continus waypoint or the end + // continues the movement until no continuous waypoint or the end bool Cont = (*it)->Cont && !(it==--vpcWaypoints.end()); // start of a continue block if (Cont && !pcRoundComp) { @@ -256,7 +256,7 @@ std::string Trajectory::getUniqueWaypointName(const char *Name) const std::vector::const_iterator it; for(it = vpcWaypoints.begin();it!=vpcWaypoints.end();++it) if((*it)->Name == CleanName) break; - + if (it == vpcWaypoints.end()) { // if not, name is OK return CleanName; @@ -325,8 +325,3 @@ void Trajectory::Restore(XMLReader &reader) } generateTrajectory(); } - - - - - diff --git a/src/Tools/updatets.py b/src/Tools/updatets.py index 6b8e0bccb6..76fba10e5c 100755 --- a/src/Tools/updatets.py +++ b/src/Tools/updatets.py @@ -228,7 +228,7 @@ def main(): update_translation(i) for j in PyCommands: update_python_translation(j) - print("\nIf updatets.py was run successully, the next step is to run ./src/Tools/updatecrowdin.py") + print("\nIf updatets.py was run successfully, the next step is to run ./src/Tools/updatecrowdin.py") if __name__ == "__main__": main()