11.1.12.4. Element

class PySpice.Spice.Element.AnyPinElement(netlist, name, *args, **kwargs)[source]

Bases: PySpice.Spice.Element.Element

PINS = []
PIN_NAMES = []
copy_to(netlist)[source]
class PySpice.Spice.Element.DipoleElement(netlist, name, *args, **kwargs)[source]

Bases: PySpice.Spice.Element.FixedPinElement, PySpice.Spice.FakeDipole.FakeDipole

This class implements a base class for dipole element.

PINS = [Pin #0 plus, Pin #1 minus]
PIN_NAMES = ['plus', 'minus']
property minus
property plus
class PySpice.Spice.Element.Element(netlist, name, *args, **kwargs)[source]

Bases: object

This class implements a base class for an element.

It use a metaclass machinery for the declaration of the parameters.

PINS = None
PREFIX = None

SPICE element prefix

copy_to(element)[source]
detach()[source]
format_node_names()[source]

Return the formatted list of nodes.

format_spice_parameters()[source]

Return the formatted list of parameters.

has_parameter(name)[source]
property name
property netlist
property node_names
property nodes
parameter_iterator()[source]

This iterator returns the parameter in the right order.

property pins
class PySpice.Spice.Element.ElementParameterMetaClass(class_name, base_classes, namespace)[source]

Bases: type

Metaclass to customise the element classes when they are created and to register SPICE prefix.

Element classes are of type ElementParameterMetaClass instead of type

class Resistor(metaclass=ElementParameterMetaClass):

<=>

Resistor = ElementParameterMetaClass('Foo', ...)
property number_of_pins
property number_of_positional_parameters
property optional_parameters
property parameters_from_args
property positional_parameters
property spice_to_parameters
class PySpice.Spice.Element.FixedPinElement(netlist, name, *args, **kwargs)[source]

Bases: PySpice.Spice.Element.Element

copy_to(netlist)[source]
class PySpice.Spice.Element.NPinElement(netlist, name, nodes, *args, **kwargs)[source]

Bases: PySpice.Spice.Element.Element

PINS = [Pin #0 *]
PIN_NAMES = ['*']
copy_to(netlist)[source]
class PySpice.Spice.Element.OptionalPin(name)[source]

Bases: object

property name
class PySpice.Spice.Element.Pin(element, pin_definition, node)[source]

Bases: PySpice.Spice.Element.PinDefinition

This class implements a pin of an element.

It stores a reference to the element, the name of the pin and the node.

add_current_probe(circuit)[source]

Add a current probe between the node and the pin.

The ammeter is named ElementName_PinName.

connect(node)[source]
property connected
property dangling
disconnect()[source]
property element
property node
class PySpice.Spice.Element.PinDefinition(position, name=None, alias=None, optional=False)[source]

Bases: object

This class defines a pin of an element.

property alias
clone()[source]
property name
property optional
property position
class PySpice.Spice.Element.TwoPortElement(netlist, name, *args, **kwargs)[source]

Bases: PySpice.Spice.Element.FixedPinElement

This class implements a base class for two-port element.

PINS = [Pin #0 output_plus, Pin #1 output_minus, Pin #2 input_plus, Pin #3 input_minus]
PIN_NAMES = ['output_plus', 'output_minus', 'input_plus', 'input_minus']
property input_minus
property input_plus
property output_minus
property output_plus