From feebc701fa8385709c3f5d51416253d5c0115a50 Mon Sep 17 00:00:00 2001 From: Andrej Date: Wed, 28 May 2025 16:57:48 +0500 Subject: [PATCH] Fix Ruff UP008 (super-call-with-parameters) https://docs.astral.sh/ruff/rules/super-call-with-parameters/ --- src/bonsai/bonsai/bim/module/drawing/svgwriter.py | 2 +- src/ifcbimtester/bimtester/guiwidget.py | 2 +- src/ifcopenshell-python/ifcopenshell/entity_instance.py | 6 +++--- src/ifcopenshell-python/ifcopenshell/geom/main.py | 2 +- src/ifcopenshell-python/ifcopenshell/validate.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/drawing/svgwriter.py b/src/bonsai/bonsai/bim/module/drawing/svgwriter.py index f372fdf60c..f9cc874e26 100644 --- a/src/bonsai/bonsai/bim/module/drawing/svgwriter.py +++ b/src/bonsai/bonsai/bim/module/drawing/svgwriter.py @@ -53,7 +53,7 @@ class External(svgwrite.container.Group): if elem.tag.startswith(ns): elem.tag = elem.tag[nsl:] - super(External, self).__init__(**extra) + super().__init__(**extra) def get_xml(self): return self.xml diff --git a/src/ifcbimtester/bimtester/guiwidget.py b/src/ifcbimtester/bimtester/guiwidget.py index 2a34977e49..b9b02e81af 100644 --- a/src/ifcbimtester/bimtester/guiwidget.py +++ b/src/ifcbimtester/bimtester/guiwidget.py @@ -38,7 +38,7 @@ def run(): class GuiWidgetBimTester(QtWidgets.QWidget): def __init__(self, args=None): - super(GuiWidgetBimTester, self).__init__() + super().__init__() if args is not None and args != {}: self.args = args diff --git a/src/ifcopenshell-python/ifcopenshell/entity_instance.py b/src/ifcopenshell-python/ifcopenshell/entity_instance.py index 60bc0ad138..8380670806 100644 --- a/src/ifcopenshell-python/ifcopenshell/entity_instance.py +++ b/src/ifcopenshell-python/ifcopenshell/entity_instance.py @@ -152,8 +152,8 @@ class entity_instance: def __init__(self, e, file=None): if isinstance(e, tuple): e = ifcopenshell_wrapper.new_IfcBaseClass(*e) - super(entity_instance, self).__setattr__("wrapped_data", e) - super(entity_instance, self).__setattr__("method_list", None) + super().__setattr__("wrapped_data", e) + super().__setattr__("method_list", None) # Make sure the file is not gc'ed while we have live instances self.wrapped_data.file = file @@ -339,7 +339,7 @@ class entity_instance: self.wrapped_data.file.transaction.store_edit(self, idx, value) if self.method_list is None: - super(entity_instance, self).__setattr__("method_list", _method_dict[self.is_a(True)]) + super().__setattr__("method_list", _method_dict[self.is_a(True)]) method = self.method_list[idx] diff --git a/src/ifcopenshell-python/ifcopenshell/geom/main.py b/src/ifcopenshell-python/ifcopenshell/geom/main.py index 9e454ed724..4a1e49bcdc 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/main.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/main.py @@ -141,7 +141,7 @@ class settings_mixin: """ def __init__(self, **kwargs): - super(settings_mixin, self).__init__() + super().__init__() for k, v in kwargs.items(): self.set(getattr(self, k), v) diff --git a/src/ifcopenshell-python/ifcopenshell/validate.py b/src/ifcopenshell-python/ifcopenshell/validate.py index ed81f10cec..01a0d61d36 100644 --- a/src/ifcopenshell-python/ifcopenshell/validate.py +++ b/src/ifcopenshell-python/ifcopenshell/validate.py @@ -75,7 +75,7 @@ attribute_types = Union[simple_type, named_type, enumeration_type, select_type, class ValidationError(Exception): def __init__(self, message, attribute=None): - super(ValidationError, self).__init__(message) + super().__init__(message) self.attribute = attribute