dss package

General submodules

dss.enums

class dss.enums.ActionCodes(value)

Bases: IntEnum

An enumeration.

Close = 2
Lock = 4
Open = 1
Reset = 3
TapDown = 7
TapUp = 6
Unlock = 5
none = 0
class dss.enums.AutoAddTypes(value)

Bases: IntEnum

An enumeration.

AddCap = 2
AddGen = 1
class dss.enums.CapControlModes(value)

Bases: IntEnum

An enumeration.

Current = 0
KVAR = 2
PF = 4
Time = 3
Voltage = 1
class dss.enums.CktModels(value)

Bases: IntEnum

An enumeration.

Multiphase = 0
PositiveSeq = 1
class dss.enums.ControlModes(value)

Bases: IntEnum

An enumeration.

Event = 1
Multirate = 3
Off = -1
Static = 0
Time = 2
class dss.enums.DSSJSONFlags(value)

Bases: IntFlag

An enumeration.

EnumAsInt = 4
ExcludeDisabled = 32
Full = 1
FullNames = 8
Pretty = 16
SkipRedundant = 2
class dss.enums.GeneratorStatus(value)

Bases: IntEnum

An enumeration.

Fixed = 1
Variable = 0
class dss.enums.LineUnits(value)

Bases: IntEnum

An enumeration.

Miles = 1
cm = 7
ft = 5
inch = 6
kFt = 2
km = 3
meter = 4
mm = 8
none = 0
class dss.enums.LoadModels(value)

Bases: IntEnum

An enumeration.

CVR = 4
ConstI = 5
ConstPFixedQ = 6
ConstPFixedX = 7
ConstPQ = 1
ConstZ = 2
Motor = 3
ZIPV = 8
class dss.enums.LoadStatus(value)

Bases: IntEnum

An enumeration.

Exempt = 2
Fixed = 1
Variable = 0
class dss.enums.MonitorModes(value)

Bases: IntEnum

An enumeration.

Magnitude = 32
PosOnly = 64
Power = 1
Sequence = 16
States = 3
Taps = 2
VI = 0
class dss.enums.OCPDevType(value)

Bases: IntEnum

An enumeration.

Fuse = 1
Recloser = 2
Relay = 3
none = 0
class dss.enums.Options(value)

Bases: IntEnum

Deprecated. Please use instead: - AutoAddTypes - CktModels - ControlModes - SolutionLoadModels - SolutionAlgorithms - RandomModes

AddCap = 2
AddGen = 1
Admittance = 2
ControlOFF = -1
Event = 1
Gaussian = 1
LogNormal = 3
Multiphase = 0
NewtonSolve = 1
NormalSolve = 0
PositiveSeq = 1
PowerFlow = 1
Static = 0
Time = 2
Uniform = 2
class dss.enums.RandomModes(value)

Bases: IntEnum

An enumeration.

Gaussian = 1
LogNormal = 3
Uniform = 2
class dss.enums.SolutionAlgorithms(value)

Bases: IntEnum

An enumeration.

NewtonSolve = 1
NormalSolve = 0
class dss.enums.SolutionLoadModels(value)

Bases: IntEnum

An enumeration.

Admittance = 2
PowerFlow = 1
class dss.enums.SolveModes(value)

Bases: IntEnum

An enumeration.

AutoAdd = 13
Daily = 1
Direct = 7
DutyCycle = 6
Dynamic = 14
FaultStudy = 9
Harmonic = 15
LD1 = 4
LD2 = 12
Monte1 = 3
Monte2 = 10
Monte3 = 11
MonteFault = 8
PeakDay = 5
SnapShot = 0
Yearly = 2
class dss.enums.SparseSolverOptions(value)

Bases: IntEnum

An enumeration.

AlwaysResetYPrimInvalid = 268435456
ReuseCompressedMatrix = 1
ReuseNothing = 0
ReuseNumericFactorization = 3
ReuseSymbolicFactorization = 2
class dss.enums.YMatrixModes(value)

Bases: IntEnum

An enumeration.

SeriesOnly = 1
WholeMatrix = 2

dss.patch_dss_com

dss.patch_dss_com.patch_dss_com(obj)

dss.plot

This module provides a work-in-progress implementation of the original OpenDSS plots using the new features from DSS C-API v0.12 and common Python modules such as matplotlib.

This is not a complete implementation yet and there are known limitations

dss.plot.disable()
dss.plot.enable(plot3d=False, plot2d=True)

Enables the experimental plotting subsystem from DSS Extensions.

Set plot3d to True to try to reproduce some of the plots from the alternative OpenDSS Visualization Tool / OpenDSS Viewer addition to OpenDSS.

Interface submodules

dss.IDSS

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IDSS.IDSS(api_util)

Bases: Base

Main OpenDSS interface. Organizes the subclasses trying to mimic the OpenDSSengine.DSS object as seems from win32com.client or comtypes.client.

This main class also includes some global settings. See more settings in ActiveCircuit.Settings.

ClearAll()
NewCircuit(name)
Return type
ICircuit
NewContext()

Creates a new DSS engine context. A DSS Context encapsulates most of the global state of the original OpenDSS engine, allowing the user to create multiple instances in the same process. By creating contexts manually, the management of threads and potential issues should be handled by the user.

(API Extension)

Return type
TypeVar(TIDSS, bound= IDSS)
Reset()
SetActiveClass(ClassName)
Return type
int
ShowPanel()
Start(code)
Return type
bool
ActiveCircuit: ICircuit

Provides access to the circuit attributes and objects in general.

ActiveClass: IActiveClass

General information about the current active DSS class.

property AllowChangeDir: bool

If disabled, the engine will not change the active working directory during execution. E.g. a “compile” command will not “chdir” to the file path.

If you have issues with long paths, enabling this might help in some scenarios.

Defaults to True (allow changes, backwards compatible) in the 0.10.x versions of DSS C-API. This might change to False in future versions.

This can also be set through the environment variable DSS_CAPI_ALLOW_CHANGE_DIR. Set it to 0 to disallow changing the active working directory.

(API Extension)

Return type
bool
property AllowDOScmd: bool

If enabled, the DOScmd command is allowed. Otherwise, an error is reported if the user tries to use it.

Defaults to False/0 (disabled state). Users should consider DOScmd deprecated on DSS Extensions.

This can also be set through the environment variable DSS_CAPI_ALLOW_DOSCMD. Setting it to 1 enables the command.

(API Extension)

Return type
bool
property AllowEditor: bool

Gets/sets whether running the external editor for “Show” is allowed

AllowEditor controls whether the external editor is used in commands like “Show”. If you set to 0 (false), the editor is not executed. Note that other side effects, such as the creation of files, are not affected.

(API Extension)

Return type
bool
property AllowForms: bool

Gets/sets whether text output is allowed

Return type
bool
property COMErrorResults: bool

If enabled, in case of errors or empty arrays, the API returns arrays with values compatible with the official OpenDSS COM interface.

For example, consider the function Loads_Get_ZIPV. If there is no active circuit or active load element: - In the disabled state (COMErrorResults=False), the function will return “[]”, an array with 0 elements. - In the enabled state (COMErrorResults=True), the function will return “[0.0]” instead. This should be compatible with the return value of the official COM interface.

Defaults to True/1 (enabled state) in the v0.12.x series. This will change to false in future series.

This can also be set through the environment variable DSS_CAPI_COM_DEFAULTS. Setting it to 0 disables the legacy/COM behavior. The value can be toggled through the API at any time.

(API Extension)

Return type
bool
Circuits: ICircuit

Kept for compatibility. Currently it is an alias to ActiveCircuit.

property Classes: List[str]

(read-only) List of DSS intrinsic classes (names of the classes)

Return type
List[str]
DSSProgress: IDSSProgress

Kept for compatibility. Controls the progress dialog/output, if avaiable.

DSSim_Coms: IDSSimComs

Kept for compatibility. Apparently was used for DSSim-PC (now OpenDSS-G), a closed-source software developed by EPRI using LabView.

property DataPath: str

DSS Data File Path. Default path for reports, etc. from DSS

Return type
str
property DefaultEditor: str

(read-only) Returns the path name for the default text editor.

Return type
str
Error: IError

The Error interface provides the current error state and messages. In DSS Python, this is already mapped to Python exceptions, so the user typpically does not need to worry about this.

Events: IDSSEvents

Kept for compatibility.

Executive: IDSS_Executive

Access to the list of available commands and options, including help text.

property LegacyModels: bool

If enabled, the legacy/deprecated models for PVSystem, InvControl, Storage and StorageControl are used. In the official OpenDSS version 9.0, the old models were removed. They are temporarily present here but may be removed in the near future. If they are important to you, please open an issue on GitHub or contact the authors from DSS Extensions: https://github.com/dss-extensions/

After toggling LegacyModels, run a “clear” command and the models will be loaded accordingly. Defaults to False.

This can also be enabled by setting the environment variable DSS_CAPI_LEGACY_MODELS to 1.

NOTE: this option will be removed in a future release.

(API Extension)

Return type
bool
property NumCircuits: int

(read-only) Number of Circuits currently defined

Return type
int
property NumClasses: int

(read-only) Number of DSS intrinsic classes

Return type
int
property NumUserClasses: int

(read-only) Number of user-defined classes

Return type
int
Obj: IObj

An experimental API that exposes all data classes of the DSS engine in a new and pythonic API.

(API Extension)

Parser: IParser

Kept for compatibility.

property Plotting

Shortcut for the plotting module. This property is equivalent to:

` from dss import plot return plot `

Gives access to the enable() and disable() functions. Requires matplotlib and SciPy to be installed, hence it is an optional feature.

(API Extension)

Text: IText

Provides access to command

property UserClasses: List[str]

(read-only) List of user-defined classes

Return type
List[str]
property Version: str

(read-only) Get version string for the DSS.

Return type
str
YMatrix: IYMatrix

The YMatrix interface provides advanced access to the internals of the DSS engine. The sparse admittance matrix of the system is also available here.

The original OpenDSSDirect.DLL had some YMatrix_* functions, but we add a lot more here.

(API Extension)

ZIP: IZIP

The ZIP interface provides functions to open compressed ZIP packages and run scripts inside the ZIP, without creating extra files on disk.

(API Extension)

dss.IDSS_Executive

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IDSS_Executive.IDSS_Executive(api_util)

Bases: Base

Command(i)

(read-only) Get i-th command

Return type
str
CommandHelp(i)

(read-only) Get help string for i-th command

Return type
str
Option(i)

(read-only) Get i-th option

Return type
str
OptionHelp(i)

(read-only) Get help string for i-th option

Return type
str
OptionValue(i)

(read-only) Get present value of i-th option

Return type
str
property NumCommands: int

(read-only) Number of DSS Executive Commands

Return type
int
property NumOptions: int

(read-only) Number of DSS Executive Options

Return type
int

dss.IDSSimComs

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IDSSimComs.IDSSimComs(api_util)

Bases: Base

BusVoltage(Index)
Return type
ndarray[Any, dtype[float64]]
BusVoltagepu(Index)
Return type
ndarray[Any, dtype[float64]]

dss.IError

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IError.IError(api_util)

Bases: Base

property Description: str

(read-only) Description of error for last operation

Return type
str
property EarlyAbort: bool

EarlyAbort controls whether all errors halts the DSS script processing (Compile/Redirect), defaults to True.

(API Extension)

Return type
bool
property ExtendedErrors: bool

Controls whether the extended error mechanism is used. Defaults to True.

Extended errors are errors derived from checks across the API to ensure a valid state. Although many of these checks are already present in the original/official COM interface, the checks do not produce any error message. An error value can be returned by a function but this value can, for many of the functions, be a valid value. As such, the user has no means to detect an invalid API call.

Extended errors use the Error interface to provide a more clear message and should help users, especially new users, to find usage issues earlier.

At Python level, an exception is raised when an error is detected through the Error interface.

The current default state is ON. For compatibility, the user can turn it off to restore the previous behavior.

(API Extension)

Return type
bool
property Number: int

(read-only) Error Number (returns current value and then resets to zero)

Return type
int

dss.IText

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IText.IText(api_util)

Bases: Base

Commands(Value)

Runs a list of strings or a large string as commands directly in the DSS engine. Intermediate results are ignored.

Value can be a list of strings, or a single large string (usually faster).

(API Extensions)

property Command: str

Input command string for the DSS.

Return type
str
property Result: str

(read-only) Result string for the last command.

Return type
str

dss.IZIP

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2021-2022 Paulo Meira

class dss.IZIP.IZIP(api_util)

Bases: Base

Close()

Closes the current open ZIP file

(API Extension)

Contains(Name)

Check if the given path name is present in the current ZIP file.

(API Extension)

Return type
bool
Extract(FileName)

Extracts the contents of the file “FileName” from the current (open) ZIP file. Returns a byte-string.

(API Extension)

Return type
bytes
List(regexp=None)

List of strings consisting of all names match the regular expression provided in regexp. If no expression is provided, all names in the current open ZIP are returned.

