Skip to content

Commit

Permalink
Fixes in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nunobrum committed Apr 10, 2023
1 parent 78f0213 commit 53f94b8
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 1,139 deletions.
5 changes: 4 additions & 1 deletion PyLTSpice/client_server/sim_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class SimClient(object):
The run() method will transfer the netlist for the server, execute a simulation and transfer the simulation results
back to the client.
Two lists are kept by this class:
* A list of started jobs (started_jobs) and,
* a list with finished jobs on the server, but, which haven't been yet transferred to the client (stored_jobs).
Expand All @@ -64,21 +65,23 @@ class SimClient(object):
Usage:
.. code-block:: python
import zipfile
from PySpice.sim.sim_client import SimClient
server = SimClient('http://localhost', 9000) # Use another computer address.
print(server.session_id)
runid = server.run("../../tests/testfile.net")
print("Got Job id", runid)
for runid in server: # may not arrive in the same order as runids were launched
zip_filename = server.get_runno_data(runid)
print(f"Received {zip_filename} from runid {runid}")
with zipfile.ZipFile(zip_filename, 'r') as zipf: # Extract the contents of the zip file
print(zipf.namelist()) # Debug printing the contents of the zip file
zipf.extract(zipf.namelist()[0]) # Normally the raw file comes first
NOTE: More elaborate algorithms such as managing multiple servers will be done on another class.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# |_| \__, |_____|_| |____/| .__/|_|\___\___|
# |___/ |_|
#
# Name: srv_interface.py
# Name: sim_server.py
# Purpose: Tool used to launch LTSpice simulation in batch mode.
#
# Author: Nuno Brum (nuno.brum@gmail.com)
Expand Down
2 changes: 2 additions & 0 deletions doc/classes/classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Python Classes
sim_simulator
raw_read
raw_write
sim_client
sim_server


============
Expand Down
7 changes: 7 additions & 0 deletions doc/classes/sim_client.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SimClient (Under development)
=============================

.. autoclass:: PyLTSpice.client_server.sim_client.SimClient
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion doc/classes/sim_runner.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ SimRunner


.. autoclass:: PyLTSpice.sim.run_task.RunTask
:members:
:members:
7 changes: 7 additions & 0 deletions doc/classes/sim_server.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SimServer (Under development)
=============================

.. autoclass:: PyLTSpice.client_server.sim_server.SimServer
:members:
:undoc-members:
:show-inheritance:
1,125 changes: 0 additions & 1,125 deletions doc_build/html/_modules/PyLTSpice/SpiceEditor.html

This file was deleted.

8 changes: 2 additions & 6 deletions doc_build/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,11 @@ <h3 style="margin-top: 1.5em;">Search</h3>
<div class="body" role="main">

<h1>All modules for which code is available</h1>
<ul><li><a href="PyLTSpice/SemiDevOpReader.html">PyLTSpice.SemiDevOpReader</a></li>
<li><a href="PyLTSpice/SpiceEditor.html">PyLTSpice.SpiceEditor</a></li>
<ul><li><a href="PyLTSpice/client_server/sim_client.html">PyLTSpice.client_server.sim_client</a></li>
<li><a href="PyLTSpice/client_server/sim_server.html">PyLTSpice.client_server.sim_server</a></li>
<li><a href="PyLTSpice/log/semi_dev_op_reader.html">PyLTSpice.log.semi_dev_op_reader</a></li>
<li><a href="PyLTSpice/raw/raw_read.html">PyLTSpice.raw.raw_read</a></li>
<li><a href="PyLTSpice/raw/raw_write.html">PyLTSpice.raw.raw_write</a></li>
<li><a href="PyLTSpice/raw_read.html">PyLTSpice.raw_read</a></li>
<li><a href="PyLTSpice/raw_write.html">PyLTSpice.raw_write</a></li>
<li><a href="PyLTSpice/sim/local_run_task.html">PyLTSpice.sim.local_run_task</a></li>
<li><a href="PyLTSpice/sim/ltspice_simulator.html">PyLTSpice.sim.ltspice_simulator</a></li>
<li><a href="PyLTSpice/sim/ngspice_simulator.html">PyLTSpice.sim.ngspice_simulator</a></li>
<li><a href="PyLTSpice/sim/run_task.html">PyLTSpice.sim.run_task</a></li>
Expand All @@ -75,7 +72,6 @@ <h1>All modules for which code is available</h1>
<li><a href="PyLTSpice/sim/simulator.html">PyLTSpice.sim.simulator</a></li>
<li><a href="PyLTSpice/sim/spice_editor.html">PyLTSpice.sim.spice_editor</a></li>
<li><a href="PyLTSpice/sim/xyce_simulator.html">PyLTSpice.sim.xyce_simulator</a></li>
<li><a href="PyLTSpice/sim_batch.html">PyLTSpice.sim_batch</a></li>
</ul>

