altdss.LoadShape

Contents

altdss.LoadShape#

Module Contents#

Classes#

ILoadShape

LoadShape

LoadShapeBatch

LoadShapeBatchProperties

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)

LoadShapeProperties

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.LoadShape.ILoadShape(iobj)#

Bases: altdss.DSSObj.IDSSObj, altdss.LoadShape.LoadShapeBatch

Action(value: Union[AnyStr, int, altdss.enums.LoadShapeAction], flags: altdss.enums.SetterFlags = 0)#

{NORMALIZE | DblSave | SngSave} After defining load curve data, setting action=normalize will modify the multipliers so that the peak is 1.0. The mean and std deviation are recomputed.

Setting action=DblSave or SngSave will cause the present mult and qmult values to be written to either a packed file of double or single. The filename is the loadshape name. The mult array will have a “_P” appended on the file name and the qmult array, if it exists, will have “_Q” appended.

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

CSVFile: List[str]#

‘property(…)’

Switch input of active power load curve data to a CSV text file containing (hour, mult) points, or simply (mult) values for fixed time interval data, one per line. NOTE: This action may reset the number of points to a lower value.

DSS property name: CSVFile, DSS property index: 7.

DblFile: List[str]#

‘property(…)’

Switch input of active power load curve data to a binary file of doubles containing (hour, mult) points, or simply (mult) values for fixed time interval data, packed one after another. NOTE: This action may reset the number of points to a lower value.

DSS property name: DblFile, DSS property index: 9.

DblSave(flags: altdss.enums.SetterFlags = 0)#

Shortcut to Action(LoadShapeAction.DblSave)

FullName() List[str]#

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

Hour: List[altdss.types.Float64Array]#

‘property(…)’

Array of hour values. Only necessary to define for variable interval data (Interval=0). If you set Interval>0 to denote fixed interval data, DO NOT USE THIS PROPERTY. You can also use the syntax: hour = (file=filename) !for text file one value per line hour = (dblfile=filename) !for packed file of doubles hour = (sngfile=filename) !for packed file of singles

DSS property name: Hour, DSS property index: 4.

Interpolation: altdss.ArrayProxy.BatchInt32ArrayProxy#

‘property(…)’

{AVG* | EDGE} Defines the interpolation method used for connecting distant dots within the load shape.

By default is AVG (average), which will return a multiplier for missing intervals based on the closest multiplier in time. EDGE interpolation keeps the last known value for missing intervals until the next defined multiplier arrives.

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

Interpolation_str: List[str]#

‘property(…)’

{AVG* | EDGE} Defines the interpolation method used for connecting distant dots within the load shape.

By default is AVG (average), which will return a multiplier for missing intervals based on the closest multiplier in time. EDGE interpolation keeps the last known value for missing intervals until the next defined multiplier arrives.

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

Interval: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Time interval for fixed interval data, hrs. Default = 1. If Interval = 0 then time data (in hours) may be at either regular or irregular intervals and time value must be specified using either the Hour property or input files. Then values are interpolated when Interval=0, but not for fixed interval data.

See also “sinterval” and “minterval”.

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

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

MInterval: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Specify fixed interval in MINUTES. Alternate way to specify Interval property.

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

Mean: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Mean of the active power multipliers. This is computed on demand the first time a value is needed. However, you may set it to another value independently. Used for Monte Carlo load simulations.

DSS property name: Mean, DSS property index: 5.

MemoryMapping: List[bool]#

‘property(…)’

{Yes | No* | True | False*} Enables the memory mapping functionality for dealing with large amounts of load shapes. By default is False. Use it to accelerate the model loading when the containing a large number of load shapes.

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

NPts: altdss.ArrayProxy.BatchInt32ArrayProxy#

‘property(…)’

Max number of points to expect in load shape vectors. This gets reset to the number of multiplier values found (in files only) if less than specified.

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

property Name: List[str]#
Normalize(flags: altdss.enums.SetterFlags = 0)#

Shortcut to Action(LoadShapeAction.Normalize)

PBase: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Base P value for normalization. Default is zero, meaning the peak will be used.

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

PMax: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

kW value at the time of max power. Is automatically set upon reading in a loadshape. Use this property to override the value automatically computed or to retrieve the value computed.

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

PMult: List[altdss.types.Float64Array]#

‘property(…)’

Synonym for “mult”.

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

PQCSVFile: List[str]#

‘property(…)’

