diff --git a/src/wireviz/DataClasses.py b/src/wireviz/DataClasses.py
index e3d80042..35bb13a2 100644
--- a/src/wireviz/DataClasses.py
+++ b/src/wireviz/DataClasses.py
@@ -309,9 +309,8 @@ def __post_init__(self) -> None:
if self.wirecount: # number of wires explicitly defined
if self.colors: # use custom color palette (partly or looped if needed)
pass
- elif (
- self.color_code
- ): # use standard color palette (partly or looped if needed)
+ elif self.color_code:
+ # use standard color palette (partly or looped if needed)
if self.color_code not in COLOR_CODES:
raise Exception("Unknown color code")
self.colors = COLOR_CODES[self.color_code]
diff --git a/src/wireviz/Harness.py b/src/wireviz/Harness.py
index 1f87d307..a6ed4da3 100644
--- a/src/wireviz/Harness.py
+++ b/src/wireviz/Harness.py
@@ -395,18 +395,16 @@ def create_graph(self) -> Graph:
wirehtml.append(
'
'
)
- for j, bgcolor in enumerate(
- bgcolors[::-1]
- ): # Reverse to match the curved wires when more than 2 colors
+ for j, bgcolor in enumerate(bgcolors[::-1]):
+ # Reverse to match the curved wires when more than 2 colors
wirehtml.append(
f' |
'
)
wirehtml.append("
")
wirehtml.append(" ")
wirehtml.append(" ")
- if (
- cable.category == "bundle"
- ): # for bundles individual wires can have part information
+ if cable.category == "bundle":
+ # for bundles individual wires can have part information
# create a list of wire parameters
wireidentification = []
if isinstance(cable.pn, list):
@@ -473,9 +471,8 @@ def create_graph(self) -> Graph:
# connections
for connection in cable.connections:
- if isinstance(
- connection.via_port, int
- ): # check if it's an actual wire and not a shield
+ # check if it's an actual wire and not a shield
+ if isinstance(connection.via_port, int):
dot.attr(
"edge",
color=":".join(
diff --git a/src/wireviz/wireviz.py b/src/wireviz/wireviz.py
index f46a301e..ec8429c8 100755
--- a/src/wireviz/wireviz.py
+++ b/src/wireviz/wireviz.py
@@ -148,9 +148,8 @@ def check_designators(what, where): # helper function
else:
sublist.append([item, 1])
connection_list.append(sublist)
- elif isinstance(
- item, list
- ): # a list of single-pin components were specified
+ elif isinstance(item, list):
+ # a list of single-pin components were specified
sublist = []
for subitem in item:
if yaml_data["connectors"][subitem].get("autogenerate"):
diff --git a/src/wireviz/wv_bom.py b/src/wireviz/wv_bom.py
index 29b49ef1..6689d79a 100644
--- a/src/wireviz/wv_bom.py
+++ b/src/wireviz/wv_bom.py
@@ -214,11 +214,8 @@ def get_bom_index(bom: List[BOMEntry], target: BOMKey) -> int:
def bom_list(bom: List[BOMEntry]) -> List[List[str]]:
"""Return list of BOM rows as lists of column strings with headings in top row."""
keys = list(BOM_COLUMNS_ALWAYS) # Always include this fixed set of BOM columns.
- for (
- fieldname
- ) in (
- BOM_COLUMNS_OPTIONAL
- ): # Include only those optional BOM columns that are in use.
+ for fieldname in BOM_COLUMNS_OPTIONAL:
+ # Include only those optional BOM columns that are in use.
if any(entry.get(fieldname) for entry in bom):
keys.append(fieldname)
# Custom mapping from internal name to BOM column headers.