See https://regex.sorokin.engineer/en/latest/regular_expressions.html for information on the expression syntax and options.

(API Extension)

Return type
List[str]
Open(FileName)

Opens and prepares a ZIP file to be used by the DSS text parser. Currently, the ZIP format support is limited by what is provided in the Free Pascal distribution. Besides that, the full filenames inside the ZIP must be shorter than 256 characters. The limitations should be removed in a future revision.

(API Extension)

Redirect(FileInZip)

Runs a “Redirect” command inside the current (open) ZIP file. In the current implementation, all files required by the script must be present inside the ZIP, using relative paths. The only exceptions are memory-mapped files.

(API Extension)

dss.IActiveClass

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IActiveClass.IActiveClass(api_util)

Bases: Base

ToJSON(options=0)

Returns the data (as a list) of all elements from the active class as a JSON-encoded string.

The options parameter contains bit-flags to toggle specific features. See Obj_ToJSON (C-API) for more, or DSSObj.to_json in Python.

Additionally, the ExcludeDisabled flag can be used to excluded disabled elements from the output.

(API Extension)

Return type
str
property ActiveClassName: str

(read-only) Returns name of active class.

Return type
str
property ActiveClassParent: str

Get the name of the parent class of the active class

Return type
str
property AllNames: List[str]

(read-only) Array of strings consisting of all element names in the active class.

Return type
List[str]
property Count: int

(read-only) Number of elements in Active Class. Same as NumElements Property.

Return type
int
property First: int

(read-only) Sets first element in the active class to be the active DSS object. If object is a CktElement, ActiveCktELment also points to this element. Returns 0 if none.

Return type
int
property Name: str

Name of the Active Element of the Active Class

Return type
str
property Next: int

(read-only) Sets next element in active class to be the active DSS object. If object is a CktElement, ActiveCktElement also points to this element. Returns 0 if no more.

Return type
int
property NumElements: int

(read-only) Number of elements in this class. Same as Count property.

Return type
int

dss.IBus

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IBus.IBus(api_util)

Bases: Base

GetUniqueNodeNumber(StartNumber)
Return type
int
ZscRefresh()
Return type
bool
property AllPCEatBus: List[str]

Returns an array with the names of all PCE connected to the active bus

Return type
List[str]
property AllPDEatBus: List[str]

Returns an array with the names of all PDE connected to the active bus

Return type
List[str]
property Coorddefined: bool

(read-only) False=0 else True. Indicates whether a coordinate has been defined for this bus

Return type
bool
property CplxSeqVoltages: ndarray[Any, dtype[float64]]

(read-only) Complex Double array of Sequence Voltages (0, 1, 2) at this Bus.

Return type
ndarray[Any, dtype[float64]]
property Cust_Duration: float

(read-only) Accumulated customer outage durations

Return type
float
property Cust_Interrupts: float

(read-only) Annual number of customer-interruptions from this bus

Return type
float
property Distance: float

(read-only) Distance from energymeter (if non-zero)

Return type
float
property Int_Duration: float

(read-only) Average interruption duration, hr.

Return type
float
property Isc: ndarray[Any, dtype[float64]]

(read-only) Short circuit currents at bus; Complex Array.

Return type
ndarray[Any, dtype[float64]]
property Lambda: float

(read-only) Accumulated failure rate downstream from this bus; faults per year

Return type
float
property LineList: List[str]

List of strings: Full Names of LINE elements connected to the active bus.

Return type
List[str]
property LoadList: List[str]

List of strings: Full Names of LOAD elements connected to the active bus.

Return type
List[str]
property N_Customers: int

(read-only) Total numbers of customers served downline from this bus

Return type
int
property N_interrupts: float

(read-only) Number of interruptions this bus per year

Return type
float
property Name: str

(read-only) Name of Bus

Return type
str
property Nodes: ndarray[Any, dtype[int32]]

(read-only) Integer Array of Node Numbers defined at the bus in same order as the voltages.

Return type
ndarray[Any, dtype[int32]]
property NumNodes: int

(read-only) Number of Nodes this bus.

Return type
int
property SectionID: int

(read-only) Integer ID of the feeder section in which this bus is located.

Return type
int
property SeqVoltages: ndarray[Any, dtype[float64]]

(read-only) Double Array of sequence voltages at this bus.

Return type
ndarray[Any, dtype[float64]]
property TotalMiles: float

(read-only) Total length of line downline from this bus, in miles. For recloser siting algorithm.

Return type
float
property VLL: ndarray[Any, dtype[float64]]

(read-only) For 2- and 3-phase buses, returns array of complex numbers represetin L-L voltages in volts. Returns -1.0 for 1-phase bus. If more than 3 phases, returns only first 3.

Return type
ndarray[Any, dtype[float64]]
property VMagAngle: ndarray[Any, dtype[float64]]

(read-only) Array of doubles containing voltages in Magnitude (VLN), angle (deg)

Return type
ndarray[Any, dtype[float64]]
property Voc: ndarray[Any, dtype[float64]]

(read-only) Open circuit voltage; Complex array.

Return type
ndarray[Any, dtype[float64]]
property Voltages: ndarray[Any, dtype[float64]]

(read-only) Complex array of voltages at this bus.

Return type
ndarray[Any, dtype[float64]]
property YscMatrix: ndarray[Any, dtype[float64]]

(read-only) Complex array of Ysc matrix at bus. Column by column.

Return type
ndarray[Any, dtype[float64]]
property ZSC012Matrix: ndarray[Any, dtype[float64]]

Array of doubles (complex) containing the complete 012 Zsc matrix

Return type
ndarray[Any, dtype[float64]]
property Zsc0: ndarray[Any, dtype[float64]]

(read-only) Complex Zero-Sequence short circuit impedance at bus.

Return type
ndarray[Any, dtype[float64]]
property Zsc1: ndarray[Any, dtype[float64]]

(read-only) Complex Positive-Sequence short circuit impedance at bus.

Return type
ndarray[Any, dtype[float64]]
property ZscMatrix: ndarray[Any, dtype[float64]]

(read-only) Complex array of Zsc matrix at bus. Column by column.

Return type
ndarray[Any, dtype[float64]]
property kVBase: float

(read-only) Base voltage at bus in kV

Return type
float
property puVLL: ndarray[Any, dtype[float64]]

(read-only) Returns Complex array of pu L-L voltages for 2- and 3-phase buses. Returns -1.0 for 1-phase bus. If more than 3 phases, returns only 3 phases.

Return type
ndarray[Any, dtype[float64]]
property puVmagAngle: ndarray[Any, dtype[float64]]

(read-only) Array of doubles containig voltage magnitude, angle pairs in per unit

Return type
ndarray[Any, dtype[float64]]
property puVoltages: ndarray[Any, dtype[float64]]

(read-only) Complex Array of pu voltages at the bus.

Return type
ndarray[Any, dtype[float64]]
property x: float

X Coordinate for bus (double)

Return type
float
property y: float

Y coordinate for bus(double)

Return type
float

dss.ICNData

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ICNData.ICNData(api_util)

Bases: Iterable

CNData objects

(API Extension)

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Count: int

Number of objects of this type

Return type
int
property DiaCable: float
Return type
float
property DiaIns: float
Return type
float
property DiaStrand: float
Return type
float
property Diameter: float
Return type
float
property EmergAmps: float

Emergency ampere rating

Return type
float
property EpsR: float
Return type
float
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property GMRUnits: int
Return type
int
property GMRac: float
Return type
float
property GmrStrand: float
Return type
float
property InsLayer: float
Return type
float
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NormAmps: float

Normal Ampere rating

Return type
float
property RStrand: float
Return type
float
property Rac: float
Return type
float
property Radius: float
Return type
float
property RadiusUnits: int
Return type
int
property Rdc: float
Return type
float
property ResistanceUnits: int
Return type
int
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int
property k: int
Return type
int

dss.ICapControls

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ICapControls.ICapControls(api_util)

Bases: Iterable

Reset()
property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property CTratio: float

Transducer ratio from pirmary current to control current.

Return type
float
property Capacitor: str

Name of the Capacitor that is controlled.

Return type
str
property Count: int

Number of objects of this type

Return type
int
property DeadTime: float
Return type
float
property Delay: float

Time delay [s] to switch on after arming. Control may reset before actually switching.

Return type
float
property DelayOff: float

Time delay [s] before swithcing off a step. Control may reset before actually switching.

Return type
float
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property Mode: int

Type of automatic controller.

Return type
int
property MonitoredObj: int

Full name of the element that PT and CT are connected to.

Return type
int
property MonitoredTerm: int

Terminal number on the element that PT and CT are connected to.

Return type
int
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property OFFSetting: float

Threshold to switch off a step. See Mode for units.

Return type
float
property ONSetting: float

Threshold to arm or switch on a step. See Mode for units.

Return type
float
property PTratio: float

Transducer ratio from primary feeder to control voltage.

Return type
float
property UseVoltOverride: float

Enables Vmin and Vmax to override the control Mode

Return type
float
property Vmax: float

With VoltOverride, swtich off whenever PT voltage exceeds this level.

Return type
float
property Vmin: float

With VoltOverride, switch ON whenever PT voltage drops below this level.

Return type
float
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.ICapacitors

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ICapacitors.ICapacitors(api_util)

Bases: Iterable

AddStep()
Return type
bool
Close()
Open()
SubtractStep()
Return type
bool
property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property AvailableSteps: int

(read-only) Number of Steps available in cap bank to be switched ON.

Return type
int
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property IsDelta: bool

Delta connection or wye?

Return type
bool
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NumSteps: int

Number of steps (default 1) for distributing and switching the total bank kVAR.

Return type
int
property States: ndarray[Any, dtype[int32]]

A array of integer [0..numsteps-1] indicating state of each step. If the read value is -1 an error has occurred.

Return type
ndarray[Any, dtype[int32]]
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int
property kV: float

Bank kV rating. Use LL for 2 or 3 phases, or actual can rating for 1 phase.

Return type
float
property kvar: float

Total bank KVAR, distributed equally among phases and steps.

Return type
float

dss.ICircuit

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ICircuit.ICircuit(api_util)

Bases: Base

AllNodeDistancesByPhase(Phase)

(read-only) Returns an array of doubles representing the distances to parent EnergyMeter. Sequence of array corresponds to other node ByPhase properties.

Return type
ndarray[Any, dtype[float64]]
AllNodeNamesByPhase(Phase)

(read-only) Return array of strings of the node names for the By Phase criteria. Sequence corresponds to other ByPhase properties.

Return type
List[str]
AllNodeVmagByPhase(Phase)

(read-only) Returns Array of doubles represent voltage magnitudes for nodes on the specified phase.

Return type
ndarray[Any, dtype[float64]]
AllNodeVmagPUByPhase(Phase)

(read-only) Returns array of per unit voltage magnitudes for each node by phase

Return type
ndarray[Any, dtype[float64]]
Capacity(Start, Increment)
Return type
float
Disable(Name)
ElementLosses(Value)

Array of total losses (complex) in a selection of elements. Use the element indices (starting at 1) as parameter.

(API Extension)

Return type
ndarray[Any, dtype[float64]]
Enable(Name)
EndOfTimeStepUpdate()
FirstElement()
Return type
int
FirstPCElement()
Return type
int
FirstPDElement()
Return type
int
NextElement()
Return type
int
NextPCElement()
Return type
int
NextPDElement()
Return type
int
Sample()
SaveSample()
SetActiveBus(BusName)
Return type
int
SetActiveBusi(BusIndex)
Return type
int
SetActiveClass(ClassName)
Return type
int
SetActiveElement(FullName)
Return type
int
UpdateStorage()
ActiveBus: IBus
ActiveCktElement: ICktElement
ActiveClass: IActiveClass
ActiveDSSElement: IDSSElement
ActiveElement: ICktElement
property AllBusDistances: ndarray[Any, dtype[float64]]

(read-only) Returns distance from each bus to parent EnergyMeter. Corresponds to sequence in AllBusNames.

Return type
ndarray[Any, dtype[float64]]
property AllBusNames: List[str]

(read-only) Array of strings containing names of all buses in circuit (see AllNodeNames).

Return type
List[str]
property AllBusVmag: ndarray[Any, dtype[float64]]

(read-only) Array of magnitudes (doubles) of voltages at all buses

Return type
ndarray[Any, dtype[float64]]
property AllBusVmagPu: ndarray[Any, dtype[float64]]

(read-only) Double Array of all bus voltages (each node) magnitudes in Per unit

Return type
ndarray[Any, dtype[float64]]
property AllBusVolts: ndarray[Any, dtype[float64]]

(read-only) Complex array of all bus, node voltages from most recent solution

Return type
ndarray[Any, dtype[float64]]
property AllElementLosses: ndarray[Any, dtype[float64]]

(read-only) Array of total losses (complex) in each circuit element

Return type
ndarray[Any, dtype[float64]]
property AllElementNames: List[str]

