From e2d8d0fca1c6a33841a5f16143d6049bb160f05a Mon Sep 17 00:00:00 2001 From: cow-bot Date: Mon, 16 Oct 2023 07:52:38 +0000 Subject: [PATCH] GO FORMAT YOURSELF (black) --- nexus_constructor/field_widget.py | 6 +++++- nexus_constructor/model/component.py | 6 ++++-- nexus_constructor/model/transformation.py | 4 +++- tests/model/test_transformations.py | 4 +++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/nexus_constructor/field_widget.py b/nexus_constructor/field_widget.py index 88947a002..3a952cfe0 100644 --- a/nexus_constructor/field_widget.py +++ b/nexus_constructor/field_widget.py @@ -438,7 +438,11 @@ def field_type_changed(self): self.edit_dialog = QDialog(parent=self) self.edit_dialog.setModal(True) self._set_up_value_validator(False) - if self._node_parent and self.streams_widget and self.streams_widget._old_schema: + if ( + self._node_parent + and self.streams_widget + and self.streams_widget._old_schema + ): self._node_parent.add_stream_module(self.streams_widget._old_schema) if self.field_type == FieldType.scalar_dataset: self.set_visibility(True, False, False, True) diff --git a/nexus_constructor/model/component.py b/nexus_constructor/model/component.py index 77bb6f7ff..f68863864 100644 --- a/nexus_constructor/model/component.py +++ b/nexus_constructor/model/component.py @@ -264,7 +264,7 @@ def add_rotation( depends_on, values, target_pos, - offset_vector if offset_vector is not None else QVector3D(0., 0., 0.), + offset_vector if offset_vector is not None else QVector3D(0.0, 0.0, 0.0), ) def _create_and_add_transform( @@ -300,7 +300,9 @@ def _create_and_add_transform( transform.ui_value = angle_or_magnitude transform.units = units transform.vector = vector - transform.offset_vector = offset_vector if offset_vector is not None else QVector3D(0., 0., 0.) + transform.offset_vector = ( + offset_vector if offset_vector is not None else QVector3D(0.0, 0.0, 0.0) + ) transform.depends_on = depends_on transform.parent_component = self if target_pos: diff --git a/nexus_constructor/model/transformation.py b/nexus_constructor/model/transformation.py index 4c76b7837..2ec83f2c7 100644 --- a/nexus_constructor/model/transformation.py +++ b/nexus_constructor/model/transformation.py @@ -71,7 +71,9 @@ def vector(self, new_vector: QVector3D): def offset_vector(self) -> QVector3D: vector = self.attributes.get_attribute_value(CommonAttrs.OFFSET) return ( - QVector3D(vector[0], vector[1], vector[2]) if vector is not None else QVector3D(0., 0., 0.) + QVector3D(vector[0], vector[1], vector[2]) + if vector is not None + else QVector3D(0.0, 0.0, 0.0) ) @offset_vector.setter diff --git a/tests/model/test_transformations.py b/tests/model/test_transformations.py index b36795a92..c3b7fc542 100644 --- a/tests/model/test_transformations.py +++ b/tests/model/test_transformations.py @@ -31,7 +31,9 @@ def create_transform( ) translation.vector = vector if vector is not None else QVector3D(1.0, 0.0, 0.0) - translation.offset_vector = offset_vector if offset_vector is not None else QVector3D(0.0, 0.0, 0.0) + translation.offset_vector = ( + offset_vector if offset_vector is not None else QVector3D(0.0, 0.0, 0.0) + ) translation.transform_type = type translation.ui_value = ui_value translation.units = units