Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #352 #353

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# -*- mode: Conf -*-

.vscode

####################################################################################################

*.stderr
Expand Down
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.note = self._read_header_field_line(header_line_iterator, 'Note')
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
1 change: 1 addition & 0 deletions PySpice/Spice/RawFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ def _to_sensitivity_analysis(self):
return SensitivityAnalysis(
simulation=self.simulation,
elements=self.elements(),
internal_parameters=self.internal_parameters(),
)

##############################################
Expand Down
4 changes: 2 additions & 2 deletions examples/diode/diode-characteristic-curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ def two_scales_tick_formatter(value, position):
analysis = analyses[25]
static_resistance = -analysis.out / analysis.Vinput
dynamic_resistance = np.diff(-analysis.out) / np.diff(analysis.Vinput)
ax2.semilogy(analysis.out, static_resistance, basey=10)
ax2.semilogy(analysis.out[10:-1], dynamic_resistance[10:], basey=10)
ax2.semilogy(analysis.out, static_resistance, base=10)
ax2.semilogy(analysis.out[10:-1], dynamic_resistance[10:], base=10)
ax2.axvline(x=0, color='black')
ax2.axvline(x=silicon_forward_voltage_threshold, color='red')
ax2.axhline(y=1, color='red')
Expand Down
Loading