PackedOpendssElement reference

PackedOpendssElements are returned by bracket-indicizing a Krang with a string containing the name of the desired element. Aside from electrical components such as Vsource, Line, etc., buses can also be returned as PackedOpendssElement. The main objective of PackedOpendssElement is to conveniently pack in one object all the methods for the components that are present in the various opendss interfaces (for example, for Vsource, from opendssdirect.CktElement and opendssdirect.Vsources); Furthermore, with the classic opendss interface, before obtaining the correct data, the component has to be selected via other interfaces, (again, for Vsource, opendssdirect.Circuit.ActiveElement and opendssdirect.Vsources.Name). With PackedOpendssElements all the available methods are directly accessible, with no interface swap or the need to explicitly select the component In addition to this core functionality, PackedOpendssElement enables you to access the underlying object’s parameter values through bracket indexing and also has a number of utility methods that you can see in the class detail docs in this page.

Class reference

class krangpower.enhancer.OpendssdirectEnhancer._PackedOpendssElement(eltype, name)

Gets a property of the item from the text interface (as opposed to a natively exposed attribute of the object’s interface). For example, <>[‘xrharm’], where <> is a _PackedOpendssElement representing a Load, lets you access the ‘xrharm’ property, which is not available in any way through the standard interface.

__init__(eltype, name)

Initialize self. See help(type(self)) for accurate signature.


The - operator disables the _PackedOpendssElement, so that it’s like it does not exists. It directly wraps the ‘disable’ command from opendss.


The + operator enables the _PackedOpendssElement, undoing the effects of a previous __neg__ call on the same element. It directly wraps the ‘enable’ command from opendss.


Return repr(self).

__setitem__(key, value)

Edits a property of the _PackedOpendssElement. Beware: If you do not pass a value with a pint measurement unit when editing a parameter that has a physical dimensionality, it will be assumed that you are using the default units.


Return str(self).


Returns a dict with all the properties-values pairs of the object as they would be returned by calls to __getitem__.


Displays informations about the object’s parameters.


Returns those properties that are marked as ‘topological’ in the configuration files and identify the wiring location of the element. (Typically, bus1 and, if it exists, bus2.)


Returns a _DssEntity (or a descendant) corresponding to _PackedOpendssElement.