From 234745a7c85d7409378210b5d24b416a6c1f9bfb Mon Sep 17 00:00:00 2001 From: Staf Verhaegen Date: Thu, 18 Aug 2022 14:56:22 +0200 Subject: [PATCH] Don't fail on convergence trial reporting When ngspice tries an alternative DC converge algorithm it reports the progress on stderr. This patch makes PySpice not error out when the alternative DC convergence has been reported to be successful. --- PySpice/Spice/NgSpice/Shared.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PySpice/Spice/NgSpice/Shared.py b/PySpice/Spice/NgSpice/Shared.py index 183c08a4..56832145 100644 --- a/PySpice/Spice/NgSpice/Shared.py +++ b/PySpice/Spice/NgSpice/Shared.py @@ -623,6 +623,12 @@ def _send_char(message_c, ngspice_id, user_data): # elif content.startswith('Warning:'): else: self._error_in_stderr = True + # Non-standard convergence trials are reported to stderr + # but can complete successfully + completed = ("completed" in content) or ("finished" in content) + if content.startswith("Note:") and completed: + self._error_in_stderr = False + func = self._logger.error if content.strip() == "Note: can't find init file.": self._spinit_not_found = True