Skip to content

Commit

Permalink
RawFile.py: fix PySpice-org#352
Browse files Browse the repository at this point in the history
  • Loading branch information
cyber-g committed Sep 11, 2023
1 parent 7021067 commit a3a46c5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions PySpice/Spice/NgSpice/RawFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
.. code::
[Note:] No compatibility mode selected! OR [Note:] Compatibility modes selected: xyz
Circuit: 230V Rectifier
Doing analysis at TEMP = 25.000000 and TNOM = 25.000000
Expand Down Expand Up @@ -189,6 +191,14 @@ def _read_header(self, stdout):
raw_data = stdout[raw_data_start:]
header_line_iterator = iter(header_lines)

try:
self._read_header_field_line(header_line_iterator, 'Note', has_value=False)
except Exception as e:
if 'No compatibility mode selected' in str(e):
# Reset iterator
header_line_iterator = iter(header_lines)
self._read_header_field_line(header_line_iterator, 'No compatibility mode selected', has_value=False)

self.circuit_name = self._read_header_field_line(header_line_iterator, 'Circuit')
self.temperature, self.nominal_temperature = self._read_temperature_line(header_line_iterator)
self.warnings = [self._read_header_field_line(header_line_iterator, 'Warning')
Expand Down

0 comments on commit a3a46c5

Please sign in to comment.