(read-only) Array of strings containing Full Name of all elements.

Return type
List[str]
property AllNodeDistances: ndarray[Any, dtype[float64]]

(read-only) Returns an array of distances from parent EnergyMeter for each Node. Corresponds to AllBusVMag sequence.

Return type
ndarray[Any, dtype[float64]]
property AllNodeNames: List[str]

(read-only) Array of strings containing full name of each node in system in same order as returned by AllBusVolts, etc.

Return type
List[str]
Buses: IBus
CNData: ICNData
CapControls: ICapControls
Capacitors: ICapacitors
CktElements: ICktElement
CtrlQueue: ICtrlQueue
DSSim_Coms: IDSSimComs
Fuses: IFuses
GICSources: IGICSources
Generators: IGenerators
ISources: IISources
Isources: IISources
LineCodes: ILineCodes
LineGeometries: ILineGeometries
property LineLosses: ndarray[Any, dtype[float64]]

(read-only) Complex total line losses in the circuit

Return type
ndarray[Any, dtype[float64]]
LineSpacings: ILineSpacings
Lines: ILines
LoadShapes: ILoadShapes
Loads: ILoads
property Losses: ndarray[Any, dtype[float64]]

(read-only) Total losses in active circuit, complex number (two-element array of double).

Return type
ndarray[Any, dtype[float64]]
Meters: IMeters
Monitors: IMonitors
property Name: str

(read-only) Name of the active circuit.

Return type
str
property NumBuses: int

(read-only) Total number of Buses in the circuit.

Return type
int
property NumCktElements: int

(read-only) Number of CktElements in the circuit.

Return type
int
property NumNodes: int

(read-only) Total number of nodes in the circuit.

Return type
int
PDElements: IPDElements
PVSystems: IPVSystems
Parallel: IParallel
property ParentPDElement: int

(read-only) Sets Parent PD element, if any, to be the active circuit element and returns index>0; Returns 0 if it fails or not applicable.

Return type
int
Reactors: IReactors
Reclosers: IReclosers
ReduceCkt: IReduceCkt

Circuit Reduction Interface

RegControls: IRegControls
Relays: IRelays
Sensors: ISensors
Settings: ISettings
Solution: ISolution
Storages: IStorages
property SubstationLosses: ndarray[Any, dtype[float64]]

(read-only) Complex losses in all transformers designated to substations.

Return type
ndarray[Any, dtype[float64]]
SwtControls: ISwtControls
property SystemY: ndarray[Any, dtype[float64]]

(read-only) System Y matrix (after a solution has been performed). This is deprecated as it returns a dense matrix. Only use it for small systems. For large scale systems, prefer YMatrix.GetCompressedYMatrix.

Return type
ndarray[Any, dtype[float64]]
TSData: ITSData
Topology: ITopology
property TotalPower: ndarray[Any, dtype[float64]]

(read-only) Total power, kW delivered to the circuit

Return type
ndarray[Any, dtype[float64]]
Transformers: ITransformers
Vsources: IVsources
WireData: IWireData
XYCurves: IXYCurves
property YCurrents: ndarray[Any, dtype[float64]]

(read-only) Array of doubles containing complex injection currents for the present solution. Is is the “I” vector of I=YV

Return type
ndarray[Any, dtype[float64]]
property YNodeOrder: List[str]

(read-only) Array of strings containing the names of the nodes in the same order as the Y matrix

Return type
List[str]
property YNodeVarray: ndarray[Any, dtype[float64]]

(read-only) Complex array of actual node voltages in same order as SystemY matrix.

Return type
ndarray[Any, dtype[float64]]

dss.ICktElement

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ICktElement.ICktElement(api_util)

Bases: Base

Close(Term, Phs)
Controller(idx)

(read-only) Full name of the i-th controller attached to this element. Ex: str = Controller(2). See NumControls to determine valid index range

Return type
str
IsOpen(Term, Phs)
Return type
bool
Open(Term, Phs)
Variable(MyVarName)

(read-only) Returns (value, Code). For PCElement, get the value of a variable by name. If Code>0 Then no variable by this name or not a PCelement.

Return type
Tuple[float, int]
VariableByIndex(Idx)

(read-only) Returns (value, Code). For PCElement, get the value of a variable by integer index. If Code>0 Then no variable by this index or not a PCelement.

Return type
Tuple[float, int]
VariableByName(MyVarName)

(read-only) Returns (value, Code). For PCElement, get the value of a variable by name. If Code>0 Then no variable by this name or not a PCelement.

Return type
Tuple[float, int]
Variablei(Idx)

(read-only) Returns (value, Code). For PCElement, get the value of a variable by integer index. If Code>0 Then no variable by this index or not a PCelement.

Return type
Tuple[float, int]
setVariableByIndex(Idx, Value)
Return type
int
setVariableByName(Idx, Value)
Return type
int
property AllPropertyNames: List[str]

(read-only) Array containing all property names of the active device.

Return type
List[str]
property AllVariableNames: List[str]

(read-only) Array of strings listing all the published variable names, if a PCElement. Otherwise, null string.

Return type
List[str]
property AllVariableValues: ndarray[Any, dtype[float64]]

(read-only) Array of doubles. Values of state variables of active element if PC element.

Return type
ndarray[Any, dtype[float64]]
property BusNames: List[str]

Array of strings. Get Bus definitions to which each terminal is connected.

Return type
List[str]
property CplxSeqCurrents: ndarray[Any, dtype[float64]]

(read-only) Complex double array of Sequence Currents for all conductors of all terminals of active circuit element.

Return type
ndarray[Any, dtype[float64]]
property CplxSeqVoltages: ndarray[Any, dtype[float64]]

(read-only) Complex double array of Sequence Voltage for all terminals of active circuit element.

Return type
ndarray[Any, dtype[float64]]
property Currents: ndarray[Any, dtype[float64]]

(read-only) Complex array of currents into each conductor of each terminal

Return type
ndarray[Any, dtype[float64]]
property CurrentsMagAng: ndarray[Any, dtype[float64]]

(read-only) Currents in magnitude, angle format as a array of doubles.

Return type
ndarray[Any, dtype[float64]]
property DisplayName: str

Display name of the object (not necessarily unique)

Return type
str
property EmergAmps: float

Emergency Ampere Rating for PD elements

Return type
float
property Enabled: bool

Boolean indicating that element is currently in the circuit.

Return type
bool
property EnergyMeter: str

(read-only) Name of the Energy Meter this element is assigned to.

Return type
str
property GUID: str

(read-only) globally unique identifier for this object

Return type
str
property Handle: int

(read-only) Pointer to this object

Return type
int
property HasOCPDevice: bool

(read-only) True if a recloser, relay, or fuse controlling this ckt element. OCP = Overcurrent Protection

Return type
bool
property HasSwitchControl: bool

(read-only) This element has a SwtControl attached.

Return type
bool
property HasVoltControl: bool

(read-only) This element has a CapControl or RegControl attached.

Return type
bool
property IsIsolated: ndarray[Any, dtype[float64]]

Returns true if the current active element is isolated. Note that this only fetches the current value. See also the Topology interface.

Return type
ndarray[Any, dtype[float64]]
property Losses: ndarray[Any, dtype[float64]]

(read-only) Total losses in the element: two-element complex array

Return type
ndarray[Any, dtype[float64]]
property Name: str

(read-only) Full Name of Active Circuit Element

Return type
str
property NodeOrder: ndarray[Any, dtype[int32]]

(read-only) Array of integer containing the node numbers (representing phases, for example) for each conductor of each terminal.

Return type
ndarray[Any, dtype[int32]]
property NodeRef: ndarray[Any, dtype[int32]]

Array of integers, a copy of the internal NodeRef of the CktElement.

Return type
ndarray[Any, dtype[int32]]
property NormalAmps: float

Normal ampere rating for PD Elements

Return type
float
property NumConductors: int

(read-only) Number of Conductors per Terminal

Return type
int
property NumControls: int

(read-only) Number of controls connected to this device. Use to determine valid range for index into Controller array.

Return type
int
property NumPhases: int

(read-only) Number of Phases

Return type
int
property NumProperties: int

(read-only) Number of Properties this Circuit Element.

Return type
int
property NumTerminals: int

(read-only) Number of Terminals this Circuit Element

Return type
int
property OCPDevIndex: int

(read-only) Index into Controller list of OCP Device controlling this CktElement

Return type
int
property OCPDevType: int

(read-only) 0=None; 1=Fuse; 2=Recloser; 3=Relay; Type of OCP controller device

Return type
int
property PhaseLosses: ndarray[Any, dtype[float64]]

(read-only) Complex array of losses by phase

Return type
ndarray[Any, dtype[float64]]
property Powers: ndarray[Any, dtype[float64]]

(read-only) Complex array of powers into each conductor of each terminal

Return type
ndarray[Any, dtype[float64]]
Properties: IDSSProperty
property Residuals: ndarray[Any, dtype[float64]]

(read-only) Residual currents for each terminal: (mag, angle)

Return type
ndarray[Any, dtype[float64]]
property SeqCurrents: ndarray[Any, dtype[float64]]

(read-only) Double array of symmetrical component currents into each 3-phase terminal

Return type
ndarray[Any, dtype[float64]]
property SeqPowers: ndarray[Any, dtype[float64]]

(read-only) Double array of sequence powers into each 3-phase teminal

Return type
ndarray[Any, dtype[float64]]
property SeqVoltages: ndarray[Any, dtype[float64]]

(read-only) Double array of symmetrical component voltages at each 3-phase terminal

Return type
ndarray[Any, dtype[float64]]
property TotalPowers: ndarray[Any, dtype[float64]]

Returns the total powers (complex) at ALL terminals of the active circuit element.

Return type
ndarray[Any, dtype[float64]]
property Voltages: ndarray[Any, dtype[float64]]

(read-only) Complex array of voltages at terminals

Return type
ndarray[Any, dtype[float64]]
property VoltagesMagAng: ndarray[Any, dtype[float64]]

(read-only) Voltages at each conductor in magnitude, angle form as array of doubles.

Return type
ndarray[Any, dtype[float64]]
property Yprim: ndarray[Any, dtype[float64]]

(read-only) YPrim matrix, column order, complex numbers (paired)

Return type
ndarray[Any, dtype[float64]]

dss.ICtrlQueue

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ICtrlQueue.ICtrlQueue(api_util)

Bases: Base

ClearActions()
ClearQueue()
Delete(ActionHandle)
DoAllQueue()
Push(Hour, Seconds, ActionCode, DeviceHandle)

Push a control action onto the DSS control queue by time, action code, and device handle (user defined). Returns Control Queue handle.

Show()
property Action: int

(write-only) Set the active action by index

Return type
int
property ActionCode: int

(read-only) Code for the active action. Long integer code to tell the control device what to do

Return type
int
property DeviceHandle: int

(read-only) Handle (User defined) to device that must act on the pending action.

Return type
int
property NumActions: int

(read-only) Number of Actions on the current actionlist (that have been popped off the control queue by CheckControlActions)

Return type
int
property PopAction: int

(read-only) Pops next action off the action list and makes it the active action. Returns zero if none.

Return type
int
property Queue: List[str]

(read-only) Array of strings containing the entire queue in CSV format

Return type
List[str]
property QueueSize: int

(read-only) Number of items on the OpenDSS control Queue

Return type
int

dss.IDSSElement

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IDSSElement.IDSSElement(api_util)

Bases: Base

ToJSON(options=0)

Returns the properties of the active DSS object as a JSON-encoded string.

The options parameter contains bit-flags to toggle specific features. See Obj_ToJSON (C-API) for more, or DSSObj.to_json in Python.

(API Extension)

Return type
str
property AllPropertyNames: List[str]

(read-only) Array of strings containing the names of all properties for the active DSS object.

Return type
List[str]
property Name: str

(read-only) Full Name of Active DSS Object (general element or circuit element).

Return type
str
property NumProperties: int

(read-only) Number of Properties for the active DSS object.

Return type
int
Properties

dss.IDSSEvents

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2019 Paulo Meira

class dss.IDSSEvents.IDSSEvents(api_util)

Bases: object

dss.IDSSProgress

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IDSSProgress.IDSSProgress(api_util)

Bases: Base

Close()
Show()
property Caption: str

(write-only) Caption to appear on the bottom of the DSS Progress form.

Return type
str
property PctProgress: int

(write-only) Percent progress to indicate [0..100]

Return type
int

dss.IDSSProperty

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IDSSProperty.IDSSProperty(api_util)

Bases: Base

property Description: str

(read-only) Description of the property.

Return type
str
property Name: str

(read-only) Name of Property

Return type
str
property Val: str
Return type
str

dss.IFuses

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IFuses.IFuses(api_util)

Bases: Iterable

Close()

Close all phases of the fuse.

IsBlown()

Current state of the fuses. TRUE if any fuse on any phase is blown. Else FALSE.

Return type
bool
Open()

Manual opening of all phases of the fuse.

Reset()

Reset fuse to normal state.

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Count: int

Number of objects of this type

Return type
int
property Delay: float

A fixed delay time in seconds added to the fuse blowing time determined by the TCC curve. Default is 0. This represents a fuse clear or other delay.

Return type
float
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property MonitoredObj: str

Full name of the circuit element to which the fuse is connected.

Return type
str
property MonitoredTerm: int

Terminal number to which the fuse is connected.

Return type
int
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NormalState: List[str]

Array of strings indicating the normal state of each phase of the fuse.

Return type
List[str]
property NumPhases: int

(read-only) Number of phases, this fuse.

Return type
int
property RatedCurrent: float

Multiplier or actual amps for the TCCcurve object. Defaults to 1.0. Multiply current values of TCC curve by this to get actual amps.

Return type
float
property State: List[str]

Array of strings indicating the state of each phase of the fuse.

Return type
List[str]
property SwitchedObj: str

Full name of the circuit element switch that the fuse controls. Defaults to the MonitoredObj.

Return type
str
property SwitchedTerm: int

Number of the terminal of the controlled element containing the switch controlled by the fuse.

Return type
int
property TCCcurve: str

Name of the TCCcurve object that determines fuse blowing.

Return type
str
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.IGICSources

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2022 Paulo Meira Copyright (c) 2022 DSS Extensions contributors

class dss.IGICSources.IGICSources(api_util)

Bases: Iterable

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Bus1: str

First bus name of GICSource (Created name)

Return type
str
property Bus2: str

Second bus name

Return type
str
property Count: int

Number of objects of this type

Return type
int
property EE: float

Eastward E Field, V/km

Return type
float
property EN: float

Northward E Field V/km

Return type
float
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property Lat1: float

Latitude of Bus1 (degrees)

Return type
float
property Lat2: float

Latitude of Bus2 (degrees)

Return type
float
property Lon1: float

Longitude of Bus1 (Degrees)

Return type
float
property Lon2: float

Longitude of Bus2 (Degrees)

Return type
float
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property Phases: int

Number of Phases, this GICSource element.

Return type
int
property Volts: float

Specify dc voltage directly

Return type
float
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.IGenerators

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IGenerators.IGenerators(api_util)

Bases: Iterable

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Bus1: str

Bus to which the Generator is connected. May include specific node specification.

(API Extension)

Return type
str
property Class: int

An arbitrary integer number representing the class of Generator so that Generator values may be segregated by class.

(API Extension)

Return type
int
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property ForcedON: bool

Indicates whether the generator is forced ON regardles of other dispatch criteria.

Return type
bool
property IsDelta: bool

Generator connection. True/1 if delta connection, False/0 if wye.

(API Extension)

Return type
bool
property Model: int

Generator Model

Return type
int
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property PF: float

Power factor (pos. = producing vars). Updates kvar based on present kW value.

Return type
float
property Phases: int

Number of phases

Return type
int
property RegisterNames: List[str]

(read-only) Array of Names of all generator energy meter registers

Return type
List[str]
property RegisterValues: ndarray[Any, dtype[float64]]

(read-only) Array of valus in generator energy meter registers.

Return type
ndarray[Any, dtype[float64]]
property Status: int

Response to dispatch multipliers: Fixed=1 (dispatch multipliers do not apply), Variable=0 (follows curves).

Related enumeration: GeneratorStatus

(API Extension)

Return type
int
property Vmaxpu: float

Vmaxpu for generator model

Return type
float
property Vminpu: float

Vminpu for Generator model

Return type
float
property Yearly: str

Name of yearly loadshape

(API Extension)

Return type
str
property daily: str

Name of the loadshape for a daily generation profile.

(API Extension)

Return type
str
property duty: str

Name of the loadshape for a duty cycle simulation.

(API Extension)

Return type
str
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int
property kV: float

Voltage base for the active generator, kV

Return type
float
property kVArated: float

kVA rating of the generator

Return type
float
property kW: float

kW output for the active generator. kvar is updated for current power factor.

Return type
float
property kva: float

kVA rating of electrical machine. Applied to machine or inverter definition for Dynamics mode solutions.

(API Extension)

Return type
float
property kvar: float

kvar output for the active generator. Updates power factor based on present kW value.

Return type
float

dss.IISources

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IISources.IISources(api_util)

Bases: Iterable

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Amps: float

Magnitude of the ISource in amps

Return type
float
property AngleDeg: float

Phase angle for ISource, degrees

Return type
float
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property Frequency: float

The present frequency of the ISource, Hz

Return type
float
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.ILineCodes

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ILineCodes.ILineCodes(api_util)

Bases: Iterable

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property C0

Zero-sequence capacitance, nF per unit length

property C1

Positive-sequence capacitance, nF per unit length

property Cmatrix: ndarray[Any, dtype[float64]]

Capacitance matrix, nF per unit length

Return type
ndarray[Any, dtype[float64]]
property Count: int

Number of objects of this type

Return type
int
property EmergAmps: float

Emergency ampere rating

Return type
float
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property IsZ1Z0: bool

(read-only) Flag denoting whether impedance data were entered in symmetrical components

Return type
bool
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NormAmps: float

Normal Ampere rating

Return type
float
property Phases: int

Number of Phases

Return type
int
property R0: float

Zero-Sequence Resistance, ohms per unit length

Return type
float
property R1: float

Positive-sequence resistance ohms per unit length

Return type
float
property Rmatrix: ndarray[Any, dtype[float64]]

Resistance matrix, ohms per unit length

Return type
ndarray[Any, dtype[float64]]
property Units: int
Return type
int
property X0: float

Zero Sequence Reactance, Ohms per unit length

Return type
float
property X1: float

Posiive-sequence reactance, ohms per unit length

Return type
float
property Xmatrix: ndarray[Any, dtype[float64]]

Reactance matrix, ohms per unit length

Return type
ndarray[Any, dtype[float64]]
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.ILineGeometries

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ILineGeometries.ILineGeometries(api_util)

Bases: Iterable

LineGeometry objects

(API Extension)

Cmatrix(Frequency, Length, Units)

(read-only) Capacitance matrix, nF

Return type
ndarray[Any, dtype[float64]]
Rmatrix(Frequency, Length, Units)

(read-only) Resistance matrix, ohms

Return type
ndarray[Any, dtype[float64]]
Xmatrix(Frequency, Length, Units)

(read-only) Reactance matrix, ohms

Return type
ndarray[Any, dtype[float64]]
Zmatrix(Frequency, Length, Units)

(read-only) Complex impedance matrix, ohms

Return type
ndarray[Any, dtype[float64]]
property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Conductors: List[str]

(read-only) Array of strings with names of all conductors in the active LineGeometry object

Return type
List[str]
property Count: int

Number of objects of this type

Return type
int
property EmergAmps: float

Emergency ampere rating

Return type
float
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Nconds: int

Number of conductors in this geometry. Default is 3. Triggers memory allocations. Define first!

Return type
int
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NormAmps: float

Normal ampere rating

Return type
float
property Phases: int

Number of Phases

Return type
int
property Reduce: bool
Return type
bool
property RhoEarth: float
Return type
float
property Units: ndarray[Any, dtype[int32]]
Return type
ndarray[Any, dtype[int32]]
property Xcoords: ndarray[Any, dtype[float64]]

Get/Set the X (horizontal) coordinates of the conductors

Return type
ndarray[Any, dtype[float64]]
property Ycoords: ndarray[Any, dtype[float64]]

Get/Set the Y (vertical/height) coordinates of the conductors

Return type
ndarray[Any, dtype[float64]]
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.ILineSpacings

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ILineSpacings.ILineSpacings(api_util)

Bases: Iterable

LineSpacing objects

(API Extension)

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Nconds: int
Return type
int
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property Phases: int

Number of Phases

Return type
int
property Units: int
Return type
int
property Xcoords: ndarray[Any, dtype[float64]]

Get/Set the X (horizontal) coordinates of the conductors

Return type
ndarray[Any, dtype[float64]]
property Ycoords: ndarray[Any, dtype[float64]]

Get/Set the Y (vertical/height) coordinates of the conductors

Return type
ndarray[Any, dtype[float64]]
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.ILines

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ILines.ILines(api_util)

Bases: Iterable

New(Name)
property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Bus1: str

Name of bus for terminal 1.

Return type
str
property Bus2: str

Name of bus for terminal 2.

Return type
str
property C0: float

Zero Sequence capacitance, nanofarads per unit length.

Return type
float
property C1: float

Positive Sequence capacitance, nanofarads per unit length.

Return type
float
property Cmatrix: ndarray[Any, dtype[float64]]
Return type
ndarray[Any, dtype[float64]]
property Count: int

Number of objects of this type

Return type
int
property EmergAmps: float

Emergency (maximum) ampere rating of Line.

Return type
float
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property Geometry: str

Line geometry code

Return type
str
property IsSwitch: bool

Sets/gets the Line element switch status. Setting it has side-effects to the line parameters.

Return type
bool
property Length: float

Length of line section in units compatible with the LineCode definition.

Return type
float
property LineCode: str

Name of LineCode object that defines the impedances.

Return type
str
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NormAmps: float

Normal ampere rating of Line.

Return type
float
property NumCust: int

(read-only) Number of customers on this line section.

Return type
int
property Parent: int

(read-only) Sets Parent of the active Line to be the active line. Returns 0 if no parent or action fails.

Return type
int
property Phases: int

Number of Phases, this Line element.

Return type
int
property R0: float

Zero Sequence resistance, ohms per unit length.

Return type
float
property R1: float

Positive Sequence resistance, ohms per unit length.

Return type
float
property Rg: float

Earth return resistance value used to compute line impedances at power frequency

Return type
float
property Rho: float

Earth Resistivity, m-ohms

Return type
float
property Rmatrix: ndarray[Any, dtype[float64]]

Resistance matrix (full), ohms per unit length. Array of doubles.

Return type
ndarray[Any, dtype[float64]]
property SeasonRating: float

Delivers the rating for the current season (in Amps) if the “SeasonalRatings” option is active

Return type
float
property Spacing: str

Line spacing code

Return type
str
property TotalCust: int

(read-only) Total Number of customers served from this line section.

Return type
int
property Units: int
Return type
int
property X0: float

Zero Sequence reactance ohms per unit length.

Return type
float
property X1: float

Positive Sequence reactance, ohms per unit length.

Return type
float
property Xg: float

Earth return reactance value used to compute line impedances at power frequency

Return type
float
property Xmatrix: ndarray[Any, dtype[float64]]
Return type
ndarray[Any, dtype[float64]]
property Yprim: ndarray[Any, dtype[float64]]

Yprimitive: Does Nothing at present on Put; Dangerous

Return type
ndarray[Any, dtype[float64]]
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.ILoadShapes

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ILoadShapes.ILoadShapes(api_util)

Bases: Iterable

New(Name)
Normalize()
UseFloat32()

Converts the current LoadShape data to float32/single precision. If there is no data or the data is already represented using float32, nothing is done.

(API Extension)

UseFloat64()

Converts the current LoadShape data to float64/double precision. If there is no data or the data is already represented using float64, nothing is done.

(API Extension)

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property HrInterval: float

Fixed interval time value, hours.

Return type
float
property MinInterval: float

Fixed Interval time value, in minutes

Return type
float
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property Npts: int

Get/set Number of points in active Loadshape.

Return type
int
property PBase: float
Return type
float
property Pbase: float
Return type
float
property Pmult: ndarray[Any, dtype[float64]]

Array of doubles for the P multiplier in the Loadshape.

Return type
ndarray[Any, dtype[float64]]
property QBase: float

Base for normalizing Q curve. If left at zero, the peak value is used.

Return type
float
property Qbase: float

Base for normalizing Q curve. If left at zero, the peak value is used.

Return type
float
property Qmult: ndarray[Any, dtype[float64]]

Array of doubles containing the Q multipliers.

Return type
ndarray[Any, dtype[float64]]
property SInterval: float
Return type
float
property Sinterval: float
Return type
float
property TimeArray: ndarray[Any, dtype[float64]]

Time array in hours correscponding to P and Q multipliers when the Interval=0.

Return type
ndarray[Any, dtype[float64]]
property UseActual: bool

Boolean flag to let Loads know to use the actual value in the curve rather than use the value as a multiplier.

Return type
bool
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int
property sInterval: float
Return type
float

dss.ILoads

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ILoads.ILoads(api_util)

Bases: Iterable

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property AllocationFactor: float

Factor for allocating loads by connected xfkva

Return type
float
property CVRcurve: str

Name of a loadshape with both Mult and Qmult, for CVR factors as a function of time.

Return type
str
property CVRvars: float

Percent reduction in Q for percent reduction in V. Must be used with dssLoadModelCVR.

Return type
float
property CVRwatts: float

Percent reduction in P for percent reduction in V. Must be used with dssLoadModelCVR.

Return type
float
property Cfactor: float

Factor relates average to peak kw. Used for allocation with kwh and kwhdays

Return type
float
property Class: int
Return type
int
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property Growth: str

Name of the growthshape curve for yearly load growth factors.

Return type
str
property IsDelta: bool

Delta loads are connected line-to-line.

Return type
bool
property Model: int

The Load Model defines variation of P and Q with voltage.

Return type
int
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NumCust: int

Number of customers in this load, defaults to one.

Return type
int
property PF: float

Get or set Power Factor for Active Load. Specify leading PF as negative. Updates kvar based on present value of kW

Return type
float
property PctMean: float

Average percent of nominal load in Monte Carlo studies; only if no loadshape defined for this load.

Return type
float
property PctStdDev: float

Percent standard deviation for Monte Carlo load studies; if there is no loadshape assigned to this load.

Return type
float
property Phases: int

Number of phases

(API Extension)

Return type
int
property RelWeight: float

Relative Weighting factor for the active LOAD

Return type
float
property Rneut: float

Neutral resistance for wye-connected loads.

Return type
float
property Sensor: str

Name of the sensor monitoring this load.

Return type
str
property Spectrum: str

Name of harmonic current spectrrum shape.

Return type
str
property Status: int

Response to load multipliers: Fixed (growth only), Exempt (no LD curve), Variable (all).

Return type
int
property Vmaxpu: float

Maximum per-unit voltage to use the load model. Above this, constant Z applies.

Return type
float
property Vminemerg: float

Minimum voltage for unserved energy (UE) evaluation.

Return type
float
property Vminnorm: float

Minimum voltage for energy exceeding normal (EEN) evaluations.

Return type
float
property Vminpu: float

Minimum voltage to apply the load model. Below this, constant Z is used.

Return type
float
property Xneut: float

Neutral reactance for wye-connected loads.

Return type
float
property Yearly: str

Name of yearly duration loadshape

Return type
str
property ZIPV: ndarray[Any, dtype[float64]]

Array of 7 doubles with values for ZIPV property of the load object

Return type
ndarray[Any, dtype[float64]]
property daily: str

Name of the loadshape for a daily load profile.

Return type
str
property duty: str

Name of the loadshape for a duty cycle simulation.

Return type
str
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int
property kV: float

Set kV rating for active Load. For 2 or more phases set Line-Line kV. Else actual kV across terminals.

Return type
float
property kW: float

Set kW for active Load. Updates kvar based on present PF.

Return type
float
property kva: float

Base load kva. Also defined kw and kvar or pf input, or load allocation by kwh or xfkva.

Return type
float
property kvar: float

Get/set kvar for active Load. If set, updates PF based on present kW.

Return type
float
property kwh: float

kwh billed for this period. Can be used with Cfactor for load allocation.

Return type
float
property kwhdays: float

Length of kwh billing period for average demand calculation. Default 30.

Return type
float
property pctSeriesRL: float

Percent of Load that is modeled as series R-L for harmonics studies

Return type
float
property xfkVA: float

Rated service transformer kVA for load allocation, using AllocationFactor. Affects kW, kvar, and pf.

Return type
float

dss.IMeters

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IMeters.IMeters(api_util)

Bases: Iterable

CloseAllDIFiles()
DoReliabilityCalc(AssumeRestoration)
OpenAllDIFiles()
Reset()
ResetAll()
Sample()
SampleAll()
Save()
SaveAll()
SetActiveSection(SectIdx)
property AllBranchesInZone: List[str]

(read-only) Wide string list of all branches in zone of the active energymeter object.

Return type
List[str]
property AllEndElements: List[str]

(read-only) Array of names of all zone end elements.

Return type
List[str]
property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property AllocFactors: ndarray[Any, dtype[float64]]

Array of doubles: set the phase allocation factors for the active meter.

Return type
ndarray[Any, dtype[float64]]
property AvgRepairTime: float

(read-only) Average Repair time in this section of the meter zone

Return type
float
property CalcCurrent: ndarray[Any, dtype[float64]]

Set the magnitude of the real part of the Calculated Current (normally determined by solution) for the Meter to force some behavior on Load Allocation

Return type
ndarray[Any, dtype[float64]]
property Count: int

Number of objects of this type

Return type
int
property CountBranches: int

(read-only) Number of branches in Active energymeter zone. (Same as sequencelist size)

Return type
int
property CountEndElements: int

(read-only) Number of zone end elements in the active meter zone.

Return type
int
property CustInterrupts: float

(read-only) Total customer interruptions for this Meter zone based on reliability calcs.

Return type
float
property DIFilesAreOpen: bool

(read-only) Global Flag in the DSS to indicate if Demand Interval (DI) files have been properly opened.

Return type
bool
property FaultRateXRepairHrs: float

(read-only) Sum of Fault Rate time Repair Hrs in this section of the meter zone

Return type
float
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property MeteredElement: str

Set Name of metered element

Return type
str
property MeteredTerminal: int

set Number of Metered Terminal

Return type
int
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NumSectionBranches: int

(read-only) Number of branches (lines) in this section

Return type
int
property NumSectionCustomers: int

(read-only) Number of Customers in the active section.

Return type
int
property NumSections: int

(read-only) Number of feeder sections in this meter’s zone

Return type
int
property OCPDeviceType: int

(read-only) Type of OCP device. 1=Fuse; 2=Recloser; 3=Relay

Return type
int
property Peakcurrent: ndarray[Any, dtype[float64]]

Array of doubles to set values of Peak Current property

Return type
ndarray[Any, dtype[float64]]
property RegisterNames: List[str]

(read-only) Array of strings containing the names of the registers.

Return type
List[str]
property RegisterValues: ndarray[Any, dtype[float64]]

(read-only) Array of all the values contained in the Meter registers for the active Meter.

Return type
ndarray[Any, dtype[float64]]
property SAIDI: float

(read-only) SAIDI for this meter’s zone. Execute DoReliabilityCalc first.

Return type
float
property SAIFI: float

(read-only) Returns SAIFI for this meter’s Zone. Execute Reliability Calc method first.

Return type
float
property SAIFIKW: float

(read-only) SAIFI based on kW rather than number of customers. Get after reliability calcs.

Return type
float
property SectSeqIdx: int

(read-only) SequenceIndex of the branch at the head of this section

Return type
int
property SectTotalCust: int

(read-only) Total Customers downline from this section

Return type
int
property SeqListSize: int

(read-only) Size of Sequence List

Return type
int
property SequenceIndex: int

Get/set Index into Meter’s SequenceList that contains branch pointers in lexical order. Earlier index guaranteed to be upline from later index. Sets PDelement active.

Return type
int
property SumBranchFltRates: float

(read-only) Sum of the branch fault rates in this section of the meter’s zone

Return type
float
property TotalCustomers: int

(read-only) Total Number of customers in this zone (downline from the EnergyMeter)

Return type
int
property Totals: ndarray[Any, dtype[float64]]

(read-only) Totals of all registers of all meters

Return type
ndarray[Any, dtype[float64]]
property ZonePCE: List[str]

Returns the list of all PCE within the area covered by the energy meter

Return type
List[str]
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.IMonitors

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IMonitors.IMonitors(api_util)

Bases: Iterable

AsMatrix()

Matrix of the active monitor, containing the hour vector, seconds vector, and all channels (index 2 = channel 1). If you need multiple channels, prefer using this function as it processes the monitor byte-stream once.

Return type
ndarray[Any, dtype[float64]]
Channel(Index)

(read-only) Array of float32 for the specified channel (usage: MyArray = DSSMonitor.Channel(i)). A Save or SaveAll should be executed first. Done automatically by most standard solution modes. Channels start at index 1.

Return type
ndarray[Any, dtype[float64]]
Process()
ProcessAll()
Reset()
ResetAll()
Sample()
SampleAll()
Save()
SaveAll()
Show()
property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property ByteStream: ndarray[Any, dtype[int8]]

(read-only) Byte Array containing monitor stream values. Make sure a “save” is done first (standard solution modes do this automatically)

Return type
ndarray[Any, dtype[int8]]
property Count: int

Number of objects of this type

Return type
int
property Element: str

Full object name of element being monitored.

Return type
str
property FileName: str

(read-only) Name of CSV file associated with active Monitor.

Return type
str
property FileVersion: int

(read-only) Monitor File Version (integer)

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property Header: List[str]

(read-only) Header string; Array of strings containing Channel names

Return type
List[str]
property Mode: int

Set Monitor mode (bitmask integer - see DSS Help)

Return type
int
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NumChannels: int

(read-only) Number of Channels in the active Monitor

Return type
int
property RecordSize: int

(read-only) Size of each record in ByteStream (Integer). Same as NumChannels.

Return type
int
property SampleCount: int

(read-only) Number of Samples in Monitor at Present

Return type
int
property Terminal: int

Terminal number of element being monitored.

Return type
int
property dblFreq: ndarray[Any, dtype[float64]]

(read-only) Array of doubles containing frequency values for harmonics mode solutions; Empty for time mode solutions (use dblHour)

Return type
ndarray[Any, dtype[float64]]
property dblHour: ndarray[Any, dtype[float64]]

(read-only) Array of doubles containing time value in hours for time-sampled monitor values; Empty if frequency-sampled values for harmonics solution (see dblFreq)

Return type
ndarray[Any, dtype[float64]]
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.IPDElements

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IPDElements.IPDElements(api_util)

Bases: Base

AllMaxCurrents(AllNodes=False)

Array of doubles with the maximum current across the conductors, for each PD element.

By default, only the first terminal is used for the maximum current, matching the behavior of the “export capacity” command. Pass AllNodes=True to force the analysis to all terminals.

See also: https://sourceforge.net/p/electricdss/discussion/beginners/thread/da5b93ca/

(API Extension)

Return type
ndarray[Any, dtype[float64]]
AllPctEmerg(AllNodes=False)

Array of doubles with the maximum current across the conductors as a percentage of the Emergency Ampere Rating, for each PD element.

By default, only the first terminal is used for the maximum current, matching the behavior of the “export capacity” command. Pass AllNodes=True to force the analysis to all terminals.

See also: https://sourceforge.net/p/electricdss/discussion/beginners/thread/da5b93ca/

(API Extension)

Return type
ndarray[Any, dtype[float64]]
AllPctNorm(AllNodes=False)

Array of doubles with the maximum current across the conductors as a percentage of the Normal Ampere Rating, for each PD element.

By default, only the first terminal is used for the maximum current, matching the behavior of the “export capacity” command. Pass AllNodes=True to force the analysis to all terminals.

See also: https://sourceforge.net/p/electricdss/discussion/beginners/thread/da5b93ca/

(API Extension)

Return type
ndarray[Any, dtype[float64]]
property AccumulatedL: float

(read-only) accummulated failure rate for this branch on downline

Return type
float
property AllCplxSeqCurrents: ndarray[Any, dtype[float64]]

Complex double array of Sequence Currents for all conductors of all terminals, for each PD elements.

(API Extension)

Return type
ndarray[Any, dtype[float64]]
property AllCurrents: ndarray[Any, dtype[float64]]

Complex array of currents for all conductors, all terminals, for each PD element.

(API Extension)

Return type
ndarray[Any, dtype[float64]]
property AllCurrentsMagAng: ndarray[Any, dtype[float64]]

Complex array (magnitude and angle format) of currents for all conductors, all terminals, for each PD element.

(API Extension)

Return type
ndarray[Any, dtype[float64]]
property AllNames: List[str]

Array of strings consisting of all PD element names.

(API Extension)

Return type
List[str]
property AllNumConductors: ndarray[Any, dtype[int32]]

Integer array listing the number of conductors of all PD elements

(API Extension)

Return type
ndarray[Any, dtype[int32]]
property AllNumPhases: ndarray[Any, dtype[int32]]

Integer array listing the number of phases of all PD elements

(API Extension)

Return type
ndarray[Any, dtype[int32]]
property AllNumTerminals: ndarray[Any, dtype[int32]]

Integer array listing the number of terminals of all PD elements

(API Extension)

Return type
ndarray[Any, dtype[int32]]
property AllPowers: ndarray[Any, dtype[float64]]

Complex array of powers into each conductor of each terminal, for each PD element.

(API Extension)

Return type
ndarray[Any, dtype[float64]]
property AllSeqCurrents: ndarray[Any, dtype[float64]]

Double array of the symmetrical component currents into each 3-phase terminal, for each PD element.

(API Extension)

Return type
ndarray[Any, dtype[float64]]
property AllSeqPowers: ndarray[Any, dtype[float64]]

Double array of sequence powers into each 3-phase teminal, for each PD element

(API Extension)

Return type
ndarray[Any, dtype[float64]]
property Count: int

(read-only) Number of PD elements (including disabled elements)

Return type
int
property FaultRate: float

Get/Set Number of failures per year. For LINE elements: Number of failures per unit length per year.

Return type
float
property First: int

(read-only) Set the first enabled PD element to be the active element. Returns 0 if none found.

Return type
int
property FromTerminal: int

(read-only) Number of the terminal of active PD element that is on the “from” side. This is set after the meter zone is determined.

Return type
int
property IsShunt: bool

(read-only) Boolean indicating of PD element should be treated as a shunt element rather than a series element. Applies to Capacitor and Reactor elements in particular.

Return type
bool
property Lambda: float

(read-only) Failure rate for this branch. Faults per year including length of line.

Return type
float
property Name: str

Get/Set name of active PD Element. Returns null string if active element is not PDElement type.

Return type
str
property Next: int

(read-only) Advance to the next PD element in the circuit. Enabled elements only. Returns 0 when no more elements.

Return type
int
property Numcustomers: int

(read-only) Number of customers, this branch

Return type
int
property ParentPDElement: int

(read-only) Sets the parent PD element to be the active circuit element. Returns 0 if no more elements upline.

Return type
int
property RepairTime: float

Average repair time for this element in hours

Return type
float
property SectionID: int

(read-only) Integer ID of the feeder section that this PDElement branch is part of

Return type
int
property TotalMiles: float

(read-only) Total miles of line from this element to the end of the zone. For recloser siting algorithm.

Return type
float
property Totalcustomers: int

(read-only) Total number of customers from this branch to the end of the zone

Return type
int
property pctPermanent: float

Get/Set percent of faults that are permanent (require repair). Otherwise, fault is assumed to be transient/temporary.

Return type
float

dss.IPVSystems

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IPVSystems.IPVSystems(api_util)

Bases: Iterable

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property Irradiance: float

Get/set the present value of the Irradiance property in kW/m²

Return type
float
property IrradianceNow: float

Returns the current irradiance value for the active PVSystem. Use it to know what’s the current irradiance value for the PV during a simulation.

Return type
float
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property PF: float

Get/set the power factor for the active PVSystem

Return type
float
property Pmpp: float

Gets/sets the rated max power of the PV array for 1.0 kW/sq-m irradiance and a user-selected array temperature of the active PVSystem.

Return type
float
property RegisterNames: List[str]

(read-only) Array of PVSYSTEM energy meter register names

Return type
List[str]
property RegisterValues: ndarray[Any, dtype[float64]]

(read-only) Array of doubles containing values in PVSystem registers.

Return type
ndarray[Any, dtype[float64]]
property Sensor: str

Name of the sensor monitoring this element.

Return type
str
property Tdaily: str

Temperature shape to use for daily simulations. Must be previously defined as a TShape object of 24 hrs, typically. The PVSystem element uses this TShape to determine the Pmpp from the Pmpp vs T curve. Units must agree with the Pmpp vs T curve.

Return type
str
property Tduty: str

Temperature shape to use for duty cycle dispatch simulations such as for solar ramp rate studies. Must be previously defined as a TShape object. Typically would have time intervals of 1-5 seconds. Designate the number of points to solve using the Set Number=xxxx command. If there are fewer points in the actual shape, the shape is assumed to repeat. The PVSystem model uses this TShape to determine the Pmpp from the Pmpp vs T curve. Units must agree with the Pmpp vs T curve.

Return type
str
property Tyearly: str

Temperature shape to use for yearly simulations. Must be previously defined as a TShape object. If this is not specified, the Daily dispatch shape, if any, is repeated during Yearly solution modes. The PVSystem element uses this TShape to determine the Pmpp from the Pmpp vs T curve. Units must agree with the Pmpp vs T curve.

Return type
str
property daily: str

Name of the loadshape for a daily PVSystem profile.

Return type
str
property duty: str

Name of the load shape to use for duty cycle dispatch simulations such as for solar ramp rate studies. Must be previously defined as a Loadshape object. Typically would have time intervals of 1-5 seconds.

Return type
str
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int
property kVArated: float

Get/set Rated kVA of the PVSystem

Return type
float
property kW: float

(read-only) get kW output

Return type
float
property kvar: float

Get/set kvar output value

Return type
float
property yearly: str

Dispatch shape to use for yearly simulations. Must be previously defined as a Loadshape object. If this is not specified, the Daily dispatch shape, if any, is repeated during Yearly solution modes. In the default dispatch mode, the PVSystem element uses this loadshape to trigger State changes.

Return type
str

dss.IParallel

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IParallel.IParallel(api_util)

Bases: Base

Parallel machine interface

CreateActor()
Wait()
property ActiveActor: int

Gets/sets the ID of the Active Actor

Return type
int
property ActiveParallel: int

(read) Sets ON/OFF (1/0) Parallel features of the Engine (write) Delivers if the Parallel features of the Engine are Active

Return type
int
property ActorCPU: int

Gets/sets the CPU of the Active Actor

Return type
int
property ActorProgress: ndarray[Any, dtype[int32]]

(read-only) Gets the progress of all existing actors in pct

Return type
ndarray[Any, dtype[int32]]
property ActorStatus: ndarray[Any, dtype[int32]]

(read-only) Gets the status of each actor

Return type
ndarray[Any, dtype[int32]]
property ConcatenateReports: int

(read) Reads the values of the ConcatenateReports option (1=enabled, 0=disabled) (write) Enable/Disable (1/0) the ConcatenateReports option for extracting monitors data

Return type
int
property NumCPUs: int

(read-only) Delivers the number of CPUs on the current PC

Return type
int
property NumCores: int

(read-only) Delivers the number of Cores of the local PC

Return type
int
property NumOfActors: int

(read-only) Gets the number of Actors created

Return type
int

dss.IParser

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IParser.IParser(api_util)

Bases: Base

Matrix(ExpectedOrder)

(read-only) Use this property to parse a Matrix token in OpenDSS format. Returns square matrix of order specified. Order same as default Fortran order: column by column.

Return type
ndarray[Any, dtype[float64]]
ResetDelimiters()
SymMatrix(ExpectedOrder)

(read-only) Use this property to parse a matrix token specified in lower triangle form. Symmetry is forced.

Return type
ndarray[Any, dtype[float64]]
Vector(ExpectedSize)

(read-only) Returns token as array of doubles. For parsing quoted array syntax.

Return type
ndarray[Any, dtype[float64]]
property AutoIncrement: bool

Default is FALSE. If TRUE parser automatically advances to next token after DblValue, IntValue, or StrValue. Simpler when you don’t need to check for parameter names.

Return type
bool
property BeginQuote: str

Get/Set String containing the the characters for Quoting in OpenDSS scripts. Matching pairs defined in EndQuote. Default is “’([{.

Return type
str
property CmdString: str

String to be parsed. Loading this string resets the Parser to the beginning of the line. Then parse off the tokens in sequence.

Return type
str
property DblValue: float

(read-only) Return next parameter as a double.

Return type
float
property Delimiters: str

String defining hard delimiters used to separate token on the command string. Default is , and =. The = separates token name from token value. These override whitesspace to separate tokens.

Return type
str
property EndQuote: str

String containing characters, in order, that match the beginning quote characters in BeginQuote. Default is “’)]}

Return type
str
property IntValue: int

(read-only) Return next parameter as a long integer.

Return type
int
property NextParam: str

(read-only) Get next token and return tag name (before = sign) if any. See AutoIncrement.

Return type
str
property StrValue: str

(read-only) Return next parameter as a string

Return type
str
property WhiteSpace: str

Get/set the characters used for White space in the command string. Default is blank and Tab.

Return type
str

dss.IReactors

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IReactors.IReactors(api_util)

Bases: Iterable

Reactor objects

(API Extension)

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Bus1: str

Name of first bus. Bus2 property will default to this bus, node 0, unless previously specified. Only Bus1 need be specified for a Yg shunt reactor.

Return type
str
property Bus2: str

Name of 2nd bus. Defaults to all phases connected to first bus, node 0, (Shunt Wye Connection) except when Bus2 is specifically defined. Not necessary to specify for delta (LL) connection

Return type
str
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property IsDelta: bool

Delta connection or wye?

Return type
bool
property LCurve: str

Name of XYCurve object, previously defined, describing per-unit variation of phase inductance, L=X/w, vs. frequency. Applies to reactance specified by X, LmH, Z, or kvar property. L generally decreases somewhat with frequency above the base frequency, approaching a limit at a few kHz.

Return type
str
property LmH: float

Inductance, mH. Alternate way to define the reactance, X, property.

Return type
float
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property Parallel: bool

Indicates whether Rmatrix and Xmatrix are to be considered in parallel.

Return type
bool
property Phases: int

Number of phases.

Return type
int
property R: float

Resistance (in series with reactance), each phase, ohms. This property applies to REACTOR specified by either kvar or X. See also help on Z.

Return type
float
property RCurve: str

Name of XYCurve object, previously defined, describing per-unit variation of phase resistance, R, vs. frequency. Applies to resistance specified by R or Z property. If actual values are not known, R often increases by approximately the square root of frequency.

Return type
str
property Rmatrix: ndarray[Any, dtype[float64]]

Resistance matrix, ohms at base frequency. Order of the matrix is the number of phases. Mutually exclusive to specifying parameters by kvar or X.

Return type
ndarray[Any, dtype[float64]]
property Rp: float

Resistance in parallel with R and X (the entire branch). Assumed infinite if not specified.

Return type
float
property SpecType: int

How the reactor data was provided: 1=kvar, 2=R+jX, 3=R and X matrices, 4=sym components. Depending on this value, only some properties are filled or make sense in the context.

Return type
int
property X: float

Reactance, each phase, ohms at base frequency. See also help on Z and LmH properties.

Return type
float
property Xmatrix: ndarray[Any, dtype[float64]]

Reactance matrix, ohms at base frequency. Order of the matrix is the number of phases. Mutually exclusive to specifying parameters by kvar or X.

Return type
ndarray[Any, dtype[float64]]
property Z: ndarray[Any, dtype[float64]]

Alternative way of defining R and X properties. Enter a 2-element array representing R +jX in ohms.

Return type
ndarray[Any, dtype[float64]]
property Z0: ndarray[Any, dtype[float64]]

Zero-sequence impedance, ohms, as a 2-element array representing a complex number.

Used to define the impedance matrix of the REACTOR if Z1 is also specified.

Note: Z0 defaults to Z1 if it is not specifically defined.

Return type
ndarray[Any, dtype[float64]]
property Z1: ndarray[Any, dtype[float64]]

Positive-sequence impedance, ohms, as a 2-element array representing a complex number.

If defined, Z1, Z2, and Z0 are used to define the impedance matrix of the REACTOR.

Z1 MUST BE DEFINED TO USE THIS OPTION FOR DEFINING THE MATRIX.

Side Effect: Sets Z2 and Z0 to same values unless they were previously defined.

Return type
ndarray[Any, dtype[float64]]
property Z2: ndarray[Any, dtype[float64]]

Negative-sequence impedance, ohms, as a 2-element array representing a complex number.

Used to define the impedance matrix of the REACTOR if Z1 is also specified.

Note: Z2 defaults to Z1 if it is not specifically defined. If Z2 is not equal to Z1, the impedance matrix is asymmetrical.

Return type
ndarray[Any, dtype[float64]]
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int
property kV: float

For 2, 3-phase, kV phase-phase. Otherwise specify actual coil rating.

Return type
float
property kvar: float

Total kvar, all phases. Evenly divided among phases. Only determines X. Specify R separately

Return type
float

dss.IReclosers

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IReclosers.IReclosers(api_util)

Bases: Iterable

Close()
Open()
Reset()

Reset recloser to normal state. If open, lock out the recloser. If closed, resets recloser to first operation.

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property GroundInst: float

Ground (3I0) instantaneous trip setting - curve multipler or actual amps.

Return type
float
property GroundTrip: float

Ground (3I0) trip multiplier or actual amps

Return type
float
property MonitoredObj: str

Full name of object this Recloser to be monitored.

Return type
str
property MonitoredTerm: int

Terminal number of Monitored object for the Recloser

Return type
int
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NormalState: int

Get/set normal state (ActionCodes.Open=1, ActionCodes.Close=2) of the recloser.

Return type
int
property NumFast: int

Number of fast shots

Return type
int
property PhaseInst: float

Phase instantaneous curve multipler or actual amps

Return type
float
property PhaseTrip: float

Phase trip curve multiplier or actual amps

Return type
float
property RecloseIntervals: ndarray[Any, dtype[float64]]

(read-only) Array of Doubles: reclose intervals, s, between shots.

Return type
ndarray[Any, dtype[float64]]
property Shots: int

Number of shots to lockout (fast + delayed)

Return type
int
property State: int

Get/Set present state of recloser. If set to open (ActionCodes.Open=1), open recloser’s controlled element and lock out the recloser. If set to close (ActionCodes.Close=2), close recloser’s controlled element and resets recloser to first operation.

Return type
int
property SwitchedObj: str

Full name of the circuit element that is being switched by the Recloser.

Return type
str
property SwitchedTerm: int

Terminal number of the controlled device being switched by the Recloser

Return type
int
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.IReduceCkt

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2019-2020 Paulo Meira

class dss.IReduceCkt.IReduceCkt(api_util)

Bases: Base

Circuit Reduction interface

