From 5635ce8b044470c9d47d2a6ab50308285bc49cd6 Mon Sep 17 00:00:00 2001 From: fgarbu Date: Fri, 6 Dec 2024 13:58:42 +0100 Subject: [PATCH] ignore some messages from ngspice 43 --- PySpice/Spice/NgSpice/Shared.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PySpice/Spice/NgSpice/Shared.py b/PySpice/Spice/NgSpice/Shared.py index f1eccc0a..2878093e 100644 --- a/PySpice/Spice/NgSpice/Shared.py +++ b/PySpice/Spice/NgSpice/Shared.py @@ -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 @@ -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) @@ -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