From f3abbbec42fc8a73fd4e7a4a0ecbc1398ae36c45 Mon Sep 17 00:00:00 2001 From: Jonathan Eisch Date: Mon, 1 Aug 2022 23:40:21 -0500 Subject: [PATCH 1/2] Treat stderr "Note:"s the same as "Warning:"s --- PySpice/Spice/NgSpice/Shared.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PySpice/Spice/NgSpice/Shared.py b/PySpice/Spice/NgSpice/Shared.py index 183c08a4..342c6749 100644 --- a/PySpice/Spice/NgSpice/Shared.py +++ b/PySpice/Spice/NgSpice/Shared.py @@ -620,7 +620,8 @@ def _send_char(message_c, ngspice_id, user_data): self._stderr.append(content) if content.startswith('Warning:'): func = self._logger.warning - # elif content.startswith('Warning:'): + elif "Note:" in content: + func = self._logger.warning else: self._error_in_stderr = True func = self._logger.error From da3bfbe4a8b1b8af88235e8c96a736043211e31f Mon Sep 17 00:00:00 2001 From: Jonathan Eisch Date: Mon, 1 Aug 2022 23:45:06 -0500 Subject: [PATCH 2/2] Warnings on stderr can start later in the line for instance: Trying gmin = 1.0000E-05 Warning: Further gmin increment which may later succeed. --- PySpice/Spice/NgSpice/Shared.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PySpice/Spice/NgSpice/Shared.py b/PySpice/Spice/NgSpice/Shared.py index 342c6749..fdb7bba9 100644 --- a/PySpice/Spice/NgSpice/Shared.py +++ b/PySpice/Spice/NgSpice/Shared.py @@ -618,7 +618,7 @@ def _send_char(message_c, ngspice_id, user_data): prefix, _, content = message.partition(' ') if prefix == 'stderr': self._stderr.append(content) - if content.startswith('Warning:'): + if "Warning:" in content: func = self._logger.warning elif "Note:" in content: func = self._logger.warning