Do1phLaterals()
DoBranchRemove()
DoDangling()

Reduce Dangling Algorithm; branches with nothing connected

DoDefault()

Do Default Reduction algorithm

DoLoopBreak()
DoParallelLines()
DoShortLines()

Do ShortLines algorithm: Set Zmag first if you don’t want the default

DoSwitches()
SaveCircuit(CktName)

Save present (reduced) circuit Filename is listed in the Text Result interface

property EditString: str

Edit String for RemoveBranches functions

Return type
str
property EnergyMeter: str

Name of Energymeter to use for reduction

Return type
str
property KeepLoad: bool

Keep load flag (T/F) for Reduction options that remove branches

Return type
bool
property StartPDElement: str

Start element for Remove Branch function

Return type
str
property Zmag: float

Zmag (ohms) for Reduce Option for Z of short lines

Return type
float

dss.IRegControls

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IRegControls.IRegControls(api_util)

Bases: Iterable

Reset()
property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property CTPrimary: float

CT primary ampere rating (secondary is 0.2 amperes)

Return type
float
property Count: int

Number of objects of this type

Return type
int
property Delay: float

Time delay [s] after arming before the first tap change. Control may reset before actually changing taps.

Return type
float
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property ForwardBand: float

Regulation bandwidth in forward direciton, centered on Vreg

Return type
float
property ForwardR: float

LDC R setting in Volts

Return type
float
property ForwardVreg: float

Target voltage in the forward direction, on PT secondary base.

Return type
float
property ForwardX: float

LDC X setting in Volts

Return type
float
property IsInverseTime: bool

Time delay is inversely adjsuted, proportinal to the amount of voltage outside the regulating band.

Return type
bool
property IsReversible: bool

Regulator can use different settings in the reverse direction. Usually not applicable to substation transformers.

Return type
bool
property MaxTapChange: int

Maximum tap change per iteration in STATIC solution mode. 1 is more realistic, 16 is the default for a faster soluiton.

Return type
int
property MonitoredBus: str

Name of a remote regulated bus, in lieu of LDC settings

Return type
str
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property PTratio: float

PT ratio for voltage control settings

Return type
float
property ReverseBand: float

Bandwidth in reverse direction, centered on reverse Vreg.

Return type
float
property ReverseR: float

Reverse LDC R setting in Volts.

Return type
float
property ReverseVreg: float

Target voltage in the revese direction, on PT secondary base.

Return type
float
property ReverseX: float

Reverse LDC X setting in volts.

Return type
float
property TapDelay: float

Time delay [s] for subsequent tap changes in a set. Control may reset before actually changing taps.

Return type
float
property TapNumber: int

Integer number of the tap that the controlled transformer winding is currentliy on.

Return type
int
property TapWinding: int

Tapped winding number

Return type
int
property Transformer: str

Name of the transformer this regulator controls

Return type
str
property VoltageLimit: float

First house voltage limit on PT secondary base. Setting to 0 disables this function.

Return type
float
property Winding: int

Winding number for PT and CT connections

Return type
int
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.IRelays

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IRelays.IRelays(api_util)

Bases: Iterable

Close()

Close the switched object controlled by the relay. Resets relay to first operation.

Open()

Open relay’s controlled element and lock out the relay.

Reset()

Reset relay to normal state. If open, lock out the relay. If closed, resets relay to first operation.

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property MonitoredObj: str

Full name of object this Relay is monitoring.

Return type
str
property MonitoredTerm: int

Number of terminal of monitored element that this Relay is monitoring.

Return type
int
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NormalState: int

Normal state of relay.

Return type
int
property State: int

Get/Set present state of relay. If set to open, open relay’s controlled element and lock out the relay. If set to close, close relay’s controlled element and resets relay to first operation.

Return type
int
property SwitchedObj: str

Full name of element that will be switched when relay trips.

Return type
str
property SwitchedTerm: int

Terminal number of the switched object that will be opened when the relay trips.

Return type
int
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.ISensors

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ISensors.ISensors(api_util)

Bases: Iterable

Reset()
ResetAll()
property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property AllocationFactor

Array of doubles for the allocation factors for each phase.

property Count: int

Number of objects of this type

Return type
int
property Currents: ndarray[Any, dtype[float64]]

Array of doubles for the line current measurements; don’t use with kWS and kVARS.

Return type
ndarray[Any, dtype[float64]]
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property IsDelta: bool

True if measured voltages are line-line. Currents are always line currents.

Return type
bool
property MeteredElement: str

Full Name of the measured element

Return type
str
property MeteredTerminal: int

Number of the measured terminal in the measured element.

Return type
int
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property PctError: float

Assumed percent error in the Sensor measurement. Default is 1.

Return type
float
property ReverseDelta: bool

True if voltage measurements are 1-3, 3-2, 2-1.

Return type
bool
property Weight: float

Weighting factor for this Sensor measurement with respect to other Sensors. Default is 1.

Return type
float
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int
property kVARS: ndarray[Any, dtype[float64]]

Array of doubles for Q measurements. Overwrites Currents with a new estimate using kWS.

Return type
ndarray[Any, dtype[float64]]
property kVS: ndarray[Any, dtype[float64]]

Array of doubles for the LL or LN (depending on Delta connection) voltage measurements.

Return type
ndarray[Any, dtype[float64]]
property kVbase: float

Voltage base for the sensor measurements. LL for 2 and 3-phase sensors, LN for 1-phase sensors.

Return type
float
property kWS: ndarray[Any, dtype[float64]]

Array of doubles for P measurements. Overwrites Currents with a new estimate using kVARS.

Return type
ndarray[Any, dtype[float64]]

dss.ISettings

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ISettings.ISettings(api_util)

Bases: Base

property AllocationFactors

(write-only) Sets all load allocation factors for all loads defined by XFKVA property to this value.

property AllowDuplicates: bool

{True | False*} Designates whether to allow duplicate names of objects

NOTE: for DSS Extensions, we are considering removing this option in a future release since it has performance impacts even when not used.

Return type
bool
property AutoBusList: str

List of Buses or (File=xxxx) syntax for the AutoAdd solution mode.

Return type
str
property CktModel: int

{dssMultiphase (0) * | dssPositiveSeq (1) } Indicate if the circuit model is positive sequence.

Return type
int
property ControlTrace: bool

{True | False*} Denotes whether to trace the control actions to a file.

Return type
bool
property EmergVmaxpu: float

Per Unit maximum voltage for Emergency conditions.

Return type
float
property EmergVminpu: float

Per Unit minimum voltage for Emergency conditions.

Return type
float
property IterateDisabled: int

Controls whether First/Next iteration includes or skips disabled circuit elements. The default behavior from OpenDSS is to skip those. The user can still activate the element by name or index.

The default value for IterateDisabled is 0, keeping the original behavior. Set it to 1 (or True) to include disabled elements. Other numeric values are reserved for other potential behaviors.

(API Extension)

Return type
int
property LoadsTerminalCheck: bool

Controls whether the terminals are checked when updating the currents in Load component. Defaults to True. If the loads are guaranteed to have their terminals closed throughout the simulation, this can be set to False to save some time.

(API Extension)

Return type
bool
property LossRegs: ndarray[Any, dtype[int32]]

Integer array defining which energy meter registers to use for computing losses

Return type
ndarray[Any, dtype[int32]]
property LossWeight: float

Weighting factor applied to Loss register values.

Return type
float
property NormVmaxpu: float

Per Unit maximum voltage for Normal conditions.

Return type
float
property NormVminpu: float

Per Unit minimum voltage for Normal conditions.

Return type
float
property PriceCurve: str

Name of LoadShape object that serves as the source of price signal data for yearly simulations, etc.

Return type
str
property PriceSignal: float

Price Signal for the Circuit

Return type
float
property Trapezoidal: bool

Gets value of trapezoidal integration flag in energy meters. Defaults to False.

Return type
bool
property UEregs: ndarray[Any, dtype[int32]]

Array of Integers defining energy meter registers to use for computing UE

Return type
ndarray[Any, dtype[int32]]
property UEweight: float

Weighting factor applied to UE register values.

Return type
float
property VoltageBases: ndarray[Any, dtype[float64]]

Array of doubles defining the legal voltage bases in kV L-L

Return type
ndarray[Any, dtype[float64]]
property ZoneLock: bool

{True | False*} Locks Zones on energy meters to prevent rebuilding if a circuit change occurs.

Return type
bool

dss.ISolution

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ISolution.ISolution(api_util)

Bases: Base

BuildYMatrix(BuildOption, AllocateVI)
CheckControls()
CheckFaultStatus()
Cleanup()
DoControlActions()
FinishTimeStep()
InitSnap()
SampleControlDevices()
Sample_DoControlActions()
Solve()
SolveAll()
SolveDirect()
SolveNoControl()
SolvePflow()
SolvePlusControl()
SolveSnap()
property AddType: int

Type of device to add in AutoAdd Mode: {dssGen (Default) | dssCap}

Return type
int
property Algorithm: int

Base Solution algorithm: {dssNormalSolve | dssNewtonSolve}

Return type
int
property BusLevels: ndarray[Any, dtype[int32]]
Return type
ndarray[Any, dtype[int32]]
property Capkvar: float

Capacitor kvar for adding capacitors in AutoAdd mode

Return type
float
property ControlActionsDone: bool

Flag indicating the control actions are done.

Return type
bool
property ControlIterations: int

Value of the control iteration counter

Return type
int
property ControlMode: int

{dssStatic* | dssEvent | dssTime} Modes for control devices

Return type
int
property Converged: bool

Flag to indicate whether the circuit solution converged

Return type
bool
property DefaultDaily: str

Default daily load shape (defaults to “Default”)

Return type
str
property DefaultYearly: str

Default Yearly load shape (defaults to “Default”)

Return type
str
property EventLog: List[str]

(read-only) Array of strings containing the Event Log

Return type
List[str]
property Frequency: float

Set the Frequency for next solution

Return type
float
property GenMult: float

Default Multiplier applied to generators (like LoadMult)

Return type
float
property GenPF: float

PF for generators in AutoAdd mode

Return type
float
property GenkW: float

Generator kW for AutoAdd mode

Return type
float
property Hour: int

Set Hour for time series solutions.

Return type
int
property IncMatrix: ndarray[Any, dtype[int32]]
Return type
ndarray[Any, dtype[int32]]
property IncMatrixCols: List[str]
Return type
List[str]
property IncMatrixRows: List[str]
Return type
List[str]
property IntervalHrs: float

Get/Set the Solution.IntervalHrs variable used for devices that integrate / custom solution algorithms

Return type
float
property Iterations: int

(read-only) Number of iterations taken for last solution. (Same as TotalIterations)

Return type
int
property LDCurve: str

Load-Duration Curve name for LD modes

Return type
str
property Laplacian: ndarray[Any, dtype[int32]]
Return type
ndarray[Any, dtype[int32]]
property LoadModel: int

Load Model: {dssPowerFlow (default) | dssAdmittance}

Return type
int
property LoadMult: float

Default load multiplier applied to all non-fixed loads

Return type
float
property MaxControlIterations: int

Maximum allowable control iterations

Return type
int
property MaxIterations: int

Max allowable iterations.

Return type
int
property MinIterations: int

Minimum number of iterations required for a power flow solution.

Return type
int
property Mode: int

Set present solution mode (by a text code - see DSS Help)

Return type
int
property ModeID: str

(read-only) ID (text) of the present solution mode

Return type
str
property MostIterationsDone: int

(read-only) Max number of iterations required to converge at any control iteration of the most recent solution.

Return type
int
property Number: int

Number of solutions to perform for Monte Carlo and time series simulations

Return type
int
property Process_Time: float

(read-only) Gets the time required to perform the latest solution (Read only)

Return type
float
property Random: int

Randomization mode for random variables “Gaussian” or “Uniform”

Return type
int
property Seconds: float

Seconds from top of the hour.

Return type
float
property StepSize: float

Time step size in sec

Return type
float
property StepsizeHr: float

(write-only) Set Stepsize in Hr

Return type
float
property StepsizeMin: float

(write-only) Set Stepsize in minutes

Return type
float
property SystemYChanged: bool

(read-only) Flag that indicates if elements of the System Y have been changed by recent activity.

Return type
bool
property Time_of_Step: float

(read-only) Get the solution process time + sample time for time step

Return type
float
property Tolerance: float

Solution convergence tolerance.

Return type
float
property Total_Time: float

Gets/sets the accumulated time of the simulation

Return type
float
property Totaliterations: int

(read-only) Total iterations including control iterations for most recent solution.

Return type
int
property Year: int

Set year for planning studies

Return type
int
property dblHour: float

Hour as a double, including fractional part

Return type
float
property pctGrowth: float

Percent default annual load growth rate

Return type
float

dss.IStorages

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2022 Paulo Meira Copyright (c) 2022 DSS Extensions contributors

class dss.IStorages.IStorages(api_util)

Bases: Iterable

Storage objects

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property RegisterNames: List[str]

