From 5ec91f908ec61cd8423ea1ecb8342386190e9b79 Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sat, 17 Feb 2024 06:00:28 +0000 Subject: [PATCH] Updated formatting with new black version --- pywr_editor/form/parameter_form.py | 6 +++--- pywr_editor/form/recorder_form.py | 6 +++--- pywr_editor/model/model_config.py | 6 +++--- tests/json_models/files/custom_parameter.py | 6 +++--- tests/widgets/test_line_edit_widget.py | 4 +--- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/pywr_editor/form/parameter_form.py b/pywr_editor/form/parameter_form.py index 68f4e629..cd60a28a 100644 --- a/pywr_editor/form/parameter_form.py +++ b/pywr_editor/form/parameter_form.py @@ -55,9 +55,9 @@ def __init__( # (for example for table and external file) self.clean_keys() self.section_form_data["parameter_obj"] = self.parameter_obj - self.section_form_data[ - "enable_optimisation_section" - ] = enable_optimisation_section + self.section_form_data["enable_optimisation_section"] = ( + enable_optimisation_section + ) self.params_data = model_config.pywr_parameter_data self.show_warning = False diff --git a/pywr_editor/form/recorder_form.py b/pywr_editor/form/recorder_form.py index fdb5c3c9..84118063 100644 --- a/pywr_editor/form/recorder_form.py +++ b/pywr_editor/form/recorder_form.py @@ -67,9 +67,9 @@ def __init__( # (for example for table and external file) self.clean_keys() self.section_form_data["recorder_obj"] = self.recorder_obj - self.section_form_data[ - "enable_optimisation_section" - ] = enable_optimisation_section + self.section_form_data["enable_optimisation_section"] = ( + enable_optimisation_section + ) self.recorders_data = self.model_config.pywr_recorder_data self.show_warning = False diff --git a/pywr_editor/model/model_config.py b/pywr_editor/model/model_config.py index 50149271..ab11e616 100644 --- a/pywr_editor/model/model_config.py +++ b/pywr_editor/model/model_config.py @@ -492,9 +492,9 @@ def schematic_size(self) -> list[float]: return self.editor_config[schematic_size_key] else: # store the schematic size if it is not set or wrong - self.editor_config[ - Constants.SCHEMATIC_SIZE_KEY.value - ] = default_schematic_size + self.editor_config[Constants.SCHEMATIC_SIZE_KEY.value] = ( + default_schematic_size + ) return default_schematic_size def update_schematic_size(self, size: list[float]) -> None: diff --git a/tests/json_models/files/custom_parameter.py b/tests/json_models/files/custom_parameter.py index fec44f1c..2298d542 100644 --- a/tests/json_models/files/custom_parameter.py +++ b/tests/json_models/files/custom_parameter.py @@ -65,9 +65,9 @@ def after(self): timestep = self.model.timestepper.current # get current timestep flow_during_timestep = self._node.flow * timestep.days # see explanation below self._remaining -= flow_during_timestep - self._remaining[ - self._remaining < 0 - ] = 0 # volume remaining cannot be less than zero + self._remaining[self._remaining < 0] = ( + 0 # volume remaining cannot be less than zero + ) @classmethod def load(cls, model, data): diff --git a/tests/widgets/test_line_edit_widget.py b/tests/widgets/test_line_edit_widget.py index 39da54ec..7d82bb1a 100644 --- a/tests/widgets/test_line_edit_widget.py +++ b/tests/widgets/test_line_edit_widget.py @@ -194,9 +194,7 @@ def test_invalid(self, qtbot, model_config, param_name, message): assert "must provide a valid parameter" in validation_obj.error_message @staticmethod - def add_parameter_with_checks( - qtbot, model_config - ) -> [ + def add_parameter_with_checks(qtbot, model_config) -> [ ParameterLineEditWidget, ModelComponentPickerDialog, ParametersDialog,