From 2f9e5b00bb2429804cc8f49c4a76a41009611beb Mon Sep 17 00:00:00 2001 From: digitalfrost Date: Sun, 7 Aug 2022 10:09:33 +0200 Subject: [PATCH 1/7] Use is not operator rather than not ... is This is advocated by both PEP8 and the Google Python Style Guide --- plugins/X3DReader/X3DReader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/X3DReader/X3DReader.py b/plugins/X3DReader/X3DReader.py index 548c9f44e6..e62c0886be 100644 --- a/plugins/X3DReader/X3DReader.py +++ b/plugins/X3DReader/X3DReader.py @@ -134,7 +134,7 @@ class X3DReader(MeshReader): geometry = self.resolveDefUse(sub_node) # TODO: appearance is completely ignored. At least apply the material color... - if not geometry is None: + if geometry is not None: try: self.verts = self.faces = [] # Safeguard self.geometry_importers[geometry.tag](self, geometry) From d65e198e8c400199f4761ef0a727354de43b2355 Mon Sep 17 00:00:00 2001 From: digitalfrost Date: Mon, 8 Aug 2022 09:28:26 +0200 Subject: [PATCH 2/7] Use is not operator rather than not ...is This is advocated by both PEP8 and the Google Python Style Guide --- plugins/X3DReader/X3DReader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/X3DReader/X3DReader.py b/plugins/X3DReader/X3DReader.py index e62c0886be..bf1966d013 100644 --- a/plugins/X3DReader/X3DReader.py +++ b/plugins/X3DReader/X3DReader.py @@ -703,7 +703,7 @@ class X3DReader(MeshReader): for c in node: if c.tag == "Coordinate": c = self.resolveDefUse(c) - if not c is None: + if c is not None: pt = c.attrib.get("point") if pt: # allow the list of float values in 'point' attribute to From 0f0815efabfed1083c3aab8f2654d4b9f3440562 Mon Sep 17 00:00:00 2001 From: digitalfrost Date: Mon, 8 Aug 2022 09:33:26 +0200 Subject: [PATCH 3/7] Use is not operator rather than not ...is This is advocated by both PEP8 and the Google Python Style Guide --- plugins/X3DReader/X3DReader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/X3DReader/X3DReader.py b/plugins/X3DReader/X3DReader.py index bf1966d013..4ef60824f1 100644 --- a/plugins/X3DReader/X3DReader.py +++ b/plugins/X3DReader/X3DReader.py @@ -493,7 +493,7 @@ class X3DReader(MeshReader): # Columns are the unit vectors for the xz plane for the cross-section if orient: mrot = orient[i] if len(orient) > 1 else orient[0] - if not mrot is None: + if mrot is not None: m = m.dot(mrot) # Tested against X3DOM, the result matches, still not sure :( if scale: From 72751b2507952e8d5308bab87c009247d18d87d1 Mon Sep 17 00:00:00 2001 From: digitalfrost Date: Mon, 8 Aug 2022 09:36:53 +0200 Subject: [PATCH 4/7] Use is not operator rather than not ... is This is advocated by both PEP8 and the Google Python Style Guide --- plugins/X3DReader/X3DReader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/X3DReader/X3DReader.py b/plugins/X3DReader/X3DReader.py index 4ef60824f1..0b41578a05 100644 --- a/plugins/X3DReader/X3DReader.py +++ b/plugins/X3DReader/X3DReader.py @@ -498,7 +498,7 @@ class X3DReader(MeshReader): if scale: mscale = scale[i] if len(scale) > 1 else scale[0] - if not mscale is None: + if mscale is not None: m = m.dot(mscale) # First the cross-section 2-vector is scaled, From 06e61a31291bc4fc307837ebf496e12089de2b3a Mon Sep 17 00:00:00 2001 From: digitalfrost Date: Mon, 8 Aug 2022 09:48:33 +0200 Subject: [PATCH 5/7] Use is not operator rather than not ... is This is advocated by both PEP8 and the Google Python Style Guide --- cura/Arranging/ShapeArray.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/Arranging/ShapeArray.py b/cura/Arranging/ShapeArray.py index 5607c03663..45454f6239 100644 --- a/cura/Arranging/ShapeArray.py +++ b/cura/Arranging/ShapeArray.py @@ -74,7 +74,7 @@ class ShapeArray: # If the child-nodes are included, adjust convex hulls as well: if include_children: children = node.getAllChildren() - if not children is None: + if children is not None: for child in children: # 'Inefficient' combination of convex hulls through known code rather than mess it up: child_hull = child.callDecoration("getConvexHull") @@ -159,4 +159,4 @@ class ShapeArray: max_col_idx = (idxs[0] - p1[0]) / (p2[0] - p1[0]) * (p2[1] - p1[1]) + p1[1] sign = numpy.sign(p2[0] - p1[0]) - return idxs[1] * sign <= max_col_idx * sign \ No newline at end of file + return idxs[1] * sign <= max_col_idx * sign From ff07129f2ce6bf92d192be003f0ef5457ae2b842 Mon Sep 17 00:00:00 2001 From: digitalfrost Date: Mon, 8 Aug 2022 09:50:36 +0200 Subject: [PATCH 6/7] Use is not operator rather than not ... is This is advocated by both PEP8 and the Google Python Style Guide --- cura/Arranging/ShapeArray.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Arranging/ShapeArray.py b/cura/Arranging/ShapeArray.py index 45454f6239..3060ea6e8e 100644 --- a/cura/Arranging/ShapeArray.py +++ b/cura/Arranging/ShapeArray.py @@ -78,7 +78,7 @@ class ShapeArray: for child in children: # 'Inefficient' combination of convex hulls through known code rather than mess it up: child_hull = child.callDecoration("getConvexHull") - if not child_hull is None: + if child_hull is not None: hull_verts = hull_verts.unionConvexHulls(child_hull) child_hull_head = child.callDecoration("getConvexHullHead") or child_hull if not child_hull_head is None: From 54b9ed97aeb3e8ddf7af65e479fe7ade3a492aa0 Mon Sep 17 00:00:00 2001 From: digitalfrost Date: Mon, 8 Aug 2022 09:52:16 +0200 Subject: [PATCH 7/7] Use is not operator rather than not ... is This is advocated by both PEP8 and the Google Python Style Guide --- cura/Arranging/ShapeArray.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Arranging/ShapeArray.py b/cura/Arranging/ShapeArray.py index 3060ea6e8e..714d9d3837 100644 --- a/cura/Arranging/ShapeArray.py +++ b/cura/Arranging/ShapeArray.py @@ -81,7 +81,7 @@ class ShapeArray: if child_hull is not None: hull_verts = hull_verts.unionConvexHulls(child_hull) child_hull_head = child.callDecoration("getConvexHullHead") or child_hull - if not child_hull_head is None: + if child_hull_head is not None: hull_head_verts = hull_head_verts.unionConvexHulls(child_hull_head) offset_verts = hull_head_verts.getMinkowskiHull(Polygon.approximatedCircle(min_offset))