Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions PySpice/Spice/NgSpice/Shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,10 @@ def _send_char(message_c, ngspice_id, user_data):
func = self._logger.warning
elif 'Note:' in content:
func = self._logger.info
elif 'doAnalyses' in content:
Comment thread
infinitymdm marked this conversation as resolved.
func = self._logger.info
elif 'run simulation(s) aborted' in content:
func = self._logger.info

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it should probably be at least a .warning, if not .error. Or is there a case where it's ok if the simulations are aborted?

else:
self._error_in_stderr = True
func = self._logger.error
Expand Down
8 changes: 6 additions & 2 deletions PySpice/Spice/Parser/HighLevelParser.py

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to keep the old import structure if possible, and instead use ElementData.elements or ElementData._init on L318-320.

Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
from ..Netlist import Node
from ..StringTools import remove_multi_space
from . import Ast
from . import ElementData
from PySpice.Spice.Parser.ElementData import elements as ElementData_elements
from PySpice.Spice.Parser.ElementData import _init as ElementData_init

from .Ast import AstNode
from .Parser import SpiceParser
from .SpiceSyntax import ElementLetters
Expand Down Expand Up @@ -313,7 +315,9 @@ def __init__(self, line: SpiceLine, ast: AstNode) -> None:
# Read nodes
self._nodes = []
number_of_pins = 0
data = ElementData.elements[self._letter]
if(len(ElementData_elements)==0):
ElementData_init()
data = ElementData_elements[self._letter]
if not data.has_variable_number_of_pins:
number_of_pins = data.number_of_pins
else: # Q or X
Expand Down