Skip to content

Importing Circuit class not working #367

@alphanoob1337

Description

@alphanoob1337

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

Windows 10, Python 3.11, PySpice 1.5, NgSpice

Expected Behaviour

The only way to import the Circuit class is using from PySpice.Spice.Netlist import Circuit which does not offer any possibilities to resolve naming conflicts and therefore I am not using the from ... import ... syntax.

I would expect import PySpice.Spice.Circuit or something similar to work but it does not since PySpice/Spice/__init__.py does not expose the Circuit class. Also a class Netlist is defined in Netlist.py which results in PySpice.Spice.Netlist referring to the object rather than the Netlist.py file.

Actual Behaviour

ModuleNotFoundError                       Traceback (most recent call last)
Cell In [1], line 7
      4 import PySpice.Logging.Logging as Logging
      5 logger = Logging.setup_logging()
----> 7 import PySpice.Spice.Netlist.Circuit
      8 from PySpice.Unit import *
      9 import scipy.optimize

ModuleNotFoundError: No module named 'PySpice.Spice.Netlist.Circuit'; 'PySpice.Spice.Netlist' is not a package

Steps to reproduce the behaviour

Run import PySpice.Spice.Netlist.Circuit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions