Quickstart

Create a Power Client object with:

>>> from cognite.power import PowerClient
>>> c = CogniteClient(api_key="<your-api-key>", project="<your project>",)

Read more about the PowerClient and the functionality it exposes below.

SDK Methods

PowerClient

class cognite.power.PowerClient(base_url=None, project=None, client_name='Cognite Power SDK', *args, **kwargs)

Main entrypoint into Cognite Power SDK. All services are made available through this object.

In addition to all functionality from the basic Cognite Python SDK, includes APIs for:

  • .ac_line_segments
  • .substations
  • .synchronous_machines
  • .hydro_generating_units
  • .wind_generating_units
  • .thermal_generating_units
  • .power_transformers
  • .power_transformer_ends
  • .power_transfer_corridors
  • .busbar_sections
  • .conform_loads
  • .nonconform_loads
  • .shunt_compensators
  • .static_var_compensators
  • .peterson_coils
  • .terminals
  • .analogs
  • .current_limits
  • .temperature_curves
  • .temperature_curve_dependent_limits
  • .temperature_curve_data
  • .operational_limit_sets
  • .operational_limit_types
  • .power_assets: does not filter by type.

Each of which is a GenericPowerAPI which returns assets of the relevant type(s).

Generic Power API

These methods typically return classes which correspond to their specific API, for example, client.power_transformers.list() will return a PowerAssetList with PowerTransformer.

Retrieve an asset by name

GenericPowerAPI.retrieve_name(name: Union[List[str], str], asset_type: str = None, bidding_area: Union[str, List[str]] = None) → Union[cognite.power.data_classes.PowerAsset, cognite.power.data_classes.PowerAssetList]

Retrieve one or more assets by exact name match. Fails if not exactly one asset is found.

Parameters:
  • name (Union[List[str], str]) – One or more names to search for.
  • asset_type (Union[str, List[str]]) – filter on these asset types. Automatically populated for specific APIs
  • bidding_area (Union[str, List[str]]) – filters on assets being in the bidding areas with this name.
Returns:

The requested asset(s).

Return type:

Union[PowerAsset,PowerAssetList]

List assets

GenericPowerAPI.list(grid_type: str = None, base_voltage: Iterable[T_co] = None, bidding_area: Union[str, List[str]] = None, asset_type: Union[str, List[str]] = None, limit: int = None, **kwargs) → cognite.power.data_classes.PowerAssetList

Lists power assets. Supports all parameters as the normal list function in addition to some power specific ones.

Parameters:
  • grid_type (str) – filters on Equipment.gridType. Can give “GridTypeKind.regional” or just “regional” etc.
  • base_voltage (Iterable) – filters on BaseVoltage_nominalVoltage in the given range or list.
  • bidding_area (Union[str, List[str]]) – filters on assets being in the bidding areas with this (case-insensitive) name.
  • asset_type (Union[str, List[str]]) – filter on these asset types. Automatically populated for specific APIs
  • kwargs – all other parameters for the normal AssetsAPI.list method
Returns:

List of the requested assets.

Return type:

PowerAssetList

Search for assets

GenericPowerAPI.search(name: str = None, grid_type: str = None, base_voltage: Iterable[T_co] = None, bidding_area: Union[str, List[str]] = None, asset_type: Union[str, List[str]] = None, limit: int = None, **kwargs) → cognite.power.data_classes.PowerAssetList

Search power assets. Supports all parameters as the normal search function in addition to some power specific ones.

Parameters:
  • name (str) – Fuzzy search on name.
  • grid_type (str) – filters on Equipment.gridType. Can give “GridTypeKind.regional” or just “regional” etc.
  • base_voltage (Iterable) – filters on BaseVoltage_nominalVoltage in the given range or list.
  • bidding_area (Union[str, List[str]]) – filters on assets being in the bidding areas with this name.
  • asset_type (Union[str, List[str]]) – filter on these asset types. Automatically populated for specific APIs
  • kwargs – all other parameters for the normal AssetsAPI.list method
Returns:

List of the requested assets.

Return type:

PowerAssetList

Base Data classes

PowerAsset

class cognite.power.data_classes.PowerAsset(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.client.data_classes.assets.Asset

Extended asset class for Power related resources

analogs()

Shortcut for finding the associated Analogs (via it’s terminals)

base_voltage

Gets the asset’s base voltage as a float, or None if it has no base voltage

grid_type

Gets the asset’s grid type, without ‘GridTypeKind.’ prefix.

metadata_value(key: str) → Optional[str]

Safe way of getting a metadata value, returns None if metadata or key does not exist

relationship_sources(*args, **kwargs)

Shortcut for finding all assets that are a source, with the current asset as a target - see PowerAssetList.relationship_sources for arguments

relationship_targets(*args, **kwargs)

Shortcut for finding all assets that are a target, with the current asset as a source - see PowerAssetList.relationship_targets for arguments

time_series(measurement_type: Union[str, List[str]] = None, timeseries_type: Union[str, List[str]] = None, unit: str = None, **kwargs)

Retrieves the time series in the asset subtree.

Parameters:
  • measurement_type – Type of measurement, e.g. “ThreePhaseActivePower”, or list thereof
  • timeseries_type – Type of time series, e.g. “estimated_value”, or list thereof
  • unit – Unit of the time series, e.g. ‘kV’.
  • kwargs – Other metadata filters
type

Shortcut for it’s metadata-defined type (e.g. ‘TransformerEnd’)

PowerAssetList

class cognite.power.data_classes.PowerAssetList(resources: List[Any], cognite_client=None)

Bases: cognite.client.data_classes.assets.AssetList

ac_line_segments(base_voltage: Iterable[T_co] = None, grid_type: Optional[str] = None)

Shortcut for finding the associated ACLineSegment for a list of PowerTransformer, Substation or Terminal

analogs()

Shortcut for finding the associated Analogs. Only works when applied directly to a list of Terminals.

connected_substations(level: int = 1, exact: bool = False, include_lines=False, base_voltage: Iterable[T_co] = None, grid_type: Optional[str] = None) → cognite.power.data_classes.PowerAssetList

Retrieves substations connected within level connections through ac_line_segments with base voltages within the specified range

Parameters:
  • level – number of connections to traverse
  • exact – only return substations whose minimum distance is exactly level
  • include_lines – also return ACLineSegments that make up the connections. Can not be used in combination with exact.
  • base_voltage – only consider ACLineSegments with these base voltage
  • grid_type – only consider ACLineSegments of this grid type
current_limits_overview() → pandas.core.frame.DataFrame

See ACLineSegment#current_limits_overview

filter(base_voltage: Iterable[T_co] = None, grid_type: str = None, x_filter: Callable = None) → cognite.power.data_classes.PowerAssetList

Filters list by grid type, base_voltage or arbitrary function of asset->bool

generating_units(power_type: Union[str, List[str], None] = None) → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated GeneratingUnit for a list of Substations

Parameters:power_type – type of generating unit, default is [“HydroGeneratingUnit”,”WindGeneratingUnit”,”ThermalGeneratingUnit”]
hydro_generating_units() → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated HydroGeneratingUnits for a list of Substations

load_duration_curve(start, end='now', terminal=1, measurement_type='ThreePhaseActivePower', timeseries_type='estimated_value', granularity='1h', dropna=True, index_granularity=0.1) → pandas.core.frame.DataFrame

See ACLineSegment#load_duration_curve

opposite_ends()

Shortcut for finding the opposite ends for a list of PowerTransformerEnd or Terminals

power_transformer_ends(end_number: Union[int, Iterable[T_co], None] = None, base_voltage: Optional[Iterable[T_co]] = None) → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated PowerTransformerEnds for a list of PowerTransformers or Terminals

Parameters:
  • end_number (Union[int, Iterable]) – filter on transformer end number
  • base_voltage (Iterable) – filter on base voltage
Returns:

List of PowerTransformerEnd

Return type:

PowerAssetList

power_transformers(grid_type: Optional[str] = None) → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated PowerTransformer for a list of PowerTransformerEnd or Substation

relationship_sources(*args, **kwargs) → cognite.power.data_classes.PowerAssetList

Shortcut for finding all assets that are a source, with the current assets as targets. See PowerAssetList.relationships for list of arguments.

relationship_targets(*args, **kwargs) → cognite.power.data_classes.PowerAssetList

Shortcut for finding all assets that are a target, with the current assets as sources. See PowerAssetList.relationships for list of arguments.

relationships(power_type: str = None, label: str = 'belongsTo', base_voltage: Optional[Iterable[T_co]] = None, grid_type: Optional[str] = None, x_filter: Optional[Callable] = None, _source_external_ids=None, _target_external_ids=None) → cognite.power.data_classes.PowerAssetList

Internal function responsible for finding assets connected by relationships.

Parameters:
  • power_type (str) – Type of asset, e.g. PowerTransformer
  • label (str) – Label of the relationship, typically belongsTo or connectsTo
  • base_voltage (str) –
  • grid_type (str) –
  • x_filter (Callable) – Other filter to be applied to the asset, returns those for which x_filter(asset) is truthy after converting the asset to the proper type
  • _targets (_sources,) – internally passed by relationship_sources/relationship_targets
Returns:

list of connected assets

Return type:

PowerAssetList

split_by_type() → Dict[str, cognite.power.data_classes.PowerAssetList]

Returns a dictionary of asset type-> list of assets

substations() → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated Substations for a list of PowerTransformer, GeneratingUnit, (Non)ConformLoad, ACLineSegment, BusbarSection Shunt/StaticVarCompensator, PetersenCoil or Terminal

synchronous_machines() → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated SynchronousMachines for a list of generating units. NB: does not check types.

terminals(sequence_number: Union[int, Iterable[T_co], None] = None)

Shortcut for finding the associated Terminals. Works on lists with mixed asset types

thermal_generating_units() → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated ThermalGeneratingUnits for a list of Substations

time_series(measurement_type: Union[str, List[str]] = None, timeseries_type: Union[str, List[str]] = None, unit: str = None, **kwargs) → cognite.client.data_classes.time_series.TimeSeriesList

Retrieves the time series in the asset subtrees.

Parameters:
  • measurement_type – Type of measurement, e.g. “ThreePhaseActivePower”, or list thereof
  • timeseries_type – Type of time series, e.g. “estimated_value”, or list thereof
  • unit – Unit of the time series, e.g. ‘kV’.
  • kwargs – Other metadata filters
type

Type of the list of assets, will raise a MixedPowerAssetListException if the list contains several asset types.

wind_generating_units() → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated WindGeneratingUnits for a list of Substations

Specific Power Asset Data classes

ACLineSegment

class cognite.power.data_classes.ACLineSegment(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset, cognite.power.data_classes.LoadDurationMixin

current_limits_overview() → pandas.core.frame.DataFrame

Returns a dataframe which combines data from temperature_curve_data and current_limits

substations() → cognite.power.data_classes.PowerAssetList

Shortcut for finding the connected substations

terminals(sequence_number: Union[int, Iterable[T_co], None] = None) → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated Terminals

Substation

class cognite.power.data_classes.Substation(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

ac_line_segments(base_voltage: Iterable[T_co] = None, grid_type: Optional[str] = None) → cognite.power.data_classes.PowerAssetList

Shortcut for finding the connected ACLineSegments for a substation

connected_substations(*args, **kwargs) → cognite.power.data_classes.PowerAssetList

See PowerAssetList.connected_substations

distance(target: cognite.power.data_classes.Substation) → int

Shortest distance to target substation. Not efficient. Returns infinity if there is no connection.

generating_units(power_type: Union[str, List[str], None] = None) → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated GeneratingUnit for a Substation

Parameters:power_type – type of generating unit, default is [“HydroGeneratingUnit”,”WindGeneratingUnit”,”ThermalGeneratingUnit”]
hydro_generating_units() → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated HydroGeneratingUnits for a Substation

power_transformers(grid_type: Optional[str] = None) → cognite.power.data_classes.PowerAssetList

Shortcut for finding the PowerTransformers for a Substation

terminals(sequence_number: Union[int, Iterable[T_co], None] = None) → cognite.power.data_classes.PowerAssetList

Shortcut for finding the terminals for a substation

thermal_generating_units() → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated ThermalGeneratingUnits for a list of Substations

wind_generating_units() → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated WindGeneratingUnits for a Substation

PowerTransformer

class cognite.power.data_classes.PowerTransformer(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

power_transformer_ends(end_number: Union[int, Iterable[T_co], None] = None, base_voltage: Iterable[T_co] = None) → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated PowerTransformerEnds for a PowerTransformer :param end_number: filter on transformer end number

substation() → cognite.power.data_classes.Substation

Shortcut for finding the substation for a PowerTransformer

terminals(sequence_number: Union[int, Iterable[T_co], None] = None) → cognite.power.data_classes.PowerAssetList

Shortcut for finding the terminals on all the PowerTransformerEnds for a PowerTransformer

PowerTransformerEnd

class cognite.power.data_classes.PowerTransformerEnd(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset, cognite.power.data_classes.LoadDurationMixin

end_number

Gets the PowerTransformerEnd’s end number as an int.

grid_type

Gets the asset’s grid type, without ‘GridTypeKind.’ prefix.

opposite_end()

Gets the PowerTransformerEnd’s opposite end (end number 1->2 and 2->1)

power_transformer() → cognite.power.data_classes.PowerTransformer

Shortcut for finding the PowerTransformer for a PowerTransformerEnd

substation() → cognite.power.data_classes.Substation

Shortcut for finding the substation for a PowerTransformerEnd

terminals(sequence_number: Union[int, Iterable[T_co], None] = None) → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated Terminals

PowerTransferCorridor

class cognite.power.data_classes.PowerTransferCorridor(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

synchronous_machines() → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated SynchronousMachines for a PowerTransferCorridor..

terminals(sequence_number: Union[int, Iterable[T_co], None] = None) → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated Terminals

SynchronousMachine

class cognite.power.data_classes.SynchronousMachine(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset, cognite.power.data_classes.LoadDurationMixin

generating_unit() → cognite.power.data_classes.GeneratingUnit

Shortcut for finding the associated GeneratingUnit for a SynchronousMachine

substation() → cognite.power.data_classes.Substation

Shortcut for finding the associated substation for a SynchronousMachine

terminals(sequence_number: Union[int, Iterable[T_co], None] = None)

Shortcut for finding the associated Terminals

HydroGeneratingUnit

class cognite.power.data_classes.HydroGeneratingUnit(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.GeneratingUnit

WindGeneratingUnit

class cognite.power.data_classes.WindGeneratingUnit(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.GeneratingUnit

BusbarSection

class cognite.power.data_classes.BusbarSection(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

substation() → cognite.power.data_classes.Substation

Shortcut for finding the substation for a PowerTransformer

ConformLoad

class cognite.power.data_classes.ConformLoad(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

NonConformLoad

class cognite.power.data_classes.NonConformLoad(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

NonConformLoad

class cognite.power.data_classes.NonConformLoad(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

PetersenCoil

class cognite.power.data_classes.PetersenCoil(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

substation() → cognite.power.data_classes.Substation

Shortcut for finding the substation for a PetersenCoil

ShuntCompensator

class cognite.power.data_classes.ShuntCompensator(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

substation() → cognite.power.data_classes.Substation

Shortcut for finding the substation for a ShuntCompensator

StaticVarCompensator

class cognite.power.data_classes.StaticVarCompensator(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

substation() → cognite.power.data_classes.Substation

Shortcut for finding the substation for a StaticVarCompensator

Terminal

class cognite.power.data_classes.Terminal(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

analogs() → cognite.power.data_classes.PowerAssetList

Shortcut for finding the associated Analogs for a Terminal

opposite_end() → cognite.power.data_classes.Terminal

Retrieves the opposite end (Sequence number 1 to 2 and vice versa), works on Terminals associated with both ACLineSegment and PowerTransformerEnd

sequence_number

Gets the terminal’s sequence number as an int.

Returns:The sequence number
Return type:Optional[int]

Analog

class cognite.power.data_classes.Analog(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

OperationalLimitSet

class cognite.power.data_classes.OperationalLimitSet(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

OperationalLimitType

class cognite.power.data_classes.OperationalLimitType(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

TemperatureCurve

class cognite.power.data_classes.TemperatureCurve(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

TemperatureCurveData

class cognite.power.data_classes.TemperatureCurveData(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

TemperatureCurveDependentLimit

class cognite.power.data_classes.TemperatureCurveDependentLimit(external_id: str = None, name: str = None, parent_id: int = None, parent_external_id: str = None, description: str = None, data_set_id: int = None, metadata: Dict[str, str] = None, source: str = None, labels: List[cognite.client.data_classes.labels.Label] = None, id: int = None, created_time: int = None, last_updated_time: int = None, root_id: int = None, aggregates: Union[Dict[str, Any], cognite.client.data_classes.assets.AggregateResultItem] = None, cognite_client=None)

Bases: cognite.power.data_classes.PowerAsset

Power Corridor

PowerCorridor

class cognite.power.power_corridor.PowerCorridor(items: List[cognite.power.power_corridor.PowerCorridorComponent], cognite_client=None)

Bases: cognite.client.data_classes._base.CogniteResourceList

calculate(start: Union[str, datetime.datetime], end: Union[str, datetime.datetime] = 'now', aggregates: Iterable[T_co] = ('average', 'max'), granularity: str = '10m', thresholds: Dict[str, float] = None) → pandas.core.frame.DataFrame

Calculates a dataframe for a PowerCorridor. The results are approximated as sums of aggregates.

PowerCorridorComponent

class cognite.power.power_corridor.PowerCorridorComponent(asset: cognite.power.data_classes.PowerAsset, sequence_number, fraction=1.0, measurement_type='ThreePhaseActivePower', timeseries_type='estimated_value')

Bases: object

Exceptions

exception cognite.power.exceptions.MixedPowerAssetListException

Bases: Exception

exception cognite.power.exceptions.SinglePowerAssetExpected

Bases: Exception

exception cognite.power.exceptions.WrongPowerTypeError

Bases: Exception

Power Graph

Initialize a PowerGraph with all assets using client.initialize_power_graph(). A PowerGraph is also initialized automatically when a PowerArea is created

PowerGraph

class cognite.power.power_graph.PowerGraph(cognite_client)

Bases: object

PowerArea

class cognite.power.power_area.PowerArea(cognite_client, substations: List[Union[cognite.power.data_classes.Substation, str]], power_graph)

Bases: object

Describes the electrical grid in a connected set of substations.

ac_line_segments() → cognite.power.data_classes.PowerAssetList

Returns the list of ACLineSegments in the graph

draw(labels='fixed', position='kamada', height=None)

Plots substations and ac line segments.

Parameters:
  • labels – ‘fixed’ to label by name, otherwise only shown on hovering over node.
  • positionsource to take positions from the assets xPosition/yPosition. project to take positions from source and project them to meters east/north. spring for a networkx spring location. kamada for a networkx kamada-kawai location.
  • height – figure height (width is set based on fixed aspect ratio)
draw_flow(labels='fixed', position='kamada', height=None, timeseries_type='estimated_value', granularity='1h', date: Optional[numpy.datetime64] = None)

Plots flow in area.

Parameters:
  • labels,position,height – as in draw
  • timeseries_type – type of time series to retrieve, i.e. value/estimated_value.
  • granularity – time step at which to average values over, as in the Python SDK retrieve_dataframe function.
  • date – datetime object at which to visualize flow, use None for now.
draw_with_map()

Plots substations and ac line segments overlayed on a world map

expand_area(level=1, grid_type: str = None, base_voltage: Iterable[T_co] = None) → cognite.power.power_area.PowerArea

Expand the area by following line segments level times.

classmethod from_interface(cognite_client, power_graph, ac_line_segments: List[Union[cognite.power.data_classes.ACLineSegment, str, Tuple[str, str]]], interior_station: Union[cognite.power.data_classes.Substation, str], grid_type: str = None, base_voltage: Iterable[T_co] = None)

Creates a power area from a list of ac line segments, interpreted as the interface of the area, as well as an interior substation

interface(base_voltage: Iterable[T_co] = None) → cognite.power.data_classes.PowerAssetList

Return the list of ACLineSegments going in/out of the area.

interface_terminals(base_voltage: Iterable[T_co] = None) → Tuple[cognite.power.data_classes.PowerAssetList, cognite.power.data_classes.PowerAssetList]

Return the lists of Terminals on the inside and outside of the interface going in/out of the area.

substations() → cognite.power.data_classes.PowerAssetList

Returns the list of Substations in the graph