-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Aligning documentation to the new folder structure.
Including the new AscEditor class on the description
- Loading branch information
Showing
16 changed files
with
133 additions
and
66 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env python | ||
# coding=utf-8 | ||
|
||
# ------------------------------------------------------------------------------- | ||
# ____ _ _____ ____ _ | ||
# | _ \ _ _| | |_ _/ ___| _ __ (_) ___ ___ | ||
# | |_) | | | | | | | \___ \| '_ \| |/ __/ _ \ | ||
# | __/| |_| | |___| | ___) | |_) | | (_| __/ | ||
# |_| \__, |_____|_| |____/| .__/|_|\___\___| | ||
# |___/ |_| | ||
# | ||
# Name: montecarlo.py | ||
# Purpose: Classes to automate Monte-Carlo simulations | ||
# | ||
# Author: Nuno Brum (nuno.brum@gmail.com) | ||
# | ||
# Created: 10-08-2023 | ||
# Licence: refer to the LICENSE file | ||
# ------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env python | ||
# coding=utf-8 | ||
|
||
# ------------------------------------------------------------------------------- | ||
# ____ _ _____ ____ _ | ||
# | _ \ _ _| | |_ _/ ___| _ __ (_) ___ ___ | ||
# | |_) | | | | | | | \___ \| '_ \| |/ __/ _ \ | ||
# | __/| |_| | |___| | ___) | |_) | | (_| __/ | ||
# |_| \__, |_____|_| |____/| .__/|_|\___\___| | ||
# |___/ |_| | ||
# | ||
# Name: sim_analysis.py | ||
# Purpose: Classes to automate Monte-Carlo, FMEA or Worst Case Analysis | ||
# be updated by user instructions | ||
# | ||
# Author: Nuno Brum (nuno.brum@gmail.com) | ||
# | ||
# Created: 06-07-2021 | ||
# Licence: refer to the LICENSE file | ||
# ------------------------------------------------------------------------------- | ||
|
||
from collections import OrderedDict | ||
from typing import Union, Optional | ||
|
||
from ...sim.sim_runner import AnyRunner | ||
from ...editor.base_editor import BaseEditor | ||
from ...sim.simulator import Simulator | ||
|
||
|
||
class SimAnalysis(object): | ||
""" | ||
Base class for making Monte-Carlo, Extreme Value Analysis (EVA) or Failure Mode and Effects Analysis. | ||
As a base class, a certain number of assertions must be made on the simulation results that will make the pass/fail. | ||
Note: For the time being only measurements done with .MEAS are possible. At a later stage the parsing of RAW files | ||
will be possible, although, it seems that the later solution is less computing intense. | ||
""" | ||
|
||
def __init__(self, circuit_file: Union[str, BaseEditor], simulator: Optional[Simulator] = None, | ||
runner: Optional[AnyRunner] = None): | ||
if isinstance(circuit_file, str): | ||
from ..editor.spice_editor import SpiceEditor | ||
self.editor = SpiceEditor(circuit_file) | ||
else: | ||
self.editor = circuit_file | ||
if simulator is None: | ||
from ..sim.ltspice_simulator import LTspice | ||
self.simulator = LTspice() | ||
else: | ||
self.simulator = simulator | ||
if runner is None: | ||
from ..sim.sim_runner import SimRunner | ||
self.runner = SimRunner(parallel_sims=1, timeout=None, verbose=False, output_folder=None) | ||
self.simulations = OrderedDict() | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
AscEditor | ||
============ | ||
|
||
Class used for manipulating LTSpice asc files. | ||
|
||
.. autoclass:: PyLTSpice.editor.asc_editor.AscEditor | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Editor Classes | ||
============== | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
spice_editor | ||
spice_circuit | ||
asc_editor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
======================== | ||
Raw and Log File Classes | ||
======================== | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
raw_read | ||
trace | ||
logreader | ||
raw_write | ||
write_trace | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 4 additions & 9 deletions
13
doc/classes/classes.rst → doc/classes/simulation_classes.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
SpiceCircuit | ||
============ | ||
|
||
.. autoclass:: PyLTSpice.sim.spice_editor.SpiceCircuit | ||
.. autoclass:: PyLTSpice.editor.spice_editor.SpiceCircuit | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
RawRead Trace | ||
============= | ||
|
||
.. autoclass:: PyLTSpice.raw_classes.Trace | ||
.. autoclass:: PyLTSpice.raw.raw_classes.Axis | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. autoclass:: PyLTSpice.raw.raw_classes.TraceRead | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
RawWrite Trace | ||
============== | ||
|
||
.. autoclass:: PyLTSpice.raw_write.Trace | ||
.. autoclass:: PyLTSpice.raw.raw_write.Trace | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |