Skip to content

Commit

Permalink
Check for duplicate pin numbers and raise an exception
Browse files Browse the repository at this point in the history
Closes #72.
  • Loading branch information
formatc1702 committed Jul 9, 2020
1 parent e1e6655 commit 6a2924f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wireviz/DataClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def __post_init__(self):
if not self.pinout:
self.pinout = [''] * self.pincount

if len(self.pinnumbers) != len(set(self.pinnumbers)):
raise Exception('Pin numbers are not unique')

def loop(self, from_pin, to_pin):
self.loops.append((from_pin, to_pin))
if self.hide_disconnected_pins:
Expand Down

0 comments on commit 6a2924f

Please sign in to comment.