<div class="clearer"></div>
Expand Down
28 changes: 25 additions & 3 deletions doc_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ <h2 id="C">C</h2>
<li><a href="classes/sim_runner.html#PyLTSpice.sim.sim_runner.SimRunner.clear_command_line_switches">clear_command_line_switches() (PyLTSpice.sim.sim_runner.SimRunner method)</a>
</li>
<li><a href="classes/spice_circuit.html#PyLTSpice.sim.spice_editor.SpiceCircuit.clone">clone() (PyLTSpice.sim.spice_editor.SpiceCircuit method)</a>
</li>
<li><a href="classes/sim_server.html#PyLTSpice.client_server.sim_server.SimServer.close_session">close_session() (PyLTSpice.client_server.sim_server.SimServer method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
Expand Down Expand Up @@ -166,6 +168,8 @@ <h2 id="G">G</h2>
<li><a href="classes/spice_circuit.html#PyLTSpice.sim.spice_editor.SpiceCircuit.get_component_value">get_component_value() (PyLTSpice.sim.spice_editor.SpiceCircuit method)</a>
</li>
<li><a href="classes/spice_circuit.html#PyLTSpice.sim.spice_editor.SpiceCircuit.get_components">get_components() (PyLTSpice.sim.spice_editor.SpiceCircuit method)</a>
</li>
<li><a href="classes/sim_server.html#PyLTSpice.client_server.sim_server.SimServer.get_files">get_files() (PyLTSpice.client_server.sim_server.SimServer method)</a>
</li>
<li><a href="classes/raw_read.html#PyLTSpice.raw.raw_read.RawRead.get_len">get_len() (PyLTSpice.raw.raw_read.RawRead method)</a>
</li>
Expand All @@ -174,6 +178,8 @@ <h2 id="G">G</h2>
<li><a href="classes/spice_circuit.html#PyLTSpice.sim.spice_editor.SpiceCircuit.get_parameter">get_parameter() (PyLTSpice.sim.spice_editor.SpiceCircuit method)</a>
</li>
<li><a href="classes/raw_read.html#PyLTSpice.raw.raw_read.RawRead.get_raw_property">get_raw_property() (PyLTSpice.raw.raw_read.RawRead method)</a>
</li>
<li><a href="classes/sim_client.html#PyLTSpice.client_server.sim_client.SimClient.get_runno_data">get_runno_data() (PyLTSpice.client_server.sim_client.SimClient method)</a>
</li>
<li><a href="classes/raw_read.html#PyLTSpice.raw.raw_read.RawRead.get_steps">get_steps() (PyLTSpice.raw.raw_read.RawRead method)</a>
</li>
Expand Down Expand Up @@ -297,9 +303,13 @@ <h2 id="R">R</h2>
</li>
<li><a href="classes/spice_editor.html#PyLTSpice.sim.spice_editor.SpiceEditor.reset_netlist">reset_netlist() (PyLTSpice.sim.spice_editor.SpiceEditor method)</a>
</li>
<li><a href="classes/sim_simulator.html#PyLTSpice.sim.ltspice_simulator.LTspice.run">run() (PyLTSpice.sim.ltspice_simulator.LTspice class method)</a>
<li><a href="classes/sim_client.html#PyLTSpice.client_server.sim_client.SimClient.run">run() (PyLTSpice.client_server.sim_client.SimClient method)</a>

<ul>
<li><a href="classes/sim_server.html#PyLTSpice.client_server.sim_server.SimServer.run">(PyLTSpice.client_server.sim_server.SimServer method)</a>
</li>
<li><a href="classes/sim_simulator.html#PyLTSpice.sim.ltspice_simulator.LTspice.run">(PyLTSpice.sim.ltspice_simulator.LTspice class method)</a>
</li>
<li><a href="classes/sim_simulator.html#PyLTSpice.sim.ngspice_simulator.NGspiceSimulator.run">(PyLTSpice.sim.ngspice_simulator.NGspiceSimulator class method)</a>
</li>
<li><a href="classes/sim_runner.html#PyLTSpice.sim.run_task.RunTask.run">(PyLTSpice.sim.run_task.RunTask method)</a>
Expand All @@ -318,6 +328,8 @@ <h2 id="R">R</h2>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="classes/sim_runner.html#PyLTSpice.sim.sim_runner.SimRunner.run_now">run_now() (PyLTSpice.sim.sim_runner.SimRunner method)</a>
</li>
<li><a href="classes/sim_server.html#PyLTSpice.client_server.sim_server.SimServer.running">running() (PyLTSpice.client_server.sim_server.SimServer method)</a>
</li>
<li><a href="classes/sim_batch.html#PyLTSpice.sim.sim_batch.SimCommander.runno">runno() (PyLTSpice.sim.sim_batch.SimCommander property)</a>
</li>
Expand Down Expand Up @@ -347,11 +359,15 @@ <h2 id="S">S</h2>
</li>
<li><a href="classes/sim_runner.html#PyLTSpice.sim.sim_runner.SimRunner.setRunCommand">setRunCommand() (PyLTSpice.sim.sim_runner.SimRunner method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="classes/sim_client.html#PyLTSpice.client_server.sim_client.SimClient">SimClient (class in PyLTSpice.client_server.sim_client)</a>
</li>
<li><a href="classes/sim_batch.html#PyLTSpice.sim.sim_batch.SimCommander">SimCommander (class in PyLTSpice.sim.sim_batch)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="classes/sim_runner.html#PyLTSpice.sim.sim_runner.SimRunner">SimRunner (class in PyLTSpice.sim.sim_runner)</a>
</li>
<li><a href="classes/sim_server.html#PyLTSpice.client_server.sim_server.SimServer">SimServer (class in PyLTSpice.client_server.sim_server)</a>
</li>
<li><a href="classes/sim_simulator.html#PyLTSpice.sim.simulator.Simulator">Simulator (class in PyLTSpice.sim.simulator)</a>
</li>
Expand All @@ -368,6 +384,12 @@ <h2 id="S">S</h2>
<li><a href="classes/spice_circuit.html#PyLTSpice.sim.spice_editor.SpiceCircuit">SpiceCircuit (class in PyLTSpice.sim.spice_editor)</a>
</li>
<li><a href="classes/spice_editor.html#PyLTSpice.sim.spice_editor.SpiceEditor">SpiceEditor (class in PyLTSpice.sim.spice_editor)</a>
</li>
<li><a href="classes/sim_server.html#PyLTSpice.client_server.sim_server.SimServer.start_session">start_session() (PyLTSpice.client_server.sim_server.SimServer method)</a>
</li>
<li><a href="classes/sim_server.html#PyLTSpice.client_server.sim_server.SimServer.status">status() (PyLTSpice.client_server.sim_server.SimServer method)</a>
</li>
<li><a href="classes/sim_server.html#PyLTSpice.client_server.sim_server.SimServer.stop_server">stop_server() (PyLTSpice.client_server.sim_server.SimServer method)</a>
</li>
</ul></td>
</tr></table>
Expand Down
2 changes: 2 additions & 0 deletions doc_build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ <h1>Welcome to PyLTSpice’s documentation!<a class="headerlink" href="#welcome-
<li class="toctree-l2"><a class="reference internal" href="classes/sim_simulator.html#others">Others</a></li>
<li class="toctree-l2"><a class="reference internal" href="classes/raw_read.html">RawRead</a></li>
<li class="toctree-l2"><a class="reference internal" href="classes/raw_write.html">RawWrite</a></li>
<li class="toctree-l2"><a class="reference internal" href="classes/sim_client.html">SimClient (Under development)</a></li>
<li class="toctree-l2"><a class="reference internal" href="classes/sim_server.html">SimServer (Under development)</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="classes/classes.html#deprecations">Deprecations</a><ul>
Expand Down
Binary file modified doc_build/html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion doc_build/html/searchindex.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ requires-python = ">=3.7"
dependencies = [
"numpy",
"psutil",
"clipboard",
]
classifiers=[
"Programming Language :: Python :: 3",
Expand Down
2 changes: 1 addition & 1 deletion tests/sim_server_example.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import time
import PyLTSpice.sim.ltspice_simulator as ltsim
from PyLTSpice.client_server.srv_interface import SimServer
from PyLTSpice.client_server.sim_server import SimServer

a = SimServer(ltsim.LTspice, port=9000)
while a.running():
Expand Down

0 comments on commit 53f94b8

Please sign in to comment.