Skip to content

Commit

Permalink
ignore some messages from ngspice 43
Browse files Browse the repository at this point in the history
  • Loading branch information
fgarbu committed Dec 6, 2024
1 parent 3203da0 commit 5635ce8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions PySpice/Spice/NgSpice/Shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,9 @@ def _send_char(message_c, ngspice_id, user_data):
if content.startswith('Warning:'):
func = self._logger.warning
# elif content.startswith('Warning:'):
elif content.strip() == "Using SPARSE 1.3 as Direct Linear Solver":
self._logger.warning('Using SPARSE 1.3 as Direct Linear Solver')
func = self._logger.warning
elif content.startswith('Error: Using SPARSE 1.3') or content.startswith('Error: bad set form'):
func = lambda x: None

else:
self._error_in_stderr = True
func = self._logger.error
Expand All @@ -639,6 +639,7 @@ def _send_char(message_c, ngspice_id, user_data):
# if self._error_in_stdout:
# self._logger.warning(content)


# Fixme: ???
return self.send_char(message, ngspice_id)

Expand Down Expand Up @@ -852,7 +853,7 @@ def exec_command(self, command, join_lines=True):

if self._error_in_stdout or self._error_in_stderr:
# raise NgSpiceCommandError("Command '{}' failed".format(command))
warnings.warn('NgSpiceCommandError: Command {} failed'.format(command))
warnings.warn('NgSpiceCommandError: Command {} warning'.format(command))

if join_lines:
return self.stdout
Expand Down

0 comments on commit 5635ce8

Please sign in to comment.