diff --git a/.gitignore b/.gitignore index d60b61d06..f427700e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ # -*- mode: Conf -*- +.vscode + #################################################################################################### *.stderr diff --git a/PySpice/Spice/NgSpice/RawFile.py b/PySpice/Spice/NgSpice/RawFile.py index 90ae7f6b1..37ac52093 100644 --- a/PySpice/Spice/NgSpice/RawFile.py +++ b/PySpice/Spice/NgSpice/RawFile.py @@ -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 @@ -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') diff --git a/PySpice/Spice/RawFile.py b/PySpice/Spice/RawFile.py index eb7d04c6e..e293832d6 100644 --- a/PySpice/Spice/RawFile.py +++ b/PySpice/Spice/RawFile.py @@ -375,6 +375,7 @@ def _to_sensitivity_analysis(self): return SensitivityAnalysis( simulation=self.simulation, elements=self.elements(), + internal_parameters=self.internal_parameters(), ) ############################################## diff --git a/examples/diode/diode-characteristic-curve.py b/examples/diode/diode-characteristic-curve.py index 4fba49704..3088e02c0 100755 --- a/examples/diode/diode-characteristic-curve.py +++ b/examples/diode/diode-characteristic-curve.py @@ -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')