skidl icon indicating copy to clipboard operation
skidl copied to clipboard

[SKiDL BUG] generate_svg failure

Open shanzez opened this issue 3 years ago • 1 comments

Describe the bug When running with generate_svg, I get a failure: KeyError: 'n"

To Reproduce Steps to reproduce the behavior:

$ npm install -g https://github.com/nturley/netlistsvg

added 37 packages, and audited 38 packages in 5s

3 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
$ python3 main.py 
Traceback (most recent call last):
  File "/Users/shanzez/temp/board/main.py", line 108, in <module>
    skidl.generate_svg()
  File "/opt/homebrew/lib/python3.9/site-packages/skidl/circuit.py", line 869, in generate_svg
    part_pin_dirs = {
  File "/opt/homebrew/lib/python3.9/site-packages/skidl/circuit.py", line 870, in <dictcomp>
    pin.num: io_dict[
KeyError: 'n'

Expected behavior Generates the svg

Desktop (please complete the following information):

  • OS macOS 12 Beta - mac Mini M1 16GB mem (reproduced on Debian Linux x64 with same below versions)
  • Python version 3.9
  • SKiDL version 1.0.0

Additional context generate_netlist and dot are fine.

shanzez avatar Jul 12 '21 08:07 shanzez

I encountered this bug recently, and I found out that it is generated when a part contains a No-Connect Pin. I think one may first remove the no-connect pins then assign I/O to each part pin, since slicing the string with the first character cannot deal with "nc".

Berry1997 avatar Dec 19 '21 17:12 Berry1997