dragonfly_energy.opendss.powerline module

PowerLine in OpenDSS.

class dragonfly_energy.opendss.powerline.PowerLine(identifier, wires, heights, relative_xs, phases, phase_count=None, nominal_voltage=None)[source]

Bases: object

Represents the properties of a power line in OpenDSS.

Parameters
  • identifier – Text string for a unique wire property ID. Must contain only characters that are acceptable in OpenDSS. This will be used to identify the object across the exported geoJSON and OpenDSS files.

  • wires – An array of Wire objects for the wires contained within the power line.

  • heights – An array of numbers that align with the wires and denote the height of the wire above the ground in meters. Negative values indicate wires below ground.

  • relative_xs – An array of numbers that align with the wires and denote the X offset relative to the wire line geometry in meters. For convenience, one of the conductors in a given wire is usually assigned the 0 position.

  • phases – An array of text values that align with the wires and denote the phases of the wire. Must be one of the following values (A, B, C, N, S1, S2).

  • phase_count – An optional integer for the number of phases carried along the power line. If None, it wil be inferred from the phases with only phases A, B, C considered distinct from one another. (Default: None).

  • nominal_voltage – An optional number for the nominal voltage along the power line. This is not required for OpenDSS simulation since this value can be inferred from surrounding transformers and substations but it it sometimes useful to assign a value directly to the power line object. (Default: None).

Properties:
  • identifier

  • display_name

  • wires

  • heights

  • relative_xs

  • phases

  • phase_count

  • nominal_voltage

  • wire_count

  • wire_ids

ToString()[source]

Overwrite .NET ToString method.

duplicate()[source]

Get a copy of this object.

classmethod from_dict(data)[source]

Create a PowerLine object from a dictionary.

Parameters

data – A dictionary representation of a PowerLine object in the format below.

{
'type': 'PowerLine',
'identifier': '3P_OH_AL_ACSR_477kcmil_Hawk_12_47_0',  # unique identifier
'wires': [{}],  # a list of wire definitions for the wires in the line
'heights': [16],  # height of the wire above the ground in meters
'relative_x': [0],  # number for the x offset from the wire line in meters
'phases': ['A']  # text for the phases of the wire
}
classmethod from_dict_abridged(data, wires)[source]

Create a PowerLine object from a dictionary.

Parameters
  • data – A dictionary representation of a PowerLine object in the format below.

  • wires – A dictionary with identifiers of wires as keys and Python wire objects as values.

{
'type': 'PowerLine',
'identifier': '3P_OH_AL_ACSR_477kcmil_Hawk_12_47_0',  # unique identifier
'wires': [''],  # a list of wire identifiers for the wires in the line
'heights': [16],  # height of the wire above the ground in meters
'relative_x': [0],  # number for the x offset from the wire line in meters
'phases': ['A']  # text for the phases of the wire
}
classmethod from_electrical_database_dict(data, wires)[source]

Create a PowerLine from an dictionary as it appears in a database.json.

Parameters
  • data – A dictionary representation of a PowerLine object in the format below.

  • wires – A dictionary with identifiers of wires as keys and Python wire objects as values.

{
'Name': '3P_OH_AL_ACSR_336kcmil_Merlin_12_47_0',  # unique identifier
"Line geometry": [
        {
            "wire": "OH ACSR 336kcmil",
            "phase": "A",
            "x (m)": 0.0,
            "height (m)": 10
        },
        {
            "wire": "OH ACSR 336kcmil",
            "phase": "B",
            "x (m)": 0.304,
            "height (m)": 10
        }
    ]
}
lock()
to_dict(abridged=False)[source]

Get PowerLine dictionary.

Parameters

abridged – Boolean to note whether the full dictionary describing the object should be returned (False) or just an abridged version (True), which only specifies the identifiers of wires. (Default: False).

to_electrical_database_dict()[source]

Get Wire as it should appear in the URBANopt database.json.

unlock()
VALID_PHASES = ('A', 'B', 'C', 'N', 'S1', 'S2')
property display_name

Get or set a string for the object name without any character restrictions.

If not set, this will be equal to the identifier.

property heights

Get or set an array of numbers for the heights above the ground in meters.

property identifier

Get or set a text string for the unique object identifier.

property nominal_voltage

Get or set a number for nominal voltage of the power line in kiloVolts.

property phase_count

Get or set an integer for the number of phases carried along the line.

property phases

Get or set an array of text for the phases of the wires.

property relative_xs

Get or set a array of numbers for the X offset relative to the wire in meters.

property wire_count

Get an integer for the number of wires in the power line.

property wire_ids

Get a list of wire identifiers in the power line.

property wires

Get or set an array of Wire objects for the phases of the wires.