Array of Names of all Storage energy meter registers

Return type
List[str]
property RegisterValues: ndarray[Any, dtype[float64]]

Array of values in Storage registers.

Return type
ndarray[Any, dtype[float64]]
property State: int

Get/set state: 0=Idling; 1=Discharging; -1=Charging;

Related enumeration: StorageStates

Return type
int
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int
property puSOC: float

Per unit state of charge

Return type
float

dss.ISwtControls

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ISwtControls.ISwtControls(api_util)

Bases: Iterable

Reset()
property Action: int

Open or Close the switch. No effect if switch is locked. However, Reset removes any lock and then closes the switch (shelf state).

Return type
int
property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Count: int

Number of objects of this type

Return type
int
property Delay: float

Time delay [s] betwen arming and opening or closing the switch. Control may reset before actually operating the switch.

Return type
float
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property IsLocked: bool

The lock prevents both manual and automatic switch operation.

Return type
bool
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NormalState: int

Get/set Normal state of switch (see actioncodes) dssActionOpen or dssActionClose

Return type
int
property State: int

Set it to force the switch to a specified state, otherwise read its present state.

Return type
int
property SwitchedObj: str

Full name of the switched element.

Return type
str
property SwitchedTerm: int

Terminal number where the switch is located on the SwitchedObj

Return type
int
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.ITSData

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ITSData.ITSData(api_util)

Bases: Iterable

TSData objects

(API Extension)

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Count: int

Number of objects of this type

Return type
int
property DiaCable: float
Return type
float
property DiaIns: float
Return type
float
property DiaShield: float
Return type
float
property Diameter: float
Return type
float
property EmergAmps: float

Emergency ampere rating

Return type
float
property EpsR: float
Return type
float
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property GMRUnits: int
Return type
int
property GMRac: float
Return type
float
property InsLayer: float
Return type
float
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NormAmps: float

Normal Ampere rating

Return type
float
property Rac: float
Return type
float
property Radius: float
Return type
float
property RadiusUnits: int
Return type
int
property Rdc: float
Return type
float
property ResistanceUnits: int
Return type
int
property TapeLap: float
Return type
float
property TapeLayer: float
Return type
float
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.ITopology

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ITopology.ITopology(api_util)

Bases: Base

property ActiveBranch: int

(read-only) Returns index of the active branch

Return type
int
property ActiveLevel: int

(read-only) Topological depth of the active branch

Return type
int
property AllIsolatedBranches: List[str]

(read-only) Array of all isolated branch names.

Return type
List[str]
property AllIsolatedLoads: List[str]

(read-only) Array of all isolated load names.

Return type
List[str]
property AllLoopedPairs: List[str]

(read-only) Array of all looped element names, by pairs.

Return type
List[str]
property BackwardBranch: int

(read-only) MOve back toward the source, return index of new active branch, or 0 if no more.

Return type
int
property BranchName: str

Name of the active branch.

Return type
str
property BusName: str

Set the active branch to one containing this bus, return index or 0 if not found

Return type
str
property First: int

(read-only) Sets the first branch active, returns 0 if none.

Return type
int
property FirstLoad: int

(read-only) First load at the active branch, return index or 0 if none.

Return type
int
property ForwardBranch: int

(read-only) Move forward in the tree, return index of new active branch or 0 if no more

Return type
int
property LoopedBranch: int

(read-only) Move to looped branch, return index or 0 if none.

Return type
int
property Next: int

(read-only) Sets the next branch active, returns 0 if no more.

Return type
int
property NextLoad: int

(read-only) Next load at the active branch, return index or 0 if no more.

Return type
int
property NumIsolatedBranches: int

(read-only) Number of isolated branches (PD elements and capacitors).

Return type
int
property NumIsolatedLoads: int

(read-only) Number of isolated loads

Return type
int
property NumLoops: int

(read-only) Number of loops

Return type
int
property ParallelBranch: int

(read-only) Move to directly parallel branch, return index or 0 if none.

Return type
int

dss.ITransformers

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.ITransformers.ITransformers(api_util)

Bases: Iterable

property AllLossesByType: ndarray[Any, dtype[float64]]

Complex array with the losses by type (total losses, load losses, no-load losses), in VA, concatenated for ALL transformers

Return type
ndarray[Any, dtype[float64]]
property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property CoreType: int

Transformer Core Type: 0=shell;1 = 1-phase; 3= 3-leg; 5= 5-leg

Return type
int
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property IsDelta: bool

Active Winding delta or wye connection?

Return type
bool
property LossesByType: ndarray[Any, dtype[float64]]

Complex array with the losses by type (total losses, load losses, no-load losses), in VA

Return type
ndarray[Any, dtype[float64]]
property MaxTap: float

Active Winding maximum tap in per-unit.

Return type
float
property MinTap: float

Active Winding minimum tap in per-unit.

Return type
float
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NumTaps: int

Active Winding number of tap steps betwein MinTap and MaxTap.

Return type
int
property NumWindings: int

Number of windings on this transformer. Allocates memory; set or change this property first.

Return type
int
property R: float

Active Winding resistance in %

Return type
float
property RdcOhms: float

dc Resistance of active winding in ohms for GIC analysis

Return type
float
property Rneut: float

Active Winding neutral resistance [ohms] for wye connections. Set less than zero for ungrounded wye.

Return type
float
property Tap: float

Active Winding tap in per-unit.

Return type
float
property Wdg: int

Active Winding Number from 1..NumWindings. Update this before reading or setting a sequence of winding properties (R, Tap, kV, kVA, etc.)

Return type
int
property WdgCurrents: ndarray[Any, dtype[float64]]

(read-only) All Winding currents (ph1, wdg1, wdg2,… ph2, wdg1, wdg2 …)

Return type
ndarray[Any, dtype[float64]]
property WdgVoltages: ndarray[Any, dtype[float64]]

(read-only) Complex array of voltages for active winding

Return type
ndarray[Any, dtype[float64]]
property XfmrCode: str

Name of an XfrmCode that supplies electircal parameters for this Transformer.

Return type
str
property Xhl: float

Percent reactance between windings 1 and 2, on winding 1 kVA base. Use for 2-winding or 3-winding transformers.

Return type
float
property Xht: float

Percent reactance between windigns 1 and 3, on winding 1 kVA base. Use for 3-winding transformers only.

Return type
float
property Xlt: float

Percent reactance between windings 2 and 3, on winding 1 kVA base. Use for 3-winding transformers only.

Return type
float
property Xneut: float

Active Winding neutral reactance [ohms] for wye connections.

Return type
float
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int
property kV: float

Active Winding kV rating. Phase-phase for 2 or 3 phases, actual winding kV for 1 phase transformer.

Return type
float
property kVA: float

Active Winding kVA rating. On winding 1, this also determines normal and emergency current ratings for all windings.

Return type
float
property kva: float

Active Winding kVA rating. On winding 1, this also determines normal and emergency current ratings for all windings.

Return type
float
property strWdgCurrents: str

(read-only) All winding currents in CSV string form like the WdgCurrents property

Return type
str

dss.IVsources

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IVsources.IVsources(api_util)

Bases: Iterable

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property AngleDeg: float

Phase angle of first phase in degrees

Return type
float
property BasekV: float

Source voltage in kV

Return type
float
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property Frequency: float

Source frequency in Hz

Return type
float
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property Phases: int

Number of phases

Return type
int
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int
property pu: float

Per-unit value of source voltage

Return type
float

dss.IWireData

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IWireData.IWireData(api_util)

Bases: Iterable

WireData objects

(API Extension)

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property CapRadius: float

Equivalent conductor radius for capacitance calcs. Specify this for bundled conductors. Defaults to same value as radius.

Return type
float
property Count: int

Number of objects of this type

Return type
int
property Diameter: float
Return type
float
property EmergAmps: float

Emergency ampere rating

Return type
float
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property GMRUnits: int
Return type
int
property GMRac: float
Return type
float
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property NormAmps: float

Normal Ampere rating

Return type
float
property Rac: float
Return type
float
property Radius: float
Return type
float
property RadiusUnits: int
Return type
int
property Rdc: float
Return type
float
property ResistanceUnits: int
Return type
int
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int

dss.IXYCurves

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IXYCurves.IXYCurves(api_util)

Bases: Iterable

property AllNames: List[str]

Array of all names of this object type

Return type
List[str]
property Count: int

Number of objects of this type

Return type
int
property First: int

Sets the first object of this type active. Returns 0 if none.

Return type
int
property Name: str

Gets the current name or sets the active object of this type by name

Return type
str
property Next: int

(read-only) Sets next object of this type active. Returns 0 if no more.

Return type
int
property Npts: int

Get/Set Number of points in X-Y curve

Return type
int
property Xarray: ndarray[Any, dtype[float64]]

Get/set X values as a Array of doubles. Set Npts to max number expected if setting

Return type
ndarray[Any, dtype[float64]]
property Xscale: float

Factor to scale X values from original curve

Return type
float
property Xshift: float

Amount to shift X value from original curve

Return type
float
property Yarray: ndarray[Any, dtype[float64]]

Get/Set Y values in curve; Set Npts to max number expected if setting

Return type
ndarray[Any, dtype[float64]]
property Yscale: float

Factor to scale Y values from original curve

Return type
float
property Yshift: float

Amount to shift Y value from original curve

Return type
float
property idx: int

Gets the current index or sets the active object of this type by index

While the official API included this for some classes, this is an API Extension for:

  • Capacitors
  • CapControls
  • ISources
  • LineCodes
  • Lines
  • LoadShapes
  • Meters
  • Monitors
  • RegControls
  • Sensors
  • SwtControls
  • Transformers
  • Vsources
  • XYCurves

(API Extension)

Return type
int
property x: float

Set X value or get interpolated value after setting Y

Return type
float
property y: float

Set Y value or get interpolated Y value after setting X

Return type
float

dss.IYMatrix

A compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.

Copyright (c) 2016-2022 Paulo Meira

Copyright (c) 2018-2022 DSS Extensions contributors

class dss.IYMatrix.IYMatrix(api_util)

Bases: Base

AddInAuxCurrents(SType)
BuildYMatrixD(BuildOps, AllocateVI)
CheckConvergence()
Return type
bool
GetCompressedYMatrix(factor=True)

Return as (data, indices, indptr) that can fed into scipy.sparse.csc_matrix

Return type
Tuple[ndarray[Any, dtype[complex128]], ndarray[Any, dtype[int32]], ndarray[Any, dtype[int32]]]
GetIPointer()

Get access to the internal Current pointer

GetPCInjCurr()
GetSourceInjCurrents()
GetVPointer()

Get access to the internal Voltage pointer

SetGeneratordQdV()
SolveSystem(NodeV=None)
Return type
int
ZeroInjCurr()
getI()

Get the data from the internal Current pointer

Return type
List[float]
getV()

Get the data from the internal Voltage pointer

Return type
List[float]
getYSparse(factor=True)

Return as (data, indices, indptr) that can fed into scipy.sparse.csc_matrix

Return type
Tuple[ndarray[Any, dtype[complex128]], ndarray[Any, dtype[int32]], ndarray[Any, dtype[int32]]]
property Iteration: int
Return type
int
property LoadsNeedUpdating: bool
Return type
bool
property SolutionInitialized: bool
Return type
bool
property SolverOptions: int

Sparse solver options. See the enumeration SparseSolverOptions

Return type
int
property SystemYChanged: bool
Return type
bool
property UseAuxCurrents: bool
Return type
bool

Module contents

A compatibility layer for DSS_CAPI that mimics the official OpenDSS COM interface.

dss is the main package for DSS Python. DSS Python is a compatibility layer for the DSS C-API library that mimics the official OpenDSS COM interface, with many extensions and a few limitations.

This module used to provide instances for the OpenDSS Version 7 implementation. As of 2022, most of the parallel-machine functions of EPRI’s OpenDSS have been reimplemented using a different approach. Therefore the PM functions are available in the instances of this module too. Besides the parallel-machine mechanisms, DSS Python also exposes the DSSContext mechanism provided by DSS Extensions. DSSContexts allow using multiple OpenDSS instances directly, including user-managed multi-threading, without using the internal OpenDSS actors.

dss.DSS(single=None, block=None): IDSS = <dss.IDSS.IDSS object>

Same as DSS_GR

dss.DSS_GR(single=None, block=None): IDSS = <dss.IDSS.IDSS object>

GR (Global Result) interface using the new DSSContext API

dss.DSS_IR: IDSS = <dss.dss_capi_ir.IDSS.IDSS object>

IR (Immediate Result) interface using the new DSSContext API – this WILL be removed in the future

dss.api_util: CffiApiUtil = <dss._cffi_api_util.CffiApiUtil object>

API utility functions and low-level access to the classic API

dss.dss(single=None, block=None): IDSS = <dss.IDSS.IDSS object>

Same as DSS_GR

dss.prime_api_util = <dss._cffi_api_util.CffiApiUtil object>

API utility functions and low-level access for DSSContext API