Skip to content

Commit

Permalink
Add suggestions from #186
Browse files Browse the repository at this point in the history
  • Loading branch information
formatc1702 committed Aug 5, 2022
1 parent e51634d commit 417c842
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/wireviz/wv_dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ def __post_init__(self) -> None:
if self.show_name is None:
self.show_name = not self.is_autogenerated

if not self.show_wirenumbers:
if self.show_wirenumbers is None:
# by default, show wire numbers for cables, hide for bundles
self.show_wirenumbers = self.category != "bundle"

Expand Down
7 changes: 4 additions & 3 deletions src/wireviz/wv_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ def expand(yaml_data):


def get_single_key_and_value(d: dict):
k = list(d.keys())[0]
v = d[k]
return (k, v)
# used for defining a line in a harness' connection set
# E.g. for the YAML input `- X1: 1`
# this function returns a tuple in the form ("X1", "1")
return next(iter(d.items()))


def int2tuple(inp):
Expand Down

0 comments on commit 417c842

Please sign in to comment.