Skip to content

Commit d2b6891

Browse files
style: format code with Black and isort
This commit fixes the style issues introduced in 43404a0 according to the output from Black and isort. Details: None
1 parent 43404a0 commit d2b6891

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

parchmint/connection.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ def to_parchmint_v1_2(self):
136136
dict: dictionary that can be used in json.dumps()
137137
"""
138138
return {
139-
"source": None
140-
if self.__source is None
141-
else self.__source.to_parchmint_v1(),
139+
"source": (
140+
None if self.__source is None else self.__source.to_parchmint_v1()
141+
),
142142
"sink": None if self.__sink is None else self.__sink.to_parchmint_v1(),
143143
"wayPoints": [list(wp) for wp in self.__waypoints],
144144
"features": [feat.ID for feat in self.__features],
@@ -268,9 +268,9 @@ def to_parchmint_v1(self):
268268
"sinks": [s.to_parchmint_v1() for s in self.sinks],
269269
"name": self.name,
270270
"id": self.ID,
271-
"source": self.source.to_parchmint_v1()
272-
if self.source is not None
273-
else None,
271+
"source": (
272+
self.source.to_parchmint_v1() if self.source is not None else None
273+
),
274274
"params": self.params.to_parchmint_v1(),
275275
"layer": self.layer.ID if self.layer is not None else None,
276276
}
@@ -372,9 +372,11 @@ def from_parchmint_v1_2(json_data: Dict, device_ref: Device) -> Connection:
372372
entity=json_data["entity"],
373373
params=Params(json_data["params"]),
374374
source=Target(json_data=json_data["source"]),
375-
sinks=[Target(json_data=sink) for sink in json_data["sinks"]]
376-
if "sinks" in json_data.keys()
377-
else [],
375+
sinks=(
376+
[Target(json_data=sink) for sink in json_data["sinks"]]
377+
if "sinks" in json_data.keys()
378+
else []
379+
),
378380
paths=[
379381
ConnectionPath.from_parchmint_v1_2(path, device_ref)
380382
for path in json_data["paths"]

parchmint/device.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -857,9 +857,11 @@ def get_valve_type(value: str) -> ValveType:
857857
device_ref.map_valve(
858858
device_ref.get_component(componentid),
859859
device_ref.get_connection(connectionid),
860-
get_valve_type(valve_type)
861-
if valve_type is not None
862-
else ValveType.NORMALLY_OPEN,
860+
(
861+
get_valve_type(valve_type)
862+
if valve_type is not None
863+
else ValveType.NORMALLY_OPEN
864+
),
863865
)
864866

865-
return device_ref
867+
return device_ref

0 commit comments

Comments
 (0)