Skip to content
Merged
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: 1 addition & 1 deletion PyLTSpice/sim/sim_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def failSim(self):
raw, log = LTC.run().wait_results()
_logger.debug(f"Raw file '{raw}' | Log File '{log}'")
# Sim Statistics
_logger.info('Successful/Total Simulations: ' + str(LTC.okSim) + '/' + str(LTC.runno))
_logger.info(f'Successful/Total Simulations: {LTC.okSim}/{LTC.runno}')


def callback_function(raw_file, log_file):
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# README #

_Current Version 5.4.5_
_Current Version 5.5.0_

PyLTSpice is a toolchain of python utilities design to interact with LTSpice Electronic Simulator.
It is mostly based on the spicelib package, being the main difference to it is
Expand Down Expand Up @@ -184,7 +184,7 @@ netlist.add_instructions(
)

# Sim Statistics
print('Successful/Total Simulations: ' + str(LTC.okSim) + '/' + str(LTC.runno))
print(f'Successful/Total Simulations: {LTC.okSim}/{LTC.runno}')

enter = input("Press enter to delete created files")
if enter == '':
Expand Down Expand Up @@ -460,6 +460,10 @@ _Make sure to initialize the root logger before importing the library to be able
For support and improvement requests please open an Issue in [GitHub spicelib issues](https://github.com/nunobrum/spicelib/issues)

## History ##
* Version 5.5.0 (spicelib 1.5.0)
* Dropping support for Python 3.9
* Using f-strings across the entire codebase
* Using the new union type hinting syntax across the entire codebase
* Version 5.4.5 (spicelib 1.4.7)
* Implementing a lazy loading approach in RawRead
* Fixing Issue #256 - Correct add_component() in SpiceEditor
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/run_simulations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ each executing in parallel a simulation. This is exemplified in the modified exa
# The timeout counter is reset everytime a simulation is finished.

# Sim Statistics
print('Successful/Total Simulations: ' + str(runner.okSim) + '/' + str(runner.runno))
print(f'Successful/Total Simulations: {runner.okSim}/{runner.runno}')

If the ``parallel_sims`` parallel simulations is not given, it defaults to 4. This means that a fifth simulation
will only start when one of the other 4 is finished. If ``parallel_sims`` needs to be adjusted according to the
Expand Down
7 changes: 4 additions & 3 deletions examples/raw_plotting.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import sys
import matplotlib.pyplot as plt
import os
from os.path import split as pathsplit
from os.path import join as pathjoin
import numpy as np
from numpy import abs as mag, angle
Expand Down Expand Up @@ -31,14 +30,16 @@ def what_to_units(whattype):
# filename = 'AC.raw'
# filename = 'AC - STEP.raw'
# filename = 'DC op point - STEP.raw'
trace_names = ("V(out)",)
# trace_names = ("V(out)",)
filename = 'Noise.raw'
trace_names = ("V(onoise)",)
raw_filename = pathjoin(test_directory, filename)

LTR = RawRead(raw_filename, trace_names, verbose=True)
# Calculate field width from the longest parameter name so the colon lines up vertically
field_width = max((len(str(p)) for p in LTR.raw_params.keys()), default=0)
for param, value in LTR.raw_params.items():
print("{}: {}{}".format(param, " " * (20 - len(param)), str(value).strip()))
print(f"{param:<{field_width}}: {value}")

if trace_names == '*':
print("Reading all the traces in the raw file")
Expand Down
4 changes: 2 additions & 2 deletions examples/sim_runner_asc_example.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from PyLTSpice import SimRunner
from PyLTSpice import AscEditor

# Force another simulatior
# Force another simulator
simulator = r"C:\Program Files\LTC\LTspiceXVII\XVIIx64.exe"

# select spice model
Expand Down Expand Up @@ -36,7 +36,7 @@
# ...

# Sim Statistics
print('Successful/Total Simulations: ' + str(LTC.okSim) + '/' + str(LTC.runno))
print(f'Successful/Total Simulations: {LTC.okSim}/{LTC.runno}')

enter = input("Press enter to delete created files")
if enter == '':
Expand Down
6 changes: 5 additions & 1 deletion examples/sim_runner_callback_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,8 @@ def processing_data(raw_file, log_file):
results = runner.wait_completion(1, abort_all_on_timeout=True)

# Sim Statistics
print('Successful/Total Simulations: ' + str(runner.okSim) + '/' + str(runner.runno))
print(f'Successful/Total Simulations: {runner.okSim}/{runner.runno}')

enter = input("Press enter to delete created files")
if enter == '':
runner.file_cleanup()
6 changes: 5 additions & 1 deletion examples/sim_runner_callback_process_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ def callback(raw_file, log_file):
results = runner.wait_completion(1, abort_all_on_timeout=True)

# Sim Statistics
print('Successful/Total Simulations: ' + str(runner.okSim) + '/' + str(runner.runno))
print(f'Successful/Total Simulations: {runner.okSim}/{runner.runno}')

enter = input("Press enter to delete created files")
if enter == '':
runner.file_cleanup()


2 changes: 1 addition & 1 deletion examples/sim_runner_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
)

# Sim Statistics
print('Successful/Total Simulations: ' + str(LTC.okSim) + '/' + str(LTC.runno))
print(f'Successful/Total Simulations: {LTC.okSim}/{LTC.runno}')

enter = input("Press enter to delete created files")
if enter == '':
Expand Down
2 changes: 1 addition & 1 deletion examples/sim_stepper_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ def processing_data(raw_file, log_file):
Stepper.run_all(callback=processing_data)

# Sim Statistics
print('Successful/Total Simulations: ' + str(Stepper.okSim) + '/' + str(Stepper.runno))
print(f'Successful/Total Simulations: {Stepper.okSim}/{Stepper.runno}')
runner.file_cleanup()
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ requires = [
build-backend = "setuptools.build_meta"
[project]
name = "PyLTSpice"
version = "5.4.5"
version = "5.5.0"
authors = [
{ name="Nuno Brum", email="me@nunobrum.com" },
]
Expand Down
4 changes: 2 additions & 2 deletions unittests/test_pyltspice.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def processing_data(raw_file, log_file):
LTC.wait_completion()

# Sim Statistics
print('Successful/Total Simulations: ' + str(LTC.okSim) + '/' + str(LTC.runno))
print(f'Successful/Total Simulations: {LTC.okSim}/{LTC.runno}')
self.assertEqual(LTC.okSim, 6)
self.assertEqual(LTC.runno, 6)

Expand Down Expand Up @@ -161,7 +161,7 @@ def test_run_from_spice_editor(self):
raw, log = LTC.run(netlist).wait_results()
print(f"Raw file '{raw}' | Log File '{log}'")
# Sim Statistics
print('Successful/Total Simulations: ' + str(LTC.okSim) + '/' + str(LTC.runno))
print(f'Successful/Total Simulations: {LTC.okSim}/{LTC.runno}')

@unittest.skipIf(skip_ltspice_tests, "Skip if not in windows environment")
def test_sim_runner(self):
Expand Down
Loading