Switch input to a CSV text file containing (active, reactive) power (P, Q) multiplier pairs, one per row. If the interval=0, there should be 3 items on each line: (hour, Pmult, Qmult)

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

QBase: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Base Q value for normalization. Default is zero, meaning the peak will be used.

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

QMax: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

kvar value at the time of max kW power. Is automatically set upon reading in a loadshape. Use this property to override the value automatically computed or to retrieve the value computed.

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

QMult: List[altdss.types.Float64Array]#

‘property(…)’

Array of multiplier values for reactive power (Q). You can also use the syntax: qmult = (file=filename) !for text file one value per line qmult = (dblfile=filename) !for packed file of doubles qmult = (sngfile=filename) !for packed file of singles qmult = (file=MyCSVFile.csv, col=4, header=yes) !for multicolumn CSV files

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

SInterval: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Specify fixed interval in SECONDS. Alternate way to specify Interval property.

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

SngFile: List[str]#

‘property(…)’

Switch input of active power load curve data to a binary file of singles containing (hour, mult) points, or simply (mult) values for fixed time interval data, packed one after another. NOTE: This action may reset the number of points to a lower value.

DSS property name: SngFile, DSS property index: 8.

SngSave(flags: altdss.enums.SetterFlags = 0)#

Shortcut to Action(LoadShapeAction.SngSave)

StdDev: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Standard deviation of active power multipliers. This is computed on demand the first time a value is needed. However, you may set it to another value independently.Is overwritten if you subsequently read in a curve

Used for Monte Carlo load simulations.

DSS property name: StdDev, DSS property index: 6.

UseActual: List[bool]#

‘property(…)’

{Yes | No* | True | False*} If true, signifies to Load, Generator, Vsource, or other objects to use the return value as the actual kW, kvar, kV, or other value rather than a multiplier. Nominally for AMI Load data but may be used for other functions.

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

UseFloat32()#

If the loadshapes are using float64/double precision internal data, use this function to convert to float32/single precision. If the data is not owned by the loadshape, this operation is not allowed.

UseFloat64()#

If the loadshape are using float32/single precision internal data, use this function to convert to float64/double precision. If the data is not owned by the loadshape, this operation is not allowed.

__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.LoadShape.LoadShapeBatchProperties]) altdss.LoadShape.LoadShapeBatch#

Creates a new batch of LoadShape 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.LoadShape.LoadShapeBatchProperties]) altdss.LoadShape.LoadShapeBatch#

Edit this LoadShape 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.

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

Creates a new LoadShape.

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.

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.LoadShape.LoadShape(api_util, ptr)#

Bases: altdss.DSSObj.DSSObj, altdss.LoadShapeExtras.LoadShapeObjMixin

Action(value: Union[AnyStr, int, altdss.enums.LoadShapeAction], flags: altdss.enums.SetterFlags = 0)#

{NORMALIZE | DblSave | SngSave} After defining load curve data, setting action=normalize will modify the multipliers so that the peak is 1.0. The mean and std deviation are recomputed.

Setting action=DblSave or SngSave will cause the present mult and qmult values to be written to either a packed file of double or single. The filename is the loadshape name. The mult array will have a “_P” appended on the file name and the qmult array, if it exists, will have “_Q” appended.

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

CSVFile: str#

‘property(…)’

Switch input of active power load curve data to a CSV text file containing (hour, mult) points, or simply (mult) values for fixed time interval data, one per line. NOTE: This action may reset the number of points to a lower value.

DSS property name: CSVFile, DSS property index: 7.

DblFile: str#

‘property(…)’

Switch input of active power load curve data to a binary file of doubles containing (hour, mult) points, or simply (mult) values for fixed time interval data, packed one after another. NOTE: This action may reset the number of points to a lower value.

DSS property name: DblFile, DSS property index: 9.

DblSave(flags: altdss.enums.SetterFlags = 0)#

Shortcut to Action(LoadShapeAction.DblSave)

FullName() str#
Hour: altdss.types.Float64Array#

‘property(…)’

Array of hour values. Only necessary to define for variable interval data (Interval=0). If you set Interval>0 to denote fixed interval data, DO NOT USE THIS PROPERTY. You can also use the syntax: hour = (file=filename) !for text file one value per line hour = (dblfile=filename) !for packed file of doubles hour = (sngfile=filename) !for packed file of singles

DSS property name: Hour, DSS property index: 4.

Interpolation: altdss.enums.LoadShapeInterpolation#

‘property(…)’

{AVG* | EDGE} Defines the interpolation method used for connecting distant dots within the load shape.

By default is AVG (average), which will return a multiplier for missing intervals based on the closest multiplier in time. EDGE interpolation keeps the last known value for missing intervals until the next defined multiplier arrives.

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

Interpolation_str: str#

‘property(…)’

{AVG* | EDGE} Defines the interpolation method used for connecting distant dots within the load shape.

By default is AVG (average), which will return a multiplier for missing intervals based on the closest multiplier in time. EDGE interpolation keeps the last known value for missing intervals until the next defined multiplier arrives.

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

Interval: float#

‘property(…)’

Time interval for fixed interval data, hrs. Default = 1. If Interval = 0 then time data (in hours) may be at either regular or irregular intervals and time value must be specified using either the Hour property or input files. Then values are interpolated when Interval=0, but not for fixed interval data.

See also “sinterval” and “minterval”.

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

Like(value: AnyStr)#

Make like another object, e.g.:

New Capacitor.C2 like=c1 …

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

MInterval: float#

‘property(…)’

Specify fixed interval in MINUTES. Alternate way to specify Interval property.

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

Mean: float#

‘property(…)’

Mean of the active power multipliers. This is computed on demand the first time a value is needed. However, you may set it to another value independently. Used for Monte Carlo load simulations.

DSS property name: Mean, DSS property index: 5.

MemoryMapping: bool#

‘property(…)’

{Yes | No* | True | False*} Enables the memory mapping functionality for dealing with large amounts of load shapes. By default is False. Use it to accelerate the model loading when the containing a large number of load shapes.

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

NPts: int#

‘property(…)’

Max number of points to expect in load shape vectors. This gets reset to the number of multiplier values found (in files only) if less than specified.

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

property Name: str#
Normalize(flags: altdss.enums.SetterFlags = 0)#

Shortcut to Action(LoadShapeAction.Normalize)

PBase: float#

‘property(…)’

Base P value for normalization. Default is zero, meaning the peak will be used.

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

PMax: float#

‘property(…)’

kW value at the time of max power. Is automatically set upon reading in a loadshape. Use this property to override the value automatically computed or to retrieve the value computed.

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

PMult: altdss.types.Float64Array#

‘property(…)’

Synonym for “mult”.

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

PQCSVFile: str#

‘property(…)’

Switch input to a CSV text file containing (active, reactive) power (P, Q) multiplier pairs, one per row. If the interval=0, there should be 3 items on each line: (hour, Pmult, Qmult)

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

QBase: float#

‘property(…)’

Base Q value for normalization. Default is zero, meaning the peak will be used.

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

QMax: float#

‘property(…)’

kvar value at the time of max kW power. Is automatically set upon reading in a loadshape. Use this property to override the value automatically computed or to retrieve the value computed.

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

QMult: altdss.types.Float64Array#

‘property(…)’

Array of multiplier values for reactive power (Q). You can also use the syntax: qmult = (file=filename) !for text file one value per line qmult = (dblfile=filename) !for packed file of doubles qmult = (sngfile=filename) !for packed file of singles qmult = (file=MyCSVFile.csv, col=4, header=yes) !for multicolumn CSV files

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

SInterval: float#

‘property(…)’

Specify fixed interval in SECONDS. Alternate way to specify Interval property.

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

SngFile: str#

‘property(…)’

Switch input of active power load curve data to a binary file of singles containing (hour, mult) points, or simply (mult) values for fixed time interval data, packed one after another. NOTE: This action may reset the number of points to a lower value.

DSS property name: SngFile, DSS property index: 8.

SngSave(flags: altdss.enums.SetterFlags = 0)#

Shortcut to Action(LoadShapeAction.SngSave)

StdDev: float#

‘property(…)’

Standard deviation of active power multipliers. This is computed on demand the first time a value is needed. However, you may set it to another value independently.Is overwritten if you subsequently read in a curve

Used for Monte Carlo load simulations.

DSS property name: StdDev, DSS property index: 6.

UseActual: bool#

‘property(…)’

{Yes | No* | True | False*} If true, signifies to Load, Generator, Vsource, or other objects to use the return value as the actual kW, kvar, kV, or other value rather than a multiplier. Nominally for AMI Load data but may be used for other functions.

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

UseFloat32()#

If this loadshape is using float64/double precision internal data, use this function to convert to float32/single precision. If the data is not owned by the loadshape, this operation is not allowed.

UseFloat64()#

If this loadshape is using float32/single precision internal data, use this function to convert to float64/double precision. If the data is not owned by the loadshape, this operation is not allowed.

__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.LoadShape.LoadShapeProperties]) altdss.LoadShape.LoadShape#

Edit this LoadShape.

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.

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.LoadShape.LoadShapeBatch(api_util, **kwargs)#

Bases: altdss.Batch.DSSBatch, altdss.LoadShapeExtras.LoadShapeBatchMixin

Action(value: Union[AnyStr, int, altdss.enums.LoadShapeAction], flags: altdss.enums.SetterFlags = 0)#

{NORMALIZE | DblSave | SngSave} After defining load curve data, setting action=normalize will modify the multipliers so that the peak is 1.0. The mean and std deviation are recomputed.

Setting action=DblSave or SngSave will cause the present mult and qmult values to be written to either a packed file of double or single. The filename is the loadshape name. The mult array will have a “_P” appended on the file name and the qmult array, if it exists, will have “_Q” appended.

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

CSVFile: List[str]#

‘property(…)’

Switch input of active power load curve data to a CSV text file containing (hour, mult) points, or simply (mult) values for fixed time interval data, one per line. NOTE: This action may reset the number of points to a lower value.

DSS property name: CSVFile, DSS property index: 7.

DblFile: List[str]#

‘property(…)’

Switch input of active power load curve data to a binary file of doubles containing (hour, mult) points, or simply (mult) values for fixed time interval data, packed one after another. NOTE: This action may reset the number of points to a lower value.

DSS property name: DblFile, DSS property index: 9.

DblSave(flags: altdss.enums.SetterFlags = 0)#

Shortcut to Action(LoadShapeAction.DblSave)

FullName() List[str]#

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

Hour: List[altdss.types.Float64Array]#

‘property(…)’

Array of hour values. Only necessary to define for variable interval data (Interval=0). If you set Interval>0 to denote fixed interval data, DO NOT USE THIS PROPERTY. You can also use the syntax: hour = (file=filename) !for text file one value per line hour = (dblfile=filename) !for packed file of doubles hour = (sngfile=filename) !for packed file of singles

DSS property name: Hour, DSS property index: 4.

Interpolation: altdss.ArrayProxy.BatchInt32ArrayProxy#

‘property(…)’

{AVG* | EDGE} Defines the interpolation method used for connecting distant dots within the load shape.

By default is AVG (average), which will return a multiplier for missing intervals based on the closest multiplier in time. EDGE interpolation keeps the last known value for missing intervals until the next defined multiplier arrives.

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

Interpolation_str: List[str]#

‘property(…)’

{AVG* | EDGE} Defines the interpolation method used for connecting distant dots within the load shape.

By default is AVG (average), which will return a multiplier for missing intervals based on the closest multiplier in time. EDGE interpolation keeps the last known value for missing intervals until the next defined multiplier arrives.

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

Interval: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Time interval for fixed interval data, hrs. Default = 1. If Interval = 0 then time data (in hours) may be at either regular or irregular intervals and time value must be specified using either the Hour property or input files. Then values are interpolated when Interval=0, but not for fixed interval data.

See also “sinterval” and “minterval”.

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

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

MInterval: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Specify fixed interval in MINUTES. Alternate way to specify Interval property.

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

Mean: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Mean of the active power multipliers. This is computed on demand the first time a value is needed. However, you may set it to another value independently. Used for Monte Carlo load simulations.

DSS property name: Mean, DSS property index: 5.

MemoryMapping: List[bool]#

‘property(…)’

{Yes | No* | True | False*} Enables the memory mapping functionality for dealing with large amounts of load shapes. By default is False. Use it to accelerate the model loading when the containing a large number of load shapes.

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

NPts: altdss.ArrayProxy.BatchInt32ArrayProxy#

‘property(…)’

Max number of points to expect in load shape vectors. This gets reset to the number of multiplier values found (in files only) if less than specified.

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

property Name: List[str]#
Normalize(flags: altdss.enums.SetterFlags = 0)#

Shortcut to Action(LoadShapeAction.Normalize)

PBase: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Base P value for normalization. Default is zero, meaning the peak will be used.

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

PMax: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

kW value at the time of max power. Is automatically set upon reading in a loadshape. Use this property to override the value automatically computed or to retrieve the value computed.

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

PMult: List[altdss.types.Float64Array]#

‘property(…)’

Synonym for “mult”.

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

PQCSVFile: List[str]#

‘property(…)’

Switch input to a CSV text file containing (active, reactive) power (P, Q) multiplier pairs, one per row. If the interval=0, there should be 3 items on each line: (hour, Pmult, Qmult)

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

QBase: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Base Q value for normalization. Default is zero, meaning the peak will be used.

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

QMax: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

kvar value at the time of max kW power. Is automatically set upon reading in a loadshape. Use this property to override the value automatically computed or to retrieve the value computed.

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

QMult: List[altdss.types.Float64Array]#

‘property(…)’

Array of multiplier values for reactive power (Q). You can also use the syntax: qmult = (file=filename) !for text file one value per line qmult = (dblfile=filename) !for packed file of doubles qmult = (sngfile=filename) !for packed file of singles qmult = (file=MyCSVFile.csv, col=4, header=yes) !for multicolumn CSV files

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

SInterval: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Specify fixed interval in SECONDS. Alternate way to specify Interval property.

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

SngFile: List[str]#

‘property(…)’

Switch input of active power load curve data to a binary file of singles containing (hour, mult) points, or simply (mult) values for fixed time interval data, packed one after another. NOTE: This action may reset the number of points to a lower value.

DSS property name: SngFile, DSS property index: 8.

SngSave(flags: altdss.enums.SetterFlags = 0)#

Shortcut to Action(LoadShapeAction.SngSave)

StdDev: altdss.ArrayProxy.BatchFloat64ArrayProxy#

‘property(…)’

Standard deviation of active power multipliers. This is computed on demand the first time a value is needed. However, you may set it to another value independently.Is overwritten if you subsequently read in a curve

Used for Monte Carlo load simulations.

DSS property name: StdDev, DSS property index: 6.

UseActual: List[bool]#

‘property(…)’

{Yes | No* | True | False*} If true, signifies to Load, Generator, Vsource, or other objects to use the return value as the actual kW, kvar, kV, or other value rather than a multiplier. Nominally for AMI Load data but may be used for other functions.

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

UseFloat32()#

If the loadshapes are using float64/double precision internal data, use this function to convert to float32/single precision. If the data is not owned by the loadshape, this operation is not allowed.

UseFloat64()#

If the loadshape are using float32/single precision internal data, use this function to convert to float64/double precision. If the data is not owned by the loadshape, this operation is not allowed.

__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.LoadShape.LoadShapeBatchProperties]) altdss.LoadShape.LoadShapeBatch#

Edit this LoadShape 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.

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.LoadShape.LoadShapeBatchProperties#

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)

Action: Union[AnyStr, int, altdss.enums.LoadShapeAction]#

None

CSVFile: Union[AnyStr, List[AnyStr]]#

None

DblFile: Union[AnyStr, List[AnyStr]]#

None

Hour: altdss.types.Float64Array#

None

Interpolation: Union[AnyStr, int, altdss.enums.LoadShapeInterpolation, List[AnyStr], List[int], List[altdss.enums.LoadShapeInterpolation], altdss.types.Int32Array]#

None

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

None

Like: AnyStr#

None

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

None

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

None

MemoryMapping: bool#

None

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

None

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

None

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

None

PMult: altdss.types.Float64Array#

None

PQCSVFile: Union[AnyStr, List[AnyStr]]#

None

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

None

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

None

QMult: altdss.types.Float64Array#

None

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

None

SngFile: Union[AnyStr, List[AnyStr]]#

None

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

None

UseActual: bool#

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.

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.LoadShape.LoadShapeProperties#

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)

Action: Union[AnyStr, int, altdss.enums.LoadShapeAction]#

None

CSVFile: AnyStr#

None

DblFile: AnyStr#

None

Hour: altdss.types.Float64Array#

None

Interpolation: Union[AnyStr, int, altdss.enums.LoadShapeInterpolation]#

None

Interval: float#

None

Like: AnyStr#

None

MInterval: float#

None

Mean: float#

None

MemoryMapping: bool#

None

NPts: int#

None

PBase: float#

None

PMax: float#

None

PMult: altdss.types.Float64Array#

None

PQCSVFile: AnyStr#

None

QBase: float#

None

QMax: float#

None

QMult: altdss.types.Float64Array#

None

SInterval: float#

None

SngFile: AnyStr#

None

StdDev: float#

None

UseActual: bool#

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.

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