Skip to content

Library.py not working as intended? #118

@CEBasile

Description

@CEBasile

Environment (OS, Python version, PySpice version, simulator)

Windows 10, Python 3.6.5, Pyspice 1.2

Expected Behaviour

Correctly finds *.lib files

Actual Behaviour

Traceback (most recent call last):
  File "motor.py", line 48, in <module>
    circuit.include(spice_library['irfb7530pbf'])
  File "C:\Users\connor\Anaconda3\lib\site-packages\PySpice\Spice\Library.py", line 107, in __getitem__
    raise KeyError(name)
KeyError: 'irfb7530pbf'

Steps to reproduce the behaviour

Download *.lib into library path
In this case its irfb7530pbf.lib
Import library with: circuit.include(spice_library['irfb7530pbf'])
Results in error: keyError(name)

Note: PySpice 1.1.4 can successfully find the library, PySpice 1.2 cannot, it appears the issue comes with the addition of the _suffix_name() method?

Adding * -- spice -- to top line of irfb7530pbf.lib appears to fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions