altdss.XfmrCode

Contents

altdss.XfmrCode#

Module Contents#

Classes#

IXfmrCode

XfmrCode

XfmrCodeBatch

XfmrCodeBatchProperties

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)

XfmrCodeProperties

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.XfmrCode.IXfmrCode(iobj)#

Bases: altdss.DSSObj.IDSSObj, altdss.XfmrCode.XfmrCodeBatch

Conns: List[altdss.types.Int32Array]#

‘property(…)’

Use this to specify all the Winding connections at once using an array. Example:

New Transformer.T1 buses=“Hibus, lowbus” ~ conns=(delta, wye)

DSS property name: Conns, DSS property index: 11.

Conns_str: List[List[str]]#

‘property(…)’

Use this to specify all the Winding connections at once using an array. Example:

New Transformer.T1 buses=“Hibus, lowbus” ~ conns=(delta, wye)

DSS property name: Conns, DSS property index: 11.

EmergHkVA: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Emergency (contingency) kVA rating of H winding (winding 1). Usually 140% - 150% of maximum nameplate rating, depending on load shape. Defaults to 150% of kVA rating of Winding 1.

DSS property name: EmergHkVA, DSS property index: 27.

FLRise: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Temperature rise, deg C, for full load. Default is 65.

DSS property name: FLRise, DSS property index: 22.

FullName() List[str]#

Returns the full name (including object type) for all objects in this batch

HSRise: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Hot spot temperature rise, deg C. Default is 15.

DSS property name: HSRise, DSS property index: 23.

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: 40.

MaxTap: List[altdss.types.Float64Array]#

‘property(…)’

Max per unit tap for the active winding. Default is 1.10

DSS property name: MaxTap, DSS property index: 28.

MinTap: List[altdss.types.Float64Array]#

‘property(…)’

Min per unit tap for the active winding. Default is 0.90

DSS property name: MinTap, DSS property index: 29.

property Name: List[str]#
NormHkVA: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Normal maximum kVA rating of H winding (winding 1). Usually 100% - 110% of maximum nameplate rating, depending on load shape. Defaults to 110% of kVA rating of Winding 1.

DSS property name: NormHkVA, DSS property index: 26.

NumTaps: List[altdss.types.Int32Array]#

‘property(…)’

Total number of taps between min and max tap. Default is 32.

DSS property name: NumTaps, DSS property index: 30.

Phases: altdss.ArrayProxy.BatchInt32ArrayProxy#

‘property(…)’

Number of phases this transformer. Default is 3.

DSS property name: Phases, DSS property index: 1.

RDCOhms: List[altdss.types.Float64Array]#

‘property(…)’

Winding dc resistance in OHMS. Useful for GIC analysis. From transformer test report. Defaults to 85% of %R property

DSS property name: RDCOhms, DSS property index: 37.

RNeut: List[altdss.types.Float64Array]#

‘property(…)’

Default = -1. Neutral resistance of wye (star)-connected winding in actual ohms.If entered as a negative value, the neutral is assumed to be open, or floating.

DSS property name: RNeut, 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 transformers.

DSS property name: Ratings, DSS property index: 39.

Seasons: altdss.ArrayProxy.BatchInt32ArrayProxy#

‘property(…)’

Defines the number of ratings to be defined for the transfomer, to be used only when defining seasonal ratings using the “Ratings” property.

DSS property name: Seasons, DSS property index: 38.

Taps: List[altdss.types.Float64Array]#

‘property(…)’

Use this to specify the normal p.u. tap of all windings at once using an array.

DSS property name: Taps, DSS property index: 14.

Thermal: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Thermal time constant of the transformer in hours. Typically about 2.

DSS property name: Thermal, DSS property index: 19.

Windings: altdss.ArrayProxy.BatchInt32ArrayProxy#

‘property(…)’

Number of windings, this transformers. (Also is the number of terminals) Default is 2. This property triggers memory allocation for the Transformer and will cause other properties to revert to default values.

DSS property name: Windings, DSS property index: 2.

X12: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Alternative to XHL for specifying the percent reactance from winding 1 to winding 2. Use for 2- or 3-winding transformers. Percent on the kVA base of winding 1.

DSS property name: X12, DSS property index: 34.

X13: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Alternative to XHT for specifying the percent reactance from winding 1 to winding 3. Use for 3-winding transformers only. Percent on the kVA base of winding 1.

DSS property name: X13, DSS property index: 35.

X23: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Alternative to XLT for specifying the percent reactance from winding 2 to winding 3.Use for 3-winding transformers only. Percent on the kVA base of winding 1.

DSS property name: X23, DSS property index: 36.

XHL: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Use this to specify the percent reactance, H-L (winding 1 to winding 2). Use for 2- or 3-winding transformers. On the kva base of winding 1.

DSS property name: XHL, DSS property index: 15.

XHT: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Use this to specify the percent reactance, H-T (winding 1 to winding 3). Use for 3-winding transformers only. On the kVA base of winding 1.

DSS property name: XHT, DSS property index: 16.

XLT: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Use this to specify the percent reactance, L-T (winding 2 to winding 3). Use for 3-winding transformers only. On the kVA base of winding 1.

DSS property name: XLT, DSS property index: 17.

XNeut: List[altdss.types.Float64Array]#

‘property(…)’

Neutral reactance of wye(star)-connected winding in actual ohms. May be + or -.

DSS property name: XNeut, DSS property index: 10.

XSCArray: List[altdss.types.Float64Array]#

‘property(…)’

Use this to specify the percent reactance between all pairs of windings as an array. All values are on the kVA base of winding 1. The order of the values is as follows:

(x12 13 14… 23 24.. 34 ..)

There will be n(n-1)/2 values, where n=number of windings.

DSS property name: XSCArray, DSS property index: 18.

__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.XfmrCode.XfmrCodeBatchProperties]) altdss.XfmrCode.XfmrCodeBatch#

Creates a new batch of XfmrCode objects

Either names, count or df 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 to end_edit() or equivalent. The default begin_edit is set to None. With None, 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 to True 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 to count. begin_edit defaults to True 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 to False.

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 and end_edit. For convenience, those are emitted automatically when editing single properties outside an edit block.

edit(**kwargs: typing_extensions.Unpack[altdss.XfmrCode.XfmrCodeBatchProperties]) altdss.XfmrCode.XfmrCodeBatch#

Edit this XfmrCode 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 the Action property is used with the Process 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.

kVAs: List[altdss.types.Float64Array]#

‘property(…)’

Use this to specify the kVA ratings of all windings at once using an array.

DSS property name: kVAs, DSS property index: 13.

kVs: List[altdss.types.Float64Array]#

‘property(…)’

Use this to specify the kV ratings of all windings at once using an array. Example:

New Transformer.T1 buses=“Hibus, lowbus” ~ conns=(delta, wye) ~ kvs=(115, 12.47)

See kV= property for voltage rules.

DSS property name: kVs, DSS property index: 12.

m: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

m Exponent for thermal properties in IEEE C57. Typically 0.9 - 1.0

DSS property name: m, DSS property index: 21.

n: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

n Exponent for thermal properties in IEEE C57. Typically 0.8.

DSS property name: n, DSS property index: 20.

new(name: AnyStr, *, begin_edit: Optional[bool] = None, activate=False, **kwargs: typing_extensions.Unpack[altdss.XfmrCode.XfmrCodeProperties]) altdss.XfmrCode.XfmrCode#

Creates a new XfmrCode.

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 an end_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.

pctIMag: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Percent magnetizing current. Default=0.0. Magnetizing branch is in parallel with windings in each phase. Also, see “ppm_antifloat”.

DSS property name: %IMag, DSS property index: 31.

pctLoadLoss: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Percent load loss at full load. The %R of the High and Low windings (1 and 2) are adjusted to agree at rated kVA loading.

DSS property name: %LoadLoss, DSS property index: 24.

pctNoLoadLoss: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Percent no load losses at rated excitation voltage. Default is 0. Converts to a resistance in parallel with the magnetizing impedance in each winding.

DSS property name: %NoLoadLoss, DSS property index: 25.

pctR: List[altdss.types.Float64Array]#

‘property(…)’

Percent resistance this winding. (half of total for a 2-winding).

DSS property name: %R, DSS property index: 8.

pctRs: List[altdss.types.Float64Array]#

‘property(…)’

Use this property to specify all the winding %resistances using an array. Example:

New Transformer.T1 buses=“Hibus, lowbus” ~ %Rs=(0.2 0.3)

DSS property name: %Rs, DSS property index: 33.

ppm_Antifloat: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Default=1 ppm. Parts per million of transformer winding VA rating connected to ground to protect against accidentally floating a winding without a reference. If positive then the effect is adding a very large reactance to ground. If negative, then a capacitor.

DSS property name: ppm_Antifloat, DSS property index: 32.

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. 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.

to_list()#
class altdss.XfmrCode.XfmrCode(api_util, ptr)#

Bases: altdss.DSSObj.DSSObj

Conns: altdss.enums.Connection#

‘property(…)’

Use this to specify all the Winding connections at once using an array. Example:

New Transformer.T1 buses=“Hibus, lowbus” ~ conns=(delta, wye)

DSS property name: Conns, DSS property index: 11.

Conns_str: List[str]#

‘property(…)’

Use this to specify all the Winding connections at once using an array. Example:

New Transformer.T1 buses=“Hibus, lowbus” ~ conns=(delta, wye)

DSS property name: Conns, DSS property index: 11.

EmergHkVA: float#

‘property(…)’

Emergency (contingency) kVA rating of H winding (winding 1). Usually 140% - 150% of maximum nameplate rating, depending on load shape. Defaults to 150% of kVA rating of Winding 1.

DSS property name: EmergHkVA, DSS property index: 27.

FLRise: float#

‘property(…)’

Temperature rise, deg C, for full load. Default is 65.

DSS property name: FLRise, DSS property index: 22.

FullName() str#
HSRise: float#

‘property(…)’

Hot spot temperature rise, deg C. Default is 15.

DSS property name: HSRise, DSS property index: 23.

Like(value: AnyStr)#

Make like another object, e.g.:

New Capacitor.C2 like=c1 …

DSS property name: Like, DSS property index: 40.

MaxTap: altdss.types.Float64Array#

‘property(…)’

Max per unit tap for the active winding. Default is 1.10

DSS property name: MaxTap, DSS property index: 28.

MinTap: altdss.types.Float64Array#

‘property(…)’

Min per unit tap for the active winding. Default is 0.90

DSS property name: MinTap, DSS property index: 29.

property Name: str#
NormHkVA: float#

‘property(…)’

Normal maximum kVA rating of H winding (winding 1). Usually 100% - 110% of maximum nameplate rating, depending on load shape. Defaults to 110% of kVA rating of Winding 1.

DSS property name: NormHkVA, DSS property index: 26.

NumTaps: altdss.types.Int32Array#

‘property(…)’

Total number of taps between min and max tap. Default is 32.

DSS property name: NumTaps, DSS property index: 30.

Phases: int#

‘property(…)’

Number of phases this transformer. Default is 3.

DSS property name: Phases, DSS property index: 1.

RDCOhms: altdss.types.Float64Array#

‘property(…)’

Winding dc resistance in OHMS. Useful for GIC analysis. From transformer test report. Defaults to 85% of %R property

DSS property name: RDCOhms, DSS property index: 37.

RNeut: altdss.types.Float64Array#

‘property(…)’

Default = -1. Neutral resistance of wye (star)-connected winding in actual ohms.If entered as a negative value, the neutral is assumed to be open, or floating.

DSS property name: RNeut, 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 transformers.

DSS property name: Ratings, DSS property index: 39.

Seasons: int#

‘property(…)’

Defines the number of ratings to be defined for the transfomer, to be used only when defining seasonal ratings using the “Ratings” property.

DSS property name: Seasons, DSS property index: 38.

Taps: altdss.types.Float64Array#

‘property(…)’

Use this to specify the normal p.u. tap of all windings at once using an array.

DSS property name: Taps, DSS property index: 14.

Thermal: float#

‘property(…)’

Thermal time constant of the transformer in hours. Typically about 2.

DSS property name: Thermal, DSS property index: 19.

Windings: int#

‘property(…)’

Number of windings, this transformers. (Also is the number of terminals) Default is 2. This property triggers memory allocation for the Transformer and will cause other properties to revert to default values.

DSS property name: Windings, DSS property index: 2.

X12: float#

‘property(…)’

Alternative to XHL for specifying the percent reactance from winding 1 to winding 2. Use for 2- or 3-winding transformers. Percent on the kVA base of winding 1.

DSS property name: X12, DSS property index: 34.

X13: float#

‘property(…)’

Alternative to XHT for specifying the percent reactance from winding 1 to winding 3. Use for 3-winding transformers only. Percent on the kVA base of winding 1.

DSS property name: X13, DSS property index: 35.

X23: float#

‘property(…)’

Alternative to XLT for specifying the percent reactance from winding 2 to winding 3.Use for 3-winding transformers only. Percent on the kVA base of winding 1.

DSS property name: X23, DSS property index: 36.

XHL: float#

‘property(…)’

Use this to specify the percent reactance, H-L (winding 1 to winding 2). Use for 2- or 3-winding transformers. On the kva base of winding 1.

DSS property name: XHL, DSS property index: 15.

XHT: float#

‘property(…)’

Use this to specify the percent reactance, H-T (winding 1 to winding 3). Use for 3-winding transformers only. On the kVA base of winding 1.

DSS property name: XHT, DSS property index: 16.

XLT: float#

‘property(…)’

Use this to specify the percent reactance, L-T (winding 2 to winding 3). Use for 3-winding transformers only. On the kVA base of winding 1.

DSS property name: XLT, DSS property index: 17.

XNeut: altdss.types.Float64Array#

‘property(…)’

Neutral reactance of wye(star)-connected winding in actual ohms. May be + or -.

DSS property name: XNeut, DSS property index: 10.

XSCArray: altdss.types.Float64Array#

‘property(…)’

Use this to specify the percent reactance between all pairs of windings as an array. All values are on the kVA base of winding 1. The order of the values is as follows:

(x12 13 14… 23 24.. 34 ..)

There will be n(n-1)/2 values, where n=number of windings.

DSS property name: XSCArray, DSS property index: 18.

__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 and end_edit. For convenience, those are emitted automatically when editing single properties outside an edit block.

edit(**kwargs: typing_extensions.Unpack[altdss.XfmrCode.XfmrCodeProperties]) altdss.XfmrCode.XfmrCode#

Edit this XfmrCode.

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 the Action property is used with the Process value.

kVAs: altdss.types.Float64Array#

‘property(…)’

Use this to specify the kVA ratings of all windings at once using an array.

DSS property name: kVAs, DSS property index: 13.

kVs: altdss.types.Float64Array#

‘property(…)’

Use this to specify the kV ratings of all windings at once using an array. Example:

New Transformer.T1 buses=“Hibus, lowbus” ~ conns=(delta, wye) ~ kvs=(115, 12.47)

See kV= property for voltage rules.

DSS property name: kVs, DSS property index: 12.

m: float#

‘property(…)’

m Exponent for thermal properties in IEEE C57. Typically 0.9 - 1.0

DSS property name: m, DSS property index: 21.

n: float#

‘property(…)’

n Exponent for thermal properties in IEEE C57. Typically 0.8.

DSS property name: n, DSS property index: 20.

pctIMag: float#

‘property(…)’

Percent magnetizing current. Default=0.0. Magnetizing branch is in parallel with windings in each phase. Also, see “ppm_antifloat”.

DSS property name: %IMag, DSS property index: 31.

pctLoadLoss: float#

‘property(…)’

Percent load loss at full load. The %R of the High and Low windings (1 and 2) are adjusted to agree at rated kVA loading.

DSS property name: %LoadLoss, DSS property index: 24.

pctNoLoadLoss: float#

‘property(…)’

Percent no load losses at rated excitation voltage. Default is 0. Converts to a resistance in parallel with the magnetizing impedance in each winding.

DSS property name: %NoLoadLoss, DSS property index: 25.

pctR: altdss.types.Float64Array#

‘property(…)’

Percent resistance this winding. (half of total for a 2-winding).

DSS property name: %R, DSS property index: 8.

pctRs: altdss.types.Float64Array#

‘property(…)’

Use this property to specify all the winding %resistances using an array. Example:

New Transformer.T1 buses=“Hibus, lowbus” ~ %Rs=(0.2 0.3)

DSS property name: %Rs, DSS property index: 33.

ppm_Antifloat: float#

‘property(…)’

Default=1 ppm. Parts per million of transformer winding VA rating connected to ground to protect against accidentally floating a winding without a reference. If positive then the effect is adding a very large reactance to ground. If negative, then a capacitor.

DSS property name: ppm_Antifloat, DSS property index: 32.

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 the DSSJSONFlags enum. Values used by this function are:

  • Full: if set, all properties are returned, ordered by property index instead.

  • SkipRedundant: if used with Full, 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 information

  • Debug: include debug information

Other bit-flags are reserved for future uses. Please use DSSJSONFlags enum to avoid potential conflicts.

(API Extension)

class altdss.XfmrCode.XfmrCodeBatch(api_util, **kwargs)#

Bases: altdss.Batch.DSSBatch

Conns: List[altdss.types.Int32Array]#

‘property(…)’

Use this to specify all the Winding connections at once using an array. Example:

New Transformer.T1 buses=“Hibus, lowbus” ~ conns=(delta, wye)

DSS property name: Conns, DSS property index: 11.

Conns_str: List[List[str]]#

‘property(…)’

Use this to specify all the Winding connections at once using an array. Example:

New Transformer.T1 buses=“Hibus, lowbus” ~ conns=(delta, wye)

DSS property name: Conns, DSS property index: 11.

EmergHkVA: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Emergency (contingency) kVA rating of H winding (winding 1). Usually 140% - 150% of maximum nameplate rating, depending on load shape. Defaults to 150% of kVA rating of Winding 1.

DSS property name: EmergHkVA, DSS property index: 27.

FLRise: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Temperature rise, deg C, for full load. Default is 65.

DSS property name: FLRise, DSS property index: 22.

FullName() List[str]#

Returns the full name (including object type) for all objects in this batch

HSRise: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Hot spot temperature rise, deg C. Default is 15.

DSS property name: HSRise, DSS property index: 23.

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: 40.

MaxTap: List[altdss.types.Float64Array]#

‘property(…)’

Max per unit tap for the active winding. Default is 1.10

DSS property name: MaxTap, DSS property index: 28.

MinTap: List[altdss.types.Float64Array]#

‘property(…)’

Min per unit tap for the active winding. Default is 0.90

DSS property name: MinTap, DSS property index: 29.

property Name: List[str]#
NormHkVA: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Normal maximum kVA rating of H winding (winding 1). Usually 100% - 110% of maximum nameplate rating, depending on load shape. Defaults to 110% of kVA rating of Winding 1.

DSS property name: NormHkVA, DSS property index: 26.

NumTaps: List[altdss.types.Int32Array]#

‘property(…)’

Total number of taps between min and max tap. Default is 32.

DSS property name: NumTaps, DSS property index: 30.

Phases: altdss.ArrayProxy.BatchInt32ArrayProxy#

‘property(…)’

Number of phases this transformer. Default is 3.

DSS property name: Phases, DSS property index: 1.

RDCOhms: List[altdss.types.Float64Array]#

‘property(…)’

Winding dc resistance in OHMS. Useful for GIC analysis. From transformer test report. Defaults to 85% of %R property

DSS property name: RDCOhms, DSS property index: 37.

RNeut: List[altdss.types.Float64Array]#

‘property(…)’

Default = -1. Neutral resistance of wye (star)-connected winding in actual ohms.If entered as a negative value, the neutral is assumed to be open, or floating.

DSS property name: RNeut, 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 transformers.

DSS property name: Ratings, DSS property index: 39.

Seasons: altdss.ArrayProxy.BatchInt32ArrayProxy#

‘property(…)’

Defines the number of ratings to be defined for the transfomer, to be used only when defining seasonal ratings using the “Ratings” property.

DSS property name: Seasons, DSS property index: 38.

Taps: List[altdss.types.Float64Array]#

‘property(…)’

Use this to specify the normal p.u. tap of all windings at once using an array.

DSS property name: Taps, DSS property index: 14.

Thermal: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Thermal time constant of the transformer in hours. Typically about 2.

DSS property name: Thermal, DSS property index: 19.

Windings: altdss.ArrayProxy.BatchInt32ArrayProxy#

‘property(…)’

Number of windings, this transformers. (Also is the number of terminals) Default is 2. This property triggers memory allocation for the Transformer and will cause other properties to revert to default values.

DSS property name: Windings, DSS property index: 2.

X12: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Alternative to XHL for specifying the percent reactance from winding 1 to winding 2. Use for 2- or 3-winding transformers. Percent on the kVA base of winding 1.

DSS property name: X12, DSS property index: 34.

X13: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Alternative to XHT for specifying the percent reactance from winding 1 to winding 3. Use for 3-winding transformers only. Percent on the kVA base of winding 1.

DSS property name: X13, DSS property index: 35.

X23: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Alternative to XLT for specifying the percent reactance from winding 2 to winding 3.Use for 3-winding transformers only. Percent on the kVA base of winding 1.

DSS property name: X23, DSS property index: 36.

XHL: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Use this to specify the percent reactance, H-L (winding 1 to winding 2). Use for 2- or 3-winding transformers. On the kva base of winding 1.

DSS property name: XHL, DSS property index: 15.

XHT: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Use this to specify the percent reactance, H-T (winding 1 to winding 3). Use for 3-winding transformers only. On the kVA base of winding 1.

DSS property name: XHT, DSS property index: 16.

XLT: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Use this to specify the percent reactance, L-T (winding 2 to winding 3). Use for 3-winding transformers only. On the kVA base of winding 1.

DSS property name: XLT, DSS property index: 17.

XNeut: List[altdss.types.Float64Array]#

‘property(…)’

Neutral reactance of wye(star)-connected winding in actual ohms. May be + or -.

DSS property name: XNeut, DSS property index: 10.

XSCArray: List[altdss.types.Float64Array]#

‘property(…)’

Use this to specify the percent reactance between all pairs of windings as an array. All values are on the kVA base of winding 1. The order of the values is as follows:

(x12 13 14… 23 24.. 34 ..)

There will be n(n-1)/2 values, where n=number of windings.

DSS property name: XSCArray, DSS property index: 18.

__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 and end_edit. For convenience, those are emitted automatically when editing single properties outside an edit block.

edit(**kwargs: typing_extensions.Unpack[altdss.XfmrCode.XfmrCodeBatchProperties]) altdss.XfmrCode.XfmrCodeBatch#

Edit this XfmrCode 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 the Action property is used with the Process value.

kVAs: List[altdss.types.Float64Array]#

‘property(…)’

Use this to specify the kVA ratings of all windings at once using an array.

DSS property name: kVAs, DSS property index: 13.

kVs: List[altdss.types.Float64Array]#

‘property(…)’

Use this to specify the kV ratings of all windings at once using an array. Example:

New Transformer.T1 buses=“Hibus, lowbus” ~ conns=(delta, wye) ~ kvs=(115, 12.47)

See kV= property for voltage rules.

DSS property name: kVs, DSS property index: 12.

m: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

m Exponent for thermal properties in IEEE C57. Typically 0.9 - 1.0

DSS property name: m, DSS property index: 21.

n: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

n Exponent for thermal properties in IEEE C57. Typically 0.8.

DSS property name: n, DSS property index: 20.

pctIMag: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Percent magnetizing current. Default=0.0. Magnetizing branch is in parallel with windings in each phase. Also, see “ppm_antifloat”.

DSS property name: %IMag, DSS property index: 31.

pctLoadLoss: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Percent load loss at full load. The %R of the High and Low windings (1 and 2) are adjusted to agree at rated kVA loading.

DSS property name: %LoadLoss, DSS property index: 24.

pctNoLoadLoss: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Percent no load losses at rated excitation voltage. Default is 0. Converts to a resistance in parallel with the magnetizing impedance in each winding.

DSS property name: %NoLoadLoss, DSS property index: 25.

pctR: List[altdss.types.Float64Array]#

‘property(…)’

Percent resistance this winding. (half of total for a 2-winding).

DSS property name: %R, DSS property index: 8.

pctRs: List[altdss.types.Float64Array]#

‘property(…)’

Use this property to specify all the winding %resistances using an array. Example:

New Transformer.T1 buses=“Hibus, lowbus” ~ %Rs=(0.2 0.3)

DSS property name: %Rs, DSS property index: 33.

ppm_Antifloat: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Default=1 ppm. Parts per million of transformer winding VA rating connected to ground to protect against accidentally floating a winding without a reference. If positive then the effect is adding a very large reactance to ground. If negative, then a capacitor.

DSS property name: ppm_Antifloat, DSS property index: 32.

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. 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.

to_list()#
class altdss.XfmrCode.XfmrCodeBatchProperties#

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)

Conns: Union[List[Union[int, altdss.enums.Connection]], List[AnyStr]]#

None

EmergHkVA: Union[float, altdss.types.Float64Array]#

None

FLRise: Union[float, altdss.types.Float64Array]#

None

HSRise: Union[float, altdss.types.Float64Array]#

None

Like: AnyStr#

None

MaxTap: altdss.types.Float64Array#

None

MinTap: altdss.types.Float64Array#

None

NormHkVA: Union[float, altdss.types.Float64Array]#

None

NumTaps: altdss.types.Int32Array#

None

Phases: Union[int, altdss.types.Int32Array]#

None

RDCOhms: altdss.types.Float64Array#

None

RNeut: altdss.types.Float64Array#

None

Ratings: altdss.types.Float64Array#

None

Seasons: Union[int, altdss.types.Int32Array]#

None

Taps: altdss.types.Float64Array#

None

Thermal: Union[float, altdss.types.Float64Array]#

None

Windings: Union[int, altdss.types.Int32Array]#

None

X12: Union[float, altdss.types.Float64Array]#

None

X13: Union[float, altdss.types.Float64Array]#

None

X23: Union[float, altdss.types.Float64Array]#

None

XHL: Union[float, altdss.types.Float64Array]#

None

XHT: Union[float, altdss.types.Float64Array]#

None

XLT: Union[float, altdss.types.Float64Array]#

None

XNeut: altdss.types.Float64Array#

None

XSCArray: 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

kVAs: altdss.types.Float64Array#

None

kVs: altdss.types.Float64Array#

None

keys()#

D.keys() -> a set-like object providing a view on D’s keys

m: Union[float, altdss.types.Float64Array]#

None

n: Union[float, altdss.types.Float64Array]#

None

pctIMag: Union[float, altdss.types.Float64Array]#

None

pctLoadLoss: Union[float, altdss.types.Float64Array]#

None

pctNoLoadLoss: Union[float, altdss.types.Float64Array]#

None

pctR: altdss.types.Float64Array#

None

pctRs: altdss.types.Float64Array#

None

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.

ppm_Antifloat: 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.XfmrCode.XfmrCodeProperties#

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)

Conns: Union[List[Union[int, altdss.enums.Connection]], List[AnyStr]]#

None

EmergHkVA: float#

None

FLRise: float#

None

HSRise: float#

None

Like: AnyStr#

None

MaxTap: altdss.types.Float64Array#

None

MinTap: altdss.types.Float64Array#

None

NormHkVA: float#

None

NumTaps: altdss.types.Int32Array#

None

Phases: int#

None

RDCOhms: altdss.types.Float64Array#

None

RNeut: altdss.types.Float64Array#

None

Ratings: altdss.types.Float64Array#

None

Seasons: int#

None

Taps: altdss.types.Float64Array#

None

Thermal: float#

None

Windings: int#

None

X12: float#

None

X13: float#

None

X23: float#

None

XHL: float#

None

XHT: float#

None

XLT: float#

None

XNeut: altdss.types.Float64Array#

None

XSCArray: 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

kVAs: altdss.types.Float64Array#

None

kVs: altdss.types.Float64Array#

None

keys()#

D.keys() -> a set-like object providing a view on D’s keys

m: float#

None

n: float#

None

pctIMag: float#

None

pctLoadLoss: float#

None

pctNoLoadLoss: float#

None

pctR: altdss.types.Float64Array#

None

pctRs: altdss.types.Float64Array#

None

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.

ppm_Antifloat: 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