diff --git a/src/bonsai/bonsai/bim/module/root/operator.py b/src/bonsai/bonsai/bim/module/root/operator.py index b1c13a8368..0a585eb918 100644 --- a/src/bonsai/bonsai/bim/module/root/operator.py +++ b/src/bonsai/bonsai/bim/module/root/operator.py @@ -413,12 +413,13 @@ class UnlinkObject(bpy.types.Operator, tool.Ifc.Operator): skip_invoke: bpy.props.BoolProperty(default=False, options={"SKIP_SAVE"}) def _execute(self, context): + objects: list[bpy.types.Object] if self.obj: - objects = [bpy.data.objects.get(self.obj)] + requested_obj = bpy.data.objects.get(self.obj) + objects = [requested_obj] if requested_obj is not None else [] else: objects = context.selected_objects - objects: list[bpy.types.Object] for obj in objects: was_active_object = obj == context.active_object diff --git a/src/bonsai/bonsai/tool/sequence.py b/src/bonsai/bonsai/tool/sequence.py index cc6c08b8da..3da5290311 100644 --- a/src/bonsai/bonsai/tool/sequence.py +++ b/src/bonsai/bonsai/tool/sequence.py @@ -1159,11 +1159,11 @@ class Sequence(bonsai.core.tool.Sequence): props.task_input_colors.clear() for group, data in groups.items(): for predefined_type in data["PredefinedType"]: - if group in ["CREATION", "OPERATION", "MOVEMENT_TO"]: + if group in ("CREATION", "OPERATION", "MOVEMENT_TO"): predefined_type_item = props.task_output_colors.add() - elif group in ["MOVEMENT_FROM"]: + elif group in ("MOVEMENT_FROM",): predefined_type_item = props.task_input_colors.add() - elif group in ["USERDEFINED", "DESTRUCTION"]: + elif group in ("USERDEFINED", "DESTRUCTION"): predefined_type_item = props.task_input_colors.add() predefined_type_item2 = props.task_output_colors.add() predefined_type_item2.name = predefined_type diff --git a/src/ifcopenshell-python/ifcopenshell/draw.py b/src/ifcopenshell-python/ifcopenshell/draw.py index 61c730bcc9..1e1a056c3c 100644 --- a/src/ifcopenshell-python/ifcopenshell/draw.py +++ b/src/ifcopenshell-python/ifcopenshell/draw.py @@ -42,7 +42,7 @@ WHITE = numpy.array((1.0, 1.0, 1.0)) DO_NOTHING = lambda *args: None -ARRANGE_POLYGON_SETTINGS = W.arrange_polygon_settings() if hasattr(W, "arrange_polygon_settings") else None +ARRANGE_POLYGON_SETTINGS = W.arrange_polygon_settings() @dataclass @@ -546,11 +546,7 @@ def main( *(tup for i, tup in enumerate(zip(path_objects, section_polies, polies)) if has_relevant_zone(i)) ) - arranged = W.arrange_polygons( - *filter(None, (ARRANGE_POLYGON_SETTINGS,)), - polies, - *((logger,) if logger is not None else ()), - ) + arranged = W.arrange_polygons(ARRANGE_POLYGON_SETTINGS, polies, logger) svg_data_3 = W.polygons_to_svg(arranged, False) dom3 = parseString(svg_data_3) svg3 = dom3.childNodes[0] diff --git a/src/ifcopenshell-python/type-check-requirements.txt b/src/ifcopenshell-python/type-check-requirements.txt index c797c28034..d0cee0bd7e 100644 --- a/src/ifcopenshell-python/type-check-requirements.txt +++ b/src/ifcopenshell-python/type-check-requirements.txt @@ -3,6 +3,7 @@ cjio >=0.8, <0.10 deepdiff docutils flask +igraph isodate jinja2 lark