improve messaging when no nets/opens/shorts are detected

This commit is contained in:
Jan Petykiewicz 2023-06-21 19:43:39 -07:00
parent 693d04ccc1
commit 3638e17777

View File

@ -68,16 +68,22 @@ class TraceAnalysis:
ss += '\n(groups of electrically connected labels)\n' ss += '\n(groups of electrically connected labels)\n'
for net in sort_nets(self.nets): for net in sort_nets(self.nets):
ss += '\t' + format_net(net) + '\n' ss += '\t' + format_net(net) + '\n'
if not self.nets:
ss += '\t<NO NETS FOUND>'
ss += '\nOpens' ss += '\nOpens'
ss += '\n(2+ nets containing the same name)\n' ss += '\n(2+ nets containing the same name)\n'
for label, count in sorted(self.opens.items()): for label, count in sorted(self.opens.items()):
ss += f'\t{label} : {count} nets\n' ss += f'\t{label} : {count} nets\n'
if not self.opens:
ss += '\t<No opens found>'
ss += '\nShorts' ss += '\nShorts'
ss += '\n(2+ unique names for the same net)\n' ss += '\n(2+ unique names for the same net)\n'
for net in sort_nets(self.shorts): for net in sort_nets(self.shorts):
ss += '\t' + format_net(net) + '\n' ss += '\t' + format_net(net) + '\n'
if not self.shorts:
ss += '\t<No shorts found>'
ss += '=============\n' ss += '=============\n'
return ss return ss