From b3311a78deb67516666ec499387229e5b08617eb Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Wed, 22 May 2024 08:05:03 +0000 Subject: [PATCH] style: format code with Black and isort This commit fixes the style issues introduced in e7dde6e according to the output from Black and isort. Details: None --- parchmint/connection.py | 20 +++++++++++--------- parchmint/device.py | 8 +++++--- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/parchmint/connection.py b/parchmint/connection.py index 5991294..838e774 100644 --- a/parchmint/connection.py +++ b/parchmint/connection.py @@ -136,9 +136,9 @@ def to_parchmint_v1_2(self): dict: dictionary that can be used in json.dumps() """ return { - "source": None - if self.__source is None - else self.__source.to_parchmint_v1(), + "source": ( + None if self.__source is None else self.__source.to_parchmint_v1() + ), "sink": None if self.__sink is None else self.__sink.to_parchmint_v1(), "wayPoints": [list(wp) for wp in self.__waypoints], "features": [feat.ID for feat in self.__features], @@ -268,9 +268,9 @@ def to_parchmint_v1(self): "sinks": [s.to_parchmint_v1() for s in self.sinks], "name": self.name, "id": self.ID, - "source": self.source.to_parchmint_v1() - if self.source is not None - else None, + "source": ( + self.source.to_parchmint_v1() if self.source is not None else None + ), "params": self.params.to_parchmint_v1(), "layer": self.layer.ID if self.layer is not None else None, } @@ -359,9 +359,11 @@ def from_parchmint_v1_2(json_data: Dict, device_ref: Device) -> Connection: entity=json_data["entity"], params=Params(json_data["params"]), source=Target(json_data=json_data["source"]), - sinks=[Target(json_data=sink) for sink in json_data["sinks"]] - if "sinks" in json_data.keys() - else [], + sinks=( + [Target(json_data=sink) for sink in json_data["sinks"]] + if "sinks" in json_data.keys() + else [] + ), paths=[ ConnectionPath.from_parchmint_v1_2(path, device_ref) for path in json_data["paths"] diff --git a/parchmint/device.py b/parchmint/device.py index 5d76f4b..09734af 100644 --- a/parchmint/device.py +++ b/parchmint/device.py @@ -857,9 +857,11 @@ def get_valve_type(value: str) -> ValveType: device_ref.map_valve( device_ref.get_component(componentid), device_ref.get_connection(connectionid), - get_valve_type(valve_type) - if valve_type is not None - else ValveType.NORMALLY_OPEN, + ( + get_valve_type(valve_type) + if valve_type is not None + else ValveType.NORMALLY_OPEN + ), ) return device_ref