altdss.LineCode
#
Module Contents#
Classes#
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2) |
|
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2) |
API#
- class altdss.LineCode.ILineCode(iobj)#
Bases:
altdss.DSSObj.IDSSObj
,altdss.LineCode.LineCodeBatch
- B0: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Alternate way to specify C0. MicroS per unit length
DSS property name:
B0
, DSS property index: 24.
- B1: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Alternate way to specify C1. MicroS per unit length
DSS property name:
B1
, DSS property index: 23.
- BaseFreq: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Frequency at which impedances are specified.
DSS property name:
BaseFreq
, DSS property index: 12.
- C0: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Zero-sequence capacitance, nf per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also B0.
DSS property name:
C0
, DSS property index: 7.
- C1: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Positive-sequence capacitance, nf per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also Cmatrix and B1.
DSS property name:
C1
, DSS property index: 6.
- CMatrix: List[altdss.types.Float64Array]#
‘property(…)’
Nodal Capacitance matrix, lower triangle, nf per unit length.Order of the matrix is the number of phases. May be used to specify the shunt capacitance of any line configuration. For balanced line models, you may use the standard symmetrical component data definition instead.
DSS property name:
CMatrix
, DSS property index: 11.
- EmergAmps: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Emergency ampere limit on line (usually one-hour rating).
DSS property name:
EmergAmps
, DSS property index: 14.
- FaultRate: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Number of faults per unit length per year.
DSS property name:
FaultRate
, DSS property index: 15.
- FullName() List[str] #
Returns the full name (including object type) for all objects in this batch
- Kron(value: Union[bool, List[bool]] = True, flags: altdss.enums.SetterFlags = 0)#
Kron = Y/N. Default=N. Perform Kron reduction on the impedance matrix after it is formed, reducing order by 1. Eliminates the conductor designated by the “Neutral=” property. Do this after the R, X, and C matrices are defined. Ignored for symmetrical components. May be issued more than once to eliminate more than one conductor by resetting the Neutral property after the previous invoking of this property. Generally, you do not want to do a Kron reduction on the matrix if you intend to solve at a frequency other than the base frequency and exploit the Rg and Xg values.
DSS property name:
Kron
, DSS property index: 18.
- Like(value: AnyStr, flags: altdss.enums.SetterFlags = 0)#
Make like another object, e.g.:
New Capacitor.C2 like=c1 …
DSS property name:
Like
, DSS property index: 28.
- LineType: altdss.ArrayProxy.BatchInt32ArrayProxy#
‘property(…)’
Code designating the type of line. One of: OH, UG, UG_TS, UG_CN, SWT_LDBRK, SWT_FUSE, SWT_SECT, SWT_REC, SWT_DISC, SWT_BRK, SWT_ELBOW, BUSBAR
OpenDSS currently does not use this internally. For whatever purpose the user defines. Default is OH.
DSS property name:
LineType
, DSS property index: 27.
- LineType_str: List[str]#
‘property(…)’
Code designating the type of line. One of: OH, UG, UG_TS, UG_CN, SWT_LDBRK, SWT_FUSE, SWT_SECT, SWT_REC, SWT_DISC, SWT_BRK, SWT_ELBOW, BUSBAR
OpenDSS currently does not use this internally. For whatever purpose the user defines. Default is OH.
DSS property name:
LineType
, DSS property index: 27.
- NPhases: altdss.ArrayProxy.BatchInt32ArrayProxy#
‘property(…)’
Number of phases in the line this line code data represents. Setting this property reinitializes the line code. Impedance matrix is reset for default symmetrical component.
DSS property name:
NPhases
, DSS property index: 1.
- property Name: List[str]#
- Neutral: altdss.ArrayProxy.BatchInt32ArrayProxy#
‘property(…)’
Designates which conductor is the “neutral” conductor that will be eliminated by Kron reduction. Default is the last conductor (nphases value). After Kron reduction is set to 0. Subsequent issuing of Kron=Yes will not do anything until this property is set to a legal value. Applies only to LineCodes defined by R, X, and C matrix.
DSS property name:
Neutral
, DSS property index: 22.
- NormAmps: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Normal ampere limit on line. This is the so-called Planning Limit. It may also be the value above which load will have to be dropped in a contingency. Usually about 75% - 80% of the emergency (one-hour) rating.
DSS property name:
NormAmps
, DSS property index: 13.
- PctPerm: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Percentage of the faults that become permanent.
DSS property name:
PctPerm
, DSS property index: 16.
- R0: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Zero-sequence Resistance, ohms per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition.
DSS property name:
R0
, DSS property index: 4.
- R1: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Positive-sequence Resistance, ohms per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also Rmatrix.
DSS property name:
R1
, DSS property index: 2.
- RMatrix: List[altdss.types.Float64Array]#
‘property(…)’
Resistance matrix, lower triangle, ohms per unit length. Order of the matrix is the number of phases. May be used to specify the impedance of any line configuration. For balanced line models, you may use the standard symmetrical component data definition instead.
DSS property name:
RMatrix
, DSS property index: 9.
- Ratings: List[altdss.types.Float64Array]#
‘property(…)’
An array of ratings to be used when the seasonal ratings flag is True. It can be used to insert multiple ratings to change during a QSTS simulation to evaluate different ratings in lines.
DSS property name:
Ratings
, DSS property index: 26.
- Repair: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Hours to repair.
DSS property name:
Repair
, DSS property index: 17.
- Rg: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Carson earth return resistance per unit length used to compute impedance values at base frequency. For making better frequency adjustments. Default is 0.01805 = 60 Hz value in ohms per kft (matches default line impedances). This value is required for harmonic solutions if you wish to adjust the earth return impedances for frequency. If not, set both Rg and Xg = 0.
DSS property name:
Rg
, DSS property index: 19.
- Seasons: altdss.ArrayProxy.BatchInt32ArrayProxy#
‘property(…)’
Defines the number of ratings to be defined for the wire, to be used only when defining seasonal ratings using the “Ratings” property.
DSS property name:
Seasons
, DSS property index: 25.
- Units: altdss.ArrayProxy.BatchInt32ArrayProxy#
‘property(…)’
One of (ohms per …) {none|mi|km|kft|m|me|ft|in|cm}. Default is none; assumes units agree with length units given in Line object
DSS property name:
Units
, DSS property index: 8.
- Units_str: List[str]#
‘property(…)’
One of (ohms per …) {none|mi|km|kft|m|me|ft|in|cm}. Default is none; assumes units agree with length units given in Line object
DSS property name:
Units
, DSS property index: 8.
- X0: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Zero-sequence Reactance, ohms per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition.
DSS property name:
X0
, DSS property index: 5.
- X1: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Positive-sequence Reactance, ohms per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also Xmatrix
DSS property name:
X1
, DSS property index: 3.
- XMatrix: List[altdss.types.Float64Array]#
‘property(…)’
Reactance matrix, lower triangle, ohms per unit length. Order of the matrix is the number of phases. May be used to specify the impedance of any line configuration. For balanced line models, you may use the standard symmetrical component data definition instead.
DSS property name:
XMatrix
, DSS property index: 10.
- Xg: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Carson earth return reactance per unit length used to compute impedance values at base frequency. For making better frequency adjustments. Default value is 0.155081 = 60 Hz value in ohms per kft (matches default line impedances). This value is required for harmonic solutions if you wish to adjust the earth return impedances for frequency. If not, set both Rg and Xg = 0.
DSS property name:
Xg
, DSS property index: 20.
- __call__()#
- __contains__(name: str) bool #
- __getitem__(name_or_idx)#
- __init__(iobj)#
- __iter__()#
- __len__() int #
- batch(**kwargs)#
Creates a new batch handler of (existing) objects
- batch_new(names: Optional[List[AnyStr]] = None, *, df=None, count: Optional[int] = None, begin_edit: Optional[bool] = None, **kwargs: typing_extensions.Unpack[altdss.LineCode.LineCodeBatchProperties]) altdss.LineCode.LineCodeBatch #
Creates a new batch of LineCode objects
Either
names
,count
ordf
is required.- Parameters:
begin_edit – The argument
begin_edit
indicates if the user want to leave the elements in the edit state, and requires a call toend_edit()
or equivalent. The defaultbegin_edit
is set toNone
. WithNone
, the behavior will be adjusted according the default of how the batch is created.**kwargs – Pass keyword arguments equivalent to the DSS properties of the object.
names – When using a list of names, each new object will match the names from this list.
begin_edit
defaults toTrue
if no arguments for properties were passed,False
otherwise.count – When using
count
, new objects will be created with based on a random prefix, with an increasing integer up tocount
.begin_edit
defaults toTrue
if no arguments for properties were passed,False
otherwise.df – Currently EXPERIMENTAL AND LIMITED, tries to get the columns from a dataframe to populate the names and the DSS properties.
begin_edit
defaults toFalse
.
- Returns:
Returns the new batch of DSS objects, wrapped in Python.
Note that, to make it easier for new users where the edit context might not be too relevant, AltDSS automatically opens/closes edit contexts for single properties if the object is not in the edit state already.
- begin_edit() None #
Marks for editing all DSS objects in the batch
In the editing mode, some final side-effects of changing properties are postponed until
end_edit
is called. This side-effects can be somewhat costly, like updating the model parameters or internal matrices.If you don’t have any performance constraint, you may edit each property individually without worrying about using
begin_edit
andend_edit
. For convenience, those are emitted automatically when editing single properties outside an edit block.
- edit(**kwargs: typing_extensions.Unpack[altdss.LineCode.LineCodeBatchProperties]) altdss.LineCode.LineCodeBatch #
Edit this LineCode batch.
This method will try to open a new edit context (if not already open), edit the properties, and finalize the edit context for objects in the batch. It can be seen as a shortcut to manually setting each property, or a Pythonic analogous (but extended) to the DSS
BatchEdit
command.- Parameters:
**kwargs – Pass keyword arguments equivalent to the DSS properties of the objects.
- Returns:
Returns itself to allow call chaining.
- end_edit(num_changes: int = 1) None #
Leaves the editing states of all DSS objects in the batch
num_changes
is required for a few classes to correctly match the official OpenDSS behavior and must be the number of properties modified in the current editing block. As of DSS C-API v0.13, this is only required for the Monitor class, when theAction
property is used with theProcess
value.
- find(name_or_idx: Union[AnyStr, int]) altdss.DSSObj.DSSObj #
Returns an object from the collection by name or index; the index must be zero-based.
- new(name: AnyStr, *, begin_edit: Optional[bool] = None, activate=False, **kwargs: typing_extensions.Unpack[altdss.LineCode.LineCodeProperties]) altdss.LineCode.LineCode #
Creates a new LineCode.
- Parameters:
name – The object’s name is a required positional argument.
activate – Activation (setting
activate
to true) is useful for integration with the classic API, and some internal OpenDSS commands. If you interact with this object only via the Alt API, no need to activate it (due to performance costs).begin_edit – This controls how the edit context is left after the object creation:
True
: The object will be left in the edit state, requiring anend_edit
call or equivalent.False
: No edit context is started.None
: If no properties are passed as keyword arguments, the object will be left in the edit state (assumes the user will fill the properties from Python attributes). Otherwise, the internal edit context will be finalized.
- Parameters:
**kwargs – Pass keyword arguments equivalent to the DSS properties of the object.
- Returns:
Returns the new DSS object, wrapped in Python.
Note that, to make it easier for new users where the edit context might not be too relevant, AltDSS automatically opens/closes edit contexts for single properties if the object is not in the edit state already.
- rho: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Default=100 meter ohms. Earth resitivity used to compute earth correction factor.
DSS property name:
rho
, DSS property index: 21.
- to_json(options: Union[int, dss.enums.DSSJSONFlags] = 0)#
Returns the data (as a list) of the elements in a batch as a JSON-encoded string.
The
options
parameter contains bit-flags to toggle specific features. SeeObj_ToJSON
(C-API) for more, orDSSObj.to_json
in Python.Additionally, the
ExcludeDisabled
flag can be used to excluded disabled elements from the output.
- to_list()#
- class altdss.LineCode.LineCode(api_util, ptr)#
Bases:
altdss.DSSObj.DSSObj
- B0: float#
‘property(…)’
Alternate way to specify C0. MicroS per unit length
DSS property name:
B0
, DSS property index: 24.
- B1: float#
‘property(…)’
Alternate way to specify C1. MicroS per unit length
DSS property name:
B1
, DSS property index: 23.
- BaseFreq: float#
‘property(…)’
Frequency at which impedances are specified.
DSS property name:
BaseFreq
, DSS property index: 12.
- C0: float#
‘property(…)’
Zero-sequence capacitance, nf per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also B0.
DSS property name:
C0
, DSS property index: 7.
- C1: float#
‘property(…)’
Positive-sequence capacitance, nf per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also Cmatrix and B1.
DSS property name:
C1
, DSS property index: 6.
- CMatrix: altdss.types.Float64Array#
‘property(…)’
Nodal Capacitance matrix, lower triangle, nf per unit length.Order of the matrix is the number of phases. May be used to specify the shunt capacitance of any line configuration. For balanced line models, you may use the standard symmetrical component data definition instead.
DSS property name:
CMatrix
, DSS property index: 11.
- EmergAmps: float#
‘property(…)’
Emergency ampere limit on line (usually one-hour rating).
DSS property name:
EmergAmps
, DSS property index: 14.
- FaultRate: float#
‘property(…)’
Number of faults per unit length per year.
DSS property name:
FaultRate
, DSS property index: 15.
- FullName() str #
- Kron(value: bool = True, flags: altdss.enums.SetterFlags = 0)#
Kron = Y/N. Default=N. Perform Kron reduction on the impedance matrix after it is formed, reducing order by 1. Eliminates the conductor designated by the “Neutral=” property. Do this after the R, X, and C matrices are defined. Ignored for symmetrical components. May be issued more than once to eliminate more than one conductor by resetting the Neutral property after the previous invoking of this property. Generally, you do not want to do a Kron reduction on the matrix if you intend to solve at a frequency other than the base frequency and exploit the Rg and Xg values.
DSS property name:
Kron
, DSS property index: 18.
- Like(value: AnyStr)#
Make like another object, e.g.:
New Capacitor.C2 like=c1 …
DSS property name:
Like
, DSS property index: 28.
- LineType: altdss.enums.LineType#
‘property(…)’
Code designating the type of line. One of: OH, UG, UG_TS, UG_CN, SWT_LDBRK, SWT_FUSE, SWT_SECT, SWT_REC, SWT_DISC, SWT_BRK, SWT_ELBOW, BUSBAR
OpenDSS currently does not use this internally. For whatever purpose the user defines. Default is OH.
DSS property name:
LineType
, DSS property index: 27.
- LineType_str: str#
‘property(…)’
Code designating the type of line. One of: OH, UG, UG_TS, UG_CN, SWT_LDBRK, SWT_FUSE, SWT_SECT, SWT_REC, SWT_DISC, SWT_BRK, SWT_ELBOW, BUSBAR
OpenDSS currently does not use this internally. For whatever purpose the user defines. Default is OH.
DSS property name:
LineType
, DSS property index: 27.
- NPhases: int#
‘property(…)’
Number of phases in the line this line code data represents. Setting this property reinitializes the line code. Impedance matrix is reset for default symmetrical component.
DSS property name:
NPhases
, DSS property index: 1.
- property Name: str#
- Neutral: int#
‘property(…)’
Designates which conductor is the “neutral” conductor that will be eliminated by Kron reduction. Default is the last conductor (nphases value). After Kron reduction is set to 0. Subsequent issuing of Kron=Yes will not do anything until this property is set to a legal value. Applies only to LineCodes defined by R, X, and C matrix.
DSS property name:
Neutral
, DSS property index: 22.
- NormAmps: float#
‘property(…)’
Normal ampere limit on line. This is the so-called Planning Limit. It may also be the value above which load will have to be dropped in a contingency. Usually about 75% - 80% of the emergency (one-hour) rating.
DSS property name:
NormAmps
, DSS property index: 13.
- PctPerm: float#
‘property(…)’
Percentage of the faults that become permanent.
DSS property name:
PctPerm
, DSS property index: 16.
- R0: float#
‘property(…)’
Zero-sequence Resistance, ohms per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition.
DSS property name:
R0
, DSS property index: 4.
- R1: float#
‘property(…)’
Positive-sequence Resistance, ohms per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also Rmatrix.
DSS property name:
R1
, DSS property index: 2.
- RMatrix: altdss.types.Float64Array#
‘property(…)’
Resistance matrix, lower triangle, ohms per unit length. Order of the matrix is the number of phases. May be used to specify the impedance of any line configuration. For balanced line models, you may use the standard symmetrical component data definition instead.
DSS property name:
RMatrix
, DSS property index: 9.
- Ratings: altdss.types.Float64Array#
‘property(…)’
An array of ratings to be used when the seasonal ratings flag is True. It can be used to insert multiple ratings to change during a QSTS simulation to evaluate different ratings in lines.
DSS property name:
Ratings
, DSS property index: 26.
- Repair: float#
‘property(…)’
Hours to repair.
DSS property name:
Repair
, DSS property index: 17.
- Rg: float#
‘property(…)’
Carson earth return resistance per unit length used to compute impedance values at base frequency. For making better frequency adjustments. Default is 0.01805 = 60 Hz value in ohms per kft (matches default line impedances). This value is required for harmonic solutions if you wish to adjust the earth return impedances for frequency. If not, set both Rg and Xg = 0.
DSS property name:
Rg
, DSS property index: 19.
- Seasons: int#
‘property(…)’
Defines the number of ratings to be defined for the wire, to be used only when defining seasonal ratings using the “Ratings” property.
DSS property name:
Seasons
, DSS property index: 25.
- Units: altdss.enums.LengthUnit#
‘property(…)’
One of (ohms per …) {none|mi|km|kft|m|me|ft|in|cm}. Default is none; assumes units agree with length units given in Line object
DSS property name:
Units
, DSS property index: 8.
- Units_str: str#
‘property(…)’
One of (ohms per …) {none|mi|km|kft|m|me|ft|in|cm}. Default is none; assumes units agree with length units given in Line object
DSS property name:
Units
, DSS property index: 8.
- X0: float#
‘property(…)’
Zero-sequence Reactance, ohms per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition.
DSS property name:
X0
, DSS property index: 5.
- X1: float#
‘property(…)’
Positive-sequence Reactance, ohms per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also Xmatrix
DSS property name:
X1
, DSS property index: 3.
- XMatrix: altdss.types.Float64Array#
‘property(…)’
Reactance matrix, lower triangle, ohms per unit length. Order of the matrix is the number of phases. May be used to specify the impedance of any line configuration. For balanced line models, you may use the standard symmetrical component data definition instead.
DSS property name:
XMatrix
, DSS property index: 10.
- Xg: float#
‘property(…)’
Carson earth return reactance per unit length used to compute impedance values at base frequency. For making better frequency adjustments. Default value is 0.155081 = 60 Hz value in ohms per kft (matches default line impedances). This value is required for harmonic solutions if you wish to adjust the earth return impedances for frequency. If not, set both Rg and Xg = 0.
DSS property name:
Xg
, DSS property index: 20.
- __hash__()#
Return hash(self).
- __init__(api_util, ptr)#
- __ne__(other)#
Return self!=value.
- __repr__()#
Return repr(self).
- begin_edit() None #
Marks a DSS object for editing
In the editing mode, some final side-effects of changing properties are postponed until
end_edit
is called. This side-effects can be somewhat costly, like updating the model parameters or internal matrices.If you don’t have any performance constraint, you may edit each property individually without worrying about using
begin_edit
andend_edit
. For convenience, those are emitted automatically when editing single properties outside an edit block.
- edit(**kwargs: typing_extensions.Unpack[altdss.LineCode.LineCodeProperties]) altdss.LineCode.LineCode #
Edit this LineCode.
This method will try to open a new edit context (if not already open), edit the properties, and finalize the edit context. It can be seen as a shortcut to manually setting each property, or a Pythonic analogous (but extended) to the DSS
Edit
command.- Parameters:
**kwargs – Pass keyword arguments equivalent to the DSS properties of the object.
- Returns:
Returns itself to allow call chaining.
- end_edit(num_changes: int = 1) None #
Leaves the editing state of a DSS object
num_changes
is required for a few classes to correctly match the official OpenDSS behavior and must be the number of properties modified in the current editing block. As of DSS C-API v0.13, this is only required for the Monitor class, when theAction
property is used with theProcess
value.
- rho: float#
‘property(…)’
Default=100 meter ohms. Earth resitivity used to compute earth correction factor.
DSS property name:
rho
, DSS property index: 21.
- to_json(options: Union[int, dss.enums.DSSJSONFlags] = 0)#
Returns an element’s data as a JSON-encoded string.
The
options
parameter contains bit-flags to toggle specific features.By default (
options = 0
), only the properties explicitly set. The properties are returned in the order they are set in the input. As a reminder, OpenDSS is sensitive to the order of the properties.The
options
bit-flags are available in theDSSJSONFlags
enum. Values used by this function are:Full
: if set, all properties are returned, ordered by property index instead.SkipRedundant
: if used withFull
, all properties except redundant and unused ones are returned.EnumAsInt
: enumerated properties are returned as integer values instead of strings.FullNames
: any element reference will use the full name ({class name}.{element name}
) even if not required.Pretty
: more whitespace is used in the output for a “prettier” format.SkipDSSClass
: do not add the “DSSClass” property to the JSON objects.
NOT IMPLEMENTED YET:
State
: include run-time state informationDebug
: include debug information
Other bit-flags are reserved for future uses. Please use
DSSJSONFlags
enum to avoid potential conflicts.(API Extension)
- class altdss.LineCode.LineCodeBatch(api_util, **kwargs)#
Bases:
altdss.Batch.DSSBatch
- B0: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Alternate way to specify C0. MicroS per unit length
DSS property name:
B0
, DSS property index: 24.
- B1: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Alternate way to specify C1. MicroS per unit length
DSS property name:
B1
, DSS property index: 23.
- BaseFreq: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Frequency at which impedances are specified.
DSS property name:
BaseFreq
, DSS property index: 12.
- C0: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Zero-sequence capacitance, nf per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also B0.
DSS property name:
C0
, DSS property index: 7.
- C1: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Positive-sequence capacitance, nf per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also Cmatrix and B1.
DSS property name:
C1
, DSS property index: 6.
- CMatrix: List[altdss.types.Float64Array]#
‘property(…)’
Nodal Capacitance matrix, lower triangle, nf per unit length.Order of the matrix is the number of phases. May be used to specify the shunt capacitance of any line configuration. For balanced line models, you may use the standard symmetrical component data definition instead.
DSS property name:
CMatrix
, DSS property index: 11.
- EmergAmps: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Emergency ampere limit on line (usually one-hour rating).
DSS property name:
EmergAmps
, DSS property index: 14.
- FaultRate: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Number of faults per unit length per year.
DSS property name:
FaultRate
, DSS property index: 15.
- FullName() List[str] #
Returns the full name (including object type) for all objects in this batch
- Kron(value: Union[bool, List[bool]] = True, flags: altdss.enums.SetterFlags = 0)#
Kron = Y/N. Default=N. Perform Kron reduction on the impedance matrix after it is formed, reducing order by 1. Eliminates the conductor designated by the “Neutral=” property. Do this after the R, X, and C matrices are defined. Ignored for symmetrical components. May be issued more than once to eliminate more than one conductor by resetting the Neutral property after the previous invoking of this property. Generally, you do not want to do a Kron reduction on the matrix if you intend to solve at a frequency other than the base frequency and exploit the Rg and Xg values.
DSS property name:
Kron
, DSS property index: 18.
- Like(value: AnyStr, flags: altdss.enums.SetterFlags = 0)#
Make like another object, e.g.:
New Capacitor.C2 like=c1 …
DSS property name:
Like
, DSS property index: 28.
- LineType: altdss.ArrayProxy.BatchInt32ArrayProxy#
‘property(…)’
Code designating the type of line. One of: OH, UG, UG_TS, UG_CN, SWT_LDBRK, SWT_FUSE, SWT_SECT, SWT_REC, SWT_DISC, SWT_BRK, SWT_ELBOW, BUSBAR
OpenDSS currently does not use this internally. For whatever purpose the user defines. Default is OH.
DSS property name:
LineType
, DSS property index: 27.
- LineType_str: List[str]#
‘property(…)’
Code designating the type of line. One of: OH, UG, UG_TS, UG_CN, SWT_LDBRK, SWT_FUSE, SWT_SECT, SWT_REC, SWT_DISC, SWT_BRK, SWT_ELBOW, BUSBAR
OpenDSS currently does not use this internally. For whatever purpose the user defines. Default is OH.
DSS property name:
LineType
, DSS property index: 27.
- NPhases: altdss.ArrayProxy.BatchInt32ArrayProxy#
‘property(…)’
Number of phases in the line this line code data represents. Setting this property reinitializes the line code. Impedance matrix is reset for default symmetrical component.
DSS property name:
NPhases
, DSS property index: 1.
- property Name: List[str]#
- Neutral: altdss.ArrayProxy.BatchInt32ArrayProxy#
‘property(…)’
Designates which conductor is the “neutral” conductor that will be eliminated by Kron reduction. Default is the last conductor (nphases value). After Kron reduction is set to 0. Subsequent issuing of Kron=Yes will not do anything until this property is set to a legal value. Applies only to LineCodes defined by R, X, and C matrix.
DSS property name:
Neutral
, DSS property index: 22.
- NormAmps: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Normal ampere limit on line. This is the so-called Planning Limit. It may also be the value above which load will have to be dropped in a contingency. Usually about 75% - 80% of the emergency (one-hour) rating.
DSS property name:
NormAmps
, DSS property index: 13.
- PctPerm: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Percentage of the faults that become permanent.
DSS property name:
PctPerm
, DSS property index: 16.
- R0: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Zero-sequence Resistance, ohms per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition.
DSS property name:
R0
, DSS property index: 4.
- R1: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Positive-sequence Resistance, ohms per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also Rmatrix.
DSS property name:
R1
, DSS property index: 2.
- RMatrix: List[altdss.types.Float64Array]#
‘property(…)’
Resistance matrix, lower triangle, ohms per unit length. Order of the matrix is the number of phases. May be used to specify the impedance of any line configuration. For balanced line models, you may use the standard symmetrical component data definition instead.
DSS property name:
RMatrix
, DSS property index: 9.
- Ratings: List[altdss.types.Float64Array]#
‘property(…)’
An array of ratings to be used when the seasonal ratings flag is True. It can be used to insert multiple ratings to change during a QSTS simulation to evaluate different ratings in lines.
DSS property name:
Ratings
, DSS property index: 26.
- Repair: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Hours to repair.
DSS property name:
Repair
, DSS property index: 17.
- Rg: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Carson earth return resistance per unit length used to compute impedance values at base frequency. For making better frequency adjustments. Default is 0.01805 = 60 Hz value in ohms per kft (matches default line impedances). This value is required for harmonic solutions if you wish to adjust the earth return impedances for frequency. If not, set both Rg and Xg = 0.
DSS property name:
Rg
, DSS property index: 19.
- Seasons: altdss.ArrayProxy.BatchInt32ArrayProxy#
‘property(…)’
Defines the number of ratings to be defined for the wire, to be used only when defining seasonal ratings using the “Ratings” property.
DSS property name:
Seasons
, DSS property index: 25.
- Units: altdss.ArrayProxy.BatchInt32ArrayProxy#
‘property(…)’
One of (ohms per …) {none|mi|km|kft|m|me|ft|in|cm}. Default is none; assumes units agree with length units given in Line object
DSS property name:
Units
, DSS property index: 8.
- Units_str: List[str]#
‘property(…)’
One of (ohms per …) {none|mi|km|kft|m|me|ft|in|cm}. Default is none; assumes units agree with length units given in Line object
DSS property name:
Units
, DSS property index: 8.
- X0: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Zero-sequence Reactance, ohms per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition.
DSS property name:
X0
, DSS property index: 5.
- X1: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Positive-sequence Reactance, ohms per unit length. Setting any of R1, R0, X1, X0, C1, C0 forces the program to use the symmetrical component line definition. See also Xmatrix
DSS property name:
X1
, DSS property index: 3.
- XMatrix: List[altdss.types.Float64Array]#
‘property(…)’
Reactance matrix, lower triangle, ohms per unit length. Order of the matrix is the number of phases. May be used to specify the impedance of any line configuration. For balanced line models, you may use the standard symmetrical component data definition instead.
DSS property name:
XMatrix
, DSS property index: 10.
- Xg: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Carson earth return reactance per unit length used to compute impedance values at base frequency. For making better frequency adjustments. Default value is 0.155081 = 60 Hz value in ohms per kft (matches default line impedances). This value is required for harmonic solutions if you wish to adjust the earth return impedances for frequency. If not, set both Rg and Xg = 0.
DSS property name:
Xg
, DSS property index: 20.
- __call__()#
- __getitem__(idx0) altdss.DSSObj.DSSObj #
Get element at 0-based index of the batch pointer array
- __init__(api_util, **kwargs)#
- __iter__()#
- __len__() int #
- batch(**kwargs) altdss.Batch.DSSBatch #
Filter a batch using integer or float DSS properties, returning a new batch.
For integers, provide a single value to match.
For floats, provide a range as a 2-valued tuple/list (min value, max value), or an exact value to value (not recommended).
Multiple properties can be listed to allow filtering various conditions.
Example for loads:
# Create an initial batch using a regular expression abc_loads = altdss.Load.batch(re=r'^abc.*$') # a batch of all loads with names starting with "abc" abc_loads_filtered = abc_loads.batch(Class=1, Phases=1, kV=(0.1, 1.0)) # Create an initial batch, already filtered abc_loads_filtered = altdss.Load.batch(re=r'^abc.*$', Class=1, Phases=1, kV=(0.1, 1.0))
- begin_edit() None #
Marks for editing all DSS objects in the batch
In the editing mode, some final side-effects of changing properties are postponed until
end_edit
is called. This side-effects can be somewhat costly, like updating the model parameters or internal matrices.If you don’t have any performance constraint, you may edit each property individually without worrying about using
begin_edit
andend_edit
. For convenience, those are emitted automatically when editing single properties outside an edit block.
- edit(**kwargs: typing_extensions.Unpack[altdss.LineCode.LineCodeBatchProperties]) altdss.LineCode.LineCodeBatch #
Edit this LineCode batch.
This method will try to open a new edit context (if not already open), edit the properties, and finalize the edit context for objects in the batch. It can be seen as a shortcut to manually setting each property, or a Pythonic analogous (but extended) to the DSS
BatchEdit
command.- Parameters:
**kwargs – Pass keyword arguments equivalent to the DSS properties of the objects.
- Returns:
Returns itself to allow call chaining.
- end_edit(num_changes: int = 1) None #
Leaves the editing states of all DSS objects in the batch
num_changes
is required for a few classes to correctly match the official OpenDSS behavior and must be the number of properties modified in the current editing block. As of DSS C-API v0.13, this is only required for the Monitor class, when theAction
property is used with theProcess
value.
- rho: altdss.ArrayProxy.BatchFloat64ArrayProxy#
‘property(…)’
Default=100 meter ohms. Earth resitivity used to compute earth correction factor.
DSS property name:
rho
, DSS property index: 21.
- to_json(options: Union[int, dss.enums.DSSJSONFlags] = 0)#
Returns the data (as a list) of the elements in a batch as a JSON-encoded string.
The
options
parameter contains bit-flags to toggle specific features. SeeObj_ToJSON
(C-API) for more, orDSSObj.to_json
in Python.Additionally, the
ExcludeDisabled
flag can be used to excluded disabled elements from the output.
- to_list()#
- class altdss.LineCode.LineCodeBatchProperties#
Bases:
typing_extensions.TypedDict
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
- B0: Union[float, altdss.types.Float64Array]#
None
- B1: Union[float, altdss.types.Float64Array]#
None
- BaseFreq: Union[float, altdss.types.Float64Array]#
None
- C0: Union[float, altdss.types.Float64Array]#
None
- C1: Union[float, altdss.types.Float64Array]#
None
- CMatrix: altdss.types.Float64Array#
None
- EmergAmps: Union[float, altdss.types.Float64Array]#
None
- FaultRate: Union[float, altdss.types.Float64Array]#
None
- Kron: bool#
None
- Like: AnyStr#
None
- LineType: Union[AnyStr, int, altdss.enums.LineType, List[AnyStr], List[int], List[altdss.enums.LineType], altdss.types.Int32Array]#
None
- NPhases: Union[int, altdss.types.Int32Array]#
None
- Neutral: Union[int, altdss.types.Int32Array]#
None
- NormAmps: Union[float, altdss.types.Float64Array]#
None
- PctPerm: Union[float, altdss.types.Float64Array]#
None
- R0: Union[float, altdss.types.Float64Array]#
None
- R1: Union[float, altdss.types.Float64Array]#
None
- RMatrix: altdss.types.Float64Array#
None
- Ratings: altdss.types.Float64Array#
None
- Repair: Union[float, altdss.types.Float64Array]#
None
- Rg: Union[float, altdss.types.Float64Array]#
None
- Seasons: Union[int, altdss.types.Int32Array]#
None
- Units: Union[AnyStr, int, altdss.enums.LengthUnit, List[AnyStr], List[int], List[altdss.enums.LengthUnit], altdss.types.Int32Array]#
None
- X0: Union[float, altdss.types.Float64Array]#
None
- X1: Union[float, altdss.types.Float64Array]#
None
- XMatrix: altdss.types.Float64Array#
None
- Xg: Union[float, altdss.types.Float64Array]#
None
- __contains__()#
True if the dictionary has the specified key, else False.
- __delattr__()#
Implement delattr(self, name).
- __delitem__()#
Delete self[key].
- __dir__()#
Default dir() implementation.
- __format__()#
Default object formatter.
Return str(self) if format_spec is empty. Raise TypeError otherwise.
- __ge__()#
Return self>=value.
- __getattribute__()#
Return getattr(self, name).
- __getitem__()#
Return self[key].
- __getstate__()#
Helper for pickle.
- __gt__()#
Return self>value.
- __init__()#
Initialize self. See help(type(self)) for accurate signature.
- __ior__()#
Return self|=value.
- __iter__()#
Implement iter(self).
- __le__()#
Return self<=value.
- __len__()#
Return len(self).
- __lt__()#
Return self<value.
- __ne__()#
Return self!=value.
- __new__()#
Create and return a new object. See help(type) for accurate signature.
- __or__()#
Return self|value.
- __reduce__()#
Helper for pickle.
- __reduce_ex__()#
Helper for pickle.
- __repr__()#
Return repr(self).
- __reversed__()#
Return a reverse iterator over the dict keys.
- __ror__()#
Return value|self.
- __setitem__()#
Set self[key] to value.
- __sizeof__()#
D.sizeof() -> size of D in memory, in bytes
- __str__()#
Return str(self).
- __subclasshook__()#
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.subclasscheck(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- clear()#
D.clear() -> None. Remove all items from D.
- copy()#
D.copy() -> a shallow copy of D
- get()#
Return the value for key if key is in the dictionary, else default.
- items()#
D.items() -> a set-like object providing a view on D’s items
- keys()#
D.keys() -> a set-like object providing a view on D’s keys
- pop()#
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()#
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- rho: Union[float, altdss.types.Float64Array]#
None
- setdefault()#
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update()#
D.update([E, ]**F) -> None. Update D from dict/iterable E and F. If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()#
D.values() -> an object providing a view on D’s values
- class altdss.LineCode.LineCodeProperties#
Bases:
typing_extensions.TypedDict
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
- B0: float#
None
- B1: float#
None
- BaseFreq: float#
None
- C0: float#
None
- C1: float#
None
- CMatrix: altdss.types.Float64Array#
None
- EmergAmps: float#
None
- FaultRate: float#
None
- Kron: bool#
None
- Like: AnyStr#
None
- LineType: Union[AnyStr, int, altdss.enums.LineType]#
None
- NPhases: int#
None
- Neutral: int#
None
- NormAmps: float#
None
- PctPerm: float#
None
- R0: float#
None
- R1: float#
None
- RMatrix: altdss.types.Float64Array#
None
- Ratings: altdss.types.Float64Array#
None
- Repair: float#
None
- Rg: float#
None
- Seasons: int#
None
- Units: Union[AnyStr, int, altdss.enums.LengthUnit]#
None
- X0: float#
None
- X1: float#
None
- XMatrix: altdss.types.Float64Array#
None
- Xg: float#
None
- __contains__()#
True if the dictionary has the specified key, else False.
- __delattr__()#
Implement delattr(self, name).
- __delitem__()#
Delete self[key].
- __dir__()#
Default dir() implementation.
- __format__()#
Default object formatter.
Return str(self) if format_spec is empty. Raise TypeError otherwise.
- __ge__()#
Return self>=value.
- __getattribute__()#
Return getattr(self, name).
- __getitem__()#
Return self[key].
- __getstate__()#
Helper for pickle.
- __gt__()#
Return self>value.
- __init__()#
Initialize self. See help(type(self)) for accurate signature.
- __ior__()#
Return self|=value.
- __iter__()#
Implement iter(self).
- __le__()#
Return self<=value.
- __len__()#
Return len(self).
- __lt__()#
Return self<value.
- __ne__()#
Return self!=value.
- __new__()#
Create and return a new object. See help(type) for accurate signature.
- __or__()#
Return self|value.
- __reduce__()#
Helper for pickle.
- __reduce_ex__()#
Helper for pickle.
- __repr__()#
Return repr(self).
- __reversed__()#
Return a reverse iterator over the dict keys.
- __ror__()#
Return value|self.
- __setitem__()#
Set self[key] to value.
- __sizeof__()#
D.sizeof() -> size of D in memory, in bytes
- __str__()#
Return str(self).
- __subclasshook__()#
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.subclasscheck(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- clear()#
D.clear() -> None. Remove all items from D.
- copy()#
D.copy() -> a shallow copy of D
- get()#
Return the value for key if key is in the dictionary, else default.
- items()#
D.items() -> a set-like object providing a view on D’s items
- keys()#
D.keys() -> a set-like object providing a view on D’s keys
- pop()#
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()#
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- rho: float#
None
- setdefault()#
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update()#
D.update([E, ]**F) -> None. Update D from dict/iterable E and F. If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values()#
D.values() -> an object providing a view on D’s values