Skip to content

Commit

Permalink
style: format code with Black and isort
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in e7dde6e according to the output
from Black and isort.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored May 22, 2024
1 parent e7dde6e commit b3311a7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
20 changes: 11 additions & 9 deletions parchmint/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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"]
Expand Down
8 changes: 5 additions & 3 deletions parchmint/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b3311a7

Please sign in to comment.