Energy Market

Note

This is the complete exposed API. Not all classes and functions are meant for the End-user, the documentation is a work in progress

Core

Shyft Open Source Energy Market model core

class shyft.energy_market.core.Catchment(self: shyft.energy_market.Catchment, id: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.HydroPowerSystem)

Bases: pybind11_object

Catchment descriptive component, suitable for energy market long-term and/or short term managment. This component usually would contain usable view of the much more details shyft.hydrology region model

__init__(self: shyft.energy_market.Catchment, id: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.HydroPowerSystem) None
property custom
get_tsm_object(self: shyft.energy_market.Catchment, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property hps

returns the hydro power system this component is a part of

Type:

HydroPowerSystem

property id
property json
property name
property obj

a python object

Type:

object

property ts
class shyft.energy_market.core.CatchmentList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.CatchmentList) -> None

  2. __init__(self: shyft.energy_market.CatchmentList, arg0: shyft.energy_market.CatchmentList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.CatchmentList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.CatchmentList) -> None

  2. __init__(self: shyft.energy_market.CatchmentList, arg0: shyft.energy_market.CatchmentList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.CatchmentList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.CatchmentList, x: shyft.energy_market.Catchment) None

Add an item to the end of the list

clear(self: shyft.energy_market.CatchmentList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.CatchmentList, L: shyft.energy_market.CatchmentList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.CatchmentList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.CatchmentList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.Catchment) None

Insert an item at a given position.

items(self: shyft.energy_market.CatchmentList) list[tuple[str, shyft.energy_market.Catchment]]
keys(self: shyft.energy_market.CatchmentList) list[str]
pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.CatchmentList) -> shyft.energy_market.Catchment

Remove and return the last item

  1. pop(self: shyft.energy_market.CatchmentList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.Catchment

Remove and return the item at index i

size(self: shyft.energy_market.CatchmentList) int
values(self: shyft.energy_market.CatchmentList) shyft.energy_market.CatchmentList
class shyft.energy_market.core.Client(self: shyft.energy_market.Client, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0)

Bases: pybind11_object

The client-api for the energy_market

Creates a python client that can communicate with the corresponding server

__init__(self: shyft.energy_market.Client, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0) None

Creates a python client that can communicate with the corresponding server

close(self: shyft.energy_market.Client) None

Close the connection. It will automatically reopen if needed.

get_model_infos(self: shyft.energy_market.Client, mids: collections.abc.Sequence[SupportsInt | SupportsIndex], created_in: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.ModelInfo]

returns all or selected model-info objects based on model-identifiers(mids)

Parameters:
  • mids (IntVector) – empty = all, or a list of known exisiting model-identifiers

  • created_in (UtcPeriod) – For which period you are interested in model-infos.

Returns:

model_infos. Strongly typed list of ModelInfo

Return type:

ModelInfoVector

property host_port

Endpoint network address of the remote server.

Type:

str

property is_open

If the connection to the remote server is (still) open.

Type:

bool

property operation_timeout_ms

Operation timeout for remote server operations, in number milliseconds.

Type:

int

read_model(self: shyft.energy_market.Client, mid: SupportsInt | SupportsIndex) shyft.energy_market.Model

Read and return the model for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting model from the server

Return type:

Model

read_models(self: shyft.energy_market.Client, mids: collections.abc.Sequence[SupportsInt | SupportsIndex]) list[shyft.energy_market.Model]

Read and return the model for specified model-identifier (mid)

Parameters:

mids (list[int]) – A strongly typed list of ints, the model-identifers for the wanted models

Returns:

  1. The resulting model from the server

Return type:

Model

property reconnect_count

Number of reconnects to the remote server that have been performed.

Type:

int

remove_model(self: shyft.energy_market.Client, mid: SupportsInt | SupportsIndex) int

Remove the specified model bymodel-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

ec. 0 or error-code?

Return type:

int

store_model(self: shyft.energy_market.Client, m: shyft.energy_market.Model, mi: shyft.time_series.ModelInfo) int

Store the model to backend, if m.id==0 then a new unique model-info is created and used

Parameters:
  • m (Model) – The model to store

  • mi (ModelInfo) – The model-info to store for the model

Returns:

mid. model-identifier for the stored model and model-info

Return type:

int

property timeout_ms

Timout for remote server operations, in number milliseconds.

Type:

int

update_model_info(self: shyft.energy_market.Client, mid: SupportsInt | SupportsIndex, mi: shyft.time_series.ModelInfo) bool

Update the model-info for specified model-identifier(mid)

Parameters:
  • mid (int) – model-identifer

  • mi (ModelInfo) – The new updated model-info

Returns:

ok. true if success

Return type:

bool

class shyft.energy_market.core.ConnectionRole(self: shyft.energy_market.ConnectionRole, value: SupportsInt | SupportsIndex)

Bases: pybind11_object

Members:

main

bypass

flood

input

__init__(self: shyft.energy_market.ConnectionRole, value: SupportsInt | SupportsIndex) None
bypass = <ConnectionRole.bypass: 1>
flood = <ConnectionRole.flood: 2>
input = <ConnectionRole.input: 3>
main = <ConnectionRole.main: 0>
ConnectionRole.name -> str
property value
class shyft.energy_market.core.Gate(self: shyft.energy_market.Gate, id: SupportsInt | SupportsIndex, name: str, json: str = '')

Bases: pybind11_object

A gate controls the amount of flow into the waterway by the gate-opening. In the case of tunnels, it’s usually either closed or open. For reservoir flood-routes, the gate should be used to model the volume-flood characteristics. The resulting flow through a waterway is a function of many factors, most imporant:

  • gate opening and gate-characteristics

  • upstream water-level

  • downstrem water-level(in some-cases)

  • waterway properties(might be state dependent)

__init__(self: shyft.energy_market.Gate, id: SupportsInt | SupportsIndex, name: str, json: str = '') None
property custom
get_tsm_object(self: shyft.energy_market.Gate, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property hps

returns the hydro power system this component is a part of

Type:

HydroPowerSystem

property id
property json
property name
property obj

a python object

Type:

object

property ts
property water_route

ref. to the waterway where this gate controls the flow

Type:

Waterway

property waterway

ref. to the waterway where this gate controls the flow

Type:

Waterway

class shyft.energy_market.core.GateList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.GateList) -> None

  2. __init__(self: shyft.energy_market.GateList, arg0: shyft.energy_market.GateList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.GateList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.GateList) -> None

  2. __init__(self: shyft.energy_market.GateList, arg0: shyft.energy_market.GateList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.GateList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.GateList, x: shyft.energy_market.Gate) None

Add an item to the end of the list

clear(self: shyft.energy_market.GateList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.GateList, L: shyft.energy_market.GateList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.GateList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.GateList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.Gate) None

Insert an item at a given position.

items(self: shyft.energy_market.GateList) list[tuple[str, shyft.energy_market.Gate]]
keys(self: shyft.energy_market.GateList) list[str]
pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.GateList) -> shyft.energy_market.Gate

Remove and return the last item

  1. pop(self: shyft.energy_market.GateList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.Gate

Remove and return the item at index i

size(self: shyft.energy_market.GateList) int
values(self: shyft.energy_market.GateList) shyft.energy_market.GateList
class shyft.energy_market.core.HydroComponent

Bases: pybind11_object

A hydro component keeps the common attributes and relational properties common for all components that can contain water

__init__(*args, **kwargs)
property custom
disconnect_from(self: shyft.energy_market.HydroComponent, other: shyft.energy_market.HydroComponent) None

disconnect from another component

property downstreams

list of hydro-components that are conceptually downstreams

Type:

HydroComponentList

equal_structure(self: shyft.energy_market.HydroComponent, other: shyft.energy_market.HydroComponent) bool

Returns true if the other object have the same interconnections to the close neighbors as self. The neighbors are identified by their .id attribute, and they must appear in the same role to be considered equal. E.g. if for a reservoir, a waterway is in role flood for self, and in role bypass for other, they are different connections.

Parameters:

() (other) – the other object, of same type, hydro component, to compare.

Returns:

bool. True if the other have same interconnections as self

get_tsm_object(self: shyft.energy_market.HydroComponent, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property hps

returns the hydro power system this component is a part of

Type:

HydroPowerSystem

property id
property json
property name
property obj

a python object

Type:

object

property ts
property upstreams

list of hydro-components that are conceptually upstreams

Type:

HydroComponentList

class shyft.energy_market.core.HydroComponentList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.HydroComponentList) -> None

  2. __init__(self: shyft.energy_market.HydroComponentList, arg0: shyft.energy_market.HydroComponentList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.HydroComponentList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.HydroComponentList) -> None

  2. __init__(self: shyft.energy_market.HydroComponentList, arg0: shyft.energy_market.HydroComponentList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.HydroComponentList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.HydroComponentList, x: shyft.energy_market.HydroComponent) None

Add an item to the end of the list

clear(self: shyft.energy_market.HydroComponentList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.HydroComponentList, L: shyft.energy_market.HydroComponentList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.HydroComponentList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.HydroComponentList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.HydroComponent) None

Insert an item at a given position.

items(self: shyft.energy_market.HydroComponentList) list[tuple[str, shyft.energy_market.HydroComponent]]
keys(self: shyft.energy_market.HydroComponentList) list[str]
pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.HydroComponentList) -> shyft.energy_market.HydroComponent

Remove and return the last item

  1. pop(self: shyft.energy_market.HydroComponentList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.HydroComponent

Remove and return the item at index i

size(self: shyft.energy_market.HydroComponentList) int
values(self: shyft.energy_market.HydroComponentList) shyft.energy_market.HydroComponentList
class shyft.energy_market.core.HydroConnection

Bases: pybind11_object

A hydro connection is the connection object that relate one hydro component to another. A hydro component have zero or more hydro connections, contained in upstream and downstream lists. If you are using the hydro system builder, there will always be a mutual/two way connection. That is, if a reservoir connects downstream to a tunell (in role main), then the tunell will have a upstream connection pointing to the reservoir (as in role input)

__init__(*args, **kwargs)
property has_target

true if valid/available target

Type:

bool

property role

role like main,bypass,flood,input

Type:

ConnectionRole

property target

target of the hydro-connection, Reservoir|Unit|Waterway

Type:

HydroComponent

shyft.energy_market.core.HydroConnectionList

alias of list

class shyft.energy_market.core.HydroGraphTraversal

Bases: pybind11_object

A collection of hydro operations

__init__(*args, **kwargs)
static extract_water_courses(hps: shyft.energy_market.HydroPowerSystem) shyft.energy_market.HydroPowerSystemList

extracts the sub-hydro system from a given hydro system

static get_path_between(*args, **kwargs)

Overloaded function.

  1. get_path_between(arg0: shyft.energy_market.HydroComponent, arg1: shyft.energy_market.HydroComponent, arg2: shyft.energy_market.ConnectionRole) -> shyft.energy_market.HydroComponentList

finds path between two hydro components

  1. get_path_between(arg0: shyft.energy_market.HydroComponent, arg1: shyft.energy_market.HydroComponent) -> shyft.energy_market.HydroComponentList

finds path between two hydro components

static get_path_to_ocean(*args, **kwargs)

Overloaded function.

  1. get_path_to_ocean(arg0: shyft.energy_market.HydroComponent, arg1: shyft.energy_market.ConnectionRole) -> shyft.energy_market.HydroComponentList

finds path to ocean for a given hydro component

  1. get_path_to_ocean(arg0: shyft.energy_market.HydroComponent) -> shyft.energy_market.HydroComponentList

finds path to ocean for a given hydro component

static is_connected(*args, **kwargs)

Overloaded function.

  1. is_connected(arg0: shyft.energy_market.HydroComponent, arg1: shyft.energy_market.HydroComponent, arg2: shyft.energy_market.ConnectionRole) -> bool

finds whether two hydro components are connected

  1. is_connected(arg0: shyft.energy_market.HydroComponent, arg1: shyft.energy_market.HydroComponent) -> bool

finds whether two hydro components are connected

static path_to_ocean(*args, **kwargs)

Overloaded function.

  1. path_to_ocean(arg0: shyft.energy_market.HydroComponentList, arg1: shyft.energy_market.ConnectionRole) -> None

finds path to ocean for a given hydro component

  1. path_to_ocean(arg0: shyft.energy_market.HydroComponentList) -> None

finds path to ocean for a given hydro component

class shyft.energy_market.core.HydroPowerSystem(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.HydroPowerSystem, name: str) -> None

creates an empty hydro power system with the specified name

  1. __init__(self: shyft.energy_market.HydroPowerSystem, id: typing.SupportsInt | typing.SupportsIndex, name: str, json: str = ‘’) -> None

creates a an empty new hydro power system with specified id and name and json str info

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.HydroPowerSystem, name: str) -> None

creates an empty hydro power system with the specified name

  1. __init__(self: shyft.energy_market.HydroPowerSystem, id: typing.SupportsInt | typing.SupportsIndex, name: str, json: str = ‘’) -> None

creates a an empty new hydro power system with specified id and name and json str info

property aggregates
property catchments
create_aggregate(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Unit
create_catchment(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Catchment

create and add catchment to the system

create_gate(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Gate
create_power_plant(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.PowerPlant
create_power_station(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.PowerPlant
create_reservoir(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Reservoir
create_river(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Waterway
create_tunnel(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Waterway
create_unit(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Unit
property created

The time when this system was created(you should specify it when you create it)

Type:

time

property custom
equal_content(self: shyft.energy_market.HydroPowerSystem, other_hps: shyft.energy_market.HydroPowerSystem) bool

returns true if alle the content of the hps are equal, same as the equal == operator, except that .id, .name .created at the top level is not compared

equal_structure(self: shyft.energy_market.HydroPowerSystem, other_hps: shyft.energy_market.HydroPowerSystem) bool

returns true if equal structure of identified objects, using the .id, but not comparing .name, .attributes etc., to the other

find_gate_by_id(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex) shyft.energy_market.Gate

returns object with specified id

find_gate_by_name(self: shyft.energy_market.HydroPowerSystem, name: str) shyft.energy_market.Gate

returns object that exactly matches name

find_power_plant_by_id(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex) shyft.energy_market.PowerPlant

returns object with specified id

find_power_plant_by_name(self: shyft.energy_market.HydroPowerSystem, name: str) shyft.energy_market.PowerPlant

returns object that exactly matches name

find_reservoir_by_id(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex) shyft.energy_market.Reservoir

returns object with specified id

find_reservoir_by_name(self: shyft.energy_market.HydroPowerSystem, name: str) shyft.energy_market.Reservoir

returns object that exactly matches name

find_unit_by_id(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex) shyft.energy_market.Unit

returns object with specified id

find_unit_by_name(self: shyft.energy_market.HydroPowerSystem, name: str) shyft.energy_market.Unit

returns object that exactly matches name

find_waterway_by_id(self: shyft.energy_market.HydroPowerSystem, id: SupportsInt | SupportsIndex) shyft.energy_market.Waterway

returns object with specified id

find_waterway_by_name(self: shyft.energy_market.HydroPowerSystem, name: str) shyft.energy_market.Waterway

returns object that exactly matches name

static from_blob(blob_string: shyft.time_series.ByteVector) shyft.energy_market.HydroPowerSystem

constructs a model from a blob_string previously created by the to_blob method

Parameters:

blob_string (string) – blob-formatted representation of the model, as create by the to_blob method

property gates

all the gates of the system

Type:

GateList

get_tsm_object(self: shyft.energy_market.HydroPowerSystem, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property model_area

returns the model area this hydro-power-system is a part of

See also

ModelArea

Type:

ModelArea

property name
property obj

a python object

Type:

object

property power_plants
property power_stations
property reservoirs
to_blob(self: shyft.energy_market.HydroPowerSystem) shyft.time_series.ByteVector

serialize the model into an blob

Returns:

blob. blob-serialized version of the model

Return type:

string

See also

from_blob

static to_blob_ref(arg0: shyft.energy_market.HydroPowerSystem) shyft.time_series.ByteVector

serialize the model into an blob

Returns:

blob. blob-serialized version of the model

Return type:

string

See also

from_blob

property ts
property units
property water_routes
property waterways
class shyft.energy_market.core.HydroPowerSystemBuilder(self: shyft.energy_market.HydroPowerSystemBuilder, hydro_power_system: shyft.energy_market.HydroPowerSystem)

Bases: pybind11_object

class to support building hydro-power-systems save and easy

__init__(self: shyft.energy_market.HydroPowerSystemBuilder, hydro_power_system: shyft.energy_market.HydroPowerSystem) None
create_aggregate(self: shyft.energy_market.HydroPowerSystemBuilder, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Unit

creates a new unit with the specified parameters

create_catchment(self: shyft.energy_market.HydroPowerSystemBuilder, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Catchment

create and add catchmment to the system

create_gate(self: shyft.energy_market.HydroPowerSystemBuilder, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Gate

create and add a gate to the system

create_power_plant(self: shyft.energy_market.HydroPowerSystemBuilder, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.PowerPlant

creates and adds a power plant to the system

create_power_station(self: shyft.energy_market.HydroPowerSystemBuilder, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.PowerPlant

creates and adds a power plant to the system

create_reservoir(self: shyft.energy_market.HydroPowerSystemBuilder, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Reservoir

creates and adds a reservoir to the system

create_river(self: shyft.energy_market.HydroPowerSystemBuilder, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Waterway

create and add river to the system

create_tunnel(self: shyft.energy_market.HydroPowerSystemBuilder, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Waterway

create and add river to the system

create_unit(self: shyft.energy_market.HydroPowerSystemBuilder, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Unit

creates a new unit with the specified parameters

create_water_route(self: shyft.energy_market.HydroPowerSystemBuilder, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Waterway

create and add river to the system

create_waterway(self: shyft.energy_market.HydroPowerSystemBuilder, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.Waterway

create and add river to the system

class shyft.energy_market.core.HydroPowerSystemList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.HydroPowerSystemList) -> None

  2. __init__(self: shyft.energy_market.HydroPowerSystemList, arg0: shyft.energy_market.HydroPowerSystemList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.HydroPowerSystemList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.HydroPowerSystemList) -> None

  2. __init__(self: shyft.energy_market.HydroPowerSystemList, arg0: shyft.energy_market.HydroPowerSystemList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.HydroPowerSystemList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.HydroPowerSystemList, x: shyft.energy_market.HydroPowerSystem) None

Add an item to the end of the list

clear(self: shyft.energy_market.HydroPowerSystemList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.HydroPowerSystemList, L: shyft.energy_market.HydroPowerSystemList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.HydroPowerSystemList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.HydroPowerSystemList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.HydroPowerSystem) None

Insert an item at a given position.

items(self: shyft.energy_market.HydroPowerSystemList) list[tuple[str, shyft.energy_market.HydroPowerSystem]]
keys(self: shyft.energy_market.HydroPowerSystemList) list[str]
pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.HydroPowerSystemList) -> shyft.energy_market.HydroPowerSystem

Remove and return the last item

  1. pop(self: shyft.energy_market.HydroPowerSystemList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.HydroPowerSystem

Remove and return the item at index i

size(self: shyft.energy_market.HydroPowerSystemList) int
values(self: shyft.energy_market.HydroPowerSystemList) shyft.energy_market.HydroPowerSystemList
shyft.energy_market.core.IntStringDict

alias of dict

shyft.energy_market.core.StringTimeSeriesDict

alias of dict

class shyft.energy_market.core.Model(self: shyft.energy_market.Model, id: SupportsInt | SupportsIndex, name: str, json: str = '')

Bases: pybind11_object

The Model class describes the LTM (persisted) model A model consists of model_areas and power-lines interconnecting them. To buid a model use the .add_area() and .add_power_line() methods

See also

ModelArea,PowerLine,PowerModule

constructs a Model object with the specified parameters

Parameters:
  • id (int) – a global unique identifier of the mode

  • name (string) – the name of the model

  • json (string) – extra info as json for the model

__init__(self: shyft.energy_market.Model, id: SupportsInt | SupportsIndex, name: str, json: str = '') None

constructs a Model object with the specified parameters

Parameters:
  • id (int) – a global unique identifier of the mode

  • name (string) – the name of the model

  • json (string) – extra info as json for the model

property area

a dict(area-name,area) for the model-areas

Type:

ModelAreaDict

create_model_area(self: shyft.energy_market.Model, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.ModelArea

create and add an area to the model. ensures that area_name, and that area_id is unique.

Parameters:
  • uid (int) – unique identifier for the area, must be unique within model

  • name (string) – any valid area-name, must be unique within model

  • json (string) – json for the area

Returns:

area. a reference to the newly added area

Return type:

ModelArea

See also

add_area

create_power_line(self: shyft.energy_market.Model, a: shyft.energy_market.ModelArea, b: shyft.energy_market.ModelArea, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.PowerLine

create and add a power line with capacity_MW between area a and b to the model

Parameters:
  • a (ModelArea) – from existing model-area, that is part of the current model

  • b (ModelArea) – to existing model-area, that is part of the current model

  • uid (int) – unique ID of the power-line

  • name (string) – unique name of the power-line

  • json (string) – json for the power-line

Returns:

pl. the newly created power-line, that is now a part of the model

Return type:

PowerLine

create_power_module(self: shyft.energy_market.Model, model_area: shyft.energy_market.ModelArea, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.PowerModule

create and add power-module to the area, doing validity checks

Parameters:
  • model_area (ModelArea) – the model-area for which we create a power-module

  • uid (string) – encoded power_type/load/wind module id

  • module_name (string) – unique module-name for each area

  • json (string) – json for the pm

Returns:

pm. a reference to the created and added power-module

Return type:

PowerModule

property created

The timestamp when the model was created, utc seconds 1970

Type:

time

property custom
equal_content(self: shyft.energy_market.Model, other: shyft.energy_market.Model) bool

Compare this model with other_model for equality, except for the .id, .name,`.created`, attributes of the model it self. This is the same as the equal,==, operation, except that the self model local attributes are not compared. This method can be used to determine that two models have the same content, even if they model.id etc. are different.

Parameters:

other (Model) – The model to compare with

Returns:

equal. true if other have exactly the same content as self(disregarding the model .id,.name,.created,.json attributes)

Return type:

bool

equal_structure(self: shyft.energy_market.Model, other: shyft.energy_market.Model) bool

Compare this model with other_model for equality in topology and interconnections. The comparison is using each object`.id` member to identify the same objects. Notice that the attributes of the objects are not considered, only the topology.

Parameters:

other (Model) – The model to compare with

Returns:

equal. true if other_model has structure and objects as self

Return type:

bool

static from_blob(blob: shyft.time_series.ByteVector) shyft.energy_market.Model

constructs a model from a blob previously created by the to_blob method

Parameters:

blob (ByteVector) – blob representation of the model, as create by the to_blob method

get_tsm_object(self: shyft.energy_market.Model, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property name
property obj

a python object

Type:

object

property power_lines

list of power-lines,each with connection to the areas they interconnect

Type:

PowerLineList

to_blob(self: shyft.energy_market.Model) shyft.time_series.ByteVector

serialize the model into a blob

Returns:

blob. serialized version of the model

Return type:

ByteVector

See also

from_blob

property ts
class shyft.energy_market.core.ModelArea(self: shyft.energy_market.ModelArea, model: shyft.energy_market.Model, id: SupportsInt | SupportsIndex, name: str, json: str = '')

Bases: pybind11_object

The ModelArea class describes the EMPS LTM (persisted) model-area A model-area consists of power modules and hydro-power-system. To buid a model-are use the .add_power_module() and the hydro-power-system builder

See also

Model,PowerLine,PowerModule,HydroPowerSystem

constructs a ModelArea object with the specified parameters

Parameters:
  • model (Model) – the model owning the created model-area

  • id (int) – a global unique identifier of the model-area

  • name (string) – the name of the model-area

  • json (string) – extra info as json

__init__(self: shyft.energy_market.ModelArea, model: shyft.energy_market.Model, id: SupportsInt | SupportsIndex, name: str, json: str = '') None

constructs a ModelArea object with the specified parameters

Parameters:
  • model (Model) – the model owning the created model-area

  • id (int) – a global unique identifier of the model-area

  • name (string) – the name of the model-area

  • json (string) – extra info as json

create_power_module(self: shyft.energy_market.ModelArea, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.PowerModule

create and add power-module to the area, doing validity checks

Parameters:
  • id (string) – encoded power_type/load/wind module id

  • module_name (string) – unique module-name for each area

  • json (string) – json for the pm

Returns:

pm. a reference to the created and added power-module

Return type:

PowerModule

property custom
property detailed_hydro

detailed hydro description.

See also

HydroPowerSystem

Type:

HydroPowerSystem

equal_structure(self: shyft.energy_market.ModelArea, other: shyft.energy_market.ModelArea) bool

Compare this model-area with other_model-area for equality in topology and interconnections. The comparison is using each object`.id` member to identify the same objects. Notice that the attributes of the objects are not considered, only the topology.

Parameters:

other (ModelArea) – The model-area to compare with

Returns:

equal. true if other_model has structure and objects as self

Return type:

bool

get_tsm_object(self: shyft.energy_market.ModelArea, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property model

the model for the area

Type:

Model

property name
property obj

a python object

Type:

object

property power_modules

power-modules in this area, a dictionary using power-module unique id

Type:

PowerModuleDict

property ts
class shyft.energy_market.core.ModelBuilder(self: shyft.energy_market.ModelBuilder, model: shyft.energy_market.Model)

Bases: pybind11_object

This class helps building an EMPS model, step by step

Make a model-builder for the model The model can be modified/built using the methods available in this class

Parameters:

model (Model) – the model to be built/modified

__init__(self: shyft.energy_market.ModelBuilder, model: shyft.energy_market.Model) None

Make a model-builder for the model The model can be modified/built using the methods available in this class

Parameters:

model (Model) – the model to be built/modified

create_model_area(self: shyft.energy_market.ModelBuilder, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.ModelArea

create and add an area to the model. ensures that area_name, and that area_id is unique.

Parameters:
  • id (int) – unique identifier for the area, must be unique within model

  • name (string) – any valid area-name, must be unique within model

  • json (string) – json for the area

Returns:

area. a reference to the newly added area

Return type:

ModelArea

See also

add_area

create_power_line(self: shyft.energy_market.ModelBuilder, id: SupportsInt | SupportsIndex, name: str, json: str, a: shyft.energy_market.ModelArea, b: shyft.energy_market.ModelArea) shyft.energy_market.PowerLine

create and add a power line with capacity_MW between area a and b to the model

Parameters:
  • id (int) – unique ID of the power-line

  • name (string) – unique name of the power-line

  • json (string) – json for the power-line

  • a (ModelArea) – from existing model-area, that is part of the current model

  • b (ModelArea) – to existing model-area, that is part of the current model

Returns:

pl. the newly created power-line, that is now a part of the model

Return type:

PowerLine

create_power_module(self: shyft.energy_market.ModelBuilder, id: SupportsInt | SupportsIndex, name: str, json: str, model_area: shyft.energy_market.ModelArea) shyft.energy_market.PowerModule

create and add power-module to the area, doing validity checks

Parameters:
  • id (int) – encoded power_type/load/wind module id

  • name (string) – unique module-name for each area

  • json (string) – json for the pm

  • model_area (ModelArea) – the model-area for which we create a power-module

Returns:

pm. a reference to the created and added power-module

Return type:

PowerModule

class shyft.energy_market.core.Point(*args, **kwargs)

Bases: pybind11_object

Simply a point (x,y)

Overloaded function.

  1. __init__(self: shyft.energy_market.Point) -> None

  2. __init__(self: shyft.energy_market.Point, x: typing.SupportsFloat | typing.SupportsIndex, y: typing.SupportsFloat | typing.SupportsIndex) -> None

construct a point with x and y

  1. __init__(self: shyft.energy_market.Point, clone: shyft.energy_market.Point) -> None

Create a clone.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.Point) -> None

  2. __init__(self: shyft.energy_market.Point, x: typing.SupportsFloat | typing.SupportsIndex, y: typing.SupportsFloat | typing.SupportsIndex) -> None

construct a point with x and y

  1. __init__(self: shyft.energy_market.Point, clone: shyft.energy_market.Point) -> None

Create a clone.

property x

float:

property y

float:

shyft.energy_market.core.PointList

alias of list

class shyft.energy_market.core.PowerLine(self: shyft.energy_market.PowerLine, model: shyft.energy_market.Model, area_1: shyft.energy_market.ModelArea, area_2: shyft.energy_market.ModelArea, id: SupportsInt | SupportsIndex, name: str, json: str = '')

Bases: pybind11_object

The PowerLine class describes the LTM (persisted) power-line A power-line represents the transmission capacity between two model-areas. Use the ModelArea.create_power_line(a1,a2,id) to build a power line

See also

Model,ModelArea,PowerModule,HydroPowerSystem

constructs a PowerLine object between area 1 and 2 with the specified id

Parameters:
  • model (Model) – the model for the power-line

  • area_1 (ModelArea) – a reference to an existing area in the model

  • area_2 (ModelArea) – a reference to an existing area in the model

  • id (int) – a global unique identifier for the power-line

  • name (string) – a global unique name for the power-line

  • json (string) – extra json for the power-line

__init__(self: shyft.energy_market.PowerLine, model: shyft.energy_market.Model, area_1: shyft.energy_market.ModelArea, area_2: shyft.energy_market.ModelArea, id: SupportsInt | SupportsIndex, name: str, json: str = '') None

constructs a PowerLine object between area 1 and 2 with the specified id

Parameters:
  • model (Model) – the model for the power-line

  • area_1 (ModelArea) – a reference to an existing area in the model

  • area_2 (ModelArea) – a reference to an existing area in the model

  • id (int) – a global unique identifier for the power-line

  • name (string) – a global unique name for the power-line

  • json (string) – extra json for the power-line

property area_1

reference to area-from

Type:

ModelArea

property area_2

reference to area-to

Type:

ModelArea

property custom
equal_structure(self: shyft.energy_market.PowerLine, other: shyft.energy_market.PowerLine) bool

Compare this power-line with the other for equality in topology and interconnections. The comparison is using each object`.id` member to identify the same objects. Notice that the attributes of the objects are not considered, only the topology.

Parameters:

() (other) – The model-area to compare with

Returns:

equal. true if other has structure equal to self

Return type:

bool

get_tsm_object(self: shyft.energy_market.PowerLine, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property model

the model for this power-line

Type:

Model

property name
property obj

a python object

Type:

object

property ts
class shyft.energy_market.core.PowerLineList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.PowerLineList) -> None

  2. __init__(self: shyft.energy_market.PowerLineList, arg0: shyft.energy_market.PowerLineList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.PowerLineList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.PowerLineList) -> None

  2. __init__(self: shyft.energy_market.PowerLineList, arg0: shyft.energy_market.PowerLineList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.PowerLineList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.PowerLineList, x: shyft.energy_market.PowerLine) None

Add an item to the end of the list

clear(self: shyft.energy_market.PowerLineList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.PowerLineList, L: shyft.energy_market.PowerLineList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.PowerLineList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.PowerLineList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.PowerLine) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.PowerLineList) -> shyft.energy_market.PowerLine

Remove and return the last item

  1. pop(self: shyft.energy_market.PowerLineList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.PowerLine

Remove and return the item at index i

size(self: shyft.energy_market.PowerLineList) int
class shyft.energy_market.core.PowerModule(self: shyft.energy_market.PowerModule, area: shyft.energy_market.ModelArea, id: SupportsInt | SupportsIndex, name: str, json: str = '')

Bases: pybind11_object

The PowerModule class describes the LTM (persisted) power-module A power-module represents an actor that consume/produces power for given price/volume characteristics. The user can influence this characteristics giving specific semantic load_type/power_type and extra data and/or relations to other power-modules within the same area.

See also

Model,ModelArea,PowerLine,HydroPowerSystem

constructs a PowerModule with specified mandatory name and module-id

Parameters:
  • area (ModelArea) – the area for this power-module

  • id (int) – unique pm-id for area

  • name (string) – the name of the power-module

  • json (string) – optional json

__init__(self: shyft.energy_market.PowerModule, area: shyft.energy_market.ModelArea, id: SupportsInt | SupportsIndex, name: str, json: str = '') None

constructs a PowerModule with specified mandatory name and module-id

Parameters:
  • area (ModelArea) – the area for this power-module

  • id (int) – unique pm-id for area

  • name (string) – the name of the power-module

  • json (string) – optional json

property area

the model-area for this power-module

Type:

ModelArea

property custom
get_tsm_object(self: shyft.energy_market.PowerModule, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property name
property obj

a python object

Type:

object

property ts
class shyft.energy_market.core.PowerModuleDict(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.PowerModuleDict) -> None

  2. __init__(self: shyft.energy_market.PowerModuleDict, arg0: shyft.energy_market.PowerModuleDict) -> None

CopyConstructor

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.PowerModuleDict) -> None

  2. __init__(self: shyft.energy_market.PowerModuleDict, arg0: shyft.energy_market.PowerModuleDict) -> None

CopyConstructor

get(self: shyft.energy_market.PowerModuleDict, key: SupportsInt | SupportsIndex, default: shyft.energy_market.PowerModule | None = None) shyft.energy_market.PowerModule | None

Return the value for key if key is in the dictionary, else default.

items(self: shyft.energy_market.PowerModuleDict) shyft.hydrology.r_pt_gs_k.ItemsView
keys(self: shyft.energy_market.PowerModuleDict) shyft.hydrology.r_pt_gs_k.KeysView
values(self: shyft.energy_market.PowerModuleDict) shyft.hydrology.r_pt_gs_k.ValuesView
class shyft.energy_market.core.PowerPlant(self: shyft.energy_market.PowerPlant, id: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.HydroPowerSystem)

Bases: pybind11_object

A hydro power plant is the site/building that contains a number of units. The attributes of the power plant, are typically sum-requirement and/or operations that applies all of the units.

__init__(self: shyft.energy_market.PowerPlant, id: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.HydroPowerSystem) None
add_aggregate(self: shyft.energy_market.PowerPlant, unit: shyft.energy_market.Unit) None

add unit to plant

add_unit(self: shyft.energy_market.PowerPlant, unit: shyft.energy_market.Unit) None

add unit to plant

property aggregates

associated units

Type:

UnitList

property custom
get_tsm_object(self: shyft.energy_market.PowerPlant, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property hps

returns the hydro power system this component is a part of

Type:

HydroPowerSystem

property id
property json
property name
property obj

a python object

Type:

object

remove_aggregate(self: shyft.energy_market.PowerPlant, unit: shyft.energy_market.Unit) None

remove unit from plant

remove_unit(self: shyft.energy_market.PowerPlant, unit: shyft.energy_market.Unit) None

remove unit from plant

property ts
property units

associated units

Type:

UnitList

class shyft.energy_market.core.PowerPlantList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.PowerPlantList) -> None

  2. __init__(self: shyft.energy_market.PowerPlantList, arg0: shyft.energy_market.PowerPlantList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.PowerPlantList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.PowerPlantList) -> None

  2. __init__(self: shyft.energy_market.PowerPlantList, arg0: shyft.energy_market.PowerPlantList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.PowerPlantList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.PowerPlantList, x: shyft.energy_market.PowerPlant) None

Add an item to the end of the list

clear(self: shyft.energy_market.PowerPlantList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.PowerPlantList, L: shyft.energy_market.PowerPlantList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.PowerPlantList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.PowerPlantList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.PowerPlant) None

Insert an item at a given position.

items(self: shyft.energy_market.PowerPlantList) list[tuple[str, shyft.energy_market.PowerPlant]]
keys(self: shyft.energy_market.PowerPlantList) list[str]
pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.PowerPlantList) -> shyft.energy_market.PowerPlant

Remove and return the last item

  1. pop(self: shyft.energy_market.PowerPlantList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.PowerPlant

Remove and return the item at index i

size(self: shyft.energy_market.PowerPlantList) int
values(self: shyft.energy_market.PowerPlantList) shyft.energy_market.PowerPlantList
class shyft.energy_market.core.Reservoir(self: shyft.energy_market.Reservoir, id: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.HydroPowerSystem)

Bases: HydroComponent

__init__(self: shyft.energy_market.Reservoir, id: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.HydroPowerSystem) None
input_from(self: shyft.energy_market.Reservoir, other: shyft.energy_market.Waterway) shyft.energy_market.Reservoir

Connect the input of the reservoir to the output of the waterway.

output_to(self: shyft.energy_market.Reservoir, other: shyft.energy_market.Waterway, role: shyft.energy_market.ConnectionRole = <ConnectionRole.main: 0>) shyft.energy_market.Reservoir

Connect the output of this reservoir to the input of the waterway, and assign the connection role

class shyft.energy_market.core.ReservoirList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.ReservoirList) -> None

  2. __init__(self: shyft.energy_market.ReservoirList, arg0: shyft.energy_market.ReservoirList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.ReservoirList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.ReservoirList) -> None

  2. __init__(self: shyft.energy_market.ReservoirList, arg0: shyft.energy_market.ReservoirList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.ReservoirList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.ReservoirList, x: shyft.energy_market.Reservoir) None

Add an item to the end of the list

clear(self: shyft.energy_market.ReservoirList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.ReservoirList, L: shyft.energy_market.ReservoirList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.ReservoirList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.ReservoirList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.Reservoir) None

Insert an item at a given position.

items(self: shyft.energy_market.ReservoirList) list[tuple[str, shyft.energy_market.Reservoir]]
keys(self: shyft.energy_market.ReservoirList) list[str]
pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.ReservoirList) -> shyft.energy_market.Reservoir

Remove and return the last item

  1. pop(self: shyft.energy_market.ReservoirList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.Reservoir

Remove and return the item at index i

size(self: shyft.energy_market.ReservoirList) int
values(self: shyft.energy_market.ReservoirList) shyft.energy_market.ReservoirList
class shyft.energy_market.core.Run(*args, **kwargs)

Bases: pybind11_object

Provides a Run concept, goes through states, created->prepinput->running->collect_result->frozen

Overloaded function.

  1. __init__(self: shyft.energy_market.Run) -> None

  2. __init__(self: shyft.energy_market.Run, id: typing.SupportsInt | typing.SupportsIndex, name: str, created: shyft.time_series.time, json: str = ‘’, mid: typing.SupportsInt | typing.SupportsIndex = 0) -> None

create a run

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.Run) -> None

  2. __init__(self: shyft.energy_market.Run, id: typing.SupportsInt | typing.SupportsIndex, name: str, created: shyft.time_series.time, json: str = ‘’, mid: typing.SupportsInt | typing.SupportsIndex = 0) -> None

create a run

property created

the time of creation, or last modification of the model

property id

the unique model id, can be used to retrieve the real model

property json

a json formatted string to enable scripting and python to store more information

property mid

model id (attached) for this run

property name

any useful name or description

property state

the current observed state for the run, like created, running,finished_run etc

class shyft.energy_market.core.RunClient(self: shyft.energy_market.RunClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0)

Bases: pybind11_object

The client-api for the generic run-repository

Creates a python client that can communicate with the corresponding server

__init__(self: shyft.energy_market.RunClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0) None

Creates a python client that can communicate with the corresponding server

close(self: shyft.energy_market.RunClient) None

Close the connection. It will automatically reopen if needed.

get_model_infos(self: shyft.energy_market.RunClient, mids: collections.abc.Sequence[SupportsInt | SupportsIndex], created_in: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.ModelInfo]

returns all or selected model-info objects based on model-identifiers(mids)

Parameters:
  • mids (IntVector) – empty = all, or a list of known exisiting model-identifiers

  • created_in (UtcPeriod) – For which period you are interested in model-infos.

Returns:

model_infos. Strongly typed list of ModelInfo

Return type:

ModelInfoVector

property host_port

Endpoint network address of the remote server.

Type:

str

property is_open

If the connection to the remote server is (still) open.

Type:

bool

property operation_timeout_ms

Operation timeout for remote server operations, in number milliseconds.

Type:

int

read_model(self: shyft.energy_market.RunClient, mid: SupportsInt | SupportsIndex) shyft.energy_market.Run

Read and return the model for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting model from the server

Return type:

Model

read_models(self: shyft.energy_market.RunClient, mids: collections.abc.Sequence[SupportsInt | SupportsIndex]) list[shyft.energy_market.Run]

Read and return the model for specified model-identifier (mid)

Parameters:

mids (list[int]) – A strongly typed list of ints, the model-identifers for the wanted models

Returns:

  1. The resulting model from the server

Return type:

Model

property reconnect_count

Number of reconnects to the remote server that have been performed.

Type:

int

remove_model(self: shyft.energy_market.RunClient, mid: SupportsInt | SupportsIndex) int

Remove the specified model bymodel-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

ec. 0 or error-code?

Return type:

int

store_model(self: shyft.energy_market.RunClient, m: shyft.energy_market.Run, mi: shyft.time_series.ModelInfo) int

Store the model to backend, if m.id==0 then a new unique model-info is created and used

Parameters:
  • m (Model) – The model to store

  • mi (ModelInfo) – The model-info to store for the model

Returns:

mid. model-identifier for the stored model and model-info

Return type:

int

property timeout_ms

Timout for remote server operations, in number milliseconds.

Type:

int

update_model_info(self: shyft.energy_market.RunClient, mid: SupportsInt | SupportsIndex, mi: shyft.time_series.ModelInfo) bool

Update the model-info for specified model-identifier(mid)

Parameters:
  • mid (int) – model-identifer

  • mi (ModelInfo) – The new updated model-info

Returns:

ok. true if success

Return type:

bool

class shyft.energy_market.core.RunServer(self: shyft.energy_market.RunServer, root_dir: str, config: shyft.time_series.ServerConfig = shyft.time_series.ServerConfig(stale_duration='1970-01-01T01:00:00Z', stale_sweep_interval='1970-01-01T00:00:00.100000Z', log=shyft.time_series.LogConfig(file='', level=200)))

Bases: pybind11_object

The server-side component for the skeleton generic run repository

Creates a server object that serves models from root_dir. The root_dir will be create if it does not exists.

Parameters:
  • root_dir (str) – Path to the root-directory that keeps/will keep the model-files

  • config (ServerConfig) – Configuration of the server

__init__(self: shyft.energy_market.RunServer, root_dir: str, config: shyft.time_series.ServerConfig = shyft.time_series.ServerConfig(stale_duration='1970-01-01T01:00:00Z', stale_sweep_interval='1970-01-01T00:00:00.100000Z', log=shyft.time_series.LogConfig(file='', level=200))) None

Creates a server object that serves models from root_dir. The root_dir will be create if it does not exists.

Parameters:
  • root_dir (str) – Path to the root-directory that keeps/will keep the model-files

  • config (ServerConfig) – Configuration of the server

get_listening_port(self: shyft.energy_market.RunServer) int

returns the port number it’s listening at for serving incoming request

get_max_connections(self: shyft.energy_market.RunServer) int

returns the maximum number of connections to be served concurrently

get_model_infos(self: shyft.energy_market.RunServer, mids: collections.abc.Sequence[SupportsInt | SupportsIndex], created_in: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.ModelInfo]

returns all or selected model-info objects based on model-identifiers(mids)

Parameters:
  • mids (IntVector) – empty = all, or a list of known exisiting model-identifiers

  • created_in (UtcPeriod) – For which period you are interested in model-infos.

Returns:

model_infos. Strongly typed list of ModelInfo

Return type:

ModelInfoVector

is_running(self: shyft.energy_market.RunServer) bool

true if server is listening and running

See also

start_server()

read_model(self: shyft.energy_market.RunServer, mid: SupportsInt | SupportsIndex) shyft.energy_market.Run

Read and return the model for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting model from the server

Return type:

Model

read_model_blob(self: shyft.energy_market.RunServer, mid: SupportsInt | SupportsIndex) list[str]

Read and return the model blob for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting blob model from the server

Return type:

ByteVector

read_models(self: shyft.energy_market.RunServer, mids: collections.abc.Sequence[SupportsInt | SupportsIndex]) list[shyft.energy_market.Run]

Read and return the model for specified model-identifier (mid)

Parameters:

mids (list[int]) – A strongly typed list of ints, the model-identifers for the wanted models

Returns:

  1. The resulting model from the server

Return type:

Model

remove_model(self: shyft.energy_market.RunServer, mid: SupportsInt | SupportsIndex) int

Remove the specified model bymodel-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

ec. 0 or error-code?

Return type:

int

set_listening_ip(self: shyft.energy_market.RunServer, ip: str) None

set the listening port for the service

Parameters:

ip (str) – ip or host-name to start listening on

Returns:

nothing.

Return type:

None

set_listening_port(self: shyft.energy_market.RunServer, port_no: SupportsInt | SupportsIndex) None

set the listening port for the service

Parameters:
  • port_no (int) – a valid and available tcp-ip port number to listen on.

  • 20000 (typically it could be)

Returns:

nothing.

Return type:

None

set_max_connections(self: shyft.energy_market.RunServer, max_connect: SupportsInt | SupportsIndex) None

limits simultaneous connections to the server (it’s multithreaded, and uses on thread pr. connect)

Parameters:

max_connect (int) – maximum number of connections before denying more connections

See also

get_max_connections()

property stale_connection_close_count

returns count of connection closed due to stale/no communication activity

Type:

int

start_server(self: shyft.energy_market.RunServer) int

start server listening in background, and processing messages

See also

set_listening_port(port_no),is_running

Returns:

port_no. the port used for listening operations, either the value as by set_listening_port, or if it was unspecified, a new available port

Return type:

in

stop_server(self: shyft.energy_market.RunServer, timeout: SupportsInt | SupportsIndex = 1000) None

stop serving connections, gracefully.

See also

start_server()

store_model(self: shyft.energy_market.RunServer, m: shyft.energy_market.Run, mi: shyft.time_series.ModelInfo) int

Store the model to backend, if m.id==0 then a new unique model-info is created and used

Parameters:
  • m (Model) – The model to store

  • mi (ModelInfo) – The model-info to store for the model

Returns:

mid. model-identifier for the stored model and model-info

Return type:

int

update_model_info(self: shyft.energy_market.RunServer, mid: SupportsInt | SupportsIndex, mi: shyft.time_series.ModelInfo) bool

Update the model-info for specified model-identifier(mid)

Parameters:
  • mid (int) – model-identifer

  • mi (ModelInfo) – The new updated model-info

Returns:

ok. true if success

Return type:

bool

class shyft.energy_market.core.Server(self: shyft.energy_market.Server, root_dir: str, config: shyft.time_series.ServerConfig = shyft.time_series.ServerConfig(stale_duration='1970-01-01T01:00:00Z', stale_sweep_interval='1970-01-01T00:00:00.100000Z', log=shyft.time_series.LogConfig(file='', level=200)))

Bases: pybind11_object

The server-side component for the skeleton energy_market model repository

Creates a server object that serves models from root_dir. The root_dir will be create if it does not exists.

Parameters:
  • root_dir (str) – Path to the root-directory that keeps/will keep the model-files

  • config (ServerConfig) – Configuration of the server

__init__(self: shyft.energy_market.Server, root_dir: str, config: shyft.time_series.ServerConfig = shyft.time_series.ServerConfig(stale_duration='1970-01-01T01:00:00Z', stale_sweep_interval='1970-01-01T00:00:00.100000Z', log=shyft.time_series.LogConfig(file='', level=200))) None

Creates a server object that serves models from root_dir. The root_dir will be create if it does not exists.

Parameters:
  • root_dir (str) – Path to the root-directory that keeps/will keep the model-files

  • config (ServerConfig) – Configuration of the server

get_listening_port(self: shyft.energy_market.Server) int

returns the port number it’s listening at for serving incoming request

get_max_connections(self: shyft.energy_market.Server) int

returns the maximum number of connections to be served concurrently

get_model_infos(self: shyft.energy_market.Server, mids: collections.abc.Sequence[SupportsInt | SupportsIndex], created_in: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.ModelInfo]

returns all or selected model-info objects based on model-identifiers(mids)

Parameters:
  • mids (IntVector) – empty = all, or a list of known exisiting model-identifiers

  • created_in (UtcPeriod) – For which period you are interested in model-infos.

Returns:

model_infos. Strongly typed list of ModelInfo

Return type:

ModelInfoVector

is_running(self: shyft.energy_market.Server) bool

true if server is listening and running

See also

start_server()

read_model(self: shyft.energy_market.Server, mid: SupportsInt | SupportsIndex) shyft.energy_market.Model

Read and return the model for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting model from the server

Return type:

Model

read_model_blob(self: shyft.energy_market.Server, mid: SupportsInt | SupportsIndex) list[str]

Read and return the model blob for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting blob model from the server

Return type:

ByteVector

read_models(self: shyft.energy_market.Server, mids: collections.abc.Sequence[SupportsInt | SupportsIndex]) list[shyft.energy_market.Model]

Read and return the model for specified model-identifier (mid)

Parameters:

mids (list[int]) – A strongly typed list of ints, the model-identifers for the wanted models

Returns:

  1. The resulting model from the server

Return type:

Model

remove_model(self: shyft.energy_market.Server, mid: SupportsInt | SupportsIndex) int

Remove the specified model bymodel-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

ec. 0 or error-code?

Return type:

int

set_listening_ip(self: shyft.energy_market.Server, ip: str) None

set the listening port for the service

Parameters:

ip (str) – ip or host-name to start listening on

Returns:

nothing.

Return type:

None

set_listening_port(self: shyft.energy_market.Server, port_no: SupportsInt | SupportsIndex) None

set the listening port for the service

Parameters:
  • port_no (int) – a valid and available tcp-ip port number to listen on.

  • 20000 (typically it could be)

Returns:

nothing.

Return type:

None

set_max_connections(self: shyft.energy_market.Server, max_connect: SupportsInt | SupportsIndex) None

limits simultaneous connections to the server (it’s multithreaded, and uses on thread pr. connect)

Parameters:

max_connect (int) – maximum number of connections before denying more connections

See also

get_max_connections()

property stale_connection_close_count

returns count of connection closed due to stale/no communication activity

Type:

int

start_server(self: shyft.energy_market.Server) int

start server listening in background, and processing messages

See also

set_listening_port(port_no),is_running

Returns:

port_no. the port used for listening operations, either the value as by set_listening_port, or if it was unspecified, a new available port

Return type:

in

stop_server(self: shyft.energy_market.Server, timeout: SupportsInt | SupportsIndex = 1000) None

stop serving connections, gracefully.

See also

start_server()

store_model(self: shyft.energy_market.Server, m: shyft.energy_market.Model, mi: shyft.time_series.ModelInfo) int

Store the model to backend, if m.id==0 then a new unique model-info is created and used

Parameters:
  • m (Model) – The model to store

  • mi (ModelInfo) – The model-info to store for the model

Returns:

mid. model-identifier for the stored model and model-info

Return type:

int

update_model_info(self: shyft.energy_market.Server, mid: SupportsInt | SupportsIndex, mi: shyft.time_series.ModelInfo) bool

Update the model-info for specified model-identifier(mid)

Parameters:
  • mid (int) – model-identifer

  • mi (ModelInfo) – The new updated model-info

Returns:

ok. true if success

Return type:

bool

class shyft.energy_market.core.TurbineCapability(self: shyft.energy_market.TurbineCapability, value: SupportsInt | SupportsIndex)

Bases: pybind11_object

Describes the capabilities of a turbine.

Members:

turbine_none

turbine_forward

turbine_backward

turbine_reversible

__init__(self: shyft.energy_market.TurbineCapability, value: SupportsInt | SupportsIndex) None
TurbineCapability.name -> str
turbine_backward = <TurbineCapability.turbine_backward: 2>
turbine_forward = <TurbineCapability.turbine_forward: 1>
turbine_none = <TurbineCapability.turbine_none: 0>
turbine_reversible = <TurbineCapability.turbine_reversible: 3>
property value
class shyft.energy_market.core.TurbineDescription(*args, **kwargs)

Bases: pybind11_object

Complete description of efficiencies a turbine for all operating zones.

Pelton turbines typically have multiple operating zones; one for each needle combination. Other turbines normally have only a single operating zone describing the entire turbine, but may have more than one to model different isolated operating zones. Each operating zone is described with a turbine efficiency object, which in turn may contain multiple efficiency curves; one for each net head.

Overloaded function.

  1. __init__(self: shyft.energy_market.TurbineDescription) -> None

  2. __init__(self: shyft.energy_market.TurbineDescription, operating_zones: shyft.energy_market.TurbineOperatingZoneList) -> None

  3. __init__(self: shyft.energy_market.TurbineDescription, clone: shyft.energy_market.TurbineDescription) -> None

Create a clone.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.TurbineDescription) -> None

  2. __init__(self: shyft.energy_market.TurbineDescription, operating_zones: shyft.energy_market.TurbineOperatingZoneList) -> None

  3. __init__(self: shyft.energy_market.TurbineDescription, clone: shyft.energy_market.TurbineDescription) -> None

Create a clone.

capability(self: shyft.energy_market.TurbineDescription) shyft.energy_market.TurbineCapability

Return the capability of the turbine

get_operating_zone(self: shyft.energy_market.TurbineDescription, p: SupportsFloat | SupportsIndex) shyft.energy_market.TurbineOperatingZone

Find operating zone for given production value p

Notes

If operating zones are overlapping then the zone with lowest value of production_min will be selected.

property operating_zones
class shyft.energy_market.core.TurbineOperatingZone(*args, **kwargs)

Bases: pybind11_object

A turbine efficiency.

Defined by a set of efficiency curves, one for each net head, with optional production limits. Part of the turbine description, to describe the efficiency of an entire turbine, or an isolated operating zone or a Pelton needle combination. Production limits are only relevant when representing an isolated operating zone or a Pelton needle combination.

Overloaded function.

  1. __init__(self: shyft.energy_market.TurbineOperatingZone) -> None

  2. __init__(self: shyft.energy_market.TurbineOperatingZone, efficiency_curves: shyft.energy_market.XyPointCurveWithZList) -> None

  3. __init__(self: shyft.energy_market.TurbineOperatingZone, efficiency_curves: shyft.energy_market.XyPointCurveWithZList, production_min: typing.SupportsFloat | typing.SupportsIndex, production_max: typing.SupportsFloat | typing.SupportsIndex) -> None

  4. __init__(self: shyft.energy_market.TurbineOperatingZone, efficiency_curves: shyft.energy_market.XyPointCurveWithZList, production_min: typing.SupportsFloat | typing.SupportsIndex, production_max: typing.SupportsFloat | typing.SupportsIndex, production_nominal: typing.SupportsFloat | typing.SupportsIndex, fcr_min: typing.SupportsFloat | typing.SupportsIndex, fcr_max: typing.SupportsFloat | typing.SupportsIndex, fcr_d_min: typing.SupportsFloat | typing.SupportsIndex = nan, fcr_d_max: typing.SupportsFloat | typing.SupportsIndex = nan) -> None

  5. __init__(self: shyft.energy_market.TurbineOperatingZone, clone: shyft.energy_market.TurbineOperatingZone) -> None

Create a clone.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.TurbineOperatingZone) -> None

  2. __init__(self: shyft.energy_market.TurbineOperatingZone, efficiency_curves: shyft.energy_market.XyPointCurveWithZList) -> None

  3. __init__(self: shyft.energy_market.TurbineOperatingZone, efficiency_curves: shyft.energy_market.XyPointCurveWithZList, production_min: typing.SupportsFloat | typing.SupportsIndex, production_max: typing.SupportsFloat | typing.SupportsIndex) -> None

  4. __init__(self: shyft.energy_market.TurbineOperatingZone, efficiency_curves: shyft.energy_market.XyPointCurveWithZList, production_min: typing.SupportsFloat | typing.SupportsIndex, production_max: typing.SupportsFloat | typing.SupportsIndex, production_nominal: typing.SupportsFloat | typing.SupportsIndex, fcr_min: typing.SupportsFloat | typing.SupportsIndex, fcr_max: typing.SupportsFloat | typing.SupportsIndex, fcr_d_min: typing.SupportsFloat | typing.SupportsIndex = nan, fcr_d_max: typing.SupportsFloat | typing.SupportsIndex = nan) -> None

  5. __init__(self: shyft.energy_market.TurbineOperatingZone, clone: shyft.energy_market.TurbineOperatingZone) -> None

Create a clone.

property efficiency_curves

A list of XyPointCurveWithZ efficiency curves for the net head range of the entire turbine, or an isolated operating zone or a Pelton needle combination.

Type:

XyPointCurveWithZList

evaluate(self: shyft.energy_market.TurbineOperatingZone, x: SupportsFloat | SupportsIndex, z: SupportsFloat | SupportsIndex) float

Evaluate the efficiency curves at a point (x, z)

property fcr_d_max

The temporary maximum production allowed for this set of efficiency curves when delivering FCR-D.

Notes

Only relevant when representing an isolated operating zone or a Pelton needle combination.

Type:

float

property fcr_d_min

The temporary minimum production allowed for this set of efficiency curves when delivering FCR-D.

Notes

Only relevant when representing an isolated operating zone or a Pelton needle combination.

Type:

float

property fcr_max

The temporary maximum production allowed for this set of efficiency curves when delivering FCR.

Notes

Only relevant when representing an isolated operating zone or a Pelton needle combination.

Type:

float

property fcr_min

The temporary minimum production allowed for this set of efficiency curves when delivering FCR.

Notes

Only relevant when representing an isolated operating zone or a Pelton needle combination.

Type:

float

property production_max

The maximum production for which the efficiency curves are valid.

Notes

Only relevant when representing an isolated operating zone or a Pelton needle combination.

Type:

float

property production_min

The minimum production for which the efficiency curves are valid.

Notes

Only relevant when representing an isolated operating zone or a Pelton needle combination.

Type:

float

property production_nominal

The nominal production, or installed/rated/nameplate capacity, for which the efficiency curves are valid.

Notes

Only relevant when representing an isolated operating zone or a Pelton needle combination.

Type:

float

shyft.energy_market.core.TurbineOperatingZoneList

alias of list

class shyft.energy_market.core.Unit(self: shyft.energy_market.Unit, id: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.HydroPowerSystem)

Bases: HydroComponent

An Unit consist of a turbine and a connected generator. The turbine is hydrologically connected to upstream tunnel and downstream tunell/river. The generator part is connected to the electrical grid through a busbar. In the long term models, the entire power plant is represented by a virtual unit that represents the total capability of the power-plant.

The short-term detailed models, usually describes every aggratate up to a granularity that is relevant for the short-term optimization/simulation horizont.

A power plant is a collection of one or more units that are natural to group into one power plant.

__init__(self: shyft.energy_market.Unit, id: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.HydroPowerSystem) None
property downstream

returns downstream waterway(river/tunnel) object(if any)

Type:

Waterway

input_from(self: shyft.energy_market.Unit, other: shyft.energy_market.Waterway) shyft.energy_market.Unit

Connect the input of this unit to the output of the waterway.

property is_pump

Returns true if the unit is a pump, otherwise, returns false

Type:

bool

output_to(self: shyft.energy_market.Unit, other: shyft.energy_market.Waterway) shyft.energy_market.Unit

Connect the output of this unit to the input of the waterway.

property power_plant

return the hydro power plant associated with this unit

Type:

PowerPlant

property power_station

return the hydro power plant associated with this unit

Type:

PowerPlant

property upstream

returns upstream tunnel(water-route) object(if any)

Type:

Waterway

class shyft.energy_market.core.UnitList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.UnitList) -> None

  2. __init__(self: shyft.energy_market.UnitList, arg0: shyft.energy_market.UnitList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.UnitList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.UnitList) -> None

  2. __init__(self: shyft.energy_market.UnitList, arg0: shyft.energy_market.UnitList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.UnitList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.UnitList, x: shyft.energy_market.Unit) None

Add an item to the end of the list

clear(self: shyft.energy_market.UnitList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.UnitList, L: shyft.energy_market.UnitList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.UnitList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.UnitList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.Unit) None

Insert an item at a given position.

items(self: shyft.energy_market.UnitList) list[tuple[str, shyft.energy_market.Unit]]
keys(self: shyft.energy_market.UnitList) list[str]
pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.UnitList) -> shyft.energy_market.Unit

Remove and return the last item

  1. pop(self: shyft.energy_market.UnitList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.Unit

Remove and return the item at index i

size(self: shyft.energy_market.UnitList) int
values(self: shyft.energy_market.UnitList) shyft.energy_market.UnitList
class shyft.energy_market.core.Waterway(self: shyft.energy_market.Waterway, id: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.HydroPowerSystem)

Bases: HydroComponent

The waterway can be a river or a tunnel, and connects the reservoirs, units(turbine).

__init__(self: shyft.energy_market.Waterway, id: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.HydroPowerSystem) None
add_gate(self: shyft.energy_market.Waterway, gate: shyft.energy_market.Gate) None

add a gate to the waterway

property downstream

returns downstream object(if any)

Type:

HydroComponent

property gates

the gates attached to the inlet of the waterway

Type:

GateList

input_from(*args, **kwargs)

Overloaded function.

  1. input_from(self: shyft.energy_market.Waterway, other: shyft.energy_market.Waterway) -> shyft.energy_market.Waterway

Connect the input of this waterway to the output of the other waterway.

  1. input_from(self: shyft.energy_market.Waterway, other: shyft.energy_market.Unit) -> shyft.energy_market.Waterway

Connect the input of this waterway to the output of the unit.

  1. input_from(self: shyft.energy_market.Waterway, reservoir: shyft.energy_market.Reservoir, role: shyft.energy_market.ConnectionRole = <ConnectionRole.main: 0>) -> shyft.energy_market.Waterway

Connect the input of this waterway to the output of the reservoir, and assign the connection role.

output_to(*args, **kwargs)

Overloaded function.

  1. output_to(self: shyft.energy_market.Waterway, other: shyft.energy_market.Waterway) -> shyft.energy_market.Waterway

Connect the output of this waterway to the input of the other waterway.

  1. output_to(self: shyft.energy_market.Waterway, other: shyft.energy_market.Reservoir) -> shyft.energy_market.Waterway

Connect the output of this waterway to the input of the reservoir.

  1. output_to(self: shyft.energy_market.Waterway, other: shyft.energy_market.Unit) -> shyft.energy_market.Waterway

Connect the output of this waterway to the input of the unit.

remove_gate(self: shyft.energy_market.Waterway, gate: shyft.energy_market.Gate) None

remove a gate from the waterway

property upstream

returns upstream object(if any)

Type:

HydroComponent

property upstream_role

the role the water way has relative to the component above

class shyft.energy_market.core.WaterwayList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.WaterwayList) -> None

  2. __init__(self: shyft.energy_market.WaterwayList, arg0: shyft.energy_market.WaterwayList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.WaterwayList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.WaterwayList) -> None

  2. __init__(self: shyft.energy_market.WaterwayList, arg0: shyft.energy_market.WaterwayList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.WaterwayList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.WaterwayList, x: shyft.energy_market.Waterway) None

Add an item to the end of the list

clear(self: shyft.energy_market.WaterwayList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.WaterwayList, L: shyft.energy_market.WaterwayList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.WaterwayList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.WaterwayList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.Waterway) None

Insert an item at a given position.

items(self: shyft.energy_market.WaterwayList) list[tuple[str, shyft.energy_market.Waterway]]
keys(self: shyft.energy_market.WaterwayList) list[str]
pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.WaterwayList) -> shyft.energy_market.Waterway

Remove and return the last item

  1. pop(self: shyft.energy_market.WaterwayList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.Waterway

Remove and return the item at index i

size(self: shyft.energy_market.WaterwayList) int
values(self: shyft.energy_market.WaterwayList) shyft.energy_market.WaterwayList
class shyft.energy_market.core.XyPointCurve(*args, **kwargs)

Bases: pybind11_object

A curve described using points, piecewise linear.

Overloaded function.

  1. __init__(self: shyft.energy_market.XyPointCurve) -> None

  2. __init__(self: shyft.energy_market.XyPointCurve, points: shyft.energy_market.XyPointList) -> None

  3. __init__(self: shyft.energy_market.XyPointCurve, x_vector: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], y_vector: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> None

  4. __init__(self: shyft.energy_market.XyPointCurve, clone: shyft.energy_market.XyPointCurve) -> None

Create a clone.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.XyPointCurve) -> None

  2. __init__(self: shyft.energy_market.XyPointCurve, points: shyft.energy_market.XyPointList) -> None

  3. __init__(self: shyft.energy_market.XyPointCurve, x_vector: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], y_vector: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> None

  4. __init__(self: shyft.energy_market.XyPointCurve, clone: shyft.energy_market.XyPointCurve) -> None

Create a clone.

calculate_x(*args, **kwargs)

Overloaded function.

  1. calculate_x(self: shyft.energy_market.XyPointCurve, x: typing.SupportsFloat | typing.SupportsIndex) -> float

interpolating and extending

  1. calculate_x(self: shyft.energy_market.XyPointCurve, x: shyft.time_series.TimeSeries, method: shyft.time_series.interpolation_scheme = ‘linear’) -> shyft.time_series.TimeSeries

interpolating and extending

calculate_y(*args, **kwargs)

Overloaded function.

  1. calculate_y(self: shyft.energy_market.XyPointCurve, x: typing.SupportsFloat | typing.SupportsIndex) -> float

interpolating and extending

  1. calculate_y(self: shyft.energy_market.XyPointCurve, x: shyft.time_series.TimeSeries, method: shyft.time_series.interpolation_scheme = ‘linear’) -> shyft.time_series.TimeSeries

interpolating and extending

is_convex(self: shyft.energy_market.XyPointCurve) bool

true if y=f(x) is convex

is_mono_increasing(self: shyft.energy_market.XyPointCurve) bool

true if y=f(x) is monotone and increasing

property points

describing the curve

Type:

PointList

x_max(self: shyft.energy_market.XyPointCurve) float

returns largest value of x

x_min(self: shyft.energy_market.XyPointCurve) float

returns smallest value of x

y_max(self: shyft.energy_market.XyPointCurve) float

returns largest value of y

y_min(self: shyft.energy_market.XyPointCurve) float

returns smallest value of y

shyft.energy_market.core.XyPointCurveList

alias of list

class shyft.energy_market.core.XyPointCurveWithZ(*args, **kwargs)

Bases: pybind11_object

A XyPointCurve with a reference value z.

Overloaded function.

  1. __init__(self: shyft.energy_market.XyPointCurveWithZ) -> None

  2. __init__(self: shyft.energy_market.XyPointCurveWithZ, other: shyft.energy_market.XyPointCurveWithZ) -> None

  3. __init__(self: shyft.energy_market.XyPointCurveWithZ, xy_point_curve: shyft.energy_market.XyPointCurve, z: typing.SupportsFloat | typing.SupportsIndex) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.XyPointCurveWithZ) -> None

  2. __init__(self: shyft.energy_market.XyPointCurveWithZ, other: shyft.energy_market.XyPointCurveWithZ) -> None

  3. __init__(self: shyft.energy_market.XyPointCurveWithZ, xy_point_curve: shyft.energy_market.XyPointCurve, z: typing.SupportsFloat | typing.SupportsIndex) -> None

property xy_curve

describes the function at z

Type:

XyPointCurve

property xy_point_curve

(Deprecated) describes the function at z, use .xy_curve instead

Type:

XyPointCurve

property z

z value

Type:

float

class shyft.energy_market.core.XyPointCurveWithZList(*args, **kwargs)

Bases: pybind11_object

A strongly typed list of XyPointCurveWithZ.

Overloaded function.

  1. __init__(self: shyft.energy_market.XyPointCurveWithZList) -> None

  2. __init__(self: shyft.energy_market.XyPointCurveWithZList, arg0: shyft.energy_market.XyPointCurveWithZList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.XyPointCurveWithZList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.XyPointCurveWithZList) -> None

  2. __init__(self: shyft.energy_market.XyPointCurveWithZList, arg0: shyft.energy_market.XyPointCurveWithZList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.XyPointCurveWithZList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.XyPointCurveWithZList, x: shyft.energy_market.XyPointCurveWithZ) None

Add an item to the end of the list

clear(self: shyft.energy_market.XyPointCurveWithZList) None

Clear the contents

evaluate(self: shyft.energy_market.XyPointCurveWithZList, x: SupportsFloat | SupportsIndex, z: SupportsFloat | SupportsIndex) float

Evaluate the curve at the point (x, z)

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.XyPointCurveWithZList, L: shyft.energy_market.XyPointCurveWithZList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.XyPointCurveWithZList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.XyPointCurveWithZList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.XyPointCurveWithZ) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.XyPointCurveWithZList) -> shyft.energy_market.XyPointCurveWithZ

Remove and return the last item

  1. pop(self: shyft.energy_market.XyPointCurveWithZList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.XyPointCurveWithZ

Remove and return the item at index i

size(self: shyft.energy_market.XyPointCurveWithZList) int
x_max(self: shyft.energy_market.XyPointCurveWithZList) float

returns largest value of x

x_min(self: shyft.energy_market.XyPointCurveWithZList) float

returns smallest value of x

y_max(self: shyft.energy_market.XyPointCurveWithZList) float

returns largest value of y

y_min(self: shyft.energy_market.XyPointCurveWithZList) float

returns smallest value of y

z_max(self: shyft.energy_market.XyPointCurveWithZList) float

returns largest value of z

z_min(self: shyft.energy_market.XyPointCurveWithZList) float

returns smallest value of z

class shyft.energy_market.core.XyzPointCurve(*args, **kwargs)

Bases: pybind11_object

A 3D curve consisting of one or more 2D curves parametrised over a third variable.

Overloaded function.

  1. __init__(self: shyft.energy_market.XyzPointCurve) -> None

  2. __init__(self: shyft.energy_market.XyzPointCurve, curves: shyft.energy_market.XyPointCurveWithZList) -> None

Create from a list.

  1. __init__(self: shyft.energy_market.XyzPointCurve, curves: shyft.energy_market.XyzPointCurveDict) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.XyzPointCurve) -> None

  2. __init__(self: shyft.energy_market.XyzPointCurve, curves: shyft.energy_market.XyPointCurveWithZList) -> None

Create from a list.

  1. __init__(self: shyft.energy_market.XyzPointCurve, curves: shyft.energy_market.XyzPointCurveDict) -> None

property curves
evaluate(self: shyft.energy_market.XyzPointCurve, x: SupportsFloat | SupportsIndex, z: SupportsFloat | SupportsIndex) float

Evaluate the curve at the point (x, z)

get_curve(self: shyft.energy_market.XyzPointCurve, z: SupportsFloat | SupportsIndex) shyft.energy_market.XyPointCurve

get the curve assigned to the value

gradient(self: shyft.energy_market.XyzPointCurve, arg0: SupportsFloat | SupportsIndex, arg1: SupportsFloat | SupportsIndex) Annotated[list[float], 'FixedSize(2)']
set_curve(self: shyft.energy_market.XyzPointCurve, z: SupportsFloat | SupportsIndex, xy: shyft.energy_market.XyPointCurve) None

Assign an XyzPointCurve to a z-value

shyft.energy_market.core.compressed_size(*args, **kwargs)

Overloaded function.

  1. compressed_size(double_vector: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], accuracy: typing.SupportsFloat | typing.SupportsIndex) -> int

  2. compressed_size(float_vector: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], accuracy: typing.SupportsFloat | typing.SupportsIndex) -> int

shyft.energy_market.core.points_from_x_y(x: collections.abc.Sequence[SupportsFloat | SupportsIndex], y: collections.abc.Sequence[SupportsFloat | SupportsIndex]) shyft.energy_market.XyPointList
class shyft.energy_market.core.run_state(self: shyft.energy_market.run_state, value: SupportsInt | SupportsIndex)

Bases: pybind11_object

Describes the possible state of the run

Members:

R_CREATED

R_PREP_INPUT

R_RUNNING

R_FINISHED_RUN

R_READ_RESULT

R_FROZEN

R_FAILED

R_CREATED = <run_state.R_CREATED: 0>
R_FAILED = <run_state.R_FAILED: 6>
R_FINISHED_RUN = <run_state.R_FINISHED_RUN: 3>
R_FROZEN = <run_state.R_FROZEN: 5>
R_PREP_INPUT = <run_state.R_PREP_INPUT: 1>
R_READ_RESULT = <run_state.R_READ_RESULT: 4>
R_RUNNING = <run_state.R_RUNNING: 2>
__init__(self: shyft.energy_market.run_state, value: SupportsInt | SupportsIndex) None
run_state.name -> str
property value
shyft.energy_market.core.downstream_reservoirs(component: shyft.energy_market.HydroComponent, max_dist: SupportsInt | SupportsIndex = 0) shyft.energy_market.ReservoirList

Find all reservoirs upstream from component, stopping at max_dist traversals

Parameters:

max_dist (int) – max traversals

Returns:

reservoirs. The reservoirs within the specified distance

Return type:

ReservoirList

shyft.energy_market.core.downstream_units(component: shyft.energy_market.HydroComponent, max_dist: SupportsInt | SupportsIndex = 0) shyft.energy_market.UnitList

Find all units downstream from component, stopping at max_dist traversals

Parameters:

max_dist (int) – max traversals

Returns:

units. The units within the specified distance

Return type:

UnitList

shyft.energy_market.core.upstream_reservoirs(component: shyft.energy_market.HydroComponent, max_dist: SupportsInt | SupportsIndex = 0) shyft.energy_market.ReservoirList

Find all reservoirs upstream from component, stopping at max_dist traversals.

Parameters:

max_dist (int) – max traversals

Returns:

reservoirs. The reservoirs within the specified distance

Return type:

ReservoirList

shyft.energy_market.core.upstream_units(component: shyft.energy_market.HydroComponent, max_dist: SupportsInt | SupportsIndex = 0) shyft.energy_market.UnitList

Find units upstream from component, stopping at max_dist traversals

Parameters:

max_dist (int) – max traversals

Returns:

units. The units within the specified distance

Return type:

UnitList

shyft.energy_market.core.has_forward_capability(arg0: shyft.energy_market.TurbineCapability) bool

Checks if a turbine can support generating

shyft.energy_market.core.has_backward_capability(arg0: shyft.energy_market.TurbineCapability) bool

Checks if a turbine can support pumping

shyft.energy_market.core.has_reversible_capability(arg0: shyft.energy_market.TurbineCapability) bool

Checks if a turbine can support both generating and pumping

STM

The detailed energy market model contains all essential energy market objects, entities, that Shyft manages.

For example, power plants with units, unit-groups, reservoirs, waterways, market areas, power-modules, contracts, contract portfolios, network with transmission lines and bus-bars for electrical connections between the elements.

The module also provides ready made services, with clients and api’s, in python, as well as web/socket protocols for setting up a complete application system covering the energy management process tasks.

The design and architecture of the system utilizes the energy market models, combined with the DTSS, the distributed time-series services, and provides a model-driven approach with time-series expressions derived from the model, so that it scales and maintains well.

The Task Services also support the workflow that are operating on StmSystem, to be efficiently orchestrated, including running optimization tasks with Sintef SHOP engine. Generic python callback allows extensions to arbitrary tasks that can be performed using python.

The UI Services and classes completes the Task Services with a a framework for model and data-driven front end., that fits the task-workflow, showing relevant data/information at the workflow process. E.g: if you are planning a power plant, you can configure the Task and UI service to provide a suitable view, e.g. chart/tables with data-bindings, that works with the backend services, in real time.

The test-suites of Shyft for the energy-market includes ready made examples that includes starting up the services, adding energy-market models, running SHOP optimization and getting results back for testing/regressions.

E.g: https://gitlab.com/shyft-os/shyft/-/blob/master/python/test_suites/energy_market/stm/shop/test_dstm_with_shop.py#L114

Shyft Energy Market detailed model

class shyft.energy_market.stm.AbsoluteConstraint

Bases: pybind11_object

A grouping of time series related to an absolute constraint (i.e. infinite cost)

__init__(*args, **kwargs)
property flag

Flag indicating whether the constraint is active or not

Type:

TimeSeries

property limit

The threshold related to the constraint

Type:

TimeSeries

class shyft.energy_market.stm.Actor(self: shyft.energy_market.stm.Actor, uid: SupportsInt | SupportsIndex, name: str, json: str, sys: shyft.energy_market.stm.StmSystem)

Bases: pybind11_object

A actor between two parties, seller and buyer, for sale of a product at a given price. The actor can refer to specific power-plant, unit group, or even other actors.

__init__(self: shyft.energy_market.stm.Actor, uid: SupportsInt | SupportsIndex, name: str, json: str, sys: shyft.energy_market.stm.StmSystem) None
property custom
flattened_attributes(self: shyft.energy_market.stm.Actor) dict

Flat dict containing all component attributes.

get_tsm_object(self: shyft.energy_market.stm.Actor, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property name
property obj

a python object

Type:

object

property system

The owner of this object.

property tag

Url tag.

Type:

str

property ts
class shyft.energy_market.stm.ActorList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ActorList) -> None

  2. __init__(self: shyft.energy_market.stm.ActorList, arg0: shyft.energy_market.stm.ActorList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.ActorList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ActorList) -> None

  2. __init__(self: shyft.energy_market.stm.ActorList, arg0: shyft.energy_market.stm.ActorList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.ActorList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.ActorList, x: shyft.energy_market.stm.Actor) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.ActorList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.ActorList, L: shyft.energy_market.stm.ActorList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.ActorList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.ActorList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.Actor) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.ActorList) -> shyft.energy_market.stm.Actor

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.ActorList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.Actor

Remove and return the item at index i

size(self: shyft.energy_market.stm.ActorList) int
class shyft.energy_market.stm.ApplicationClient(self: shyft.energy_market.stm.ApplicationClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0)

Bases: pybind11_object

__init__(self: shyft.energy_market.stm.ApplicationClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0) None
add_case(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex, cse: shyft.energy_market.stm.StmCase) tuple[bool]
add_task_ref(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex, case_id: SupportsInt | SupportsIndex, model_ref: shyft.energy_market.stm.StmModelRef) tuple[bool]
get_case_by_id(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex, case_id: SupportsInt | SupportsIndex) tuple[shyft.energy_market.stm.StmCase]
get_case_by_name(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex, case_name: str) tuple[shyft.energy_market.stm.StmCase]
get_layout_infos(self: shyft.energy_market.stm.ApplicationClient, model_ids: collections.abc.Sequence[SupportsInt | SupportsIndex], period: shyft.time_series.UtcPeriod | None) tuple[list[shyft.time_series.ModelInfo]]
get_task_infos(self: shyft.energy_market.stm.ApplicationClient, model_ids: collections.abc.Sequence[SupportsInt | SupportsIndex], period: shyft.time_series.UtcPeriod | None) tuple[list[shyft.time_series.ModelInfo]]
get_task_ref(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex, case_id: SupportsInt | SupportsIndex, model_key: str) tuple[shyft.energy_market.stm.StmModelRef]
read_layout(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex) tuple[shyft.energy_market.stm.LayoutInfo]
read_layout_with_args(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex, layout_name: str, args: str, store_layout: bool) tuple[shyft.energy_market.stm.LayoutInfo]
read_layouts(self: shyft.energy_market.stm.ApplicationClient, model_ids: collections.abc.Sequence[SupportsInt | SupportsIndex]) tuple[list[shyft.energy_market.stm.LayoutInfo]]
read_task(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex) tuple[shyft.energy_market.stm.StmTask]
read_tasks(self: shyft.energy_market.stm.ApplicationClient, model_ids: collections.abc.Sequence[SupportsInt | SupportsIndex]) tuple[list[shyft.energy_market.stm.StmTask]]
remove_case_by_id(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex, case_id: SupportsInt | SupportsIndex) tuple[bool]
remove_case_by_name(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex, case_name: str) tuple[bool]
remove_layout(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex) tuple[bool]
remove_task(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex) tuple[bool]
remove_task_ref(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex, case_id: SupportsInt | SupportsIndex, model_key: str) tuple[bool]
store_layout(self: shyft.energy_market.stm.ApplicationClient, model: shyft.energy_market.stm.LayoutInfo, model_info: shyft.time_series.ModelInfo | None) tuple[int]
store_task(self: shyft.energy_market.stm.ApplicationClient, model: shyft.energy_market.stm.StmTask, model_info: shyft.time_series.ModelInfo | None) tuple[int]
task_fx(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex, args: str) tuple[bool]
update_case(self: shyft.energy_market.stm.ApplicationClient, mode_id: SupportsInt | SupportsIndex, case_: shyft.energy_market.stm.StmCase) tuple[()]
update_layout_info(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex | None, model_info: shyft.time_series.ModelInfo) tuple[bool]
update_task_info(self: shyft.energy_market.stm.ApplicationClient, model_id: SupportsInt | SupportsIndex | None, model_info: shyft.time_series.ModelInfo) tuple[bool]
class shyft.energy_market.stm.ApplicationServer(self: shyft.energy_market.stm.ApplicationServer, ip: str, port: SupportsInt | SupportsIndex, callbacks: tuple)

Bases: pybind11_object

Parameters:
  • ip (str) – Listening IP

  • port (int) – Listening port

  • callbacks (task_callback, layout_callback) – Model callbacks

__init__(self: shyft.energy_market.stm.ApplicationServer, ip: str, port: SupportsInt | SupportsIndex, callbacks: tuple) None
Parameters:
  • ip (str) – Listening IP

  • port (int) – Listening port

  • callbacks (task_callback, layout_callback) – Model callbacks

close(self: shyft.energy_market.stm.ApplicationServer) None
start_server(self: shyft.energy_market.stm.ApplicationServer) int
stop_server(self: shyft.energy_market.stm.ApplicationServer, timeout: SupportsInt | SupportsIndex = 1000) None
class shyft.energy_market.stm.Busbar(self: shyft.energy_market.stm.Busbar, uid: SupportsInt | SupportsIndex, name: str, json: str, net: shyft.energy_market.stm.Network)

Bases: pybind11_object

A hub connected by transmission lines

class TsTriplet

Bases: pybind11_object

Describes .realised, .schedule and .result time-series

__init__(*args, **kwargs)
property realised

SI-units, realised time-series, as in historical fact

Type:

_ts

property result

SI-units, result, as provided by optimisation

Type:

_ts

property schedule

SI-units, schedule, as in current schedule

Type:

_ts

__init__(self: shyft.energy_market.stm.Busbar, uid: SupportsInt | SupportsIndex, name: str, json: str, net: shyft.energy_market.stm.Network) None
add_power_module(self: shyft.energy_market.stm.Busbar, arg0: shyft.energy_market.stm.PowerModule, arg1: shyft.time_series.TimeSeries) None

Associate a (time-dependent) power module to this busbar

add_to_end_of_transmission_line(self: shyft.energy_market.stm.Busbar, arg0: shyft.energy_market.stm.TransmissionLine) None

Add this busbar to the end of a transmission line

add_to_market_area(self: shyft.energy_market.stm.Busbar, arg0: shyft.energy_market.stm.MarketArea) None

Associate a market area to this busbar

add_to_start_of_transmission_line(self: shyft.energy_market.stm.Busbar, arg0: shyft.energy_market.stm.TransmissionLine) None

Add this busbar to the start of a transmission line

add_unit(self: shyft.energy_market.stm.Busbar, arg0: shyft.energy_market.stm.Unit, arg1: shyft.time_series.TimeSeries) None

Associate a (time-dependent) unit to this busbar

add_wind_farm(self: shyft.energy_market.stm.Busbar, arg0: shyft.energy_market.stm.WindFarm, arg1: shyft.time_series.TimeSeries) None

Associate a (time-dependent) wind farm to this busbar

property custom
flattened_attributes(self: shyft.energy_market.stm.Busbar) dict

Flat dict containing all component attributes.

property flow

Flow attributes.

Type:

TsTriplet

get_market_areas(self: shyft.energy_market.stm.Busbar) shyft.energy_market.stm.MarketAreaList

Get any market areas associated with this busbar

get_transmission_lines_from_busbar(self: shyft.energy_market.stm.Busbar) shyft.energy_market.stm.TransmissionLineList

Get any transmission lines connected from this busbar

get_transmission_lines_to_busbar(self: shyft.energy_market.stm.Busbar) shyft.energy_market.stm.TransmissionLineList

Get any transmission lines connected to this busbar

get_tsm_object(self: shyft.energy_market.stm.Busbar, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property name
property network

The owner of this object.

property obj

a python object

Type:

object

property power_modules

modules associated with this busbar

Type:

PowerModuleMemberList

property price

Price attributes.

Type:

TsTriplet

remove_power_module(self: shyft.energy_market.stm.Busbar, arg0: shyft.energy_market.stm.PowerModule) None

Remove a (time-dependent) power module from this busbar

remove_unit(self: shyft.energy_market.stm.Busbar, arg0: shyft.energy_market.stm.Unit) None

Remove a (time-dependent) unit from this busbar

remove_wind_farm(self: shyft.energy_market.stm.Busbar, arg0: shyft.energy_market.stm.WindFarm) None

Remove a (time-dependent) wind farm from this busbar

property tag

Url tag.

Type:

str

property ts
property units

Units associated with this busbar

Type:

UnitMemberList

property wind_farms

Wind Farms associated with this busbar

Type:

WindFarmMemberList

class shyft.energy_market.stm.BusbarList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.BusbarList) -> None

  2. __init__(self: shyft.energy_market.stm.BusbarList, arg0: shyft.energy_market.stm.BusbarList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.BusbarList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.BusbarList) -> None

  2. __init__(self: shyft.energy_market.stm.BusbarList, arg0: shyft.energy_market.stm.BusbarList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.BusbarList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.BusbarList, x: shyft.energy_market.stm.Busbar) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.BusbarList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.BusbarList, L: shyft.energy_market.stm.BusbarList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.BusbarList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.BusbarList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.Busbar) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.BusbarList) -> shyft.energy_market.stm.Busbar

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.BusbarList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.Busbar

Remove and return the item at index i

size(self: shyft.energy_market.stm.BusbarList) int
class shyft.energy_market.stm.Catchment(self: shyft.energy_market.stm.Catchment, uid: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem)

Bases: Catchment

Stm catchment.

__init__(self: shyft.energy_market.stm.Catchment, uid: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem) None
property custom
flattened_attributes(self: shyft.energy_market.stm.Catchment) dict

Flat dict containing all component attributes.

get_tsm_object(self: shyft.energy_market.stm.Catchment, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property inflow_m3s

discharge m3/s, time series.

Type:

_ts

property json
property name
property obj

a python object

Type:

object

property tag

Url tag.

Type:

str

property ts
class shyft.energy_market.stm.CatchmentList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.CatchmentList) -> None

  2. __init__(self: shyft.energy_market.stm.CatchmentList, arg0: collections.abc.Sequence[shyft.energy_market.stm.Catchment]) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.CatchmentList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.CatchmentList) -> None

  2. __init__(self: shyft.energy_market.stm.CatchmentList, arg0: collections.abc.Sequence[shyft.energy_market.stm.Catchment]) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.CatchmentList, arg0: collections.abc.Iterable) -> None

append(self: collections.abc.Sequence[shyft.energy_market.stm.Catchment], x: shyft.energy_market.stm.Catchment) None

Add an item to the end of the list

clear(self: collections.abc.Sequence[shyft.energy_market.stm.Catchment]) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: collections.abc.Sequence[shyft.energy_market.stm.Catchment], L: collections.abc.Sequence[shyft.energy_market.stm.Catchment]) -> None

Extend the list by appending all the items in the given list

  1. extend(self: collections.abc.Sequence[shyft.energy_market.stm.Catchment], L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: collections.abc.Sequence[shyft.energy_market.stm.Catchment], i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.Catchment) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: collections.abc.Sequence[shyft.energy_market.stm.Catchment]) -> shyft.energy_market.stm.Catchment

Remove and return the last item

  1. pop(self: collections.abc.Sequence[shyft.energy_market.stm.Catchment], i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.Catchment

Remove and return the item at index i

size(self: collections.abc.Sequence[shyft.energy_market.stm.Catchment]) int
class shyft.energy_market.stm.Contract(self: shyft.energy_market.stm.Contract, uid: SupportsInt | SupportsIndex, name: str, json: str, sys: shyft.energy_market.stm.StmSystem)

Bases: pybind11_object

A contract between two parties, seller and buyer, for sale of a product at a given price. The contract can refer to specific power-plant, unit group, or even other contracts.

class Constraint

Bases: pybind11_object

Contract.Constraint attributes

__init__(*args, **kwargs)
property max_trade

Maximum quantity (volume) that must be traded for this contract.

Type:

_ts

property min_trade

Minimum quantity (volume) that must be traded for this contract.

Type:

_ts

property ramping_down

Max quantity (volume) to ramp down between timesteps for this contract.

Type:

_ts

property ramping_down_penalty_cost

Penalty for violating ramping down limit.

Type:

_ts

property ramping_up

Max quantity (volume) to ramp up between timesteps for this contract.

Type:

_ts

property ramping_up_penalty_cost

Penalty for violating ramping up limit.

Type:

_ts

class ContractHydroComponent

Bases: pybind11_object

A hydro component referred to by a contract.

__init__(*args, **kwargs)
property component

The related hydro component

Type:

HydroComponent

property custom
flattened_attributes(self: shyft.energy_market.stm.Contract.ContractHydroComponent) dict

Flat dict containing all component attributes.

get_tsm_object(self: shyft.energy_market.stm.Contract.ContractHydroComponent, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property name
property obj

a python object

Type:

object

property owner

ref. to the contract that owns this component

Type:

Contract

property tag

Url tag.

Type:

str

property ts
class ContractHydroComponentList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.Contract.ContractHydroComponentList) -> None

  2. __init__(self: shyft.energy_market.stm.Contract.ContractHydroComponentList, arg0: shyft.energy_market.stm.Contract.ContractHydroComponentList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.Contract.ContractHydroComponentList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.Contract.ContractHydroComponentList) -> None

  2. __init__(self: shyft.energy_market.stm.Contract.ContractHydroComponentList, arg0: shyft.energy_market.stm.Contract.ContractHydroComponentList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.Contract.ContractHydroComponentList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.Contract.ContractHydroComponentList, x: shyft.energy_market.stm.Contract.ContractHydroComponent) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.Contract.ContractHydroComponentList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.Contract.ContractHydroComponentList, L: shyft.energy_market.stm.Contract.ContractHydroComponentList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.Contract.ContractHydroComponentList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.Contract.ContractHydroComponentList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.Contract.ContractHydroComponent) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.Contract.ContractHydroComponentList) -> shyft.energy_market.stm.Contract.ContractHydroComponent

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.Contract.ContractHydroComponentList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.Contract.ContractHydroComponent

Remove and return the item at index i

size(self: shyft.energy_market.stm.Contract.ContractHydroComponentList) int
class ContractRelation

Bases: pybind11_object

A relation to another contract, where the relation-type is a user specified integer. This allows building and maintaining contract system that have internal rules/constraints There is a minimal set of rules, like avoiding circularities that are enforced

__init__(*args, **kwargs)
property id

The id of the relation

Type:

int

property owner

ref. to the contract that owns this relation

Type:

Contract

property related

The related contract

Type:

Contract

property relation_type

Free to use integer to describe relation type

Type:

_u16

class ContractRelationList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.Contract.ContractRelationList) -> None

  2. __init__(self: shyft.energy_market.stm.Contract.ContractRelationList, arg0: shyft.energy_market.stm.Contract.ContractRelationList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.Contract.ContractRelationList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.Contract.ContractRelationList) -> None

  2. __init__(self: shyft.energy_market.stm.Contract.ContractRelationList, arg0: shyft.energy_market.stm.Contract.ContractRelationList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.Contract.ContractRelationList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.Contract.ContractRelationList, x: shyft.energy_market.stm.Contract.ContractRelation) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.Contract.ContractRelationList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.Contract.ContractRelationList, L: shyft.energy_market.stm.Contract.ContractRelationList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.Contract.ContractRelationList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.Contract.ContractRelationList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.Contract.ContractRelation) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.Contract.ContractRelationList) -> shyft.energy_market.stm.Contract.ContractRelation

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.Contract.ContractRelationList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.Contract.ContractRelation

Remove and return the item at index i

size(self: shyft.energy_market.stm.Contract.ContractRelationList) int
__init__(self: shyft.energy_market.stm.Contract, uid: SupportsInt | SupportsIndex, name: str, json: str, sys: shyft.energy_market.stm.StmSystem) None
property active

Contract status (dead/alive).

Type:

_ts

add_hydro_component(self: shyft.energy_market.stm.Contract, id: SupportsInt | SupportsIndex, component: shyft.energy_market.HydroComponent) shyft.energy_market.stm.Contract.ContractHydroComponent

Add a hydro component to this contract

Parameters:
  • id (Id) – The contract hydro component id (must be unique for this contract)

  • component (HydroComponent) – The hydro component to be added to the contract

add_relation(self: shyft.energy_market.stm.Contract, id: SupportsInt | SupportsIndex, contract: shyft.energy_market.stm.Contract, relation_type: SupportsInt | SupportsIndex) shyft.energy_market.stm.Contract.ContractRelation

Add a contract as a relation from this contract

Parameters:
  • id (Id) – The relation id (must be unique for this contract)

  • contract (Contract) – The contract to be added as a relation

  • relation_type (RelationType) – A free to use integer to describe relation type

add_to_market_area(self: shyft.energy_market.stm.Contract, arg0: shyft.energy_market.stm.MarketArea) None

Add this contract to specified energy market area. Convenience for appending to MarketArea.contracts.

add_to_portfolio(self: shyft.energy_market.stm.Contract, arg0: shyft.energy_market.stm.ContractPortfolio) None

Add this contract to specified portfolio. Convenience for appending to ContractPortfolio.contracts.

property buyer

The name of the buyer party of the contract.

Type:

_string

property buyer_

buyer

Type:

Actor

property constraint

Constrant of this contract.

Type:

Constraint

property custom
property fee

[money/s] Any contract fees, in rate units so that fee over the contract period gives total fee.

Type:

_ts

Find contracts that have a relation to self.

Returns:

contracts. The contracts that have a relation to this contract

Return type:

ContractVector

flattened_attributes(self: shyft.energy_market.stm.Contract) dict

Flat dict containing all component attributes.

get_market_areas(self: shyft.energy_market.stm.Contract) shyft.energy_market.stm.MarketAreaList

Get any energy market areas this contract is associated with. Convenience for search in MarketArea.contracts.

get_portfolios(self: shyft.energy_market.stm.Contract) shyft.energy_market.stm.ContractPortfolioList

Get any portfolios this contract is associated with. Convenience for search in ContractPortfolio.contracts.

get_tsm_object(self: shyft.energy_market.stm.Contract, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property hydro_components

List of related hydro components.

Type:

ContractHydroComponentList

property id
property json
property name
property obj

a python object

Type:

object

property options

Defines optional price/volume curves for future trading.

Type:

_t_xy_

parent(self: shyft.energy_market.stm.Contract) shyft.energy_market.stm.Contract

Contract: Owning contract

property parent_id

Optional reference to parent (contract). Typically for forwardes/futures, that is splitted into shorter terms as time for the delivery is approaching.

Type:

_string

property power_plants

List of associated power plants.

Type:

PowerPlantList

property price

[money/J] Contract price.

Type:

_ts

property quantity

[J/s] Contract quantity, in rate units, so that integrated over contract period gives total volume.

Type:

_ts

property relations

List of related contracts.

Type:

ContractRelationList

remove_hydro_component(self: shyft.energy_market.stm.Contract, component: shyft.energy_market.stm.Contract.ContractHydroComponent) bool

Remove hydro_component to contract.

Parameters:

component (ContractHydroComponent) – The hydro_component to be removed

remove_relation(self: shyft.energy_market.stm.Contract, contract_relation: shyft.energy_market.stm.Contract.ContractRelation) None

Remove relation to contract.

Parameters:

contract_relation (ContractRelation) – The relation to be removed

property revenue

[money/s] Calculated revenue, in rate units, so that integrated of the contract period gives total revenue volume

Type:

_ts

property seller

The name of the seller party of the contract.

Type:

_string

property seller_

seller

Type:

Actor

property system

The owner of this object.

property tag

Url tag.

Type:

str

property ts
property validation

Validation status (and whether the contract has been validated or not).

Type:

_ts

property wind_farms

List of associated wind farms.

Type:

WindFarmList

class shyft.energy_market.stm.ContractList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ContractList) -> None

  2. __init__(self: shyft.energy_market.stm.ContractList, arg0: shyft.energy_market.stm.ContractList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.ContractList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ContractList) -> None

  2. __init__(self: shyft.energy_market.stm.ContractList, arg0: shyft.energy_market.stm.ContractList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.ContractList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.ContractList, x: shyft.energy_market.stm.Contract) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.ContractList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.ContractList, L: shyft.energy_market.stm.ContractList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.ContractList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.ContractList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.Contract) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.ContractList) -> shyft.energy_market.stm.Contract

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.ContractList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.Contract

Remove and return the item at index i

size(self: shyft.energy_market.stm.ContractList) int
class shyft.energy_market.stm.ContractPortfolio(self: shyft.energy_market.stm.ContractPortfolio, uid: SupportsInt | SupportsIndex, name: str, json: str, sys: shyft.energy_market.stm.StmSystem)

Bases: pybind11_object

Stm contract portfolio represents a set of contracts, so that the sum of interesting contract properties can be evaluated and compared.

__init__(self: shyft.energy_market.stm.ContractPortfolio, uid: SupportsInt | SupportsIndex, name: str, json: str, sys: shyft.energy_market.stm.StmSystem) None
property contracts
property custom
property fee

[money/s] Fees of the portfolio, normally sum of contracts.

Type:

_ts

flattened_attributes(self: shyft.energy_market.stm.ContractPortfolio) dict

Flat dict containing all component attributes.

get_tsm_object(self: shyft.energy_market.stm.ContractPortfolio, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property name
property obj

a python object

Type:

object

property quantity

[J/s] normally sum of contracts, unit depends on the contracts.

Type:

_ts

property revenue

[money/s] Calculated revenue.

Type:

_ts

property system

The owner of this object.

property tag

Url tag.

Type:

str

property ts
class shyft.energy_market.stm.ContractPortfolioList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ContractPortfolioList) -> None

  2. __init__(self: shyft.energy_market.stm.ContractPortfolioList, arg0: shyft.energy_market.stm.ContractPortfolioList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.ContractPortfolioList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ContractPortfolioList) -> None

  2. __init__(self: shyft.energy_market.stm.ContractPortfolioList, arg0: shyft.energy_market.stm.ContractPortfolioList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.ContractPortfolioList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.ContractPortfolioList, x: shyft.energy_market.stm.ContractPortfolio) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.ContractPortfolioList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.ContractPortfolioList, L: shyft.energy_market.stm.ContractPortfolioList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.ContractPortfolioList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.ContractPortfolioList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.ContractPortfolio) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.ContractPortfolioList) -> shyft.energy_market.stm.ContractPortfolio

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.ContractPortfolioList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.ContractPortfolio

Remove and return the item at index i

size(self: shyft.energy_market.stm.ContractPortfolioList) int
class shyft.energy_market.stm.DStmClient(self: shyft.energy_market.stm.DStmClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0)

Bases: pybind11_object

Client side for the DStmServer

Takes care of message exchange to the remote server, using the supplied parameters. It implements the message protocol of the server, sending message-prefix, arguments, waiting for the response, deserialize the response and handle it back to the user.

See also

DStmServer

__init__(self: shyft.energy_market.stm.DStmClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0) None
add_compute_server(self: shyft.energy_market.stm.DStmClient, host_port: str) bool

add a compute node specified by it’s address string of form host:port

Parameters:

host_port (str) – the address of the dstm compute node service in the form of host:port

add_model(self: shyft.energy_market.stm.DStmClient, mid: str, mdl: shyft.energy_market.stm.StmSystem) bool

Add model to server

Parameters:
  • mid (str) – ID/key to store model as.

  • mdl (StmSystem) – STM System to store in key ‘mid’

Returns:

success. Returns True on success

Return type:

bool

cache_flush(self: shyft.energy_market.stm.DStmClient) None

flushes all items out of internal dtss cache and stats

cache_stats(self: shyft.energy_market.stm.DStmClient) shyft.time_series.CacheStats

CacheStats: the internal dtss current cache statistics

clone_model(self: shyft.energy_market.stm.DStmClient, old_mid: str, new_mid: str, sparse: bool = False) bool

Clone existing model with ID.

Parameters:
  • old_mid (str) – ID of model to clone

  • new_mid (str) – ID to store cloned model against

  • sparse (bool) – Stips model of expressions if true, increases speed.

Returns:

success. Returns True on success

Return type:

bool

close(self: shyft.energy_market.stm.DStmClient) None

Close the connection. It will automatically reopen if needed.

compute_server_status(self: shyft.energy_market.stm.DStmClient) list[shyft.energy_market.stm.ServerStatus]

Get status of managed compute servers

Returns:

status. status of managed compute servers.

Return type:

List[ComputeServerStatus]

create_model(self: shyft.energy_market.stm.DStmClient, mid: str) bool

Create an empty model and store it server side.

Parameters:

mid (str) – ID of new model

Returns:

success. Returns true on success

Return type:

bool

evaluate_model(self: shyft.energy_market.stm.DStmClient, mid: str, bind_period: shyft.time_series.UtcPeriod, use_ts_cached_read: bool = True, update_ts_cache: bool = True, clip_period: shyft.time_series.UtcPeriod = UtcPeriod()) bool

Evaluate any unbound time series attributes of a model

Parameters:
  • mid (str) – ID of model to evaluate

  • bind_period (UtcPeriod) – Period for bind in evaluate.

  • use_ts_cached_read (bool) – allow use of cached results. Use it for immutable data reads!

  • update_ts_cache (bool) – when reading time-series, also update the cache with the data. Use it for immutable data reads!

  • clip_period (UtcPeriod) – Period for clip in evaluate.

See also

UtcPeriod

Returns:

bound. Returns whether any of the model’s attributes had to be bound.

Return type:

bool

evaluate_ts(self: shyft.energy_market.stm.DStmClient, tsv: shyft.time_series.TsVector, bind_period: shyft.time_series.UtcPeriod, use_ts_cached_read: bool = True, update_ts_cache: bool = True, clip_period: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.TimeSeries | shyft.energy_market.stm.TsEvaluationError]

Evaluate any time series expressions If an expression can not be evaluated, TsEvaluationError is returned in place of the ts.

Parameters:
  • tsv (TsVector) – Timeseries to evaluate

  • bind_period (UtcPeriod) – Period for bind in evaluate.

  • use_ts_cached_read (bool) – allow use of cached results. Use it for immutable data reads!

  • update_ts_cache (bool) – when reading time-series, also update the cache with the data. Use it for immutable data reads!

  • clip_period (UtcPeriod) – Period for clip in evaluate.

See also

UtcPeriod

Returns:

result. Returns the evaluated timeseries or an evaluation error.

Return type:

list

fx(self: shyft.energy_market.stm.DStmClient, mid: str, fx_arg: str) bool

Execute the serverside fx, passing supplied arguments

Parameters:
  • mid (str) – ID of model for the server-side fx

  • fx_arg (str) – any argument passed to the server-side fx

Returns:

success. true if call successfully done

Return type:

bool

get_attrs(self: shyft.energy_market.stm.DStmClient, urls: collections.abc.Sequence[str]) list[bool | float | int | int | shyft.time_series.TimeSeries | shyft.energy_market.t_xy | shyft.energy_market.t_xyz | shyft.energy_market.t_xyz_list | shyft.energy_market.t_turbine_description | str | shyft.time_series.TsVector | shyft.energy_market.UnitGroupType | shyft.time_series.TimeAxis | shyft.time_series.GeoPoint | shyft.energy_market.stm.UrlResolveError]

Get a list of attributes specified by url. If an url is unable to be resolved UrlResolveError is returned in place of the attribute.

Parameters:

urls (list) – list of dstm attribute urls.

Returns:

attrs. list of dstm attributes.

Return type:

list

get_log(self: shyft.energy_market.stm.DStmClient, mid: str) list[shyft.energy_market.stm.LogEntry]

Get log for a model

Parameters:

mid (str) – ID of model to get log for

Returns:

entries. List of log entries

Return type:

ShopLogEntryList

get_model(self: shyft.energy_market.stm.DStmClient, mid: str, stripped: bool = False) shyft.energy_market.stm.StmSystem

Get a stored model by ID

Parameters:
  • mid (str) – ID of model to get

  • stripped (bool) – default false, full model, if true return stripped skeleton model

Returns:

  1. Requested model

Return type:

StmSystem

get_model_ids(self: shyft.energy_market.stm.DStmClient) list[str]

Get IDs of all models stored

Returns:

id_list. List of model IDs

Return type:

List[str]

get_model_infos(self: shyft.energy_market.stm.DStmClient) dict[str, shyft.time_series.ModelInfo]

Get model infos of all models stored

Returns:

mi_list. Dict of (ModelKey, ModelInfo) for each model stored.

Return type:

ModelInfoList

See also

shyft.energy_market.core.ModelInfo

get_server_version(self: shyft.energy_market.stm.DStmClient) str

Get version of remote server.

Returns:

version. Server version string

Return type:

str

get_state(self: shyft.energy_market.stm.DStmClient, mid: str) shyft.energy_market.stm.ModelState

Get the state of a model by ID

Parameters:

mid (str) – ID of model to get state of

Returns:

state. State of requested model

Return type:

ModelState

get_ts(self: shyft.energy_market.stm.DStmClient, mid: str, ts_urls: collections.abc.Sequence[str]) shyft.time_series.TsVector

Get the time-series from the model mid, as specified by ts_urls

Parameters:
  • mid (str) – ID of model

  • ts_urls (StringVector) – Strongly typed list of strings, urls, like dstm://Mmid/..

Returns:

time-series. list of time-series as specifed by the list of ts_urls, same order

Return type:

TsVector

property host_port

Endpoint network address of the remote server.

Type:

str

property is_open

If the connection to the remote server is (still) open.

Type:

bool

property operation_timeout_ms

Operation timeout for remote server operations, in number milliseconds.

Type:

int

optimize(self: shyft.energy_market.stm.DStmClient, mid: str, ta: shyft.time_series.TimeAxis, cmd: collections.abc.Sequence[shyft.energy_market.stm.ShopCommand], compute_node_mode: bool = False) bool

Run optimization on a model

Parameters:
  • mid (str) – ID of model to run optimization on

  • ta (TimeAxis) – Time span to run optimization over

  • cmd (List[ShopCommand]) – List of SHOP commands

  • compute_node_mode (bool) – default false, for compute nodes set to true to minimize work done after optimize

See also

ShopCommand

Returns:

success. Stating whether optimization was started successfully or not.

Return type:

bool

patch_model(self: shyft.energy_market.stm.DStmClient, mid: str, op: shyft.energy_market.stm.StmPatchOperation, p: shyft.energy_market.stm.StmSystem) bool

Patch the model mid with patch p using operation op.

Parameters:
  • mid (str) – ID of model

  • () (p) – Operation is one of ADD,REMOVE_RELATIONS,REMOVE_OBJECTS

  • () – The StmSystem describing the patch

Returns:

ok. whether or not the model was reset.

Return type:

bool

property reconnect_count

Number of reconnects to the remote server that have been performed.

Type:

int

remove_model(self: shyft.energy_market.stm.DStmClient, mid: str) bool

Remove model by ID.

Parameters:

mid (str) – ID of model to remove.

Returns:

success. Returns True on success.

Return type:

bool

rename_model(self: shyft.energy_market.stm.DStmClient, old_mid: str, new_mid: str) bool

Rename a model

Parameters:
  • old_mid (str) – ID of model to rename

  • new_mid (str) – New ID of model

Returns:

success. Returns True on success.

Return type:

bool

reset_model(self: shyft.energy_market.stm.DStmClient, mid: str) bool

Reset the model specified by mid.

Parameters:

mid (str) – ID of model

Returns:

ok. whether or not the model was reset.

Return type:

bool

set_attrs(self: shyft.energy_market.stm.DStmClient, attrs: collections.abc.Sequence[tuple[str, bool | SupportsFloat | SupportsIndex | SupportsInt | SupportsIndex | SupportsInt | SupportsIndex | shyft.time_series.TimeSeries | shyft.energy_market.t_xy | shyft.energy_market.t_xyz | shyft.energy_market.t_xyz_list | shyft.energy_market.t_turbine_description | str | shyft.time_series.TsVector | shyft.energy_market.UnitGroupType | shyft.time_series.TimeAxis | shyft.time_series.GeoPoint]]) list[shyft.energy_market.stm.UrlResolveError | None]

Set a list of attributes specified by url. If anyone is subscribed on the attribute they are notified

Parameters:

attrs (list) – list of pairs of dstm url and attribute.

Returns:

attrs. list of None if successful or UrlResolveError if the attribute could not be set.

Return type:

list

set_model(self: shyft.energy_market.stm.DStmClient, mid: str, model: shyft.energy_market.stm.StmSystem) bool

Set the model specified by mid.

Parameters:
  • mid (str) – ID of model

  • model (StmSystem) – Model to store

Returns:

ok. whether or not the model was set.

Return type:

bool

set_ts(self: shyft.energy_market.stm.DStmClient, mid: str, tsv: shyft.time_series.TsVector) None

Set the time-series in the model mid, as specified by ts_urls in the tsv. If anyone is subscribers on time-series, or expressions affected, they are notified

Parameters:
  • mid (str) – ID of model

  • tsv (TsVector) – list of TimeSeries(ts_url,ts_with_values) ,ts_url, like dstm://Mmid/..

start_tune(self: shyft.energy_market.stm.DStmClient, mid: str) bool

Start tuning a model

Parameters:

mid (str) – ID of model to run optimization on

Returns:

success. Stating tuning was started successfully or not.

Return type:

bool

stop_tune(self: shyft.energy_market.stm.DStmClient, mid: str) bool

Stop tuning a model

Parameters:

mid (str) – ID of model to run optimization on

Returns:

success. Stating tuning was stopped successfully or not.

Return type:

bool

property timeout_ms

Timout for remote server operations, in number milliseconds.

Type:

int

tune(self: shyft.energy_market.stm.DStmClient, mid: str, ta: shyft.time_series.TimeAxis, cmd: collections.abc.Sequence[shyft.energy_market.stm.ShopCommand]) bool

Run tuning optimization on a model

Parameters:
  • mid (str) – ID of model to run optimization on

  • ta (TimeAxis) – Time span to run optimization over

  • cmd (List[ShopCommand]) – List of SHOP commands

See also

ShopCommand

Returns:

success. Stating whether tuning optimization was started successfully or not.

Return type:

bool

class shyft.energy_market.stm.DStmServer(*args, **kwargs)

Bases: pybind11_object

A server object serving distributed, ‘live’ STM systems. The server contains an DTSS that handles time series for the models stored in the server.

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.DStmServer, config: shyft.energy_market.stm.DStmServerConfig) -> None

  2. __init__(self: shyft.energy_market.stm.DStmServer) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.DStmServer, config: shyft.energy_market.stm.DStmServerConfig) -> None

  2. __init__(self: shyft.energy_market.stm.DStmServer) -> None

add_compute_server(self: shyft.energy_market.stm.DStmServer, host_port: str) bool

add a compute node specified by it’s address string of form host:port

Parameters:

host_port (str) – the address of the dstm compute node service in the form of host:port

add_container(self: shyft.energy_market.stm.DStmServer, container_name: str, root_dir: str) None

Add a container to the server’s DTSS.

Parameters:
  • container_name (str) – name of container to create.

  • root_dir (str) – Directory where container’s time series are stored.

Returns:

nothing.

Return type:

None

add_model(self: shyft.energy_market.stm.DStmServer, mid: str, mdl: shyft.energy_market.stm.StmSystem) bool

Add model to server

Parameters:
  • mid (str) – ID/key to store model as.

  • mdl (StmSystem) – STM System to store in key ‘mid’

Returns:

success. Returns True on success

Return type:

bool

Raises:

RuntimeError – If ‘mid’ is already an ID of a model.

apply(self: shyft.energy_market.stm.DStmServer, mid: str, action: collections.abc.Callable[[shyft.energy_market.stm.StmSystem], object]) object

Apply an action to a model.

The action gets exclusive access to the model when applied. Take care not to return something owned by the model itself, as exclusive access will be lost on return

Parameters:
  • mid (str) – ID of model

  • action (Callable[[StmSystem],object]) – function to apply to model

Returns:

obj. Object returned by the action

Return type:

object

property cache_max_items

internal dtss cache_max_items is the maximum number of time-series identities that are kept in memory. Elements exceeding this capacity is elided using the least-recently-used algorithm. Notice that assigning a lower value than the existing value will also flush out time-series from cache in the least recently used order.

Type:

int

property cache_memory_target

The internal dtss servere memory max target in number of bytes. If not set directly the following equation is use: cache_memory_target = cache_ts_initial_size_estimate * cache_max_items When setting the target directly, number of items in the chache is set so that real memory usage is less than the specified target. The setter could cause elements to be flushed out of cache.

Type:

int

property cache_stats

the internal dtss current cache statistics

Type:

CacheStats

property cache_ts_initial_size_estimate

The internal dtss initial time-series size estimate in bytes for the cache mechanism. memory-target = cache_ts_initial_size_estimate * cache_max_items algorithm. Notice that assigning a lower value than the existing value will also flush out time-series from cache in the least recently used order.

Type:

int

property can_modify

true if this instance can modify main dtss server items, time-series, containers etc.

Type:

bool

clear_cache_stats(self: shyft.energy_market.stm.DStmServer) None

clear accumulated cache_stats of the internal dtss server

clear_master_slave(self: shyft.energy_market.stm.DStmServer) None

Deprecated(use disable_dtss_replica)

clone_model(self: shyft.energy_market.stm.DStmServer, old_mid: str, new_mid: str, sparse: bool = False) bool

Clone existing model with ID.

Parameters:
  • old_mid (str) – ID of model to clone

  • new_mid (str) – ID to store cloned model against

  • sparse (bool) – Stips model of expressions if true, increases speed.

Returns:

success. Returns True on success

Return type:

bool

Raises:
  • RuntimeError – ‘new_mid’ already stores a model

  • RuntimeError – ‘old_mid’ doesn’t store a model to clone

close(self: shyft.energy_market.stm.DStmServer) None

close and stop serving requests on the hpc binary socket interface

configure_dtss_replica(self: shyft.energy_market.stm.DStmServer, ip: str, port: SupportsInt | SupportsIndex, master_poll_time: SupportsFloat | SupportsIndex, unsubscribe_threshold: SupportsInt | SupportsIndex, unsubscribe_max_delay: SupportsFloat | SupportsIndex, can_modify: bool = True, subscription_consistency_interval: SupportsFloat | SupportsIndex = 0.0, protocol_version: SupportsInt | SupportsIndex = 0) None

Set dstm server dtss kernel in replica mode, redirecting all IO calls on this dtss to the primary ip:port dtss. This instance of the dtss is kept in sync with changes done on the primary using subscription to changes on the primary Calculations, and caches are still done locally unloading the computational efforts from the primary.

Parameters:
  • ip (str) – The ip address where the primary dtss is running

  • port (int) – The port number for the primary dtss

  • master_poll_time (time) – [s] max time between each update from primary, typicall 0.1 s is ok

  • unsubscribe_threshold (int) – minimum number of unsubscribed time-series before also unsubscribing from the primary

  • unsubscribe_max_delay (time) – maximum time to delay unsubscriptions, regardless number

  • can_modify (bool) – if false, the main dtss is enforced read-only, default true

  • subscription_consistency_interval (float) – if >0.0, then enable costly consistency check and fix functionality. It should be > 10 minutes or more due to high cost

  • protocol_version (int) – version to run the sync over, defaults to internal

create_model(self: shyft.energy_market.stm.DStmServer, mid: str) bool

Create a new model

Parameters:

mid (str) – ID of new model

Returns:

  1. Empty model with ID set to ‘mid’

Return type:

StmSystem

Raises:

RuntimeError – If ‘mid’ already is ID of a model

disable_dtss_replica(self: shyft.energy_market.stm.DStmServer) None

Clear dtss replica mode if configured, cleanly shut down connection to primary dtss.

evaluate_model(self: shyft.energy_market.stm.DStmServer, mid: str, bind_period: shyft.time_series.UtcPeriod, use_ts_cached_read: bool = True, update_ts_cache: bool = True, clip_period: shyft.time_series.UtcPeriod = UtcPeriod()) bool

Evaluate any unbound time series attributes of a model

Parameters:
  • mid (str) – ID of model to evaluate

  • bind_period (UtcPeriod) – Period for bind in evaluate.

  • use_ts_cached_read (bool) – allow use of cached results. Use it for immutable data reads!

  • update_ts_cache (bool) – when reading time-series, also update the cache with the data. Use it for immutable data reads!

  • clip_period (UtcPeriod) – Period for clip in evaluate.

See also

UtcPeriod

Returns:

bound. Returns whether any of the model’s attributes had to be bound.

Return type:

bool

flush_cache(self: shyft.energy_market.stm.DStmServer) None

flushes all items out of internal dtss cache (cache_stats remain un-touched)

property fx

server-side callable function(lambda) that takes two parameters: mid : the model id fx_arg: arbitrary string to pass to the server-side function The server-side fx is called when the client (or web-api) invokea the c.fx(mid,fx_arg). The signature of the callback function should be (mid:str, fx_arg:str) -> bool This feature is simply enabling the users to tailor server-side functionality in python! Examples:

>>> from shyft.energy_market.stm import DStmServer
>>> s=DStmServer()
>>> def my_fx(mid:str, fx_arg:str)->bool:
>>>     print(f'invoked with mid={mid} fx_arg={fx_arg}')
>>>   # note we can use captured Server s here!>>>     return True
>>> # and then bind the function to the callback
>>> s.fx=my_fx
>>> s.start_server()
>>> : # later using client from anywhere to invoke the call
>>> fx_result=c.fx('my_model_id', 'my_args')
Type:

Callable[[str,str],bool]

get_listening_ip(self: shyft.energy_market.stm.DStmServer) str

return the ip adress the server is listening on for serving incoming requests

get_listening_port(self: shyft.energy_market.stm.DStmServer) int

returns the port number it’s listening at for serving incoming request

get_model(self: shyft.energy_market.stm.DStmServer, mid: str) shyft.energy_market.stm.StmSystem

Get model from server

Parameters:

mid (str) – ID/key to store model as.

Returns:

  1. Found system

Return type:

StmSystem

get_model_ids(self: shyft.energy_market.stm.DStmServer) list[str]

Get IDs of all models stored

Returns:

id_list. List of model IDs

Return type:

List[str]

get_model_infos(self: shyft.energy_market.stm.DStmServer) dict[str, shyft.time_series.ModelInfo]

Get model infos of all models stored

Returns:

mi_list. Dict of (ModelKey, ModelInfo) for each model stored.

Return type:

ModelInfoList

See also

shyft.energy_market.core.ModelInfo

get_state(self: shyft.energy_market.stm.DStmServer, mid: str) shyft.energy_market.stm.ModelState

Get state of stored model by ID

Parameters:

mid (str) – ID of model to get state of

Returns:

state. State of requested model

Return type:

ModelState

Raises:

RuntimeError – Unable to find model with ID ‘mid’

get_version_info(self: shyft.energy_market.stm.DStmServer) str

returns the version number of the DStmServer

get_web_api_ip(self: shyft.energy_market.stm.DStmServer) str

Get listening IP for web API. Returns empty string if not running.

get_web_api_port(self: shyft.energy_market.stm.DStmServer) int

Get listening port for web API. Returns -1 if not running

is_running(self: shyft.energy_market.stm.DStmServer) bool

true if server is listening and running

See also

start_server()

notify_change(self: shyft.energy_market.stm.DStmServer, urls: collections.abc.Sequence[str]) None

Notify change on model urls, dstm://M…, so that changes are pushed to subscribers. In case the urls are wrong, misformed etc, there is no exception raised for that. It’s the callers responsibility entirely to provide valid URLs

Parameters:

urls (StringVector) – List of valid model-urls as kept by this server

optimize(self: shyft.energy_market.stm.DStmServer, mid: str, ta: shyft.time_series.TimeAxis, cmd: collections.abc.Sequence[shyft.energy_market.stm.ShopCommand], compute_node_mode: bool = False) bool

Run SHOP optimization on a model

Parameters:
  • mid (str) – ID of model to run optimization on

  • ta (TimeAxis) – Time span to run optimization over

  • cmd (List[ShopCommand]) – List of SHOP commands

  • compute_node_mode (bool) – default false, for compute nodes set to true to minimize work done after optimize

See also

ShopCommand

Returns:

success. Stating whether optimization was started successfully or not.

Return type:

bool

remove_from_cache(self: shyft.energy_market.stm.DStmServer, ts_ids: collections.abc.Sequence[str]) None

flushes the specified ts_ids from cache Has only effect for ts-ids that are in cache, non-existing items are ignored

Parameters:

ts_ids (StringVector) – a list of time-series ids to flush out

remove_model(self: shyft.energy_market.stm.DStmServer, mid: str) bool

Remove model by ID.

Parameters:

mid (str) – ID of model to remove.

Returns:

success. Returns True on success.

Return type:

bool

Raises:

RuntimeError – If model with ID ‘mid’ does not exist.

rename_model(self: shyft.energy_market.stm.DStmServer, old_mid: str, new_mid: str) bool

Rename a model

Parameters:
  • old_mid (str) – ID of model to rename

  • new_mid (str) – New ID of model

Returns:

success. Returns True on success.

Return type:

bool

Raises:
  • RuntimeError – ‘new_mid’ already stores a model

  • RuntimeError – ‘old_mid’ doesn’t store a model to rename

set_listening_ip(self: shyft.energy_market.stm.DStmServer, ip: str) None

set the listening port for the service

Parameters:

ip (str) – ip or host-name to start listening on

Returns:

nothing.

Return type:

None

set_listening_port(self: shyft.energy_market.stm.DStmServer, port_no: SupportsInt | SupportsIndex) None

set the listening port for the service

Parameters:
  • port_no (int) – a valid and available tcp-ip port number to listen on.

  • 20000 (typically it could be)

Returns:

nothing.

Return type:

None

set_master_slave_mode(self: shyft.energy_market.stm.DStmServer, ip: str, port: SupportsInt | SupportsIndex, master_poll_time: SupportsFloat | SupportsIndex, unsubscribe_threshold: SupportsInt | SupportsIndex, unsubscribe_max_delay: SupportsFloat | SupportsIndex, can_modify: bool = True, subscription_consistency_interval: SupportsFloat | SupportsIndex = 0.0, protocol_version: SupportsInt | SupportsIndex = 0) None

Deprecated(use configure_dtss_replica)

Parameters:
  • ip (str) – The ip address where the primary dtss is running

  • port (int) – The port number for the primary dtss

  • master_poll_time (time) – [s] max time between each update from primary, typicall 0.1 s is ok

  • unsubscribe_threshold (int) – minimum number of unsubscribed time-series before also unsubscribing from the primary

  • unsubscribe_max_delay (time) – maximum time to delay unsubscriptions, regardless number

  • can_modify (bool) – if false, the main dtss is enforced read-only, default true

  • subscription_consistency_interval (float) – if >0.0, then enable costly consistency check and fix functionality. It should be > 10 minutes or more due to high cost

  • protocol_version (int) – version to run the sync over, defaults to internal

start_server(self: shyft.energy_market.stm.DStmServer) int
start_web_api(self: shyft.energy_market.stm.DStmServer, host_ip: str, port: SupportsInt | SupportsIndex, doc_root: str, fg_threads: SupportsInt | SupportsIndex = 2, bg_threads: SupportsInt | SupportsIndex = 4, tls_only: bool = False) int

Start a web API for communicating with server

Parameters:
  • host_ip (str) – 0.0.0.0 for any interface, 127.0.0.1 for local only, etc.

  • port (int) – port number to serve the web API on. Ensure it’s available!

  • doc_root (str) – directory from which we will serve http/https documents.

  • fg_threads (int) – number of web API foreground threads, typical 1-4 depending on load.

  • bg_threads (int) – number of long running background thread workers to serve requests etc.

  • tls_only (bool) – default false, set to true to enforce tls sessions only.

Returns:

port. the real port number used, if port arg is 0, then the auto-allocated value.

Return type:

int

stop_server(self: shyft.energy_market.stm.DStmServer, timeout: SupportsInt | SupportsIndex = 1000) None

stop serving connections, gracefully.

See also

start_server()

stop_web_api(self: shyft.energy_market.stm.DStmServer) None

Stops any ongoing web API service

class shyft.energy_market.stm.DStmServerConfig(*args, **kwargs)

Bases: pybind11_object

Config for DStm server binary: Binary server config janitor: Janitor config managed_server: Managed server config

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.DStmServerConfig, binary: shyft.time_series.ServerConfig, janitor: shyft.energy_market.stm.JanitorConfig = JanitorConfig(duration=”1970-01-01T00:00:10Z”, stale_threshold=”1970-01-01T00:00:30Z”), managed_server: shyft.energy_market.stm.ManagedServerConfig = ManagedServerConfig(timeout_ms=10000, operation_timeout_ms=0)) -> None

  2. __init__(self: shyft.energy_market.stm.DStmServerConfig, arg0: shyft.time_series.ServerConfig) -> None

  3. __init__(self: shyft.energy_market.stm.DStmServerConfig) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.DStmServerConfig, binary: shyft.time_series.ServerConfig, janitor: shyft.energy_market.stm.JanitorConfig = JanitorConfig(duration=”1970-01-01T00:00:10Z”, stale_threshold=”1970-01-01T00:00:30Z”), managed_server: shyft.energy_market.stm.ManagedServerConfig = ManagedServerConfig(timeout_ms=10000, operation_timeout_ms=0)) -> None

  2. __init__(self: shyft.energy_market.stm.DStmServerConfig, arg0: shyft.time_series.ServerConfig) -> None

  3. __init__(self: shyft.energy_market.stm.DStmServerConfig) -> None

property janitor
property log
property managed_server
property stale_duration
property stale_sweep_interval
class shyft.energy_market.stm.Gate(self: shyft.energy_market.stm.Gate, id: SupportsInt | SupportsIndex, name: str, json: str = '')

Bases: Gate

Stm gate.

class Discharge

Bases: pybind11_object

Attribute collection

class Constraints

Bases: pybind11_object

Attribute collection

__init__(*args, **kwargs)
property max

[masl] Discharge constraint maximum, time series.

Type:

_ts

property min

[masl] Discharge constraint minimum, time series.

Type:

_ts

__init__(*args, **kwargs)
property constraint

Discharge constraint attributes.

Type:

Constraints

property merge_tolerance

[m3/s] Maximum deviation in discharge between two timesteps.

Type:

_ts

property realised

[m3/s] Historical discharge restriction.

Type:

_ts

property result

[m3/s] Discharge result.

Type:

_ts

property schedule

[m3/s] Discharge schedule restriction.

Type:

_ts

property static_max

[m3/s] Maximum discharge.

Type:

_ts

class Opening

Bases: pybind11_object

Attribute collection

class Constraints

Bases: pybind11_object

Constraint attributes

__init__(*args, **kwargs)
property continuous

Flag determining whether the gate can be set to anything between predefined positions, time-dependent attribute.

Type:

_ts

property positions

Predefined gate positions mapped to gate opening.

Type:

_t_xy_

__init__(*args, **kwargs)
property constraint

Opening constraint attributes.

Type:

Constraints

property realised

Historical opening schedule, value between 0.0 and 1.0.

Type:

_ts

property result

Result opening schedule, value between 0.0 and 1.0.

Type:

_ts

property schedule

Planned opening schedule, value between 0.0 and 1.0.

Type:

_ts

__init__(self: shyft.energy_market.stm.Gate, id: SupportsInt | SupportsIndex, name: str, json: str = '') None
property cost

Gate adjustment cost, time series.

Type:

_ts

property custom
property discharge
flattened_attributes(self: shyft.energy_market.stm.Gate) dict

Flat dict containing all component attributes.

property flow_description

Gate flow description. Flow [m^3/s] as a function of water level [m] for relative gate opening [%].

Type:

_t_xy_z_list

property flow_description_delta_h

Gate flow description. Flow [m^3/s] as a function of water level difference [m] for relative gate opening [%].

Type:

_t_xy_z_list

get_tsm_object(self: shyft.energy_market.stm.Gate, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property name
property obj

a python object

Type:

object

property opening
property tag

Url tag.

Type:

str

property ts
class shyft.energy_market.stm.GateList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.GateList) -> None

  2. __init__(self: shyft.energy_market.stm.GateList, arg0: collections.abc.Sequence[shyft.energy_market.stm.Gate]) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.GateList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.GateList) -> None

  2. __init__(self: shyft.energy_market.stm.GateList, arg0: collections.abc.Sequence[shyft.energy_market.stm.Gate]) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.GateList, arg0: collections.abc.Iterable) -> None

append(self: collections.abc.Sequence[shyft.energy_market.stm.Gate], x: shyft.energy_market.stm.Gate) None

Add an item to the end of the list

clear(self: collections.abc.Sequence[shyft.energy_market.stm.Gate]) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: collections.abc.Sequence[shyft.energy_market.stm.Gate], L: collections.abc.Sequence[shyft.energy_market.stm.Gate]) -> None

Extend the list by appending all the items in the given list

  1. extend(self: collections.abc.Sequence[shyft.energy_market.stm.Gate], L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: collections.abc.Sequence[shyft.energy_market.stm.Gate], i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.Gate) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: collections.abc.Sequence[shyft.energy_market.stm.Gate]) -> shyft.energy_market.stm.Gate

Remove and return the last item

  1. pop(self: collections.abc.Sequence[shyft.energy_market.stm.Gate], i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.Gate

Remove and return the item at index i

size(self: collections.abc.Sequence[shyft.energy_market.stm.Gate]) int
class shyft.energy_market.stm.HpsClient(self: shyft.energy_market.stm.HpsClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0)

Bases: pybind11_object

The client api for the hydro-power-system repostory server.

Creates a python client that can communicate with the corresponding server

__init__(self: shyft.energy_market.stm.HpsClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0) None

Creates a python client that can communicate with the corresponding server

close(self: shyft.energy_market.stm.HpsClient) None

Close the connection. It will automatically reopen if needed.

get_model_infos(self: shyft.energy_market.stm.HpsClient, mids: collections.abc.Sequence[SupportsInt | SupportsIndex], created_in: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.ModelInfo]

returns all or selected model-info objects based on model-identifiers(mids)

Parameters:
  • mids (IntVector) – empty = all, or a list of known exisiting model-identifiers

  • created_in (UtcPeriod) – For which period you are interested in model-infos.

Returns:

model_infos. Strongly typed list of ModelInfo

Return type:

ModelInfoVector

property host_port

Endpoint network address of the remote server.

Type:

str

property is_open

If the connection to the remote server is (still) open.

Type:

bool

property operation_timeout_ms

Operation timeout for remote server operations, in number milliseconds.

Type:

int

read_model(self: shyft.energy_market.stm.HpsClient, mid: SupportsInt | SupportsIndex) shyft.energy_market.stm.HydroPowerSystem

Read and return the model for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting model from the server

Return type:

Model

read_models(self: shyft.energy_market.stm.HpsClient, mids: collections.abc.Sequence[SupportsInt | SupportsIndex]) list[shyft.energy_market.stm.HydroPowerSystem]

Read and return the model for specified model-identifier (mid)

Parameters:

mids (list[int]) – A strongly typed list of ints, the model-identifers for the wanted models

Returns:

  1. The resulting model from the server

Return type:

Model

property reconnect_count

Number of reconnects to the remote server that have been performed.

Type:

int

remove_model(self: shyft.energy_market.stm.HpsClient, mid: SupportsInt | SupportsIndex) int

Remove the specified model bymodel-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

ec. 0 or error-code?

Return type:

int

store_model(self: shyft.energy_market.stm.HpsClient, m: shyft.energy_market.stm.HydroPowerSystem, mi: shyft.time_series.ModelInfo) int

Store the model to backend, if m.id==0 then a new unique model-info is created and used

Parameters:
  • m (Model) – The model to store

  • mi (ModelInfo) – The model-info to store for the model

Returns:

mid. model-identifier for the stored model and model-info

Return type:

int

property timeout_ms

Timout for remote server operations, in number milliseconds.

Type:

int

update_model_info(self: shyft.energy_market.stm.HpsClient, mid: SupportsInt | SupportsIndex, mi: shyft.time_series.ModelInfo) bool

Update the model-info for specified model-identifier(mid)

Parameters:
  • mid (int) – model-identifer

  • mi (ModelInfo) – The new updated model-info

Returns:

ok. true if success

Return type:

bool

class shyft.energy_market.stm.HpsServer(self: shyft.energy_market.stm.HpsServer, root_dir: str, config: shyft.time_series.ServerConfig = shyft.time_series.ServerConfig(stale_duration='1970-01-01T01:00:00Z', stale_sweep_interval='1970-01-01T00:00:00.100000Z', log=shyft.time_series.LogConfig(file='', level=200)))

Bases: pybind11_object

The server-side component for the hydro-power-system model repository.

Creates a server object that serves models from root_dir. The root_dir will be create if it does not exists.

Parameters:
  • root_dir (str) – Path to the root-directory that keeps/will keep the model-files

  • config (ServerConfig) – Configuration of the server

__init__(self: shyft.energy_market.stm.HpsServer, root_dir: str, config: shyft.time_series.ServerConfig = shyft.time_series.ServerConfig(stale_duration='1970-01-01T01:00:00Z', stale_sweep_interval='1970-01-01T00:00:00.100000Z', log=shyft.time_series.LogConfig(file='', level=200))) None

Creates a server object that serves models from root_dir. The root_dir will be create if it does not exists.

Parameters:
  • root_dir (str) – Path to the root-directory that keeps/will keep the model-files

  • config (ServerConfig) – Configuration of the server

get_listening_port(self: shyft.energy_market.stm.HpsServer) int

returns the port number it’s listening at for serving incoming request

get_max_connections(self: shyft.energy_market.stm.HpsServer) int

returns the maximum number of connections to be served concurrently

get_model_infos(self: shyft.energy_market.stm.HpsServer, mids: collections.abc.Sequence[SupportsInt | SupportsIndex], created_in: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.ModelInfo]

returns all or selected model-info objects based on model-identifiers(mids)

Parameters:
  • mids (IntVector) – empty = all, or a list of known exisiting model-identifiers

  • created_in (UtcPeriod) – For which period you are interested in model-infos.

Returns:

model_infos. Strongly typed list of ModelInfo

Return type:

ModelInfoVector

is_running(self: shyft.energy_market.stm.HpsServer) bool

true if server is listening and running

See also

start_server()

read_model(self: shyft.energy_market.stm.HpsServer, mid: SupportsInt | SupportsIndex) shyft.energy_market.stm.HydroPowerSystem

Read and return the model for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting model from the server

Return type:

Model

read_model_blob(self: shyft.energy_market.stm.HpsServer, mid: SupportsInt | SupportsIndex) list[str]

Read and return the model blob for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting blob model from the server

Return type:

ByteVector

read_models(self: shyft.energy_market.stm.HpsServer, mids: collections.abc.Sequence[SupportsInt | SupportsIndex]) list[shyft.energy_market.stm.HydroPowerSystem]

Read and return the model for specified model-identifier (mid)

Parameters:

mids (list[int]) – A strongly typed list of ints, the model-identifers for the wanted models

Returns:

  1. The resulting model from the server

Return type:

Model

remove_model(self: shyft.energy_market.stm.HpsServer, mid: SupportsInt | SupportsIndex) int

Remove the specified model bymodel-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

ec. 0 or error-code?

Return type:

int

set_listening_ip(self: shyft.energy_market.stm.HpsServer, ip: str) None

set the listening port for the service

Parameters:

ip (str) – ip or host-name to start listening on

Returns:

nothing.

Return type:

None

set_listening_port(self: shyft.energy_market.stm.HpsServer, port_no: SupportsInt | SupportsIndex) None

set the listening port for the service

Parameters:
  • port_no (int) – a valid and available tcp-ip port number to listen on.

  • 20000 (typically it could be)

Returns:

nothing.

Return type:

None

set_max_connections(self: shyft.energy_market.stm.HpsServer, max_connect: SupportsInt | SupportsIndex) None

limits simultaneous connections to the server (it’s multithreaded, and uses on thread pr. connect)

Parameters:

max_connect (int) – maximum number of connections before denying more connections

See also

get_max_connections()

property stale_connection_close_count

returns count of connection closed due to stale/no communication activity

Type:

int

start_server(self: shyft.energy_market.stm.HpsServer) int

start server listening in background, and processing messages

See also

set_listening_port(port_no),is_running

Returns:

port_no. the port used for listening operations, either the value as by set_listening_port, or if it was unspecified, a new available port

Return type:

in

stop_server(self: shyft.energy_market.stm.HpsServer, timeout: SupportsInt | SupportsIndex = 1000) None

stop serving connections, gracefully.

See also

start_server()

store_model(self: shyft.energy_market.stm.HpsServer, m: shyft.energy_market.stm.HydroPowerSystem, mi: shyft.time_series.ModelInfo) int

Store the model to backend, if m.id==0 then a new unique model-info is created and used

Parameters:
  • m (Model) – The model to store

  • mi (ModelInfo) – The model-info to store for the model

Returns:

mid. model-identifier for the stored model and model-info

Return type:

int

update_model_info(self: shyft.energy_market.stm.HpsServer, mid: SupportsInt | SupportsIndex, mi: shyft.time_series.ModelInfo) bool

Update the model-info for specified model-identifier(mid)

Parameters:
  • mid (int) – model-identifer

  • mi (ModelInfo) – The new updated model-info

Returns:

ok. true if success

Return type:

bool

class shyft.energy_market.stm.HydroPowerSystem(self: shyft.energy_market.stm.HydroPowerSystem, uid: SupportsInt | SupportsIndex, name: str)

Bases: HydroPowerSystem

A hydro power system, with indataset.

The hydro power system consists of reservoirs, waterway (river/tunnel) and units. In addition, the power plant has the role of keeping related units together into a group that resembles what most people would think is a power plant in this context. The power plant has just references to the units (generator/turbine parts), but can keep sum-requirements/schedules and computations valid at power plant level.

Create hydro power system with unique uid.

__init__(self: shyft.energy_market.stm.HydroPowerSystem, uid: SupportsInt | SupportsIndex, name: str) None

Create hydro power system with unique uid.

create_aggregate(self: shyft.energy_market.stm.HydroPowerSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.Unit

Create stm unit.

Returns:

unit. The new unit.

Return type:

Unit

create_catchment(self: shyft.energy_market.stm.HydroPowerSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.Catchment

Create stm catchment .

Returns:

catchment. The new catchment.

Return type:

Catchment

create_gate(self: shyft.energy_market.stm.HydroPowerSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.Gate

Create stm gate.

Returns:

gate. The new gate.

Return type:

Gate

create_power_plant(self: shyft.energy_market.stm.HydroPowerSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.PowerPlant

Create stm power plant that keeps units.

Returns:

power_plant. The new PowerPlant.

Return type:

PowerPlant

create_reservoir(self: shyft.energy_market.stm.HydroPowerSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.Reservoir

Create stm reservoir with unique uid.

Returns:

reservoir. The new reservoir.

Return type:

Reservoir

create_reservoir_aggregate(self: shyft.energy_market.stm.HydroPowerSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.ReservoirAggregate

Create stm reservoir aggregate with unique uid.

Returns:

reservoir_aggregate. The new ReservoirAggregate.

Return type:

ReservoirAggregate

create_river(self: shyft.energy_market.stm.HydroPowerSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.Waterway

Create stm waterway (a tunnel or river).

Returns:

waterway. The new waterway.

Return type:

Waterway

create_tunnel(self: shyft.energy_market.stm.HydroPowerSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.Waterway

Create stm waterway (a tunnel or river).

Returns:

waterway. The new waterway.

Return type:

Waterway

create_unit(self: shyft.energy_market.stm.HydroPowerSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.Unit

Create stm unit.

Returns:

unit. The new unit.

Return type:

Unit

create_waterway(self: shyft.energy_market.stm.HydroPowerSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.Waterway

Create stm waterway (a tunnel or river).

Returns:

waterway. The new waterway.

Return type:

Waterway

property custom
find_catchment_by_id(self: shyft.energy_market.stm.HydroPowerSystem, arg0: SupportsInt | SupportsIndex) shyft.energy_market.stm.Catchment
find_catchment_by_name(self: shyft.energy_market.stm.HydroPowerSystem, arg0: str) shyft.energy_market.stm.Catchment
find_gate_by_id(self: shyft.energy_market.stm.HydroPowerSystem, arg0: SupportsInt | SupportsIndex) shyft.energy_market.stm.Gate
find_gate_by_name(self: shyft.energy_market.stm.HydroPowerSystem, arg0: str) shyft.energy_market.stm.Gate
find_power_plant_by_id(self: shyft.energy_market.stm.HydroPowerSystem, arg0: SupportsInt | SupportsIndex) shyft.energy_market.stm.PowerPlant
find_power_plant_by_name(self: shyft.energy_market.stm.HydroPowerSystem, arg0: str) shyft.energy_market.stm.PowerPlant
find_reservoir_aggregate_by_id(self: shyft.energy_market.stm.HydroPowerSystem, arg0: SupportsInt | SupportsIndex) shyft.energy_market.stm.ReservoirAggregate
find_reservoir_aggregate_by_name(self: shyft.energy_market.stm.HydroPowerSystem, arg0: str) shyft.energy_market.stm.ReservoirAggregate
find_reservoir_by_id(self: shyft.energy_market.stm.HydroPowerSystem, arg0: SupportsInt | SupportsIndex) shyft.energy_market.stm.Reservoir
find_reservoir_by_name(self: shyft.energy_market.stm.HydroPowerSystem, arg0: str) shyft.energy_market.stm.Reservoir
find_unit_by_id(self: shyft.energy_market.stm.HydroPowerSystem, arg0: SupportsInt | SupportsIndex) shyft.energy_market.stm.Unit
find_unit_by_name(self: shyft.energy_market.stm.HydroPowerSystem, arg0: str) shyft.energy_market.stm.Unit
find_waterway_by_id(self: shyft.energy_market.stm.HydroPowerSystem, arg0: SupportsInt | SupportsIndex) shyft.energy_market.stm.Waterway
find_waterway_by_name(self: shyft.energy_market.stm.HydroPowerSystem, arg0: str) shyft.energy_market.stm.Waterway
flattened_attributes(self: shyft.energy_market.stm.HydroPowerSystem) dict

Flat dict containing all component attributes.

static from_blob(blob: shyft.time_series.ByteVector) shyft.energy_market.stm.HydroPowerSystem

Re-create a stm hps from a previously created blob.

Parameters:

blob (ByteVector) – The blob containing a previously stored hps.

Returns:

hps. A stm hydro-power-system including it’s attributes in the ids.

Return type:

HydroPowerSystem

static from_stripped_blob(blob: shyft.time_series.ByteVector) shyft.energy_market.stm.HydroPowerSystem

Re-create a stm hps from a previously created stripped blob.

Parameters:

blob (ByteVector) – The blob containing a previously stripped stored hps.

Returns:

hps. A stripped stm hydro-power-system.

Return type:

HydroPowerSystem

get_tsm_object(self: shyft.energy_market.stm.HydroPowerSystem, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property name
property obj

a python object

Type:

object

property reservoir_aggregates

all the reservoir aggregates

Type:

ReservoirAggregateList

property system

The owner of this object.

property tag

Url tag.

Type:

str

to_blob(self: shyft.energy_market.stm.HydroPowerSystem) shyft.time_series.ByteVector

Serialize the model to a blob.

Returns:

blob. Blob form of the model.

Return type:

ByteVector

to_stripped_blob(self: shyft.energy_market.stm.HydroPowerSystem) shyft.time_series.ByteVector

Serialize the model to a blob, stripping expressions, custom attributes and json.

Returns:

blob. Blob form of the stripped model.

Return type:

ByteVector

property ts
class shyft.energy_market.stm.HydroPowerSystemList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.HydroPowerSystemList) -> None

  2. __init__(self: shyft.energy_market.stm.HydroPowerSystemList, arg0: shyft.energy_market.stm.HydroPowerSystemList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.HydroPowerSystemList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.HydroPowerSystemList) -> None

  2. __init__(self: shyft.energy_market.stm.HydroPowerSystemList, arg0: shyft.energy_market.stm.HydroPowerSystemList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.HydroPowerSystemList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.HydroPowerSystemList, x: shyft.energy_market.stm.HydroPowerSystem) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.HydroPowerSystemList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.HydroPowerSystemList, L: shyft.energy_market.stm.HydroPowerSystemList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.HydroPowerSystemList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.HydroPowerSystemList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.HydroPowerSystem) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.HydroPowerSystemList) -> shyft.energy_market.stm.HydroPowerSystem

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.HydroPowerSystemList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.HydroPowerSystem

Remove and return the item at index i

size(self: shyft.energy_market.stm.HydroPowerSystemList) int
class shyft.energy_market.stm.JanitorConfig(*args, **kwargs)

Bases: pybind11_object

A janitor config The duration member determines how often to check for stale connection. The stale_threshold is the threshold where no activity leads to server-side close of socket.

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.JanitorConfig) -> None

  2. __init__(self: shyft.energy_market.stm.JanitorConfig, duration: shyft.time_series.time, stale_threshold: shyft.time_series.time) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.JanitorConfig) -> None

  2. __init__(self: shyft.energy_market.stm.JanitorConfig, duration: shyft.time_series.time, stale_threshold: shyft.time_series.time) -> None

property duration
property stale_threshold
class shyft.energy_market.stm.LayoutInfo(self: shyft.energy_market.stm.LayoutInfo, id: SupportsInt | SupportsIndex, name: str, json: str = '')

Bases: pybind11_object

Provides layout information that can be leveraged by a renderer.

Construct a LayoutInfo from id, name, and json

__init__(self: shyft.energy_market.stm.LayoutInfo, id: SupportsInt | SupportsIndex, name: str, json: str = '') None

Construct a LayoutInfo from id, name, and json

property id

identifying number

Type:

int

property json

Json-string containing layout information

Type:

str

property name

A descriptive name

Type:

str

class shyft.energy_market.stm.LogEntry(self: shyft.energy_market.stm.LogEntry)

Bases: pybind11_object

A log entry.

__init__(self: shyft.energy_market.stm.LogEntry) None
property code
property message
property severity
property time
class shyft.energy_market.stm.LogSeverity(self: shyft.energy_market.stm.LogSeverity, value: SupportsInt | SupportsIndex)

Bases: pybind11_object

Log severity

Members:

INFORMATION

WARNING

ERROR

ERROR = <LogSeverity.ERROR: 2>
INFORMATION = <LogSeverity.INFORMATION: 0>
WARNING = <LogSeverity.WARNING: 1>
__init__(self: shyft.energy_market.stm.LogSeverity, value: SupportsInt | SupportsIndex) None
LogSeverity.name -> str
property value
class shyft.energy_market.stm.ManagedServerConfig(*args, **kwargs)

Bases: pybind11_object

Config for the clients to Compute servers managed by DSstm timeout_ms: timout for operations operation_timeout_ms: life-time or max operation time if set>0

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ManagedServerConfig) -> None

  2. __init__(self: shyft.energy_market.stm.ManagedServerConfig, duration: typing.SupportsInt | typing.SupportsIndex, stale_threshold: typing.SupportsInt | typing.SupportsIndex) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ManagedServerConfig) -> None

  2. __init__(self: shyft.energy_market.stm.ManagedServerConfig, duration: typing.SupportsInt | typing.SupportsIndex, stale_threshold: typing.SupportsInt | typing.SupportsIndex) -> None

property operation_timeout_ms
property timeout_ms
class shyft.energy_market.stm.ManagedServerState(self: shyft.energy_market.stm.ManagedServerState, value: SupportsInt | SupportsIndex)

Bases: pybind11_object

Describes the possible states of a managed compute server

Members:

IDLE

ASSIGNED

BUSY

DEAD

ASSIGNED = <ManagedServerState.ASSIGNED: 1>
BUSY = <ManagedServerState.BUSY: 2>
DEAD = <ManagedServerState.DEAD: 3>
IDLE = <ManagedServerState.IDLE: 0>
__init__(self: shyft.energy_market.stm.ManagedServerState, value: SupportsInt | SupportsIndex) None
ManagedServerState.name -> str
property value
class shyft.energy_market.stm.MarketArea(self: shyft.energy_market.stm.MarketArea, uid: SupportsInt | SupportsIndex, name: str, json: str, stm_sys: shyft.energy_market.stm.StmSystem)

Bases: pybind11_object

A market area, with load/price and other properties.

Within the market area, there are zero or more energy- producing/consuming units.

class Offering

Bases: pybind11_object

describes actors (supply/demand) offering into the market

__init__(*args, **kwargs)
property bids

time dep x,y, x=price[Money/J],y=amount[W]

Type:

_t_xy_

property price

Given the usage, the effective price based on bids

Type:

TsTriplet

property usage

The amount consumed/used of the offering

Type:

TsTriplet

class TsTriplet

Bases: pybind11_object

describes .realised, .schedule and .result time-series

__init__(*args, **kwargs)
property realised

SI-units, realised time-series, as in historical fact

Type:

_ts

property result

SI-units, result, as provided by optimisation

Type:

_ts

property schedule

SI-units, schedule, as in current schedule

Type:

_ts

class TsTripletResult

Bases: pybind11_object

describes .realised, .schedule and .result time-series

__init__(*args, **kwargs)
property realised

SI-units, realised time-series, as in historical fact

Type:

_ts

property result

SI-units, result, as provided by optimisation

Type:

_ts

property schedule

SI-units, schedule, as in current schedule

Type:

_ts

__init__(self: shyft.energy_market.stm.MarketArea, uid: SupportsInt | SupportsIndex, name: str, json: str, stm_sys: shyft.energy_market.stm.StmSystem) None
property busbars
property buy

[W] Buy result.

Type:

_ts

property contracts
create_busbar_derived_unit_group(self: shyft.energy_market.stm.MarketArea, id: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.UnitGroup

Add a unit-group of type ‘production’ to the system and to the market area. The unit group will derive its units from the associated network busbars. Units are automatically added/removed if busbars are added/removed on the network.

Parameters:
  • id (int) – Unique id of the group.

  • name (str) – Unique name of the group.

  • json (str) – Json payload for py customization.

Returns:

unit_group. The newly created unit-group.

Return type:

UnitGroup

property custom
property demand

The demand side describing the buyers of energy

Type:

Offering

flattened_attributes(self: shyft.energy_market.stm.MarketArea) dict

Flat dict containing all component attributes.

get_consumption(self: shyft.energy_market.stm.MarketArea) shyft.energy_market.stm.MarketArea.TsTripletResult

Get the sum of consumption contribution for all busbars

Args: :returns: consumption. Consumption contribution sum, as triplet: result,realised,schedule :rtype: TsTripletResult

get_export(self: shyft.energy_market.stm.MarketArea) shyft.energy_market.stm.MarketArea.TsTripletResult

Get the total export of the market area. (converted to positive value) If the actual sum of busbar flow is positive, export is 0.

Args: :returns: export. Market area export, as triplet: result,realised,schedule :rtype: TsTripletResult

get_import(self: shyft.energy_market.stm.MarketArea) shyft.energy_market.stm.MarketArea.TsTripletResult

Get the total import of the market area. If the actual sum of busbar flow is negative, import is 0.

Args: :returns: import. Market area import, as triplet: result,realised,schedule :rtype: TsTripletResult

get_production(self: shyft.energy_market.stm.MarketArea) shyft.energy_market.stm.MarketArea.TsTripletResult

Get the sum of production contribution for all busbars

Args: :returns: production. Production contribution sum, as triplet: result,realised,schedule :rtype: TsTripletResult

get_tsm_object(self: shyft.energy_market.stm.MarketArea, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property load

[W] Load.

Type:

_ts

property max_buy

[W] Maximum buy.

Type:

_ts

property max_sale

[W] Maximum sale.

Type:

_ts

property name
property obj

a python object

Type:

object

property price

[Money/J] Price.

Type:

_ts

property production

[W] Production result.

Type:

_ts

remove_unit_group(self: shyft.energy_market.stm.MarketArea) shyft.energy_market.stm.UnitGroup

Remove the unit group associated with this market if available.

Args: :returns: unit_group. The newly removed unit group. :rtype: UnitGroup

property reserve_obligation_penalty

[Money/x] Obligation penalty.

Type:

_ts

property sale

[W] Sale result.

Type:

_ts

property supply

The supply side describing the producers of energy

Type:

Offering

property system

The owner of this object.

property tag

Url tag.

Type:

str

transmission_lines_from(self: shyft.energy_market.stm.MarketArea, from_market: shyft.energy_market.stm.MarketArea) shyft.energy_market.stm.TransmissionLineList

Remove the unit group associated with this market if available.

Parameters:

from (MarketArea) – MarketArea to get transmission lines from

Returns:

transmission_line_list. List of transmission lines from MarketArea

Return type:

TransmissionLineList

transmission_lines_to(self: shyft.energy_market.stm.MarketArea, to_market: shyft.energy_market.stm.MarketArea) shyft.energy_market.stm.TransmissionLineList

Get transmission lines (from this) to MarketArea

Parameters:

to (MarketArea) – MarketArea to get transmission lines to

Returns:

transmission_line_list. List of transmission lines to MarketArea

Return type:

TransmissionLineList

property ts
property unit_group

Getter and setter for unit group.

Type:

UnitGroup

class shyft.energy_market.stm.MarketAreaList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.MarketAreaList) -> None

  2. __init__(self: shyft.energy_market.stm.MarketAreaList, arg0: shyft.energy_market.stm.MarketAreaList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.MarketAreaList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.MarketAreaList) -> None

  2. __init__(self: shyft.energy_market.stm.MarketAreaList, arg0: shyft.energy_market.stm.MarketAreaList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.MarketAreaList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.MarketAreaList, x: shyft.energy_market.stm.MarketArea) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.MarketAreaList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.MarketAreaList, L: shyft.energy_market.stm.MarketAreaList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.MarketAreaList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.MarketAreaList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.MarketArea) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.MarketAreaList) -> shyft.energy_market.stm.MarketArea

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.MarketAreaList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.MarketArea

Remove and return the item at index i

size(self: shyft.energy_market.stm.MarketAreaList) int
class shyft.energy_market.stm.ModelRefList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ModelRefList) -> None

  2. __init__(self: shyft.energy_market.stm.ModelRefList, arg0: shyft.energy_market.stm.ModelRefList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.ModelRefList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ModelRefList) -> None

  2. __init__(self: shyft.energy_market.stm.ModelRefList, arg0: shyft.energy_market.stm.ModelRefList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.ModelRefList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.ModelRefList, x: shyft.energy_market.stm.StmModelRef) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.ModelRefList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.ModelRefList, L: shyft.energy_market.stm.ModelRefList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.ModelRefList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.ModelRefList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.StmModelRef) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.ModelRefList) -> shyft.energy_market.stm.StmModelRef

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.ModelRefList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.StmModelRef

Remove and return the item at index i

size(self: shyft.energy_market.stm.ModelRefList) int
class shyft.energy_market.stm.ModelState(self: shyft.energy_market.stm.ModelState, value: SupportsInt | SupportsIndex)

Bases: pybind11_object

Describes the possible state of the STM model

Members:

IDLE

RUNNING

TUNING

FINISHED

FAILED

FAILED = <ModelState.FAILED: 4>
FINISHED = <ModelState.FINISHED: 3>
IDLE = <ModelState.IDLE: 0>
RUNNING = <ModelState.RUNNING: 1>
TUNING = <ModelState.TUNING: 2>
__init__(self: shyft.energy_market.stm.ModelState, value: SupportsInt | SupportsIndex) None
ModelState.name -> str
property value
class shyft.energy_market.stm.Network(self: shyft.energy_market.stm.Network, uid: SupportsInt | SupportsIndex, name: str, json: str, sys: shyft.energy_market.stm.StmSystem)

Bases: pybind11_object

A network consisting of busbars and transmission lines.

__init__(self: shyft.energy_market.stm.Network, uid: SupportsInt | SupportsIndex, name: str, json: str, sys: shyft.energy_market.stm.StmSystem) None
property busbars

List of busbars.

Type:

BusbarList

create_busbar(self: shyft.energy_market.stm.Network, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.Busbar

Create stm busbar with unique uid.

Returns:

busbar. The new busbar.

Return type:

Busbar

create_transmission_line(self: shyft.energy_market.stm.Network, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.TransmissionLine

Create stm transmission line with unique uid.

Returns:

transmission_line. The new transmission line.

Return type:

TransmissionLine

property custom
flattened_attributes(self: shyft.energy_market.stm.Network) dict

Flat dict containing all component attributes.

get_tsm_object(self: shyft.energy_market.stm.Network, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property name
property obj

a python object

Type:

object

property system

The owner of this object.

property tag

Url tag.

Type:

str

property transmission_lines

List of transmission lines.

Type:

TransmissionLineList

property ts
class shyft.energy_market.stm.NetworkList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.NetworkList) -> None

  2. __init__(self: shyft.energy_market.stm.NetworkList, arg0: shyft.energy_market.stm.NetworkList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.NetworkList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.NetworkList) -> None

  2. __init__(self: shyft.energy_market.stm.NetworkList, arg0: shyft.energy_market.stm.NetworkList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.NetworkList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.NetworkList, x: shyft.energy_market.stm.Network) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.NetworkList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.NetworkList, L: shyft.energy_market.stm.NetworkList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.NetworkList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.NetworkList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.Network) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.NetworkList) -> shyft.energy_market.stm.Network

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.NetworkList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.Network

Remove and return the item at index i

size(self: shyft.energy_market.stm.NetworkList) int
class shyft.energy_market.stm.PenaltyConstraint

Bases: pybind11_object

A grouping of time-series related to a constraint with a penalty cost

__init__(*args, **kwargs)
property cost

The cost of violating the constraint

Type:

TimeSeries

property flag

Flag indicating whether the constraint is active or not

Type:

TimeSeries

property limit

The threshold related to the constraint

Type:

TimeSeries

property penalty

Incurred cost of violating the constraint

Type:

TimeSeries

class shyft.energy_market.stm.PowerModule(self: shyft.energy_market.stm.PowerModule, uid: SupportsInt | SupportsIndex, name: str, json: str, sys: shyft.energy_market.stm.StmSystem)

Bases: pybind11_object

A power module representing consumption.

class Power

Bases: pybind11_object

Unit.Power attributes, consumption[W, J/s].

__init__(*args, **kwargs)
property realised

Historical fact, time series. W, J/s, if positive then production, if negative then consumption.

Type:

_ts

property result

The optimal/simulated/estimated result, time series. W, J/s, if positive then production, if negative then consumption

Type:

_ts

property schedule

The current schedule, time series. W, J/s, if positive then production, if negative then consumption

Type:

_ts

__init__(self: shyft.energy_market.stm.PowerModule, uid: SupportsInt | SupportsIndex, name: str, json: str, sys: shyft.energy_market.stm.StmSystem) None
property custom
flattened_attributes(self: shyft.energy_market.stm.PowerModule) dict

Flat dict containing all component attributes.

get_tsm_object(self: shyft.energy_market.stm.PowerModule, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property name
property obj

a python object

Type:

object

property power

Power attributes.

Type:

Power

property system

The owner of this object.

property tag

Url tag.

Type:

str

property ts
class shyft.energy_market.stm.PowerModuleList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.PowerModuleList) -> None

  2. __init__(self: shyft.energy_market.stm.PowerModuleList, arg0: shyft.energy_market.stm.PowerModuleList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.PowerModuleList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.PowerModuleList) -> None

  2. __init__(self: shyft.energy_market.stm.PowerModuleList, arg0: shyft.energy_market.stm.PowerModuleList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.PowerModuleList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.PowerModuleList, x: shyft.energy_market.stm.PowerModule) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.PowerModuleList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.PowerModuleList, L: shyft.energy_market.stm.PowerModuleList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.PowerModuleList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.PowerModuleList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.PowerModule) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.PowerModuleList) -> shyft.energy_market.stm.PowerModule

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.PowerModuleList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.PowerModule

Remove and return the item at index i

size(self: shyft.energy_market.stm.PowerModuleList) int
class shyft.energy_market.stm.PowerModuleMember

Bases: pybind11_object

A power_mobule busbar member, refers to a specific power_module along with the time-series that takes care of the temporal membership/contribution to the busbar sum.

__init__(*args, **kwargs)
property active

[unit-less] if available, this time-series is multiplied with the contribution from the power_module.

Type:

_ts

property power_module

The power_module this member represents.

Type:

PowerModule

class shyft.energy_market.stm.PowerPlant(self: shyft.energy_market.stm.PowerPlant, uid: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem)

Bases: PowerPlant

A power plant keeping stm units.

After creating the units, create the power plant, and add the units to the power plant.

class BestProfit

Bases: pybind11_object

Describes the best profit (BP) curves of the power plant.

__init__(*args, **kwargs)
property cost_average

Average production cost after changing the production of the plant from the current operating pointto a new point in the best profit curve of the plant.

Type:

_t_xy_

property cost_commitment

Sum of startup costs or shutdown costs after changing the production of the plant from the current operating point to a new point in the best profit curve of the plant.

Type:

_t_xy_

property cost_marginal

Marginal production cost after changing the production of the plant from the current operating point to a new point in the best profit curve of the plant.

Type:

_t_xy_

property discharge

Plant discharge after changing the production of the plant from the current operating point to a newpoint in the best profit curve of the plant.

Type:

_t_xy_

property dynamic_water_value

Flag determining whether water values in the best profit calculation should be based on dynamic results per time step from the optimization or the static end value description.

Type:

_ts

class Discharge

Bases: pybind11_object

Attribute collection

__init__(*args, **kwargs)
property constraint_max

[m3/s] Discharge maximum restriction, time series.

Type:

_ts

property constraint_min

[m3/s] Discharge minimum restriction, time series.

Type:

_ts

property downstream_level_constraint

Max discharge limited by downstream water level.

Type:

_t_xy_

property intake_loss_from_bypass_flag

Headloss of intake affected by bypass discharge.

Type:

_ts

property ramping_down

[m3/s] Constraint on decreasing discharge, time-dependent attribute.

Type:

_ts

property ramping_up

[m3/s] Constraint on increasing discharge, time-dependent attribute.

Type:

_ts

property realised

[m3/s] Discharge realised, usually related/or defined as unit.discharge.realised.

Type:

_ts

property result

[m3/s] Discharge result, time series.

Type:

_ts

property schedule

[m3/s] Discharge schedule, time series.

Type:

_ts

property upstream_level_constraint

Max discharge limited by upstream water level.

Type:

_t_xy_

class Fees

Bases: pybind11_object

Describes other costs when producing.

__init__(*args, **kwargs)
property feeding_fee

Use nan for periods that should have no fee.

Type:

_ts

Type:

Extra cost for feeding electricity into the grid. The feeding fee is added as an extra production cost in the objective function. Tip

class Production

Bases: pybind11_object

Attribute collection

__init__(*args, **kwargs)
property constraint_max

[W] Production maximum restriction, time series.

Type:

_ts

property constraint_min

[W] Production minimum restriction, time series.

Type:

_ts

property instant_max

[W] Computed instant max production for the rotating units

Type:

_ts

property merge_tolerance

[W] Max deviation in production, time-dependent attribute.

Type:

_ts

property ramping_down

[W] Constraint on decreasing production, time-dependent attribute.

Type:

_ts

property ramping_steps

([], [W]) -> [W/s] Absolute ramping constraint as a function of constraint-curve index and current production

Type:

_t_xy_z_list

property ramping_steps_which

[] Selects which ramping_steps curve to use.

Type:

_ts

property ramping_up

[W] Constraint on increasing production, time-dependent attribute.

Type:

_ts

property realised

[W] Production realised, usually related to sum of unit.production.realised.

Type:

_ts

property result

[W] Production result, time series.

Type:

_ts

property schedule

[W] Production schedule, time series.

Type:

_ts

__init__(self: shyft.energy_market.stm.PowerPlant, uid: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem) None
add_aggregate(self: shyft.energy_market.stm.PowerPlant, unit: shyft.energy_market.stm.Unit) None

Add unit to plant.

add_unit(self: shyft.energy_market.stm.PowerPlant, unit: shyft.energy_market.stm.Unit) None

Add unit to plant.

property best_profit

BP curves.

Type:

BestProfit

property custom
property discharge

Discharge attributes.

Type:

Discharge

property fees

other costs of production.

Type:

Fees

flattened_attributes(self: shyft.energy_market.stm.PowerPlant) dict

Flat dict containing all component attributes.

get_tsm_object(self: shyft.energy_market.stm.PowerPlant, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property gross_head

[masl]Gross head, time-dependent attribute.

Type:

_ts

property id
property json
property mip

Mip flag.

Type:

_ts

property name
property obj

a python object

Type:

object

property outlet_level

[masl] Outlet level, time-dependent attribute.

Type:

_ts

property production

Production attributes.

Type:

Production

property reserve

Reserve attributes.

Type:

_Reserve

property tag

Url tag.

Type:

str

property ts
property unavailability

Unavailability, time series.

Type:

_ts

class shyft.energy_market.stm.PowerPlantList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.PowerPlantList) -> None

  2. __init__(self: shyft.energy_market.stm.PowerPlantList, arg0: shyft.energy_market.stm.PowerPlantList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.PowerPlantList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.PowerPlantList) -> None

  2. __init__(self: shyft.energy_market.stm.PowerPlantList, arg0: shyft.energy_market.stm.PowerPlantList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.PowerPlantList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.PowerPlantList, x: shyft.energy_market.stm.PowerPlant) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.PowerPlantList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.PowerPlantList, L: shyft.energy_market.stm.PowerPlantList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.PowerPlantList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.PowerPlantList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.PowerPlant) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.PowerPlantList) -> shyft.energy_market.stm.PowerPlant

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.PowerPlantList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.PowerPlant

Remove and return the item at index i

size(self: shyft.energy_market.stm.PowerPlantList) int
class shyft.energy_market.stm.Reservoir(self: shyft.energy_market.stm.Reservoir, uid: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem)

Bases: Reservoir

Stm reservoir.

class Inflow

Bases: pybind11_object

__init__(*args, **kwargs)
property realised

[m3/s] Historical inflow, time series.

Type:

_ts

property result

[m3/s] Inflow result, time series.

Type:

_ts

property schedule

[m3/s] Inflow input, time series.

Type:

_ts

class Level

Bases: pybind11_object

class Constraints

Bases: pybind11_object

__init__(*args, **kwargs)
property max

[masl] Level constraint maximum, time series.

Type:

_ts

property min

[masl] Level constraint minimum, time series.

Type:

_ts

__init__(*args, **kwargs)
property constraint

Level constraint attributes.

Type:

Constraints

property realised

[masl] Historical water level, time series.

Type:

_ts

property regulation_max

[masl] Highest regulated water level, time-dependent attribute.

Type:

_ts

property regulation_min

[masl] Lowest regulated water level, time-dependent attribute.

Type:

_ts

property result

[masl] Level results, time series.

Type:

_ts

property schedule

[masl] Level schedule, time series.

Type:

_ts

class Ramping

Bases: pybind11_object

__init__(*args, **kwargs)
property amplitude_down

[s][m] Max level change down for a time period, duration vs m change.

Type:

_t_xy

property amplitude_up

[s][m] Max level change up for a time period, duration vs m change.

Type:

_t_xy

property level_down

[m/s] Max level change down, time series.

Type:

_ts

property level_up

[m/s] Max level change up, time series.

Type:

_ts

class Volume

Bases: pybind11_object

class Constraints

Bases: pybind11_object

class Tactical

Bases: pybind11_object

__init__(*args, **kwargs)
property max

[masl],[money] Tactical maximum volume constraint.

Type:

PenaltyConstraint

property min

[masl],[money] Tactical minimum volume constraint.

Type:

PenaltyConstraint

__init__(*args, **kwargs)
property max

[m3] Volume constraint maximum, time series.

Type:

_ts

property min

[m3] Volume constraint minimum, time series.

Type:

_ts

property tactical

Tactical volume constraint attributes.

Type:

Tactical

class Cost

Bases: pybind11_object

class CostCurve

Bases: pybind11_object

__init__(*args, **kwargs)
property curve

[m3],[money/m3] Volume cost curve.

Type:

_t_xy_

property penalty

[money] Volume penalty, time series.

Type:

_ts

__init__(*args, **kwargs)
property flood

Cost applied to volume.

Type:

_CostCurve

property peak

Cost applied to the highest volume reached.

Type:

CostCurve

class Slack

Bases: pybind11_object

__init__(*args, **kwargs)
property lower

[m3] Lower volume slack

Type:

_ts

property upper

[m3] Upper volume slack

Type:

_ts

__init__(*args, **kwargs)
property constraint

Volume constraint attributes.

Type:

Constraints

property penalty

[m3] Volume penalty, time series.

Type:

_ts

property realised

[m3] Historical volume, time series.

Type:

_ts

property result

[m3] Volume results, time series.

Type:

_ts

property schedule

[m3] Volume schedule, time series.

Type:

_ts

property slack

Slack attributes.

Type:

Slack

property static_max

[m3] Maximum regulated volume, time-dependent attribute.

Type:

_ts

class WaterValue

Bases: pybind11_object

class Result

Bases: pybind11_object

__init__(*args, **kwargs)
property end_value

[money] Resulting water-value at the endpoint.

Type:

_ts

property global_volume

[money/m3] Resulting water-value.

Type:

_ts

property local_energy

[money/joule] Resulting water-value.

Type:

_ts

property local_volume

[money/m3] Resulting water-value.

Type:

_ts

__init__(*args, **kwargs)
property endpoint_desc

[money/joule] Fixed water-value endpoint.

Type:

_ts

property global_endpoint_desc

[money/m3] State-dependent, global water-value description.

Type:

_t_xy_z_list

property result

Optimizer detailed watervalue results.

Type:

Result

__init__(self: shyft.energy_market.stm.Reservoir, uid: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem) None
property custom
flattened_attributes(self: shyft.energy_market.stm.Reservoir) dict

Flat dict containing all component attributes.

get_tsm_object(self: shyft.energy_market.stm.Reservoir, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property inflow

Inflow attributes.

Type:

Inflow

property json
property level

Level attributes.

Type:

_Level

property name
property obj

a python object

Type:

object

property ramping

Ramping attributes.

Type:

Ramping

property tag

Url tag.

Type:

str

property ts
property volume

Volume attributes.

Type:

Volume

property volume_level_mapping

Volume capacity description, time-dependent x=[masl], y=[m3].

Type:

_t_xy_

property water_value

water-value attributes.

Type:

WaterValue

class shyft.energy_market.stm.ReservoirAggregate(self: shyft.energy_market.stm.ReservoirAggregate, uid: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem)

Bases: pybind11_object

A reservoir_aggregate keeping stm reservoirs.

After creating the reservoirs, create the reservoir aggregate, and add the reservoirs to it.

class Inflow

Bases: pybind11_object

Attribute collection

__init__(*args, **kwargs)
property realised

[m3/s] Inflow realised, time series.

Type:

_ts

property result

[m3/s] Inflow result, time series.

Type:

_ts

property schedule

[m3/s] Inflow schedule, time series.

Type:

_ts

class Volume

Bases: pybind11_object

Attribute collection

class Constraints

Bases: pybind11_object

Attribute collection

__init__(*args, **kwargs)
property max

[m3] Volume constraint maximum, time series.

Type:

_ts

property max_penalty

[money/m3] Penalty cost for violating the minimum constraint.

Type:

_ts

property min

[m3] Volume constraint minimum, time series.

Type:

_ts

property min_penalty

[money/m3] Penalty cost for violating the minimum constraint.

Type:

_ts

__init__(*args, **kwargs)
property constraint

Volume constraint attributes.

Type:

Constraints

property realised

[m3] Production realised, time series.

Type:

_ts

property result

[m3] Production result, time series.

Type:

_ts

property schedule

[m3] Production schedule, time series.

Type:

_ts

property static_max

[m3] Production static max, time series.

Type:

_ts

__init__(self: shyft.energy_market.stm.ReservoirAggregate, uid: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem) None
add_reservoir(self: shyft.energy_market.stm.ReservoirAggregate, reservoir: shyft.energy_market.stm.Reservoir) None

Adds a reservoir to the reservoir aggregate.

Parameters:

reservoir (Reservoir) – The reservoir to be added to the reservoir aggregate

property custom
flattened_attributes(self: shyft.energy_market.stm.ReservoirAggregate) dict

Flat dict containing all component attributes.

get_tsm_object(self: shyft.energy_market.stm.ReservoirAggregate, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property inflow

Inflow attributes.

Type:

Inflow

property json
property name
property obj

a python object

Type:

object

remove_reservoir(self: shyft.energy_market.stm.ReservoirAggregate, reservoir: shyft.energy_market.stm.Reservoir) None

Remove a reservoir from the reservoir aggregate

Parameters:

reservoir (Reservoir) – The reservoir to be removed from the reservoir aggregate

property reservoirs
property tag

Url tag.

Type:

str

property ts
property volume

Volume attributes.

Type:

Volume

class shyft.energy_market.stm.ReservoirAggregateList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ReservoirAggregateList) -> None

  2. __init__(self: shyft.energy_market.stm.ReservoirAggregateList, arg0: collections.abc.Sequence[shyft.energy_market.stm.ReservoirAggregate]) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.ReservoirAggregateList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ReservoirAggregateList) -> None

  2. __init__(self: shyft.energy_market.stm.ReservoirAggregateList, arg0: collections.abc.Sequence[shyft.energy_market.stm.ReservoirAggregate]) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.ReservoirAggregateList, arg0: collections.abc.Iterable) -> None

append(self: collections.abc.Sequence[shyft.energy_market.stm.ReservoirAggregate], x: shyft.energy_market.stm.ReservoirAggregate) None

Add an item to the end of the list

clear(self: collections.abc.Sequence[shyft.energy_market.stm.ReservoirAggregate]) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: collections.abc.Sequence[shyft.energy_market.stm.ReservoirAggregate], L: collections.abc.Sequence[shyft.energy_market.stm.ReservoirAggregate]) -> None

Extend the list by appending all the items in the given list

  1. extend(self: collections.abc.Sequence[shyft.energy_market.stm.ReservoirAggregate], L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: collections.abc.Sequence[shyft.energy_market.stm.ReservoirAggregate], i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.ReservoirAggregate) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: collections.abc.Sequence[shyft.energy_market.stm.ReservoirAggregate]) -> shyft.energy_market.stm.ReservoirAggregate

Remove and return the last item

  1. pop(self: collections.abc.Sequence[shyft.energy_market.stm.ReservoirAggregate], i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.ReservoirAggregate

Remove and return the item at index i

size(self: collections.abc.Sequence[shyft.energy_market.stm.ReservoirAggregate]) int
class shyft.energy_market.stm.ReservoirList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ReservoirList) -> None

  2. __init__(self: shyft.energy_market.stm.ReservoirList, arg0: shyft.energy_market.stm.ReservoirList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.ReservoirList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ReservoirList) -> None

  2. __init__(self: shyft.energy_market.stm.ReservoirList, arg0: shyft.energy_market.stm.ReservoirList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.ReservoirList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.ReservoirList, x: shyft.energy_market.stm.Reservoir) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.ReservoirList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.ReservoirList, L: shyft.energy_market.stm.ReservoirList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.ReservoirList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.ReservoirList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.Reservoir) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.ReservoirList) -> shyft.energy_market.stm.Reservoir

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.ReservoirList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.Reservoir

Remove and return the item at index i

size(self: shyft.energy_market.stm.ReservoirList) int
class shyft.energy_market.stm.RunParameters

Bases: pybind11_object

A set of parameters from a simulation- or optimization run. It is a part of the StmSystem class.

__init__(*args, **kwargs)
property fx_log

from the fx-callback.

Type:

MessageList

property head_opt

Whether head optimization is turned on.

Type:

bool

property n_full_runs

Number of full runs.

Type:

int

property n_inc_runs

Number of incremental runs.

Type:

int

property run_time_axis

The time axis for the SHOP run.

Type:

TimeAxis

class shyft.energy_market.stm.ServerStatus

Bases: pybind11_object

Status of a managed compute server

__init__(*args, **kwargs)
property address
property last_send
property model_id
property state
class shyft.energy_market.stm.ShopCommand(*args, **kwargs)

Bases: pybind11_object

A shop command, which can later be sent to the shop core.

In the shop core a command can be described as a string with syntax: ‘<keyword> <specifier> [/<opt> [/<opt>…]] [[<obj>] [<obj>…]]’. The keyword is a general word that specifies the kind of action, for example ‘set’, ‘save’ or ‘return’. The specifier identifies what data will be affected by the command, and it is unique for every command, for example ‘method’, or ‘ramping’. Commands can accept one or several pre-set options to further specify the command. These always start with a forward slash, consist of one word only, and if more than one the order is important. Some commands also needs input objects, usually an integer, floating point, or string value.

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ShopCommand, command: str) -> None

Create from a single string in shop command language syntax.

  1. __init__(self: shyft.energy_market.stm.ShopCommand, keyword: str, specifier: str, options: collections.abc.Sequence[str], objects: collections.abc.Sequence[str]) -> None

Create from individual components.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ShopCommand, command: str) -> None

Create from a single string in shop command language syntax.

  1. __init__(self: shyft.energy_market.stm.ShopCommand, keyword: str, specifier: str, options: collections.abc.Sequence[str], objects: collections.abc.Sequence[str]) -> None

Create from individual components.

property keyword

keyword of the command

static log_file(*args, **kwargs)

Overloaded function.

  1. log_file() -> shyft.energy_market.stm.ShopCommand

Shop command string ‘log file’.

  1. log_file(filename: str) -> shyft.energy_market.stm.ShopCommand

Shop command string ‘log file <filename>’.

static log_file_lp(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘log file /lp <filename>’.

property objects

list of objects

property options

list of options

static penalty_cost_all(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /all <value>’.

static penalty_cost_discharge(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /discharge <value>’.

static penalty_cost_gate_ramping(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /gate /ramping <value>’.

static penalty_cost_load(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /load <value>’.

static penalty_cost_overflow(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /overflow <value>’.

static penalty_cost_overflow_time_adjust(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /overflow_time_adjust <value>’.

static penalty_cost_powerlimit(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /powerlimit <value>’.

static penalty_cost_reserve(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /reserve <value>’.

static penalty_cost_reservoir_endpoint(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /reservoir /endpoint <value>’.

static penalty_cost_reservoir_ramping(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /reservoir /ramping <value>’.

static penalty_cost_soft_p_penalty(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /soft_p_penalty <value>’.

static penalty_cost_soft_q_penalty(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /soft_q_penalty <value>’.

static penalty_flag_all(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /all /on|/off’.

static penalty_flag_discharge(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /discharge’.

static penalty_flag_gate_max_q_con(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /gate /max_q_con’.

static penalty_flag_gate_min_q_con(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /gate /min_q_con’.

static penalty_flag_gate_ramping(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /gate /ramping’.

static penalty_flag_load(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /load’.

static penalty_flag_plant_max_p_con(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /plant /max_p_con’.

static penalty_flag_plant_max_q_con(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /plant /max_q_con’.

static penalty_flag_plant_min_p_con(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /plant /min_p_con’.

static penalty_flag_plant_min_q_con(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /plant /min_q_con’.

static penalty_flag_plant_schedule(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /plant /schedule’.

static penalty_flag_powerlimit(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /powerlimit’.

static penalty_flag_reservoir_endpoint(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /reservoir /endpoint’.

static penalty_flag_reservoir_ramping(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /reservoir /ramping’.

static print_bp_curves() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves’.

static print_bp_curves_all_combinations() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /all_combinations’.

static print_bp_curves_current_combination() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /current_combination’.

static print_bp_curves_discharge() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /discharge’.

static print_bp_curves_dyn_points() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /dyn_points’.

static print_bp_curves_from_zero() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /from_zero’.

static print_bp_curves_market_ref_mc() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /market_ref_mc’.

static print_bp_curves_mc_format() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /mc_format’.

static print_bp_curves_no_vertical_step() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /no_vertical_step’.

static print_bp_curves_old_points() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /old_points’.

static print_bp_curves_operation() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /operation’.

static print_bp_curves_production() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /production’.

static print_mc_curves(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves <filename>’.

static print_mc_curves_down(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /down <filename>’.

static print_mc_curves_down_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /down /mod <filename>’.

static print_mc_curves_down_pq(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /down /pq <filename>’.

static print_mc_curves_down_pq_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /down /pq /mod <filename>’.

static print_mc_curves_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /mod <filename>’.

static print_mc_curves_pq(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /pq <filename>’.

static print_mc_curves_pq_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /pq /mod <filename>’.

static print_mc_curves_up(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up <filename>’.

static print_mc_curves_up_down(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /down <filename>’.

static print_mc_curves_up_down_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /down /mod <filename>’.

static print_mc_curves_up_down_pq(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /down /pq <filename>’.

static print_mc_curves_up_down_pq_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /down /pq /mod <filename>’.

static print_mc_curves_up_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /mod <filename>’.

static print_mc_curves_up_pq(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /pq <filename>’.

static print_mc_curves_up_pq_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /pq /mod <filename>’.

static print_model(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print model <filename>’.

static print_pqcurves_all(*args, **kwargs)

Overloaded function.

  1. print_pqcurves_all() -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /all’.

  1. print_pqcurves_all(filename: str) -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /all <filename>’.

static print_pqcurves_convex(*args, **kwargs)

Overloaded function.

  1. print_pqcurves_convex() -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /convex’.

  1. print_pqcurves_convex(filename: str) -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /convex <filename>’.

static print_pqcurves_final(*args, **kwargs)

Overloaded function.

  1. print_pqcurves_final() -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /final’.

  1. print_pqcurves_final(filename: str) -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /final <filename>’.

static print_pqcurves_original(*args, **kwargs)

Overloaded function.

  1. print_pqcurves_original() -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /original’.

  1. print_pqcurves_original(filename: str) -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /original <filename>’.

static return_scenario_result_table(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘return scenario_result_table <filename>’.

static return_shopsimres(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘return shopsimres <filename>’.

static return_shopsimres_gen(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘return shopsimres /gen <filename>’.

static return_simres(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘return simres <filename>’.

static return_simres_gen(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘return simres /gen <filename>’.

static save_pq_curves(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘save pq_curves /on|/off’.

static save_series(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘save series <filename>’.

static save_shopsimseries(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘save shopsimseries <filename>’.

static save_tunnelloss() shyft.energy_market.stm.ShopCommand

Shop command string ‘save tunnelloss’.

static save_xmlseries(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘save xmlseries <filename>’.

static save_xmlshopsimseries(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘save xmlshopsimseries <filename>’.

static set_bypass_loss(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘set bypass_loss /on|/off’.

static set_capacity_all(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set capacity /all <value>’.

static set_capacity_bypass(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set capacity /bypass <value>’.

static set_capacity_gate(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set capacity /gate <value>’.

static set_capacity_spill(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set capacity /spill <value>’.

static set_code_full() shyft.energy_market.stm.ShopCommand

Shop command string ‘set code /full’.

static set_code_head() shyft.energy_market.stm.ShopCommand

Shop command string ‘set code /head’.

static set_code_incremental() shyft.energy_market.stm.ShopCommand

Shop command string ‘set code /incremental’.

static set_com_dec_period(value: SupportsInt | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set com_dec_period <value>’.

static set_droop_discretization_limit(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set droop_discretization_limit <value>’.

static set_dyn_flex_mip(value: SupportsInt | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set dyn_flex_mip <value>’.

static set_dyn_seg_incr() shyft.energy_market.stm.ShopCommand

Shop command string ‘set dyn_seg /incr’.

static set_dyn_seg_mip() shyft.energy_market.stm.ShopCommand

Shop command string ‘set dyn_seg /mip’.

static set_dyn_seg_on() shyft.energy_market.stm.ShopCommand

Shop command string ‘set dyn_seg /on’.

static set_fcr_d_band(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set fcr_d_band <value>’.

static set_fcr_n_band(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set fcr_n_band <value>’.

static set_fcr_n_equality(value: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘set fcr_n_equality <value>’.

static set_gen_turn_off_limit(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set gen_turn_off_limit <value>’.

static set_headopt_feedback(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set headopt_feedback <value>’.

static set_max_num_threads(value: SupportsInt | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set max_num_threads <value>’.

static set_merge_off() shyft.energy_market.stm.ShopCommand

Shop command string ‘set merge /off’.

static set_merge_on() shyft.energy_market.stm.ShopCommand

Shop command string ‘set merge /on’.

static set_merge_stop() shyft.energy_market.stm.ShopCommand

Shop command string ‘set merge /stop’.

static set_method_baropt() shyft.energy_market.stm.ShopCommand

Shop command string ‘set method /baropt’.

static set_method_dual() shyft.energy_market.stm.ShopCommand

Shop command string ‘set method /dual’.

static set_method_hydbaropt() shyft.energy_market.stm.ShopCommand

Shop command string ‘set method /hydbaropt’.

static set_method_netdual() shyft.energy_market.stm.ShopCommand

Shop command string ‘set method /netdual’.

static set_method_netprimal() shyft.energy_market.stm.ShopCommand

Shop command string ‘set method /netprimal’.

static set_method_primal() shyft.energy_market.stm.ShopCommand

Shop command string ‘set method /primal’.

static set_mipgap(absolute: bool, value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set mipgap /absolute|/relative <value>’.

static set_newgate(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘set newgate /on|/off’.

static set_nseg_all(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set nseg /all <value>’.

static set_nseg_down(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set nseg /down <value>’.

static set_nseg_up(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set nseg /up <value>’.

static set_parallel_mode_auto() shyft.energy_market.stm.ShopCommand

Shop command string ‘set parallel_mode /auto’.

static set_parallel_mode_deterministic() shyft.energy_market.stm.ShopCommand

Shop command string ‘set parallel_mode /deterministic’.

static set_parallel_mode_opportunistic() shyft.energy_market.stm.ShopCommand

Shop command string ‘set parallel_mode /opportunistic’.

static set_password(key: str, value: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘set password <value>’.

static set_power_head_optimization(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘set power_head_optimization /on|/off’.

static set_ramping(mode: SupportsInt | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set ramping <value>’.

static set_reserve_ramping_cost(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set reserve_ramping_cost <value>’.

static set_reserve_slack_cost(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set reserve_slack_cost <value>’.

static set_time_delay_unit_hour() shyft.energy_market.stm.ShopCommand

Shop command string ‘set time_delay_unit hour’.

static set_time_delay_unit_minute() shyft.energy_market.stm.ShopCommand

Shop command string ‘set time_delay_unit minute’.

static set_time_delay_unit_time_step_length() shyft.energy_market.stm.ShopCommand

Shop command string ‘set time_delay_unit time_step_length’.

static set_timelimit(value: SupportsInt | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set timelimit <value>’.

static set_universal_mip_not_set() shyft.energy_market.stm.ShopCommand

Shop command string ‘set universal_mip /not_set’.

static set_universal_mip_off() shyft.energy_market.stm.ShopCommand

Shop command string ‘set universal_mip /off’.

static set_universal_mip_on() shyft.energy_market.stm.ShopCommand

Shop command string ‘set universal_mip /on’.

static set_xmllog(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘set xmllog /on|/off’.

property specifier

specifier of the command

static start_shopsim() shyft.energy_market.stm.ShopCommand

Shop command string ‘start shopsim’.

static start_sim(iterations: SupportsInt | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘start sim <iterations>’.

class shyft.energy_market.stm.StmCase(*args, **kwargs)

Bases: pybind11_object

Provided a case concept for Stm. A case, can hold a number of references to stm model runs. A StmTask contains many cases, each with a set of stm model runs.

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.StmCase) -> None

  2. __init__(self: shyft.energy_market.stm.StmCase, id: typing.SupportsInt | typing.SupportsIndex, name: str, created: shyft.time_series.time, json: str = ‘’, labels: collections.abc.Sequence[str] = [], model_refs: shyft.energy_market.stm.ModelRefList = ModelRefList([])) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.StmCase) -> None

  2. __init__(self: shyft.energy_market.stm.StmCase, id: typing.SupportsInt | typing.SupportsIndex, name: str, created: shyft.time_series.time, json: str = ‘’, labels: collections.abc.Sequence[str] = [], model_refs: shyft.energy_market.stm.ModelRefList = ModelRefList([])) -> None

add_model_ref(self: shyft.energy_market.stm.StmCase, mr: shyft.energy_market.stm.StmModelRef) None

Add a model reference to the case.

Parameters:

mr (StmModelRef) – The model reference to add.

property created

The time of creation, or last modification.

Type:

time

get_model_ref(self: shyft.energy_market.stm.StmCase, mkey: str) shyft.energy_market.stm.StmModelRef

Get model reference in the case based on model key.

Parameters:

mkey (str) – The model key the reference has stored. Cf. StmModelRef.model_key.

Returns:

mr. Requested model reference. None if not found in the case.

Return type:

StmModelRef

property id

The unique case ID.

Type:

int

property json

A json formatted string with miscellaneous data.

Type:

str

property labels
property model_refs
property name

Any useful name of description.

Type:

str

remove_model_ref(self: shyft.energy_market.stm.StmCase, mkey: str) bool

Remove a stm run model reference from the case.

Parameters:

mkey (str) – The stm run model key the reference has stored. Cf. StmModelRef.model_key.

Returns:

success. True if model reference was successfully removed. False if case did not contain model reference with given model key.

Return type:

Boolean

update_model_ref(self: shyft.energy_market.stm.StmCase, mr: shyft.energy_market.stm.StmModelRef) None

Update model reference, using the model_key as reference.

Parameters:

mr (StmModelRef) – The model reference to update.

class shyft.energy_market.stm.StmClient(self: shyft.energy_market.stm.StmClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0)

Bases: pybind11_object

The client api for the stm repository server.

Creates a python client that can communicate with the corresponding server

__init__(self: shyft.energy_market.stm.StmClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0) None

Creates a python client that can communicate with the corresponding server

close(self: shyft.energy_market.stm.StmClient) None

Close the connection. It will automatically reopen if needed.

get_model_infos(self: shyft.energy_market.stm.StmClient, mids: collections.abc.Sequence[SupportsInt | SupportsIndex], created_in: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.ModelInfo]

returns all or selected model-info objects based on model-identifiers(mids)

Parameters:
  • mids (IntVector) – empty = all, or a list of known exisiting model-identifiers

  • created_in (UtcPeriod) – For which period you are interested in model-infos.

Returns:

model_infos. Strongly typed list of ModelInfo

Return type:

ModelInfoVector

property host_port

Endpoint network address of the remote server.

Type:

str

property is_open

If the connection to the remote server is (still) open.

Type:

bool

property operation_timeout_ms

Operation timeout for remote server operations, in number milliseconds.

Type:

int

read_model(self: shyft.energy_market.stm.StmClient, mid: SupportsInt | SupportsIndex) shyft.energy_market.stm.StmSystem

Read and return the model for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting model from the server

Return type:

Model

read_models(self: shyft.energy_market.stm.StmClient, mids: collections.abc.Sequence[SupportsInt | SupportsIndex]) list[shyft.energy_market.stm.StmSystem]

Read and return the model for specified model-identifier (mid)

Parameters:

mids (list[int]) – A strongly typed list of ints, the model-identifers for the wanted models

Returns:

  1. The resulting model from the server

Return type:

Model

property reconnect_count

Number of reconnects to the remote server that have been performed.

Type:

int

remove_model(self: shyft.energy_market.stm.StmClient, mid: SupportsInt | SupportsIndex) int

Remove the specified model bymodel-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

ec. 0 or error-code?

Return type:

int

store_model(self: shyft.energy_market.stm.StmClient, m: shyft.energy_market.stm.StmSystem, mi: shyft.time_series.ModelInfo) int

Store the model to backend, if m.id==0 then a new unique model-info is created and used

Parameters:
  • m (Model) – The model to store

  • mi (ModelInfo) – The model-info to store for the model

Returns:

mid. model-identifier for the stored model and model-info

Return type:

int

property timeout_ms

Timout for remote server operations, in number milliseconds.

Type:

int

update_model_info(self: shyft.energy_market.stm.StmClient, mid: SupportsInt | SupportsIndex, mi: shyft.time_series.ModelInfo) bool

Update the model-info for specified model-identifier(mid)

Parameters:
  • mid (int) – model-identifer

  • mi (ModelInfo) – The new updated model-info

Returns:

ok. true if success

Return type:

bool

class shyft.energy_market.stm.StmModelRef(*args, **kwargs)

Bases: pybind11_object

Reference to a model, and where to find it.

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.StmModelRef) -> None

  2. __init__(self: shyft.energy_market.stm.StmModelRef, host: str, port_num: typing.SupportsInt | typing.SupportsIndex, api_port_num: typing.SupportsInt | typing.SupportsIndex, model_key: str, stm_key: typing.SupportsInt | typing.SupportsIndex = 0) -> None

Create a run info.

Parameters:
  • host (str) – Where the referenced model is stored.

  • port_num (int) – At what port number to interface with the server.

  • api_port_num (int) – At what port number to interface with the server using the web API.

  • model_key (str) – The model key the referenced model is stored under.

  • stm_key (int) – If >0, then the stm model id of the persisted StmSystem

  1. __init__(self: shyft.energy_market.stm.StmModelRef) -> None

Default constructor for StmRunInfo.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.StmModelRef) -> None

  2. __init__(self: shyft.energy_market.stm.StmModelRef, host: str, port_num: typing.SupportsInt | typing.SupportsIndex, api_port_num: typing.SupportsInt | typing.SupportsIndex, model_key: str, stm_key: typing.SupportsInt | typing.SupportsIndex = 0) -> None

Create a run info.

Parameters:
  • host (str) – Where the referenced model is stored.

  • port_num (int) – At what port number to interface with the server.

  • api_port_num (int) – At what port number to interface with the server using the web API.

  • model_key (str) – The model key the referenced model is stored under.

  • stm_key (int) – If >0, then the stm model id of the persisted StmSystem

  1. __init__(self: shyft.energy_market.stm.StmModelRef) -> None

Default constructor for StmRunInfo.

property api_port_num

Port number to interface with server through web API.

Type:

int

property host

Where model is stored.

Type:

str

property labels

A set of labels for the model.

Type:

StringVector

property model_key

The model key the referenced model is stored under.

Type:

str

property port_num

Port number to interface with server.

Type:

int

property stm_id

If >0 The id of the persisted StmSystem

Type:

int

class shyft.energy_market.stm.StmPatchOperation(self: shyft.energy_market.stm.StmPatchOperation, value: SupportsInt | SupportsIndex)

Bases: pybind11_object

Describes how a patch should be applied to the STM model

Members:

ADD

REMOVE_RELATIONS

REMOVE_OBJECTS

ADD = <StmPatchOperation.ADD: 0>
REMOVE_OBJECTS = <StmPatchOperation.REMOVE_OBJECTS: 2>
REMOVE_RELATIONS = <StmPatchOperation.REMOVE_RELATIONS: 1>
__init__(self: shyft.energy_market.stm.StmPatchOperation, value: SupportsInt | SupportsIndex) None
StmPatchOperation.name -> str
property value
class shyft.energy_market.stm.StmServer(self: shyft.energy_market.stm.StmServer, root_dir: str, config: shyft.time_series.ServerConfig = shyft.time_series.ServerConfig(stale_duration='1970-01-01T01:00:00Z', stale_sweep_interval='1970-01-01T00:00:00.100000Z', log=shyft.time_series.LogConfig(file='', level=200)))

Bases: pybind11_object

The server-side component for the stm energy_market model repository.

Creates a server object that serves models from root_dir. The root_dir will be create if it does not exists.

Parameters:
  • root_dir (str) – Path to the root-directory that keeps/will keep the model-files

  • config (ServerConfig) – Configuration of the server

__init__(self: shyft.energy_market.stm.StmServer, root_dir: str, config: shyft.time_series.ServerConfig = shyft.time_series.ServerConfig(stale_duration='1970-01-01T01:00:00Z', stale_sweep_interval='1970-01-01T00:00:00.100000Z', log=shyft.time_series.LogConfig(file='', level=200))) None

Creates a server object that serves models from root_dir. The root_dir will be create if it does not exists.

Parameters:
  • root_dir (str) – Path to the root-directory that keeps/will keep the model-files

  • config (ServerConfig) – Configuration of the server

get_listening_port(self: shyft.energy_market.stm.StmServer) int

returns the port number it’s listening at for serving incoming request

get_max_connections(self: shyft.energy_market.stm.StmServer) int

returns the maximum number of connections to be served concurrently

get_model_infos(self: shyft.energy_market.stm.StmServer, mids: collections.abc.Sequence[SupportsInt | SupportsIndex], created_in: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.ModelInfo]

returns all or selected model-info objects based on model-identifiers(mids)

Parameters:
  • mids (IntVector) – empty = all, or a list of known exisiting model-identifiers

  • created_in (UtcPeriod) – For which period you are interested in model-infos.

Returns:

model_infos. Strongly typed list of ModelInfo

Return type:

ModelInfoVector

is_running(self: shyft.energy_market.stm.StmServer) bool

true if server is listening and running

See also

start_server()

read_model(self: shyft.energy_market.stm.StmServer, mid: SupportsInt | SupportsIndex) shyft.energy_market.stm.StmSystem

Read and return the model for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting model from the server

Return type:

Model

read_model_blob(self: shyft.energy_market.stm.StmServer, mid: SupportsInt | SupportsIndex) list[str]

Read and return the model blob for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting blob model from the server

Return type:

ByteVector

read_models(self: shyft.energy_market.stm.StmServer, mids: collections.abc.Sequence[SupportsInt | SupportsIndex]) list[shyft.energy_market.stm.StmSystem]

Read and return the model for specified model-identifier (mid)

Parameters:

mids (list[int]) – A strongly typed list of ints, the model-identifers for the wanted models

Returns:

  1. The resulting model from the server

Return type:

Model

remove_model(self: shyft.energy_market.stm.StmServer, mid: SupportsInt | SupportsIndex) int

Remove the specified model bymodel-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

ec. 0 or error-code?

Return type:

int

set_listening_ip(self: shyft.energy_market.stm.StmServer, ip: str) None

set the listening port for the service

Parameters:

ip (str) – ip or host-name to start listening on

Returns:

nothing.

Return type:

None

set_listening_port(self: shyft.energy_market.stm.StmServer, port_no: SupportsInt | SupportsIndex) None

set the listening port for the service

Parameters:
  • port_no (int) – a valid and available tcp-ip port number to listen on.

  • 20000 (typically it could be)

Returns:

nothing.

Return type:

None

set_max_connections(self: shyft.energy_market.stm.StmServer, max_connect: SupportsInt | SupportsIndex) None

limits simultaneous connections to the server (it’s multithreaded, and uses on thread pr. connect)

Parameters:

max_connect (int) – maximum number of connections before denying more connections

See also

get_max_connections()

property stale_connection_close_count

returns count of connection closed due to stale/no communication activity

Type:

int

start_server(self: shyft.energy_market.stm.StmServer) int

start server listening in background, and processing messages

See also

set_listening_port(port_no),is_running

Returns:

port_no. the port used for listening operations, either the value as by set_listening_port, or if it was unspecified, a new available port

Return type:

in

stop_server(self: shyft.energy_market.stm.StmServer, timeout: SupportsInt | SupportsIndex = 1000) None

stop serving connections, gracefully.

See also

start_server()

store_model(self: shyft.energy_market.stm.StmServer, m: shyft.energy_market.stm.StmSystem, mi: shyft.time_series.ModelInfo) int

Store the model to backend, if m.id==0 then a new unique model-info is created and used

Parameters:
  • m (Model) – The model to store

  • mi (ModelInfo) – The model-info to store for the model

Returns:

mid. model-identifier for the stored model and model-info

Return type:

int

update_model_info(self: shyft.energy_market.stm.StmServer, mid: SupportsInt | SupportsIndex, mi: shyft.time_series.ModelInfo) bool

Update the model-info for specified model-identifier(mid)

Parameters:
  • mid (int) – model-identifer

  • mi (ModelInfo) – The new updated model-info

Returns:

ok. true if success

Return type:

bool

class shyft.energy_market.stm.StmSystem(self: shyft.energy_market.stm.StmSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '')

Bases: pybind11_object

A complete stm system, with market areas, and hydro power systems.

Create stm system.

__init__(self: shyft.energy_market.stm.StmSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') None

Create stm system.

property actors
add_unit_group(self: shyft.energy_market.stm.StmSystem, id: SupportsInt | SupportsIndex, name: str, json: str = '', group_type: shyft.energy_market.UnitGroupType = <UnitGroupType.UNSPECIFIED: 0>) shyft.energy_market.stm.UnitGroup

Add an empty named unit-group to the system.

Parameters:
  • id (int) – Unique id of the group.

  • name (str) – Unique name of the group.

  • json (str) – Json payload for py customization.

  • group_type (int) – One of UnitGroupType values, default 0.

Returns:

unit_group. The newly created unit-group.

Return type:

UnitGroup

property contract_portfolios
property contracts
create_hydro_power_system(self: shyft.energy_market.stm.StmSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.HydroPowerSystem

Create hydro power system with unique uid.

Returns:

hps. The new hydro power system.

Return type:

HydroPowerSystem

create_market_area(self: shyft.energy_market.stm.StmSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.MarketArea

Create stm energy market area with unique uid.

Returns:

market_area. The new market area.

Return type:

MarketArea

create_network(self: shyft.energy_market.stm.StmSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.Network

Create stm network with unique uid.

Returns:

network. The new network.

Return type:

Network

create_power_module(self: shyft.energy_market.stm.StmSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.PowerModule

Create stm power module with unique uid.

Returns:

power_module. The new power module.

Return type:

PowerModule

create_wind_farm(self: shyft.energy_market.stm.StmSystem, uid: SupportsInt | SupportsIndex, name: str, json: str = '') shyft.energy_market.stm.WindFarm

Create stm network with unique uid.

Returns:

wind_farm. The new wind farm.

Return type:

WindFarm

property custom

Ensure all members(hps,contracts etc.) refers to this system to enable easy py navigation. Usually only needed in cases where the stm-system is built without proper system refrences for child objects. side-effects: Missing uplinks are fixed.

Returns:

result. True if anything was changed in uplinks

static from_blob(blob: shyft.time_series.ByteVector) shyft.energy_market.stm.StmSystem

Re-create a stm system from a previously create blob.

Returns:

stm_sys. A stm system including hydro-power-systems and markets.

Return type:

StmSystem

static from_stripped_blob(blob: shyft.time_series.ByteVector) shyft.energy_market.stm.StmSystem

Re-create a stm system from a previously created stripped blob.

Returns:

stm_sys. A stripped stm system including hydro-power-systems and markets.

Return type:

StmSystem

get_attr(self: shyft.energy_market.stm.StmSystem, url: str) bool | float | int | int | shyft.time_series.TimeSeries | shyft.energy_market.t_xy | shyft.energy_market.t_xyz | shyft.energy_market.t_xyz_list | shyft.energy_market.t_turbine_description | str | shyft.time_series.TsVector | shyft.energy_market.UnitGroupType | shyft.time_series.TimeAxis | shyft.time_series.GeoPoint | shyft.energy_market.stm.UrlResolveError

Get an attribute specified by url.

get_attrs(self: shyft.energy_market.stm.StmSystem, urls: collections.abc.Sequence[str]) list[bool | float | int | int | shyft.time_series.TimeSeries | shyft.energy_market.t_xy | shyft.energy_market.t_xyz | shyft.energy_market.t_xyz_list | shyft.energy_market.t_turbine_description | str | shyft.time_series.TsVector | shyft.energy_market.UnitGroupType | shyft.time_series.TimeAxis | shyft.time_series.GeoPoint | shyft.energy_market.stm.UrlResolveError]

Get attributes specified by urls.

get_tsm_object(self: shyft.energy_market.stm.StmSystem, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property hydro_power_systems
property id
property json
property market_areas
property name
property networks
property obj

a python object

Type:

object

patch(self: shyft.energy_market.stm.StmSystem, op: shyft.energy_market.stm.StmPatchOperation, p: shyft.energy_market.stm.StmSystem) bool

Patch self with patch p using operation op. If operation is ADD, the new objects in p that have id==0, will have auto assigned unique id`s For the value of the auto assigned `id is max(obj.id)+1, in the order of appearance. side-effects: The patch p is updated with these new object id values.

Parameters:
  • () (p) – Operation is one of ADD,REMOVE_RELATIONS,REMOVE_OBJECTS

  • () – The StmSystem describing the patch

Returns:

result. True if patch operation and type was applied, false if not supported operation

property power_modules
result_ts_urls(self: shyft.energy_market.stm.StmSystem, prefix: str) list[str]

Generate and return all result time series urls for the specified model. Useful in the context of a dstm client, that have a get_ts method that accepts this list.

Parameters:

() (prefix) – Url prefix, like dstm://Mmodel_id.

Returns:

ts_urls. A strongly typed list of strings with ready to use ts-urls.

Return type:

StringVector

property run_parameters
set_attr(self: shyft.energy_market.stm.StmSystem, url: str, attr: bool | SupportsFloat | SupportsIndex | SupportsInt | SupportsIndex | SupportsInt | SupportsIndex | shyft.time_series.TimeSeries | shyft.energy_market.t_xy | shyft.energy_market.t_xyz | shyft.energy_market.t_xyz_list | shyft.energy_market.t_turbine_description | str | shyft.time_series.TsVector | shyft.energy_market.UnitGroupType | shyft.time_series.TimeAxis | shyft.time_series.GeoPoint) shyft.energy_market.stm.UrlResolveError | None

Set an attribute specified by url.

set_attrs(self: shyft.energy_market.stm.StmSystem, attrs: collections.abc.Sequence[tuple[str, bool | SupportsFloat | SupportsIndex | SupportsInt | SupportsIndex | SupportsInt | SupportsIndex | shyft.time_series.TimeSeries | shyft.energy_market.t_xy | shyft.energy_market.t_xyz | shyft.energy_market.t_xyz_list | shyft.energy_market.t_turbine_description | str | shyft.time_series.TsVector | shyft.energy_market.UnitGroupType | shyft.time_series.TimeAxis | shyft.time_series.GeoPoint]]) list[shyft.energy_market.stm.UrlResolveError | None]

Set attributes specified by url

property summary
property tag

Url tag.

Type:

str

to_blob(self: shyft.energy_market.stm.StmSystem) shyft.time_series.ByteVector

Serialize the model to a blob.

Returns:

blob. Blob form of the model.

Return type:

ByteVector

to_stripped_blob(self: shyft.energy_market.stm.StmSystem) shyft.time_series.ByteVector

Serialize the model to a blob, stripping away expressions, json and custom attributes.

Returns:

blob. Blob form of the stripped model.

Return type:

ByteVector

property ts
property unit_groups
property wind_farms
class shyft.energy_market.stm.StmTask(*args, **kwargs)

Bases: pybind11_object

Task concept for Stm. Can contain a number of cases, each of them can contain one or more stm model-run references. Defined through its set of labels, a base model, which should relate to child runs and model_refs, and a task name.

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.StmTask) -> None

  2. __init__(self: shyft.energy_market.stm.StmTask, id: typing.SupportsInt | typing.SupportsIndex, name: str, created: shyft.time_series.time, json: str = ‘’, labels: collections.abc.Sequence[str] = [], cases: collections.abc.Sequence[shyft.energy_market.stm.StmCase] = [], base_model: shyft.energy_market.stm.StmModelRef = StmModelRef(host=’’, port_num=-1, api_port_num=-1, model_key=’’, stm_key=0), task_name: str = ‘’) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.StmTask) -> None

  2. __init__(self: shyft.energy_market.stm.StmTask, id: typing.SupportsInt | typing.SupportsIndex, name: str, created: shyft.time_series.time, json: str = ‘’, labels: collections.abc.Sequence[str] = [], cases: collections.abc.Sequence[shyft.energy_market.stm.StmCase] = [], base_model: shyft.energy_market.stm.StmModelRef = StmModelRef(host=’’, port_num=-1, api_port_num=-1, model_key=’’, stm_key=0), task_name: str = ‘’) -> None

add_case(self: shyft.energy_market.stm.StmTask, case: shyft.energy_market.stm.StmCase) None

Add a case (set of stm model runs) to the task.

Parameters:

case (StmCase) – The case instance to add to the task.

Returns:

None. Returns nothing.

Return type:

None

property base_model

Base model, which should correspond to models used in runs.

Type:

StmModelRef

property cases

Set of runs connected to task.

Type:

StmCaseVector

property created

The time of creation, or last modification.

Type:

time

get_case(*args, **kwargs)

Overloaded function.

  1. get_case(self: shyft.energy_market.stm.StmTask, cid: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.StmCase

Get run from task based on ID.

Parameters:

cid (int) – Id of case you want to get.

Returns:

case. Request case, None if not found.

Return type:

StmCase

  1. get_case(self: shyft.energy_market.stm.StmTask, rname: str) -> shyft.energy_market.stm.StmCase

Get case based on its name.

Parameters:

rname (str) – Name of case you want to get.

Returns:

case. Request case, None if not found.

Return type:

StmCase

property id

The unique task ID.

Type:

int

property json

A json formatted string with miscellaneous data.

Type:

str

property labels
property name

Any useful name or description.

Type:

str

remove_case(*args, **kwargs)

Overloaded function.

  1. remove_case(self: shyft.energy_market.stm.StmTask, id: typing.SupportsInt | typing.SupportsIndex) -> bool

Remove a case from task based on id.

  1. remove_case(self: shyft.energy_market.stm.StmTask, name: str) -> bool

Remove a case from task based on name.

property task_name

Name of task connected to task.

Type:

str

update_case(self: shyft.energy_market.stm.StmTask, case: shyft.energy_market.stm.StmCase) bool

Update case inplace

Parameters:

case (StmCase) – The case to update inplace.

class shyft.energy_market.stm.StmTaskClient(self: shyft.energy_market.stm.StmTaskClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0)

Bases: pybind11_object

The client api for the Task repository. Notice that this client has all the standard methods of a micro-service for store,find,remove and get model info related to working with the Task model objects. Additionally, it provides specialized functions to query/update work with the task parts, during a tasks lifetime

Creates a python client that can communicate with the corresponding server

__init__(self: shyft.energy_market.stm.StmTaskClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0) None

Creates a python client that can communicate with the corresponding server

add_case(self: shyft.energy_market.stm.StmTaskClient, mid: SupportsInt | SupportsIndex, case: shyft.energy_market.stm.StmCase) None

Add a case to a task on the server.

Parameters:
  • mid (int) – Task id to add a run to.

  • case (StmCase) – The case to add to the task.

Raises:
  • RuntimeError – If provided mid is an invalid task id.

  • RuntimeError – If the provided case has the same id or name as a case already in the task.

add_case_auto_id(self: shyft.energy_market.stm.StmTaskClient, mid: SupportsInt | SupportsIndex, case: shyft.energy_market.stm.StmCase) int

Add a case to a task on the server with generated unique id.

Parameters:
  • mid (int) – Task id to add a run to.

  • case (StmCase) – The case to add to the task.

Returns:

cid. The generated unique id of the added case.

Return type:

int

Raises:
  • RuntimeError – If provided mid is an invalid task id.

  • RuntimeError – If the provided case has the same name as a case already in the task.

add_model_ref(self: shyft.energy_market.stm.StmTaskClient, mid: SupportsInt | SupportsIndex, cid: SupportsInt | SupportsIndex, mr: shyft.energy_market.stm.StmModelRef) None

Add a model reference to a case on server.

Parameters:
  • mid (int) – Task ID.

  • cid (int) – Case ID.

  • mr (StmModelRef) – The model reference to add to case with ID=cid, contained in task with ID=mid.

close(self: shyft.energy_market.stm.StmTaskClient) None

Close the connection. It will automatically reopen if needed.

fx(self: shyft.energy_market.stm.StmTaskClient, mid: SupportsInt | SupportsIndex, fx_arg: str) bool

Execute the serverside fx, passing supplied arguments.

Parameters:
  • mid (str) – ID of the task for the server-side fx.

  • fx_arg (str) – Any argument passed to the server-side fx.

Returns:

success. true if the call was successful.

Return type:

bool

get_case(*args, **kwargs)

Overloaded function.

  1. get_case(self: shyft.energy_market.stm.StmTaskClient, mid: typing.SupportsInt | typing.SupportsIndex, cid: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.StmCase

Get case from task based on case’s id.

Parameters:
  • mid (int) – Task ID.

  • cid (int) – Case ID.

Returns:

case. Requested case, or None if not found.

Return type:

StmCase

  1. get_case(self: shyft.energy_market.stm.StmTaskClient, mid: typing.SupportsInt | typing.SupportsIndex, cname: str) -> shyft.energy_market.stm.StmCase

Get from task based on case’s name.

Parameters:
  • mid (int) – Task ID.

  • cname (str) – Case name.

  • case (StmCase) – Requested run, or None if not found.

get_model_infos(self: shyft.energy_market.stm.StmTaskClient, mids: collections.abc.Sequence[SupportsInt | SupportsIndex], created_in: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.ModelInfo]

returns all or selected model-info objects based on model-identifiers(mids)

Parameters:
  • mids (IntVector) – empty = all, or a list of known exisiting model-identifiers

  • created_in (UtcPeriod) – For which period you are interested in model-infos.

Returns:

model_infos. Strongly typed list of ModelInfo

Return type:

ModelInfoVector

get_model_ref(self: shyft.energy_market.stm.StmTaskClient, mid: SupportsInt | SupportsIndex, cid: SupportsInt | SupportsIndex, mkey: str) shyft.energy_market.stm.StmModelRef

Get a model reference stored in a case contained in a task.

Parameters:
  • mid (int) – Task ID.

  • cid (int) – Case ID.

  • mkey (str) – Model key of model reference. What is stored in StmModelRef.model_key.

Returns:

mr. Requested model reference. None if run wasn’t found or didn’t contain the requested model reference.

Return type:

StmModelRef

property host_port

Endpoint network address of the remote server.

Type:

str

property is_open

If the connection to the remote server is (still) open.

Type:

bool

property operation_timeout_ms

Operation timeout for remote server operations, in number milliseconds.

Type:

int

read_model(self: shyft.energy_market.stm.StmTaskClient, mid: SupportsInt | SupportsIndex) shyft.energy_market.stm.StmTask

Read and return the model for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting model from the server

Return type:

Model

read_models(self: shyft.energy_market.stm.StmTaskClient, mids: collections.abc.Sequence[SupportsInt | SupportsIndex]) list[shyft.energy_market.stm.StmTask]

Read and return the model for specified model-identifier (mid)

Parameters:

mids (list[int]) – A strongly typed list of ints, the model-identifers for the wanted models

Returns:

  1. The resulting model from the server

Return type:

Model

property reconnect_count

Number of reconnects to the remote server that have been performed.

Type:

int

remove_case(*args, **kwargs)

Overloaded function.

  1. remove_case(self: shyft.energy_market.stm.StmTaskClient, mid: typing.SupportsInt | typing.SupportsIndex, cid: typing.SupportsInt | typing.SupportsIndex) -> bool

Remove a case from a task on server.

Parameters:
  • mid (int) – Task id to remove run from.

  • cid (int) – Id of case to remove.

Returns:

success. True if the case was successfully removed from the task.

Return type:

Boolean

  1. remove_case(self: shyft.energy_market.stm.StmTaskClient, mid: typing.SupportsInt | typing.SupportsIndex, rname: str) -> bool

Remove case from a task on server based on it’s case name.

Parameters:
  • mid (int) – Task id to remove run from.

  • cname (str) – Name of the case to remove.

Returns:

success. True if the case was successfully removed from the task.

Return type:

Boolean

remove_model(self: shyft.energy_market.stm.StmTaskClient, mid: SupportsInt | SupportsIndex) int

Remove the specified model bymodel-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

ec. 0 or error-code?

Return type:

int

remove_model_ref(self: shyft.energy_market.stm.StmTaskClient, mid: SupportsInt | SupportsIndex, cid: SupportsInt | SupportsIndex, mkey: str) bool

Remove a model reference from a case contained in a task.

Parameters:
  • mid (int) – Task ID.

  • cid (int) – Case ID.

  • mkey (str) – Model key of model reference. What is stored in StmModelRef.model_key.

Returns:

success. True if model reference was successfully removed, False otherwise.

Return type:

Boolean

store_model(self: shyft.energy_market.stm.StmTaskClient, m: shyft.energy_market.stm.StmTask, mi: shyft.time_series.ModelInfo) int

Store the model to backend, if m.id==0 then a new unique model-info is created and used

Parameters:
  • m (Model) – The model to store

  • mi (ModelInfo) – The model-info to store for the model

Returns:

mid. model-identifier for the stored model and model-info

Return type:

int

property timeout_ms

Timout for remote server operations, in number milliseconds.

Type:

int

update_case(self: shyft.energy_market.stm.StmTaskClient, mid: SupportsInt | SupportsIndex, case: shyft.energy_market.stm.StmCase) None
Parameters:
  • mid (int) – Task ID.

  • case (StmCase) – Case to be updated inplace within the task.

update_model_info(self: shyft.energy_market.stm.StmTaskClient, mid: SupportsInt | SupportsIndex, mi: shyft.time_series.ModelInfo) bool

Update the model-info for specified model-identifier(mid)

Parameters:
  • mid (int) – model-identifer

  • mi (ModelInfo) – The new updated model-info

Returns:

ok. true if success

Return type:

bool

update_model_ref(self: shyft.energy_market.stm.StmTaskClient, mid: SupportsInt | SupportsIndex, cid: SupportsInt | SupportsIndex, mr: shyft.energy_market.stm.StmModelRef) None

Update a model reference in a case on server.

Parameters:
  • mid (int) – Task ID.

  • cid (int) – Case ID.

  • mr (StmModelRef) – The model reference to update to case with model_key, ID=cid, contained in task with ID=mid.

class shyft.energy_market.stm.StmTaskServer(self: shyft.energy_market.stm.StmTaskServer, root_dir: str, config: shyft.time_series.ServerConfig = shyft.time_series.ServerConfig(stale_duration='1970-01-01T01:00:00Z', stale_sweep_interval='1970-01-01T00:00:00.100000Z', log=shyft.time_series.LogConfig(file='', level=200)))

Bases: pybind11_object

The server-side component for the STM Task repository.

Creates a server object that serves models from root_dir. The root_dir will be create if it does not exists.

Parameters:
  • root_dir (str) – Path to the root-directory that keeps/will keep the model-files

  • config (ServerConfig) – Configuration of the server

__init__(self: shyft.energy_market.stm.StmTaskServer, root_dir: str, config: shyft.time_series.ServerConfig = shyft.time_series.ServerConfig(stale_duration='1970-01-01T01:00:00Z', stale_sweep_interval='1970-01-01T00:00:00.100000Z', log=shyft.time_series.LogConfig(file='', level=200))) None

Creates a server object that serves models from root_dir. The root_dir will be create if it does not exists.

Parameters:
  • root_dir (str) – Path to the root-directory that keeps/will keep the model-files

  • config (ServerConfig) – Configuration of the server

add_auth_tokens(self: shyft.energy_market.stm.StmTaskServer, tokens: collections.abc.Sequence[str]) None

Adds auth tokens, and activate authentication. The tokens is compared exactly to the autorization token passed in the request. Authorization should onlye be used for the https/wss, unless other measures(vpn/ssh tunnels etc.) are used to protect auth tokens on the wire

Parameters:

() (tokens) – list of tokens, where each token is like Basic dXNlcjpwd2Q=, e.g: base64 user:pwd

property auth_needed

returns true if the server is setup with auth-tokens, requires web-api clients to pass a valid token

Type:

bool

auth_tokens(self: shyft.energy_market.stm.StmTaskServer) list[str]

returns the registered authentication tokens.

property fx

server-side callable function(lambda) that takes two parameters: mid : the model id fx_arg: arbitrary string to pass to the server-side function The server-side fx is called when the client (or the web-api) invokes the c.fx(mid,fx_arg). The signature of the callback function should be (mid:str, fx_arg:str) -> bool This feature is simply enabling the users to tailor server-side functionality in python!

Examples:

>>> from shyft.energy_market.stm import StmTaskServer
>>> s=StmTaskServer()
>>> def my_fx(mid:str, fx_arg:str)->bool:
>>>     print(f'invoked with mid={mid} fx_arg={fx_arg}')
>>>   # note we can use captured Server s here!>>>     return True
>>> # and then bind the function to the callback
>>> s.fx=my_fx
>>> s.start_server()
>>> : # later using the client from anywhere to invoke the call
>>> fx_result=c.fx('my_model_id', 'my_args')
Type:

Callable[[str,str],bool]

get_listening_port(self: shyft.energy_market.stm.StmTaskServer) int

returns the port number it’s listening at for serving incoming request

get_max_connections(self: shyft.energy_market.stm.StmTaskServer) int

returns the maximum number of connections to be served concurrently

get_model_infos(self: shyft.energy_market.stm.StmTaskServer, mids: collections.abc.Sequence[SupportsInt | SupportsIndex], created_in: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.ModelInfo]

returns all or selected model-info objects based on model-identifiers(mids)

Parameters:
  • mids (IntVector) – empty = all, or a list of known exisiting model-identifiers

  • created_in (UtcPeriod) – For which period you are interested in model-infos.

Returns:

model_infos. Strongly typed list of ModelInfo

Return type:

ModelInfoVector

is_running(self: shyft.energy_market.stm.StmTaskServer) bool

true if server is listening and running

See also

start_server()

read_model(self: shyft.energy_market.stm.StmTaskServer, mid: SupportsInt | SupportsIndex) shyft.energy_market.stm.StmTask

Read and return the model for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting model from the server

Return type:

Model

read_model_blob(self: shyft.energy_market.stm.StmTaskServer, mid: SupportsInt | SupportsIndex) shyft.time_series.ByteVector

Read and return the model blob for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting blob model from the server

Return type:

ByteVector

read_models(self: shyft.energy_market.stm.StmTaskServer, mids: collections.abc.Sequence[SupportsInt | SupportsIndex]) list[shyft.energy_market.stm.StmTask]

Read and return the model for specified model-identifier (mid)

Parameters:

mids (list[int]) – A strongly typed list of ints, the model-identifers for the wanted models

Returns:

  1. The resulting model from the server

Return type:

Model

remove_auth_tokens(self: shyft.energy_market.stm.StmTaskServer, tokens: collections.abc.Sequence[str]) None

removes auth tokens, if it matches all available tokens, then deactivate auth requirement for clients

Parameters:

() (tokens) – list of tokens, where each token is like Basic dXNlcjpwd2Q=, e.g: base64 user:pwd

remove_model(self: shyft.energy_market.stm.StmTaskServer, mid: SupportsInt | SupportsIndex) int

Remove the specified model bymodel-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

ec. 0 or error-code?

Return type:

int

set_listening_ip(self: shyft.energy_market.stm.StmTaskServer, ip: str) None

set the listening port for the service

Parameters:

ip (str) – ip or host-name to start listening on

Returns:

nothing.

Return type:

None

set_listening_port(self: shyft.energy_market.stm.StmTaskServer, port_no: SupportsInt | SupportsIndex) None

set the listening port for the service

Parameters:
  • port_no (int) – a valid and available tcp-ip port number to listen on.

  • 20000 (typically it could be)

Returns:

nothing.

Return type:

None

set_max_connections(self: shyft.energy_market.stm.StmTaskServer, max_connect: SupportsInt | SupportsIndex) None

limits simultaneous connections to the server (it’s multithreaded, and uses on thread pr. connect)

Parameters:

max_connect (int) – maximum number of connections before denying more connections

See also

get_max_connections()

property stale_connection_close_count

returns count of connection closed due to stale/no communication activity

Type:

int

start_server(self: shyft.energy_market.stm.StmTaskServer) int

start server listening in background, and processing messages

See also

set_listening_port(port_no),is_running

Returns:

port_no. the port used for listening operations, either the value as by set_listening_port, or if it was unspecified, a new available port

Return type:

in

start_web_api(self: shyft.energy_market.stm.StmTaskServer, host_ip: str, port: SupportsInt | SupportsIndex, doc_root: str, fg_threads: SupportsInt | SupportsIndex = 2, bg_threads: SupportsInt | SupportsIndex = 4, tls_only: bool = False) int

Start a web API for communicating with server

Parameters:
  • host_ip (str) – 0.0.0.0 for any interface, 127.0.0.1 for local only, &c.

  • port (int) – port number to serve the web API on. 0 for auto-port, otherwise ensure it’s available

  • doc_root (str) – directory form which we will serve http/https documents.

  • fg_threads (int) – number of web API foreground threads, typically 1-4 depending on load.

  • bg_threads (int) – number of long running background thread workers to serve requests &c.

  • tls_only (bool) – default false, set to true to enforce tls sessions only.

Returns:

port. real port number, if port arg is 0, then auto-allocated, otherwise the passed arg

Return type:

int

stop_server(self: shyft.energy_market.stm.StmTaskServer, timeout: SupportsInt | SupportsIndex = 1000) None

stop serving connections, gracefully.

See also

start_server()

stop_web_api(self: shyft.energy_market.stm.StmTaskServer) None

Stops any ongoing web API service.

store_model(self: shyft.energy_market.stm.StmTaskServer, m: shyft.energy_market.stm.StmTask, mi: shyft.time_series.ModelInfo) int

Store the model to backend, if m.id==0 then a new unique model-info is created and used

Parameters:
  • m (Model) – The model to store

  • mi (ModelInfo) – The model-info to store for the model

Returns:

mid. model-identifier for the stored model and model-info

Return type:

int

update_model_info(self: shyft.energy_market.stm.StmTaskServer, mid: SupportsInt | SupportsIndex, mi: shyft.time_series.ModelInfo) bool

Update the model-info for specified model-identifier(mid)

Parameters:
  • mid (int) – model-identifer

  • mi (ModelInfo) – The new updated model-info

Returns:

ok. true if success

Return type:

bool

class shyft.energy_market.stm.TransmissionLine(self: shyft.energy_market.stm.TransmissionLine, uid: SupportsInt | SupportsIndex, name: str, json: str, net: shyft.energy_market.stm.Network)

Bases: pybind11_object

A transmission line connecting two busbars.

class Flow

Bases: pybind11_object

Transmission flow description

__init__(*args, **kwargs)
property result

[W] Resulting flow.

Type:

_ts

class Loss

Bases: pybind11_object

Transmission loss description

__init__(*args, **kwargs)
property constant_coeff

Constant loss coefficient.

Type:

_ts

property linear_coeff

Linear loss coefficient.

Type:

_ts

property quadratic_coeff

Quadratic loss coefficient.

Type:

_ts

property result

[W] Resulting loss.

Type:

_ts

__init__(self: shyft.energy_market.stm.TransmissionLine, uid: SupportsInt | SupportsIndex, name: str, json: str, net: shyft.energy_market.stm.Network) None
property capacity

Transmission line capacity

Type:

_ts

property custom
flattened_attributes(self: shyft.energy_market.stm.TransmissionLine) dict

Flat dict containing all component attributes.

property flow

flow description.

Type:

Flow

property from_bb

connected from this transmission line

Type:

Busbar

get_tsm_object(self: shyft.energy_market.stm.TransmissionLine, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property loss

loss description.

Type:

Loss

property name
property network

The owner of this object.

property obj

a python object

Type:

object

property tag

Url tag.

Type:

str

property to_bb

connected to this transmission line

Type:

Busbar

property ts
class shyft.energy_market.stm.TransmissionLineList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.TransmissionLineList) -> None

  2. __init__(self: shyft.energy_market.stm.TransmissionLineList, arg0: shyft.energy_market.stm.TransmissionLineList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.TransmissionLineList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.TransmissionLineList) -> None

  2. __init__(self: shyft.energy_market.stm.TransmissionLineList, arg0: shyft.energy_market.stm.TransmissionLineList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.TransmissionLineList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.TransmissionLineList, x: shyft.energy_market.stm.TransmissionLine) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.TransmissionLineList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.TransmissionLineList, L: shyft.energy_market.stm.TransmissionLineList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.TransmissionLineList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.TransmissionLineList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.TransmissionLine) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.TransmissionLineList) -> shyft.energy_market.stm.TransmissionLine

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.TransmissionLineList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.TransmissionLine

Remove and return the item at index i

size(self: shyft.energy_market.stm.TransmissionLineList) int
class shyft.energy_market.stm.TsEvaluationError(self: shyft.energy_market.stm.TsEvaluationError)

Bases: pybind11_object

Ts evaluation error

__init__(self: shyft.energy_market.stm.TsEvaluationError) None
property what
class shyft.energy_market.stm.Unit(self: shyft.energy_market.stm.Unit, uid: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem)

Bases: Unit

Stm unit (turbine and generator assembly).

class BestProfit

Bases: pybind11_object

Describes the best profit (BP) curves of the unit.

__init__(*args, **kwargs)
property discharge

Optimal discharge for the generator given a certain production level of the plant.

Type:

_t_xy_

property discharge_production_ratio

Ratio between discharge and production for the generator given a certain production level of the plant.

Type:

_t_xy_

property operating_zone

Optimal operating zone or Pelton needle combination for the generator given a certain production level of the plant.

Type:

_t_xy_

property production

Optimal production for the unit given a certain production level of the plant.

Type:

_t_xy_

property schedule_deviation

Whether the unit schedule can be deviated from when generating curves.

Type:

_ts

class Cost

Bases: pybind11_object

Unit.Cost contains the start/stop costs.

__init__(*args, **kwargs)
property pump_start

[money] Start pump cost.

Type:

_ts

property pump_stop

[money] Stop pump cost.

Type:

_ts

property start

[money] Start cost.

Type:

_ts

property stop

[money] Stop cost.

Type:

_ts

class Discharge

Bases: pybind11_object

Unit.Discharge attributes, flow[m3/s].

class Constraint

Bases: pybind11_object

Constraints and limitations to the unit-flow.

__init__(*args, **kwargs)
property max

[m3/s] Discharge constraint maximum.

Type:

_ts

property max_from_downstream_level

Discharge maximum, as a function of downstream pressure/water level.

Type:

_t_xy_

property min

[m3/s] Discharge constraint minimum.

Type:

_ts

__init__(*args, **kwargs)
property constraint

Constraint group.

Type:

Constraint

property realised

[m^3/s] Discharge realised, usually the result of non trivial computation based on the measured unit.production.realised.

Type:

_ts

property result

[m^3/s] Discharge result.

Type:

_ts

property schedule

[m^3/s] Discharge schedule.

Type:

_ts

class Production

Bases: pybind11_object

Unit.Production attributes, effect[W].

class Constraint

Bases: pybind11_object

Contains the effect constraints to the unit.

__init__(*args, **kwargs)
property max

[W] Production constraint maximum.

Type:

_ts

property min

[W] Production constraint minimum.

Type:

_ts

__init__(*args, **kwargs)
property commitment

Production commitment.

Type:

_ts

property constraint

Constraint group.

Type:

Constraint

property nominal

[W] Nominal production, or installed/rated/nameplate capacity, time-dependent attribute.

Type:

_ts

property pump_commitment

Consumption commitment.

Type:

_ts

property realised

[W] Historical production.

Type:

_ts

property result

[W] Production result, time series.

Type:

_ts

property schedule

[W] Production schedule.

Type:

_ts

property static_max

[W] Production maximum, time-dependent attribute.

Type:

_ts

property static_min

[W] Production minimum, time-dependent attribute.

Type:

_ts

class ProductionDischargeRelation

Bases: pybind11_object

Describes the production discharge relation (PQ) curves of the unit.

__init__(*args, **kwargs)
property convex

Convexified PQ curve that includes all the time-dependent operating limits and removes all the nonconcave points of the original PQ curve, the slope of each segment is non-increasing, x=flow[m3/s], y=effect[W].

Type:

_t_xy_

property final

Final PQ curve that is the final form included into the MILP optimization problem, the first point of the convex PQ curve is extended to Q=0, x=flow[m3/s], y=effect[W].

Type:

_t_xy_

property original

Original PQ curve that includes non-convex regions, x=flow[m3/s], y=effect[W].

Type:

_t_xy_

class PumpConstraint

Bases: pybind11_object

Contains the pump constraints.

__init__(*args, **kwargs)
property min_downstream_level

[masl] Minimum level downstream pump.

Type:

_ts

class Reserve

Bases: pybind11_object

Unit.Reserve contains all operational reserve related attributes.

class FcrDroop

Bases: pybind11_object

Per reserve type attributes

__init__(*args, **kwargs)
property cost

Droop cost. test

Type:

_ts

property result

Droop result. test

Type:

_ts

property steps

General discrete droop steps, x=step number, y=droop settings value.

Type:

_t_xy_

class Pair

Bases: pybind11_object

Describes the up and down pair of reserve specification.

__init__(*args, **kwargs)
property down

Down reserve specification.

Type:

Spec

property up

Up reserve specification.

Type:

Spec

class Spec

Bases: pybind11_object

Describes reserve specification, (.schedule, or min..result..max) SI-units is W.

__init__(*args, **kwargs)
property cost

Reserve cost.

Type:

_ts

property max

Reserve minimum of range if no schedule.

Type:

_ts

property min

Reserve minimum of range if no schedule.

Type:

_ts

property penalty

Reserve penalty.

Type:

_ts

property realised

Reserve realised.

Type:

_ts

property result

Reserve result.

Type:

_ts

property schedule

Reserve schedule.

Type:

_ts

__init__(*args, **kwargs)
property afrr

aFRR up, down attributes.

Type:

Pair

property afrr_static_max

[W] Unit max-limit valid for aFRR calculations.

Type:

_ts

property afrr_static_min

[W] Unit min-limit valid for aFRR calculations.

Type:

_ts

property droop

Droop attributes, related/common to fcr settings.

Type:

_Droop

property droop_steps

General discrete droop steps, x=step number, y=droop settings value.

Type:

_t_xy_

property fcr_d

FCR_d up, down attributes.

Type:

Pair

property fcr_d_static_max

[W] Unit max-limit valid for FCR-D calculations (otherwise fcr_static_max is used).

Type:

_ts

property fcr_d_static_min

[W] Unit min-limit valid for FCR-D calculations (otherwise fcr_static_min is used).

Type:

_ts

property fcr_mip

FCR flag.

Type:

_ts

property fcr_n

FCR_n up, down attributes.

Type:

Pair

property fcr_static_max

[W] Unit max-limit valid for FCR calculations (otherwise long running max is used).

Type:

_ts

property fcr_static_min

[W] Unit min-limit valid for FCR calculations (otherwise long running min is used).

Type:

_ts

property frr

FRR up, down attributes.

Type:

Pair

property mfrr

mFRR up, down attributes.

Type:

Pair

property mfrr_start_flag

Flag specifying if mFRR up is allowed to start a unit, 0 means no, NaN or non-zero means yes.

Type:

_ts

property mfrr_static_min

[W] Unit max-limit valid for mFRR calculations.

Type:

_ts

property mfrr_stop_flag

Flag for extending optimization for mFRR stop.

Type:

_ts

property rr

RR up, down attributes.

Type:

Pair

__init__(self: shyft.energy_market.stm.Unit, uid: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem) None
property best_profit

BP curves.

Type:

BestProfit

property cost

Cost attributes.

Type:

Cost

property custom
property discharge

Discharge attributes.

Type:

Discharge

property effective_head

Effective head of the generator, time-dependent attribute.

Type:

_ts

flattened_attributes(self: shyft.energy_market.stm.Unit) dict

Flat dict containing all component attributes.

property generator_description

Generator efficiency curve, time-dependent attribute.

Type:

_t_xy_

get_tsm_object(self: shyft.energy_market.stm.Unit, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property id
property json
property name
property obj

a python object

Type:

object

property priority

Priority value for determining uploading order.

Type:

_ts

property production

Production attributes.

Type:

Production

property production_discharge_relation

PQ curves.

Type:

ProductionDischargeRelation

property pump_constraint

Pump constraint attributes.

Type:

PumpConstraint

property pump_description

Time-dependent description of pump efficiency.

Type:

_t_xy_z_list

property pump_unavailability

Time series where time steps the unit is unavailable are marked with value 1, while a value nan or 0 means it is available.

Type:

_ts

property reserve

Operational reserve attributes.

Type:

Reserve

property tag

Url tag.

Type:

str

property ts
property turbine_description

Time-dependent description of turbine efficiency.

Type:

_turbine_description

property unavailability

Time series where time steps the unit is unavailable are marked with value 1, while a value nan or 0 means it is available.

Type:

_ts

class shyft.energy_market.stm.UnitGroup

Bases: pybind11_object

A a group of Units, with constraints applicable to the sum of the unit-features (production, flow…), that the optimization can take into account.

class Delivery

Bases: pybind11_object

This describes the sum of product delivery aspects for the units.

__init__(*args, **kwargs)
property realised

[product-unit] sum realised, as historical fact

Type:

_ts

property result

[product-unit] sum result

Type:

_ts

property schedule

[product-unit] sum schedule

Type:

_ts

class Member

Bases: pybind11_object

A unit group member, refers to a specific unit along with the time-series that takes care of the temporal membership/contribution to the unit_group sum.

__init__(*args, **kwargs)
property active

[unit-less] if available, this time-series is multiplied with the contribution from the unit.

Type:

_ts

property unit

The unit this member represents.

Type:

Unit

class MemberList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.UnitGroup.MemberList) -> None

  2. __init__(self: shyft.energy_market.stm.UnitGroup.MemberList, arg0: shyft.energy_market.stm.UnitGroup.MemberList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.UnitGroup.MemberList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.UnitGroup.MemberList) -> None

  2. __init__(self: shyft.energy_market.stm.UnitGroup.MemberList, arg0: shyft.energy_market.stm.UnitGroup.MemberList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.UnitGroup.MemberList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.UnitGroup.MemberList, x: shyft.energy_market.stm.UnitGroup.Member) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.UnitGroup.MemberList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.UnitGroup.MemberList, L: shyft.energy_market.stm.UnitGroup.MemberList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.UnitGroup.MemberList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.UnitGroup.MemberList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.UnitGroup.Member) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.UnitGroup.MemberList) -> shyft.energy_market.stm.UnitGroup.Member

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.UnitGroup.MemberList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.UnitGroup.Member

Remove and return the item at index i

size(self: shyft.energy_market.stm.UnitGroup.MemberList) int
class Obligation

Bases: pybind11_object

This describes the obligation aspects of the unit group that the members should satisfy.

__init__(*args, **kwargs)
property cost

[money/W] the cost of not satisfying the schedule.

Type:

_ts

property penalty

[money] If target violated, the cost of the violation.

Type:

_ts

property result

[W] the resulting target/slack met after optimization.

Type:

_ts

property schedule

[W] schedule/target that should be met.

Type:

_ts

__init__(*args, **kwargs)
add_unit(self: shyft.energy_market.stm.UnitGroup, unit: shyft.energy_market.stm.Unit, active: shyft.time_series.TimeSeries) None

Adds a unit to the group, maintaining any needed expressions.

Parameters:
  • unit (Unit) – The unit to be added to the group (sum expressions automagically updated).

  • active (TimeSeries) – Determine the temporal group-member-ship, if empty Ts, then always member.

property custom
property delivery

Sum of product/obligation delivery schedule,result and realised for unit-members.

Type:

Delivery

flattened_attributes(self: shyft.energy_market.stm.UnitGroup) dict

Flat dict containing all component attributes.

property flow

[m3/s] the sum resulting water flow for this unit-group.

Type:

_ts

get_tsm_object(self: shyft.energy_market.stm.UnitGroup, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property group_type

Unit group-type, one of GroupType enum, fcr_n_up, fcr_n_down etc.

Type:

unit_group_type

property id
property json
property market_area

Getter market area.

Type:

MarketArea

property members

unit group members

Type:

MemberList

property name
property obj

a python object

Type:

object

property obligation

Obligation schedule, cost, results and penalty.

Type:

Obligation

property production

[W] the sum resulting production for this unit-group.

Type:

_ts

remove_unit(self: shyft.energy_market.stm.UnitGroup, unit: shyft.energy_market.stm.Unit) None

Remove a nunit from the group maintaining any needed expressions.

Parameters:

unit (Unit) – The unit to be removed from the group (sum expressions automagically updated).

property tag

Url tag.

Type:

str

property ts
class shyft.energy_market.stm.UnitGroupList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.UnitGroupList) -> None

  2. __init__(self: shyft.energy_market.stm.UnitGroupList, arg0: shyft.energy_market.stm.UnitGroupList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.UnitGroupList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.UnitGroupList) -> None

  2. __init__(self: shyft.energy_market.stm.UnitGroupList, arg0: shyft.energy_market.stm.UnitGroupList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.UnitGroupList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.UnitGroupList, x: shyft.energy_market.stm.UnitGroup) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.UnitGroupList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.UnitGroupList, L: shyft.energy_market.stm.UnitGroupList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.UnitGroupList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.UnitGroupList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.UnitGroup) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.UnitGroupList) -> shyft.energy_market.stm.UnitGroup

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.UnitGroupList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.UnitGroup

Remove and return the item at index i

size(self: shyft.energy_market.stm.UnitGroupList) int
class shyft.energy_market.stm.UnitList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.UnitList) -> None

  2. __init__(self: shyft.energy_market.stm.UnitList, arg0: shyft.energy_market.stm.UnitList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.UnitList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.UnitList) -> None

  2. __init__(self: shyft.energy_market.stm.UnitList, arg0: shyft.energy_market.stm.UnitList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.UnitList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.UnitList, x: shyft.energy_market.stm.Unit) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.UnitList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.UnitList, L: shyft.energy_market.stm.UnitList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.UnitList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.UnitList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.Unit) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.UnitList) -> shyft.energy_market.stm.Unit

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.UnitList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.Unit

Remove and return the item at index i

size(self: shyft.energy_market.stm.UnitList) int
class shyft.energy_market.stm.UnitMember

Bases: pybind11_object

A unit busbar member, refers to a specific unit along with the time-series that takes care of the temporal membership/contribution to the busbar sum.

__init__(*args, **kwargs)
property active

[unit-less] if available, this time-series is multiplied with the contribution from the unit.

Type:

_ts

property unit

The unit this member represents.

Type:

Unit

class shyft.energy_market.stm.UrlResolveError

Bases: pybind11_object

Url resolve error

__init__(*args, **kwargs)
property what
class shyft.energy_market.stm.Waterway(self: shyft.energy_market.stm.Waterway, uid: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem)

Bases: Waterway

Stm waterway.

class Discharge

Bases: pybind11_object

Attribute collection

class Constraints

Bases: pybind11_object

The constraints for a waterway, provide means of controlling the flow, change of flow, or even accumulated volume of flow.

__init__(*args, **kwargs)
property accumulated_max

[m3] allowed accumulated positive deviation volume, actual vs .reference. If set to nan at a timestep, the accumulator is reset to 0 starting from that timestep.

Type:

_ts

property accumulated_min

[m3] allowed accumulated negative deviation volume, actual vs .reference. If set to nan at a timestep, the accumulator is reset to 0 starting from that timestep.

Type:

_ts

property max

[m3/s] Discharge constraint max flow.

Type:

_ts

property max_average

[s][m3/s] maximum average discharge on waterway as a function of duration in seconds.

Type:

_t_xy

property min

[m3/s] Discharge constraint min flow.

Type:

_ts

property min_average

[s][m3/s] minimum average discharge on waterway as a function of duration in seconds.

Type:

_t_xy

property ramping_down

[m3/s] Discharge constraint ramping_down.

Type:

_ts

property ramping_up

[m3/s] Discharge constraint ramping_up.

Type:

_ts

class Penalties

Bases: pybind11_object

Attribute collection

class Costs

Bases: pybind11_object

Attribute collection

__init__(*args, **kwargs)
property accumulated_max

[money/m3] Penalty cost constraint accumulated_max.

Type:

_ts

property accumulated_min

[money/m3] Penalty cost accumulated_min.

Type:

_ts

property constraint_max

[m3/s] Penalty cost constraint_max.

Type:

_ts

property constraint_min

[m3/s] Penalty cost constraint_min.

Type:

_ts

property max_average

[(money/h)/(m3/s)] Penalty cost for constraint max_average_discharge.

Type:

_ts

property min_average

[(money/h)/(m3/s)] Penalty cost for constraint min_average_discharge.

Type:

_ts

property peak_curve

[m3/s][nok/m3/s] Cost of peak flow curve.

Type:

_t_xy

property ramping_down

[m3/s] Penalty cost ramping_down.

Type:

_ts

property ramping_up

[m3/s] Penalty cost ramping_up.

Type:

_ts

property rate

[money/(m3/s)] Penalty cost for rate of discharge.

Type:

_ts

class Results

Bases: pybind11_object

Attribute collection

__init__(*args, **kwargs)
property accumulated_max

[money] Resulting penalty for violating accumulated_max.

Type:

_ts

property accumulated_min

[money] Resulting penalty for violating accumulated_min,

Type:

_ts

property constraint_max

[money] Resulting penalty for violating max constraint.

Type:

_ts

property constraint_min

[money] Resulting penalty for violating min constraint.

Type:

_ts

property ramping_down

[money] Resulting penalty for violating ramping down constraint.

property ramping_up

[money] Resulting penalty for violating ramping up constraint.

Type:

_ts

property rate

[money] Resulting penalty for discharge.

Type:

_ts

__init__(*args, **kwargs)
property cost

Penalty cost attributes.

Type:

Costs

property result

Penalty result attributes.

Type:

Results

__init__(*args, **kwargs)
property constraint

Discharge constraint attributes

Type:

Constraints

property penalty

Discharge penalty attributes.

Type:

Penalties

property realised

[m3/s] Discharge realised. - as in historical fact. For the case of constraint, used to establish initial accumulated deviation at the start of the optimisation period.

Type:

_ts

property reference

[m3/s] Discharge reference. Used as reference for the constraint criteria (might be different from .schedule).

Type:

_ts

property result

[m3/s] Discharge result. As computed by optimization/simulation process.

Type:

_ts

property schedule

[m3/s] Discharge schedule. As in wanted scheduled flow.

Type:

_ts

property static_max

[m3/s] Discharge maximum, time-dependent attribute, bi-directional value.

Type:

_ts

class FlowDescription

Bases: pybind11_object

Attribute collection

class DeltaMeter

Bases: pybind11_object

Delta meter flow description of the waterway.

__init__(*args, **kwargs)
property downstream_ref

x=difference between up- and downstream level [m], y=flow [m3/s]. z=downstream level [masl]

Type:

_t_xy_z_list

property upstream_ref

x=difference between up- and downstream level [m], y=flow [m3/s]. z=upstream level [masl]

Type:

_t_xy_z_list

__init__(*args, **kwargs)
property delta_meter

Delta meter description.

Type:

DeltaMeter

property upstream_ref

[m3/s] Discharge constraint min flow.

Type:

_t_xy

class Geometry

Bases: pybind11_object

Attribute collection

__init__(*args, **kwargs)
property diameter

[m] Tunnel diameter, time-dependent attribute.

Type:

_ts

property length

[m] Tunnel length, time-dependent attribute.

Type:

_ts

property z0

[masl] Tunnel inlet level, time-dependent attribute.

Type:

_ts

property z1

[masl] Tunnel outlet level, time-dependent attribute.

Type:

_ts

__init__(self: shyft.energy_market.stm.Waterway, uid: SupportsInt | SupportsIndex, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem) None
add_gate(*args, **kwargs)

Overloaded function.

  1. add_gate(self: shyft.energy_market.stm.Waterway, uid: typing.SupportsInt | typing.SupportsIndex, name: str, json: str = ‘’) -> shyft.energy_market.stm.Gate

Create and add a new gate to the waterway.

  1. add_gate(self: shyft.energy_market.stm.Waterway, gate: shyft.energy_market.stm.Gate) -> shyft.energy_market.stm.Gate

Add an existing gate to the waterway.

property custom
property delay

Time delay of flow.

Type:

_t_xy_

property deviation

Deviation attributes.

Type:

_Deviation

property discharge

Discharge attributes.

Type:

Discharge

flattened_attributes(self: shyft.energy_market.stm.Waterway) dict

Flat dict containing all component attributes.

property flow_description

Flow describing attributes.

Type:

FlowDescription

property geometry

Geometry attributes.

Type:

Geometry

get_tsm_object(self: shyft.energy_market.stm.Waterway, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property head_loss_coeff

Loss factor, time-dependent attribute.

Type:

_ts

property head_loss_func

Loss function, time-dependent attribute.

Type:

_t_xy_z_list

property id
property json
property name
property obj

a python object

Type:

object

property tag

Url tag.

Type:

str

property ts
class shyft.energy_market.stm.WaterwayList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.WaterwayList) -> None

  2. __init__(self: shyft.energy_market.stm.WaterwayList, arg0: collections.abc.Sequence[shyft.energy_market.stm.Waterway]) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.WaterwayList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.WaterwayList) -> None

  2. __init__(self: shyft.energy_market.stm.WaterwayList, arg0: collections.abc.Sequence[shyft.energy_market.stm.Waterway]) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.WaterwayList, arg0: collections.abc.Iterable) -> None

append(self: collections.abc.Sequence[shyft.energy_market.stm.Waterway], x: shyft.energy_market.stm.Waterway) None

Add an item to the end of the list

clear(self: collections.abc.Sequence[shyft.energy_market.stm.Waterway]) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: collections.abc.Sequence[shyft.energy_market.stm.Waterway], L: collections.abc.Sequence[shyft.energy_market.stm.Waterway]) -> None

Extend the list by appending all the items in the given list

  1. extend(self: collections.abc.Sequence[shyft.energy_market.stm.Waterway], L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: collections.abc.Sequence[shyft.energy_market.stm.Waterway], i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.Waterway) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: collections.abc.Sequence[shyft.energy_market.stm.Waterway]) -> shyft.energy_market.stm.Waterway

Remove and return the last item

  1. pop(self: collections.abc.Sequence[shyft.energy_market.stm.Waterway], i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.Waterway

Remove and return the item at index i

size(self: collections.abc.Sequence[shyft.energy_market.stm.Waterway]) int
class shyft.energy_market.stm.WindFarm(self: shyft.energy_market.stm.WindFarm, uid: SupportsInt | SupportsIndex, name: str, json: str, sys: shyft.energy_market.stm.StmSystem)

Bases: pybind11_object

A wind farm, models a wiki-wind-farm. In Shyft we provide the descriptive model suitable for covering multiple processes and purposes, ranging from high level estimates of wind farm, suitable for region-level power production analysis, to detailed turbine-level models, allowing detailed modelling and operations for day-ahead/intraday

class Cost

Bases: pybind11_object

WindFarm.cost related attributes, tactical and factual.

__init__(*args, **kwargs)
property break_even

[money/J] minimum price to break-even, also known as cutoff-price time series.

Type:

_ts

class Production

Bases: pybind11_object

WindFarm.production attributes, amount power produced[W].

class Constraint

Bases: pybind11_object

Contains the effect constraints to the wind-turbine.

__init__(*args, **kwargs)
property max

[W] Production constraint maximum.

Type:

_ts

property min

[W] Production constraint minimum.

Type:

_ts

__init__(*args, **kwargs)
property constraint

relevant for production

Type:

Constraint

property forecast

[W] The forecast amount of power produced, time series.

Type:

_ts

property realised

[W] Production realised, time series.

Type:

_ts

property result

[W] Power produced. As computed by optimization/simulation process.

Type:

_ts

property schedule

[W] The current schedule, time series.

Type:

_ts

class Reserve

Bases: pybind11_object

WindFarm.Reserve contains all operational reserve related attributes.

class Pair

Bases: pybind11_object

Describes the up and down pair of reserve specification.

__init__(*args, **kwargs)
property down

Down reserve specification.

Type:

Spec

property up

Up reserve specification.

Type:

Spec

class Spec

Bases: pybind11_object

Describes reserve specification, (.schedule, or min..result..max) SI-units is W.

__init__(*args, **kwargs)
property cost

Reserve cost.

Type:

_ts

property max

Reserve minimum of range if no schedule.

Type:

_ts

property min

Reserve minimum of range if no schedule.

Type:

_ts

property penalty

Reserve penalty.

Type:

_ts

property realised

Reserve realised.

Type:

_ts

property result

Reserve result.

Type:

_ts

property schedule

Reserve schedule.

Type:

_ts

__init__(*args, **kwargs)
property fcr_d

FCR_d up, down attributes.

Type:

Pair

property fcr_n

FCR_n up, down attributes.

Type:

Pair

property mfrr

mFRR up, down attributes.

Type:

Pair

__init__(self: shyft.energy_market.stm.WindFarm, uid: SupportsInt | SupportsIndex, name: str, json: str, sys: shyft.energy_market.stm.StmSystem) None
add_wind_turbines(self: shyft.energy_market.stm.WindFarm, wind_turbines: collections.abc.Sequence[shyft.energy_market.stm.WindTurbine]) None

Adds a prepared list of wind-turbines to the wind-farm already a part of a StmSystem(requirement). The items are validated prior any modifications to the wind-farm. The wind-farm is assigned the owner of the turbines added.

Parameters:

wind_turbines (WindTurbineList) – Wind-turbines to be added.

property cost

Cost attributes.

Type:

Cost

create_wind_turbine(self: shyft.energy_market.stm.WindFarm, id: SupportsInt | SupportsIndex, name: str, json: str, location: shyft.time_series.GeoPoint, height: shyft.time_series.TimeSeries, power_curve: shyft.energy_market.t_xy) shyft.energy_market.stm.WindTurbine

Creates and adds a wind-turbine to the wind-farm already a part of StmSystem(requirement). Valid id and non-empty name and uniqueness of those are enforced.

Parameters:
  • id (int) – Unique id of the wind-turbine.

  • name (str) – Unique name of the wind-turbine.

  • json (str) – Json payload for py customization.

  • location (GeoPoint) – Location of the wind-turbine.

  • height (TimeSeries) – Height of the wind-turbine.

  • power_curve (t_xy_) – Power-curve for the wind-turbine.

Returns:

wind_turbine. The newly created and added wind-turbine.

Return type:

WindTurbine

property custom
property epsg

[] epsg spec for the location attribute of the Wind Farm,.

Type:

_int

flattened_attributes(self: shyft.energy_market.stm.WindFarm) dict

Flat dict containing all component attributes.

get_tsm_object(self: shyft.energy_market.stm.WindFarm, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property height

[m] average turbine height for the Wind Farm.

Type:

_ts

property icing

[] 0.6..1.0 icing production loss factor for the Wind Farm.

Type:

_ts

property id
property json
property location

[m,m,m] in specified epsg, the geo mid-point of the Wind Farm.

Type:

_geo_point

property name
property obj

a python object

Type:

object

property power_correction

[] 0.7..1.3 air-density power correction factor for the Wind Farm.

Type:

_ts

property power_curve

[x=m/s,y=W] the time-dependent power-curve of the Wind Farm.

Type:

_t_xy_

property production

Production attributes.

Type:

Production

property reserve

Reserve attributes.

Type:

Reserve

property system

The owner of this object.

property tag

Url tag.

Type:

str

property ts
property unavailability

[] 0..1, unavailability for the Wind Farm.

Type:

_ts

property wake_loss

[] 0.87..0.93 wake-loss factor for the Wind Farm.

Type:

_ts

property wind_turbines

list of wind turbines for this WindFarm

Type:

WindTurbineList

class shyft.energy_market.stm.WindFarmList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.WindFarmList) -> None

  2. __init__(self: shyft.energy_market.stm.WindFarmList, arg0: shyft.energy_market.stm.WindFarmList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.WindFarmList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.WindFarmList) -> None

  2. __init__(self: shyft.energy_market.stm.WindFarmList, arg0: shyft.energy_market.stm.WindFarmList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.WindFarmList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.stm.WindFarmList, x: shyft.energy_market.stm.WindFarm) None

Add an item to the end of the list

clear(self: shyft.energy_market.stm.WindFarmList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.stm.WindFarmList, L: shyft.energy_market.stm.WindFarmList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.stm.WindFarmList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.stm.WindFarmList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.WindFarm) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.stm.WindFarmList) -> shyft.energy_market.stm.WindFarm

Remove and return the last item

  1. pop(self: shyft.energy_market.stm.WindFarmList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.WindFarm

Remove and return the item at index i

size(self: shyft.energy_market.stm.WindFarmList) int
class shyft.energy_market.stm.WindFarmMember

Bases: pybind11_object

A wind farm busbar member, refers to a specific wind farm along with the time-series that takes care of the temporal membership/contribution to the busbar sum.

__init__(*args, **kwargs)
property active

[unit-less] if available, this time-series is multiplied with the contribution from the wind farm.

Type:

_ts

property farm

The wind farm this member represents.

Type:

Farm

class shyft.energy_market.stm.WindTurbine(self: shyft.energy_market.stm.WindTurbine, uid: SupportsInt | SupportsIndex, name: str, json: str = '')

Bases: pybind11_object

A Wind turbine, wiki-wind-turbine. is a part of wind park.

Create wind turbine with unique id and name, can later be added to a wind farm.

class Cost

Bases: pybind11_object

WindTurbine.cost related attributes, tactical and factual.

__init__(*args, **kwargs)
property start

[money/#] start cost, time series.

Type:

_ts

property stop

[money/#] stop cost, time series.

Type:

_ts

class Production

Bases: pybind11_object

WindTurbine.production attributes, amount power produced[W].

class Constraint

Bases: pybind11_object

Contains the effect constraints to the wind-turbine.

__init__(*args, **kwargs)
property max

[W] Production constraint maximum.

Type:

_ts

property min

[W] Production constraint minimum.

Type:

_ts

class Reserve

Bases: pybind11_object

WindTurbine.Reserve contains all operational reserve related attributes.

class Pair

Bases: pybind11_object

Describes the up and down pair of reserve specification.

__init__(*args, **kwargs)
property down

Down reserve specification.

Type:

Spec

property up

Up reserve specification.

Type:

Spec

class Spec

Bases: pybind11_object

Describes reserve specification, (.schedule, or min..result..max) SI-units is W.

__init__(*args, **kwargs)
property cost

Reserve cost.

Type:

_ts

property max

Reserve minimum of range if no schedule.

Type:

_ts

property min

Reserve minimum of range if no schedule.

Type:

_ts

property penalty

Reserve penalty.

Type:

_ts

property realised

Reserve realised.

Type:

_ts

property result

Reserve result.

Type:

_ts

property schedule

Reserve schedule.

Type:

_ts

__init__(*args, **kwargs)
property fcr_d

FCR_d up, down attributes.

Type:

Pair

property fcr_n

FCR_n up, down attributes.

Type:

Pair

property mfrr

mFRR up, down attributes.

Type:

Pair

__init__(*args, **kwargs)
property constraint

relevant for production

Type:

Constraint

property realised

[W, J/s] Production realised, time series.

Type:

_ts

property result

[W, J/s] Power produced. As computed by optimization/simulation process.

Type:

_ts

property schedule

[W, J/s] The current schedule, time series.

Type:

_ts

__init__(self: shyft.energy_market.stm.WindTurbine, uid: SupportsInt | SupportsIndex, name: str, json: str = '') None

Create wind turbine with unique id and name, can later be added to a wind farm.

property cost

cost related tactical and actual attributes.

Type:

Cost

property custom
flattened_attributes(self: shyft.energy_market.stm.WindTurbine) dict

Flat dict containing all component attributes.

get_tsm_object(self: shyft.energy_market.stm.WindTurbine, key: str) shyft.energy_market.ts_attr

Get a specific extra time series for this object.

The returned time series is wrapped in an object which exposes method for retrieving url etc.

Parameters:

key (str) – The key in the tsm of the time series to get.

Raises:

runtime_error – If specified key does not exist.

property height

[m] average turbine height for the Wind Farm, time series.

Type:

_ts

property id
property json
property location

[m,m,m] in specified epsg of its WindFarm, the geo mid-point of the Wind turbine.

Type:

_geo_point

property name
property obj

a python object

Type:

object

property power_curve

[x=m/s,y=W] the time-dependent power-curve.

Type:

_t_xy_

property production

Production attributes.

Type:

Production

property reserve

Operational reserve attributes.

Type:

Reserve

property tag

Url tag.

Type:

str

property ts
property wind_farm

The owning/parent system that keeps this WindTurbine.

Type:

StmSystem

class shyft.energy_market.stm.WindTurbineList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.WindTurbineList) -> None

  2. __init__(self: shyft.energy_market.stm.WindTurbineList, arg0: collections.abc.Sequence[shyft.energy_market.stm.WindTurbine]) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.WindTurbineList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.WindTurbineList) -> None

  2. __init__(self: shyft.energy_market.stm.WindTurbineList, arg0: collections.abc.Sequence[shyft.energy_market.stm.WindTurbine]) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.stm.WindTurbineList, arg0: collections.abc.Iterable) -> None

append(self: collections.abc.Sequence[shyft.energy_market.stm.WindTurbine], x: shyft.energy_market.stm.WindTurbine) None

Add an item to the end of the list

clear(self: collections.abc.Sequence[shyft.energy_market.stm.WindTurbine]) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: collections.abc.Sequence[shyft.energy_market.stm.WindTurbine], L: collections.abc.Sequence[shyft.energy_market.stm.WindTurbine]) -> None

Extend the list by appending all the items in the given list

  1. extend(self: collections.abc.Sequence[shyft.energy_market.stm.WindTurbine], L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: collections.abc.Sequence[shyft.energy_market.stm.WindTurbine], i: SupportsInt | SupportsIndex, x: shyft.energy_market.stm.WindTurbine) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: collections.abc.Sequence[shyft.energy_market.stm.WindTurbine]) -> shyft.energy_market.stm.WindTurbine

Remove and return the last item

  1. pop(self: collections.abc.Sequence[shyft.energy_market.stm.WindTurbine], i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.stm.WindTurbine

Remove and return the item at index i

size(self: collections.abc.Sequence[shyft.energy_market.stm.WindTurbine]) int
shyft.energy_market.stm.compute_effective_price(usage: shyft.time_series.TimeSeries, bids: shyft.energy_market.t_xy, use_cheapest: bool) shyft.time_series.TimeSeries

Given usage, and bids, compute the effective price achieved consuming bids in the order as speficied with use_cheapest. If usage is 0, then first available price is computed. If bids are None, usage None, or empty, then empty is returned. If usage is more than available in the bids, the effective price for all the bids are computed.

Parameters:
  • usage – The usage in W

  • bids – The available bids, time-dependent xy, where x= price [Money/J], y= energy [W]

  • use_cheapest – Take cheapest bids first, act as buyer, if false, act as seller, and take highest bids first

Returns:

The computed effective price result

Return type:

effective price

shyft.energy_market.stm.evaluate(model: shyft.energy_market.stm.StmSystem, tsv: shyft.time_series.TsVector, bind_period: shyft.time_series.UtcPeriod = UtcPeriod(time.min, time.max), read_fn: collections.abc.Callable[[collections.abc.Sequence[str]], shyft.time_series.TsVector] = None) list[shyft.time_series.TimeSeries | shyft.energy_market.stm.TsEvaluationError]

Utility function to verify correctness of evaluate timeseries on model.

Parameters:
  • model (StmSystem) – Use the model as binding context for the supplied expressions

  • tsv (TsVector) – The expressions to be evaluated

  • bind_period (UtcPeriod) – The bind_period to be read for expression terminal time-series

  • read_fn (Callable) – A fx(TsVector)->TsVector callable

shyft.energy_market.stm.url_planning_inputs(model_id: str, model: shyft.energy_market.stm.StmSystem) list[str]

Get all the time-series input for running an algorithmic process on a stm_sytem

shyft.energy_market.stm.url_planning_outputs(model_id: str, model: shyft.energy_market.stm.StmSystem) list[str]

Get all the time-series urls that are considered result, or might contain result, after running an algorithmic process on a stm-system

STM Compute and Shop

A scalable compute node service, currently implementing the running Sintef SHOP optimizations. It is automatically managed through the shyft.energy_market.stm.DStmServer class.

Note

This module require license from Sintef, and that you have a in-house build setup according to recipe as described on Shyft wiki: https://gitlab.com/shyft-os/shyft/-/wikis/Reference-docs/Shyft-for-SHOP

Shyft Energy Market compute server

class shyft.energy_market.stm.compute.Client(host_port, timeout_ms, operation_timeout_ms=0)[source]

Bases: object

A client to the Server.

Create a client with the host port host_port

Parameters:
  • host_port (str)

  • timeout_ms (SupportsInt | SupportsIndex)

  • operation_timeout_ms (SupportsInt | SupportsIndex)

__init__(host_port, timeout_ms, operation_timeout_ms=0)[source]

Create a client with the host port host_port

Parameters:
  • host_port (str)

  • timeout_ms (SupportsInt | SupportsIndex)

  • operation_timeout_ms (SupportsInt | SupportsIndex)

Return type:

None

send(request)[source]
Parameters:

request (shyft.energy_market.stm.compute.StartRequest | shyft.energy_market.stm.compute.GetStatusRequest | shyft.energy_market.stm.compute.GetAttrsRequest | shyft.energy_market.stm.compute.SetAttrsRequest | shyft.energy_market.stm.compute.StopRequest | shyft.energy_market.stm.compute.PlanRequest | shyft.energy_market.stm.compute.GetPlanRequest)

Return type:

shyft.energy_market.stm.compute.StartReply | shyft.energy_market.stm.compute.GetStatusReply | shyft.energy_market.stm.compute.GetAttrsReply | shyft.energy_market.stm.compute.SetAttrsReply | shyft.energy_market.stm.compute.StopReply | shyft.energy_market.stm.compute.PlanReply | shyft.energy_market.stm.compute.GetPlanReply

property operation_timeout_ms: int

Operation timeout for remote server operations, in number milliseconds.

Type:

int

class shyft.energy_market.stm.compute.GetAttrsReply[source]

Bases: object

Compute reply

__init__()[source]
Return type:

None

property attrs: list[bool | float | int | TimeSeries | t_xy | t_xyz | t_xyz_list | t_turbine_description | str | TsVector | UnitGroupType | TimeAxis | GeoPoint | None]
class shyft.energy_market.stm.compute.GetAttrsRequest[source]

Bases: object

Compute request

__init__()[source]
Return type:

None

property urls: list[str]
class shyft.energy_market.stm.compute.GetPlanReply[source]

Bases: object

Compute reply

summary: _OptimizationSummary
__init__()[source]
Return type:

None

class shyft.energy_market.stm.compute.GetPlanRequest[source]

Bases: object

Compute request

__init__()[source]
Return type:

None

class shyft.energy_market.stm.compute.GetStatusReply[source]

Bases: object

Compute reply

state: State
__init__()[source]
Return type:

None

property log: list[LogEntry]
class shyft.energy_market.stm.compute.GetStatusRequest[source]

Bases: object

Compute request

__init__()[source]
Return type:

None

property log_index: int | None
class shyft.energy_market.stm.compute.ManagedServerState(self: shyft.energy_market.stm.ManagedServerState, value: SupportsInt | SupportsIndex)

Bases: pybind11_object

Describes the possible states of a managed compute server

Members:

IDLE

ASSIGNED

BUSY

DEAD

ASSIGNED = <ManagedServerState.ASSIGNED: 1>
BUSY = <ManagedServerState.BUSY: 2>
DEAD = <ManagedServerState.DEAD: 3>
IDLE = <ManagedServerState.IDLE: 0>
__init__(self: shyft.energy_market.stm.ManagedServerState, value: SupportsInt | SupportsIndex) None
ManagedServerState.name -> str
property value
class shyft.energy_market.stm.compute.PlanReply[source]

Bases: object

Compute reply

__init__()[source]
Return type:

None

class shyft.energy_market.stm.compute.PlanRequest[source]

Bases: object

Compute request

time_axis: TimeAxis
__init__()[source]
Return type:

None

property commands: list[ShopCommand]
class shyft.energy_market.stm.compute.Server(config=Ellipsis)[source]

Bases: object

A server for running heavy STM computations.

Parameters:

config (ServerConfig)

__init__(config=Ellipsis)[source]
Parameters:

config (ServerConfig)

Return type:

None

close()[source]
Return type:

None

get_listening_ip()[source]
Return type:

str

get_listening_port()[source]
Return type:

int

is_running()[source]
Return type:

bool

set_listening_ip(ip)[source]
Parameters:

ip (str)

Return type:

None

set_listening_port(port_no)[source]
Parameters:

port_no (SupportsInt | SupportsIndex)

Return type:

None

start_server()[source]
Return type:

int

stop_server(timeout=1000)[source]
Parameters:

timeout (SupportsInt | SupportsIndex)

Return type:

None

class shyft.energy_market.stm.compute.ServerConfig[source]
class shyft.energy_market.stm.compute.ServerConfig(base0: shyft.time_series.ServerConfig, /, clean_run_files: bool, persistent_storage_path: str)

Bases: ServerConfig

Compute server config

Helper for @overload to raise when called.

clean_run_files: bool
log: LogConfig
persistent_storage_path: str
__init__(**kwds)

Helper for @overload to raise when called.

class shyft.energy_market.stm.compute.ServerStatus

Bases: pybind11_object

Status of a managed compute server

__init__(*args, **kwargs)
property address
property last_send
property model_id
property state
class shyft.energy_market.stm.compute.SetAttrsReply[source]

Bases: object

Compute reply

__init__()[source]
Return type:

None

property attrs: list[bool]
class shyft.energy_market.stm.compute.SetAttrsRequest[source]

Bases: object

Compute request

__init__()[source]
Return type:

None

property attrs: list[tuple[str, bool | float | int | TimeSeries | t_xy | t_xyz | t_xyz_list | t_turbine_description | str | TsVector | UnitGroupType | TimeAxis | GeoPoint]]
class shyft.energy_market.stm.compute.StartReply[source]

Bases: object

Compute reply

__init__()[source]
Return type:

None

class shyft.energy_market.stm.compute.StartRequest[source]

Bases: object

Compute request

model: StmSystem
model_id: str
__init__()[source]
Return type:

None

class shyft.energy_market.stm.compute.State(value)[source]

Bases: object

Describes the possible states of a compute server

Members:

IDLE

STARTED

RUNNING

DONE

Parameters:

value (SupportsInt | SupportsIndex)

DONE: ClassVar[State]
IDLE: ClassVar[State]
RUNNING: ClassVar[State]
STARTED: ClassVar[State]
__init__(value)[source]
Parameters:

value (SupportsInt | SupportsIndex)

Return type:

None

property name: str
property value: int
class shyft.energy_market.stm.compute.StopReply[source]

Bases: object

Compute reply

__init__()[source]
Return type:

None

class shyft.energy_market.stm.compute.StopRequest[source]

Bases: object

Compute request

__init__()[source]
Return type:

None

STM Shop

This module provide the direct interface to emit StmSystem to the Shop engine, running commands etc.

Note

This module require license from Sintef, and that you have a in-house build setup according to recipe as described on Shyft wiki: https://gitlab.com/shyft-os/shyft/-/wikis/Reference-docs/Shyft-for-SHOP

Statkraft Energy Market short term model Shop adapter

class shyft.energy_market.stm.shop.ShopCommand(*args, **kwargs)

Bases: pybind11_object

A shop command, which can later be sent to the shop core.

In the shop core a command can be described as a string with syntax: ‘<keyword> <specifier> [/<opt> [/<opt>…]] [[<obj>] [<obj>…]]’. The keyword is a general word that specifies the kind of action, for example ‘set’, ‘save’ or ‘return’. The specifier identifies what data will be affected by the command, and it is unique for every command, for example ‘method’, or ‘ramping’. Commands can accept one or several pre-set options to further specify the command. These always start with a forward slash, consist of one word only, and if more than one the order is important. Some commands also needs input objects, usually an integer, floating point, or string value.

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ShopCommand, command: str) -> None

Create from a single string in shop command language syntax.

  1. __init__(self: shyft.energy_market.stm.ShopCommand, keyword: str, specifier: str, options: collections.abc.Sequence[str], objects: collections.abc.Sequence[str]) -> None

Create from individual components.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.stm.ShopCommand, command: str) -> None

Create from a single string in shop command language syntax.

  1. __init__(self: shyft.energy_market.stm.ShopCommand, keyword: str, specifier: str, options: collections.abc.Sequence[str], objects: collections.abc.Sequence[str]) -> None

Create from individual components.

property keyword

keyword of the command

static log_file(*args, **kwargs)

Overloaded function.

  1. log_file() -> shyft.energy_market.stm.ShopCommand

Shop command string ‘log file’.

  1. log_file(filename: str) -> shyft.energy_market.stm.ShopCommand

Shop command string ‘log file <filename>’.

static log_file_lp(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘log file /lp <filename>’.

property objects

list of objects

property options

list of options

static penalty_cost_all(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /all <value>’.

static penalty_cost_discharge(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /discharge <value>’.

static penalty_cost_gate_ramping(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /gate /ramping <value>’.

static penalty_cost_load(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /load <value>’.

static penalty_cost_overflow(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /overflow <value>’.

static penalty_cost_overflow_time_adjust(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /overflow_time_adjust <value>’.

static penalty_cost_powerlimit(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /powerlimit <value>’.

static penalty_cost_reserve(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /reserve <value>’.

static penalty_cost_reservoir_endpoint(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /reservoir /endpoint <value>’.

static penalty_cost_reservoir_ramping(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /reservoir /ramping <value>’.

static penalty_cost_soft_p_penalty(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /soft_p_penalty <value>’.

static penalty_cost_soft_q_penalty(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty cost /soft_q_penalty <value>’.

static penalty_flag_all(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /all /on|/off’.

static penalty_flag_discharge(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /discharge’.

static penalty_flag_gate_max_q_con(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /gate /max_q_con’.

static penalty_flag_gate_min_q_con(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /gate /min_q_con’.

static penalty_flag_gate_ramping(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /gate /ramping’.

static penalty_flag_load(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /load’.

static penalty_flag_plant_max_p_con(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /plant /max_p_con’.

static penalty_flag_plant_max_q_con(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /plant /max_q_con’.

static penalty_flag_plant_min_p_con(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /plant /min_p_con’.

static penalty_flag_plant_min_q_con(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /plant /min_q_con’.

static penalty_flag_plant_schedule(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /plant /schedule’.

static penalty_flag_powerlimit(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /powerlimit’.

static penalty_flag_reservoir_endpoint(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /reservoir /endpoint’.

static penalty_flag_reservoir_ramping(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘penalty flag /on|/off /reservoir /ramping’.

static print_bp_curves() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves’.

static print_bp_curves_all_combinations() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /all_combinations’.

static print_bp_curves_current_combination() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /current_combination’.

static print_bp_curves_discharge() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /discharge’.

static print_bp_curves_dyn_points() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /dyn_points’.

static print_bp_curves_from_zero() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /from_zero’.

static print_bp_curves_market_ref_mc() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /market_ref_mc’.

static print_bp_curves_mc_format() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /mc_format’.

static print_bp_curves_no_vertical_step() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /no_vertical_step’.

static print_bp_curves_old_points() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /old_points’.

static print_bp_curves_operation() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /operation’.

static print_bp_curves_production() shyft.energy_market.stm.ShopCommand

Shop command string ‘print bp_curves /production’.

static print_mc_curves(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves <filename>’.

static print_mc_curves_down(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /down <filename>’.

static print_mc_curves_down_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /down /mod <filename>’.

static print_mc_curves_down_pq(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /down /pq <filename>’.

static print_mc_curves_down_pq_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /down /pq /mod <filename>’.

static print_mc_curves_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /mod <filename>’.

static print_mc_curves_pq(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /pq <filename>’.

static print_mc_curves_pq_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /pq /mod <filename>’.

static print_mc_curves_up(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up <filename>’.

static print_mc_curves_up_down(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /down <filename>’.

static print_mc_curves_up_down_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /down /mod <filename>’.

static print_mc_curves_up_down_pq(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /down /pq <filename>’.

static print_mc_curves_up_down_pq_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /down /pq /mod <filename>’.

static print_mc_curves_up_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /mod <filename>’.

static print_mc_curves_up_pq(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /pq <filename>’.

static print_mc_curves_up_pq_mod(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print mc_curves /up /pq /mod <filename>’.

static print_model(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘print model <filename>’.

static print_pqcurves_all(*args, **kwargs)

Overloaded function.

  1. print_pqcurves_all() -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /all’.

  1. print_pqcurves_all(filename: str) -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /all <filename>’.

static print_pqcurves_convex(*args, **kwargs)

Overloaded function.

  1. print_pqcurves_convex() -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /convex’.

  1. print_pqcurves_convex(filename: str) -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /convex <filename>’.

static print_pqcurves_final(*args, **kwargs)

Overloaded function.

  1. print_pqcurves_final() -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /final’.

  1. print_pqcurves_final(filename: str) -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /final <filename>’.

static print_pqcurves_original(*args, **kwargs)

Overloaded function.

  1. print_pqcurves_original() -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /original’.

  1. print_pqcurves_original(filename: str) -> shyft.energy_market.stm.ShopCommand

Shop command string ‘print pqcurves /original <filename>’.

static return_scenario_result_table(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘return scenario_result_table <filename>’.

static return_shopsimres(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘return shopsimres <filename>’.

static return_shopsimres_gen(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘return shopsimres /gen <filename>’.

static return_simres(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘return simres <filename>’.

static return_simres_gen(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘return simres /gen <filename>’.

static save_pq_curves(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘save pq_curves /on|/off’.

static save_series(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘save series <filename>’.

static save_shopsimseries(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘save shopsimseries <filename>’.

static save_tunnelloss() shyft.energy_market.stm.ShopCommand

Shop command string ‘save tunnelloss’.

static save_xmlseries(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘save xmlseries <filename>’.

static save_xmlshopsimseries(filename: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘save xmlshopsimseries <filename>’.

static set_bypass_loss(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘set bypass_loss /on|/off’.

static set_capacity_all(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set capacity /all <value>’.

static set_capacity_bypass(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set capacity /bypass <value>’.

static set_capacity_gate(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set capacity /gate <value>’.

static set_capacity_spill(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set capacity /spill <value>’.

static set_code_full() shyft.energy_market.stm.ShopCommand

Shop command string ‘set code /full’.

static set_code_head() shyft.energy_market.stm.ShopCommand

Shop command string ‘set code /head’.

static set_code_incremental() shyft.energy_market.stm.ShopCommand

Shop command string ‘set code /incremental’.

static set_com_dec_period(value: SupportsInt | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set com_dec_period <value>’.

static set_droop_discretization_limit(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set droop_discretization_limit <value>’.

static set_dyn_flex_mip(value: SupportsInt | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set dyn_flex_mip <value>’.

static set_dyn_seg_incr() shyft.energy_market.stm.ShopCommand

Shop command string ‘set dyn_seg /incr’.

static set_dyn_seg_mip() shyft.energy_market.stm.ShopCommand

Shop command string ‘set dyn_seg /mip’.

static set_dyn_seg_on() shyft.energy_market.stm.ShopCommand

Shop command string ‘set dyn_seg /on’.

static set_fcr_d_band(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set fcr_d_band <value>’.

static set_fcr_n_band(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set fcr_n_band <value>’.

static set_fcr_n_equality(value: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘set fcr_n_equality <value>’.

static set_gen_turn_off_limit(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set gen_turn_off_limit <value>’.

static set_headopt_feedback(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set headopt_feedback <value>’.

static set_max_num_threads(value: SupportsInt | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set max_num_threads <value>’.

static set_merge_off() shyft.energy_market.stm.ShopCommand

Shop command string ‘set merge /off’.

static set_merge_on() shyft.energy_market.stm.ShopCommand

Shop command string ‘set merge /on’.

static set_merge_stop() shyft.energy_market.stm.ShopCommand

Shop command string ‘set merge /stop’.

static set_method_baropt() shyft.energy_market.stm.ShopCommand

Shop command string ‘set method /baropt’.

static set_method_dual() shyft.energy_market.stm.ShopCommand

Shop command string ‘set method /dual’.

static set_method_hydbaropt() shyft.energy_market.stm.ShopCommand

Shop command string ‘set method /hydbaropt’.

static set_method_netdual() shyft.energy_market.stm.ShopCommand

Shop command string ‘set method /netdual’.

static set_method_netprimal() shyft.energy_market.stm.ShopCommand

Shop command string ‘set method /netprimal’.

static set_method_primal() shyft.energy_market.stm.ShopCommand

Shop command string ‘set method /primal’.

static set_mipgap(absolute: bool, value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set mipgap /absolute|/relative <value>’.

static set_newgate(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘set newgate /on|/off’.

static set_nseg_all(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set nseg /all <value>’.

static set_nseg_down(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set nseg /down <value>’.

static set_nseg_up(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set nseg /up <value>’.

static set_parallel_mode_auto() shyft.energy_market.stm.ShopCommand

Shop command string ‘set parallel_mode /auto’.

static set_parallel_mode_deterministic() shyft.energy_market.stm.ShopCommand

Shop command string ‘set parallel_mode /deterministic’.

static set_parallel_mode_opportunistic() shyft.energy_market.stm.ShopCommand

Shop command string ‘set parallel_mode /opportunistic’.

static set_password(key: str, value: str) shyft.energy_market.stm.ShopCommand

Shop command string ‘set password <value>’.

static set_power_head_optimization(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘set power_head_optimization /on|/off’.

static set_ramping(mode: SupportsInt | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set ramping <value>’.

static set_reserve_ramping_cost(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set reserve_ramping_cost <value>’.

static set_reserve_slack_cost(value: SupportsFloat | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set reserve_slack_cost <value>’.

static set_time_delay_unit_hour() shyft.energy_market.stm.ShopCommand

Shop command string ‘set time_delay_unit hour’.

static set_time_delay_unit_minute() shyft.energy_market.stm.ShopCommand

Shop command string ‘set time_delay_unit minute’.

static set_time_delay_unit_time_step_length() shyft.energy_market.stm.ShopCommand

Shop command string ‘set time_delay_unit time_step_length’.

static set_timelimit(value: SupportsInt | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘set timelimit <value>’.

static set_universal_mip_not_set() shyft.energy_market.stm.ShopCommand

Shop command string ‘set universal_mip /not_set’.

static set_universal_mip_off() shyft.energy_market.stm.ShopCommand

Shop command string ‘set universal_mip /off’.

static set_universal_mip_on() shyft.energy_market.stm.ShopCommand

Shop command string ‘set universal_mip /on’.

static set_xmllog(on: bool) shyft.energy_market.stm.ShopCommand

Shop command string ‘set xmllog /on|/off’.

property specifier

specifier of the command

static start_shopsim() shyft.energy_market.stm.ShopCommand

Shop command string ‘start shopsim’.

static start_sim(iterations: SupportsInt | SupportsIndex) shyft.energy_market.stm.ShopCommand

Shop command string ‘start sim <iterations>’.

shyft.energy_market.stm.shop.ShopCommandList

alias of list

class shyft.energy_market.stm.shop.ShopCommander[source]

Bases: object

A shop commander, utility for sending individual commands to the shop core.

execute(command)[source]

Execute command object.

Parameters:

command (ShopCommand)

Return type:

None

execute_string(command_string)[source]

Execute command string.

Parameters:

command_string (str)

Return type:

None

executed()[source]

Get executed commands as objects.

Return type:

list[ShopCommand]

executed_strings()[source]

Get executed commands as strings.

Return type:

list[str]

log_file(**kwds)

Helper for @overload to raise when called.

log_file_lp(filename)[source]

Shop command string ‘log file /lp <filename>’.

Parameters:

filename (str)

Return type:

None

penalty_cost_all(value)[source]

Shop command string ‘penalty cost /all <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

penalty_cost_discharge(value)[source]

Shop command string ‘penalty cost /discharge <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

penalty_cost_gate_ramping(value)[source]

Shop command string ‘penalty cost /gate /ramping <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

penalty_cost_load(value)[source]

Shop command string ‘penalty cost /load <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

penalty_cost_overflow(value)[source]

Shop command string ‘penalty cost /overflow <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

penalty_cost_overflow_time_adjust(value)[source]

Shop command string ‘penalty cost /overflow_time_adjust <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

penalty_cost_powerlimit(value)[source]

Shop command string ‘penalty cost /powerlimit <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

penalty_cost_reserve(value)[source]

Shop command string ‘penalty cost /reserve <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

penalty_cost_reservoir_endpoint(value)[source]

Shop command string ‘penalty cost /reservoir /endpoint <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

penalty_cost_reservoir_ramping(value)[source]

Shop command string ‘penalty cost /reservoir /ramping <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

penalty_cost_soft_p_penalty(value)[source]

Shop command string ‘penalty cost /soft_p_penalty <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

penalty_cost_soft_q_penalty(value)[source]

Shop command string ‘penalty cost /soft_q_penalty <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

penalty_flag_all(on)[source]

Shop command string ‘penalty flag /all /on|/off’.

Parameters:

on (bool)

Return type:

None

penalty_flag_discharge(on)[source]

Shop command string ‘penalty flag /on|/off /discharge’.

Parameters:

on (bool)

Return type:

None

penalty_flag_gate_max_q_con(on)[source]

Shop command string ‘penalty flag /on|/off /gate /max_q_con’.

Parameters:

on (bool)

Return type:

None

penalty_flag_gate_min_q_con(on)[source]

Shop command string ‘penalty flag /on|/off /gate /min_q_con’.

Parameters:

on (bool)

Return type:

None

penalty_flag_gate_ramping(on)[source]

Shop command string ‘penalty flag /on|/off /gate /ramping’.

Parameters:

on (bool)

Return type:

None

penalty_flag_load(on)[source]

Shop command string ‘penalty flag /on|/off /load’.

Parameters:

on (bool)

Return type:

None

penalty_flag_plant_max_p_con(on)[source]

Shop command string ‘penalty flag /on|/off /plant /max_p_con’.

Parameters:

on (bool)

Return type:

None

penalty_flag_plant_max_q_con(on)[source]

Shop command string ‘penalty flag /on|/off /plant /max_q_con’.

Parameters:

on (bool)

Return type:

None

penalty_flag_plant_min_p_con(on)[source]

Shop command string ‘penalty flag /on|/off /plant /min_p_con’.

Parameters:

on (bool)

Return type:

None

penalty_flag_plant_min_q_con(on)[source]

Shop command string ‘penalty flag /on|/off /plant /min_q_con’.

Parameters:

on (bool)

Return type:

None

penalty_flag_plant_schedule(on)[source]

Shop command string ‘penalty flag /on|/off /plant /schedule’.

Parameters:

on (bool)

Return type:

None

penalty_flag_powerlimit(on)[source]

Shop command string ‘penalty flag /on|/off /powerlimit’.

Parameters:

on (bool)

Return type:

None

penalty_flag_reservoir_endpoint(on)[source]

Shop command string ‘penalty flag /on|/off /reservoir /endpoint’.

Parameters:

on (bool)

Return type:

None

penalty_flag_reservoir_ramping(on)[source]

Shop command string ‘penalty flag /on|/off /reservoir /ramping’.

Parameters:

on (bool)

Return type:

None

print_bp_curves()[source]

Shop command string ‘print bp_curves’.

Return type:

None

print_bp_curves_all_combinations()[source]

Shop command string ‘print bp_curves /all_combinations’.

Return type:

None

print_bp_curves_current_combination()[source]

Shop command string ‘print bp_curves /current_combination’.

Return type:

None

print_bp_curves_discharge()[source]

Shop command string ‘print bp_curves /discharge’.

Return type:

None

print_bp_curves_dyn_points()[source]

Shop command string ‘print bp_curves /dyn_points’.

Return type:

None

print_bp_curves_from_zero()[source]

Shop command string ‘print bp_curves /from_zero’.

Return type:

None

print_bp_curves_market_ref_mc()[source]

Shop command string ‘print bp_curves /market_ref_mc’.

Return type:

None

print_bp_curves_mc_format()[source]

Shop command string ‘print bp_curves /mc_format’.

Return type:

None

print_bp_curves_no_vertical_step()[source]

Shop command string ‘print bp_curves /no_vertical_step’.

Return type:

None

print_bp_curves_old_points()[source]

Shop command string ‘print bp_curves /old_points’.

Return type:

None

print_bp_curves_operation()[source]

Shop command string ‘print bp_curves /operation’.

Return type:

None

print_bp_curves_production()[source]

Shop command string ‘print bp_curves /production’.

Return type:

None

print_mc_curves(filename)[source]

Shop command string ‘print mc_curves <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_down(filename)[source]

Shop command string ‘print mc_curves /down <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_down_mod(filename)[source]

Shop command string ‘print mc_curves /down /mod <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_down_pq(filename)[source]

Shop command string ‘print mc_curves /down /pq <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_down_pq_mod(filename)[source]

Shop command string ‘print mc_curves /down /pq /mod <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_mod(filename)[source]

Shop command string ‘print mc_curves /mod <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_pq(filename)[source]

Shop command string ‘print mc_curves /pq <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_pq_mod(filename)[source]

Shop command string ‘print mc_curves /pq /mod <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_up(filename)[source]

Shop command string ‘print mc_curves /up <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_up_down(filename)[source]

Shop command string ‘print mc_curves /up /down <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_up_down_mod(filename)[source]

Shop command string ‘print mc_curves /up /down /mod <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_up_down_pq(filename)[source]

Shop command string ‘print mc_curves /up /down /pq <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_up_down_pq_mod(filename)[source]

Shop command string ‘print mc_curves /up /down /pq /mod <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_up_mod(filename)[source]

Shop command string ‘print mc_curves /up /mod <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_up_pq(filename)[source]

Shop command string ‘print mc_curves /up /pq <filename>’.

Parameters:

filename (str)

Return type:

None

print_mc_curves_up_pq_mod(filename)[source]

Shop command string ‘print mc_curves /up /pq /mod <filename>’.

Parameters:

filename (str)

Return type:

None

print_model(filename)[source]

Shop command string ‘print model <filename>’.

Parameters:

filename (str)

Return type:

None

print_pqcurves_all(**kwds)

Helper for @overload to raise when called.

print_pqcurves_convex(**kwds)

Helper for @overload to raise when called.

print_pqcurves_final(**kwds)

Helper for @overload to raise when called.

print_pqcurves_original(**kwds)

Helper for @overload to raise when called.

return_scenario_result_table(filename)[source]

Shop command string ‘return scenario_result_table <filename>’.

Parameters:

filename (str)

Return type:

None

return_shopsimres(filename)[source]

Shop command string ‘return shopsimres <filename>’.

Parameters:

filename (str)

Return type:

None

return_shopsimres_gen(filename)[source]

Shop command string ‘return shopsimres /gen <filename>’.

Parameters:

filename (str)

Return type:

None

return_simres(filename)[source]

Shop command string ‘return simres <filename>’.

Parameters:

filename (str)

Return type:

None

return_simres_gen(filename)[source]

Shop command string ‘return simres /gen <filename>’.

Parameters:

filename (str)

Return type:

None

save_pq_curves(on)[source]

Shop command string ‘save pq_curves /on|/off’.

Parameters:

on (bool)

Return type:

None

save_series(filename)[source]

Shop command string ‘save series <filename>’.

Parameters:

filename (str)

Return type:

None

save_shopsimseries(filename)[source]

Shop command string ‘save shopsimseries <filename>’.

Parameters:

filename (str)

Return type:

None

save_tunnelloss()[source]

Shop command string ‘save tunnelloss’.

Return type:

None

save_xmlseries(filename)[source]

Shop command string ‘save xmlseries <filename>’.

Parameters:

filename (str)

Return type:

None

save_xmlshopsimseries(filename)[source]

Shop command string ‘save xmlshopsimseries <filename>’.

Parameters:

filename (str)

Return type:

None

set_bypass_loss(on)[source]

Shop command string ‘set bypass_loss /on|/off’.

Parameters:

on (bool)

Return type:

None

set_capacity_all(value)[source]

Shop command string ‘set capacity /all <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_capacity_bypass(value)[source]

Shop command string ‘set capacity /bypass <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_capacity_gate(value)[source]

Shop command string ‘set capacity /gate <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_capacity_spill(value)[source]

Shop command string ‘set capacity /spill <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_code_full()[source]

Shop command string ‘set code /full’.

Return type:

None

set_code_head()[source]

Shop command string ‘set code /head’.

Return type:

None

set_code_incremental()[source]

Shop command string ‘set code /incremental’.

Return type:

None

set_com_dec_period(value)[source]

Shop command string ‘set com_dec_period <value>’.

Parameters:

value (SupportsInt | SupportsIndex)

Return type:

None

set_droop_discretization_limit(value)[source]

Shop command string ‘set droop_discretization_limit <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_dyn_flex_mip(value)[source]

Shop command string ‘set dyn_flex_mip <value>’.

Parameters:

value (SupportsInt | SupportsIndex)

Return type:

None

set_dyn_seg_incr()[source]

Shop command string ‘set dyn_seg /incr’.

Return type:

None

set_dyn_seg_mip()[source]

Shop command string ‘set dyn_seg /mip’.

Return type:

None

set_dyn_seg_on()[source]

Shop command string ‘set dyn_seg /on’.

Return type:

None

set_fcr_d_band(value)[source]

Shop command string ‘set fcr_d_band <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_fcr_n_band(value)[source]

Shop command string ‘set fcr_n_band <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_fcr_n_equality(value)[source]

Shop command string ‘set fcr_n_equality <value>’.

Parameters:

value (SupportsInt | SupportsIndex)

Return type:

None

set_gen_turn_off_limit(value)[source]

Shop command string ‘set gen_turn_off_limit <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_headopt_feedback(value)[source]

Shop command string ‘set headopt_feedback <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_max_num_threads(value)[source]

Shop command string ‘set max_num_threads <value>’.

Parameters:

value (SupportsInt | SupportsIndex)

Return type:

None

set_merge_off()[source]

Shop command string ‘set merge /off’.

Return type:

None

set_merge_on()[source]

Shop command string ‘set merge /on’.

Return type:

None

set_merge_stop()[source]

Shop command string ‘set merge /stop’.

Return type:

None

set_method_baropt()[source]

Shop command string ‘set method /baropt’.

Return type:

None

set_method_dual()[source]

Shop command string ‘set method /dual’.

Return type:

None

set_method_hydbaropt()[source]

Shop command string ‘set method /hydbaropt’.

Return type:

None

set_method_netdual()[source]

Shop command string ‘set method /netdual’.

Return type:

None

set_method_netprimal()[source]

Shop command string ‘set method /netprimal’.

Return type:

None

set_method_primal()[source]

Shop command string ‘set method /primal’.

Return type:

None

set_mipgap(absolute, value)[source]

Shop command string ‘set mipgap /absolute|/relative <value>’.

Parameters:
  • absolute (bool)

  • value (SupportsFloat | SupportsIndex)

Return type:

None

set_newgate(on)[source]

Shop command string ‘set newgate /on|/off’.

Parameters:

on (bool)

Return type:

None

set_nseg_all(value)[source]

Shop command string ‘set nseg /all <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_nseg_down(value)[source]

Shop command string ‘set nseg /down <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_nseg_up(value)[source]

Shop command string ‘set nseg /up <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_parallel_mode_auto()[source]

Shop command string ‘set parallel_mode /auto’.

Return type:

None

set_parallel_mode_deterministic()[source]

Shop command string ‘set parallel_mode /deterministic’.

Return type:

None

set_parallel_mode_opportunistic()[source]

Shop command string ‘set parallel_mode /opportunistic’.

Return type:

None

set_password(key, value)[source]

Shop command string ‘set password <value>’.

Parameters:
  • key (str)

  • value (str)

Return type:

None

set_power_head_optimization(on)[source]

Shop command string ‘set power_head_optimization /on|/off’.

Parameters:

on (bool)

Return type:

None

set_ramping(mode)[source]

Shop command string ‘set ramping <value>’.

Parameters:

mode (SupportsInt | SupportsIndex)

Return type:

None

set_reserve_ramping_cost(value)[source]

Shop command string ‘set reserve_ramping_cost <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_reserve_slack_cost(value)[source]

Shop command string ‘set reserve_slack_cost <value>’.

Parameters:

value (SupportsFloat | SupportsIndex)

Return type:

None

set_time_delay_unit_hour()[source]

Shop command string ‘set time_delay_unit hour’.

Return type:

None

set_time_delay_unit_minute()[source]

Shop command string ‘set time_delay_unit minute’.

Return type:

None

set_time_delay_unit_time_step_length()[source]

Shop command string ‘set time_delay_unit time_step_length’.

Return type:

None

set_timelimit(value)[source]

Shop command string ‘set timelimit <value>’.

Parameters:

value (SupportsInt | SupportsIndex)

Return type:

None

set_universal_mip_not_set()[source]

Shop command string ‘set universal_mip /not_set’.

Return type:

None

set_universal_mip_off()[source]

Shop command string ‘set universal_mip /off’.

Return type:

None

set_universal_mip_on()[source]

Shop command string ‘set universal_mip /on’.

Return type:

None

set_xmllog(on)[source]

Shop command string ‘set xmllog /on|/off’.

Parameters:

on (bool)

Return type:

None

start_shopsim()[source]

Shop command string ‘start shopsim’.

Return type:

None

start_sim(iterations)[source]

Shop command string ‘start sim <iterations>’.

Parameters:

iterations (SupportsInt | SupportsIndex)

Return type:

None

class shyft.energy_market.stm.shop.ShopSystem(arg0: shyft.time_series.UtcPeriod, arg1: shyft.time_series.time)[source]
class shyft.energy_market.stm.shop.ShopSystem(arg0: shyft.time_series.TimeAxis)

Bases: object

A shop system, managing a session to the shop core.

Helper for @overload to raise when called.

static environment()[source]

Print all environment variables to standard output.

Return type:

None

static environment_string()[source]

Get all environment variables as a newline delimited string value.

Return type:

str

static optimize(stm_system, time_axis, commands, logging_to_stdstreams, logging_to_files)[source]
Parameters:
Return type:

None

static optimize2(stm_system, time_begin, time_end, time_step, commands, logging_to_stdstreams, logging_to_files)[source]
Parameters:
  • stm_system (StmSystem)

  • time_begin (time)

  • time_end (time)

  • time_step (time)

  • commands (Sequence[ShopCommand])

  • logging_to_stdstreams (bool)

  • logging_to_files (bool)

Return type:

None

__init__(**kwds)

Helper for @overload to raise when called.

collect(stm_system)[source]
Parameters:

stm_system (StmSystem)

Return type:

None

command_raw(command)[source]
Parameters:

command (str)

Return type:

None

complete(stm_system)[source]
Parameters:

stm_system (StmSystem)

Return type:

None

emit(stm_system)[source]

Emit a stm system into the shop core.

Parameters:

stm_system (StmSystem)

Return type:

None

export_data(all=False)[source]
Parameters:

all (bool)

Return type:

None

export_data_string(all=False)[source]
Parameters:

all (bool)

Return type:

str

export_topology(all=False, raw=False)[source]
Parameters:
  • all (bool)

  • raw (bool)

Return type:

None

export_topology_string(all=False, raw=False)[source]
Parameters:
  • all (bool)

  • raw (bool)

Return type:

str

export_yaml_string(input_only=False, output_only=False, compress_txy=False, compress_connection=False)[source]
Parameters:
  • input_only (bool)

  • output_only (bool)

  • compress_txy (bool)

  • compress_connection (bool)

Return type:

str

get_executed_commands_raw()[source]
Return type:

list[str]

get_log_buffer(**kwds)

Helper for @overload to raise when called.

get_status()[source]
Return type:

shyft.energy_market.stm.shop.Status | None

get_version_info()[source]

Get version information from the shop core.

Return type:

str

set_logging_to_files(on=True)[source]
Parameters:

on (bool)

Return type:

None

set_logging_to_stdstreams(on=True)[source]
Parameters:

on (bool)

Return type:

None

property commander: ShopCommander

Get shop commander object.

class shyft.energy_market.stm.shop.Status(value)[source]

Bases: object

Describes SHOP solver status

Members:

NOT_SET

OPTIMAL_SOLUTION

OPTIMAL_INTEGER_SOLUTION

OPTIMAL_WITHIN_TOLERANCES

TIMEOUT_SOLUTION_EXISTS

OPTIMAL_SOLUTION_SCALED

SUBOPTIMAL_SOLUTION

INFEASIBLE

INTEGER_INFEASIBLE

INTEGER_INFEASIBLE_OR_UNBOUNDED

UNBOUNDED

TIMEOUT_INTEGER

TIMEOUT

Parameters:

value (SupportsInt | SupportsIndex)

INFEASIBLE: ClassVar[Status]
INTEGER_INFEASIBLE: ClassVar[Status]
INTEGER_INFEASIBLE_OR_UNBOUNDED: ClassVar[Status]
NOT_SET: ClassVar[Status]
OPTIMAL_INTEGER_SOLUTION: ClassVar[Status]
OPTIMAL_SOLUTION: ClassVar[Status]
OPTIMAL_SOLUTION_SCALED: ClassVar[Status]
OPTIMAL_WITHIN_TOLERANCES: ClassVar[Status]
SUBOPTIMAL_SOLUTION: ClassVar[Status]
TIMEOUT: ClassVar[Status]
TIMEOUT_INTEGER: ClassVar[Status]
TIMEOUT_SOLUTION_EXISTS: ClassVar[Status]
UNBOUNDED: ClassVar[Status]
__init__(value)[source]
Parameters:

value (SupportsInt | SupportsIndex)

Return type:

None

to_log_severity()[source]
Return type:

LogSeverity

property name: str
property value: int

Urgent Market Messages

In the Nord Pool electricity market, UMM (Urgent Market Messages) are a critical transparency mechanism to inform market participants about events that may affect the market balance, such as production outages, transmission constraints, or capacity changes. UMMs are governed under EU REMIT (Regulation on Wholesale Energy Market Integrity and Transparency), and Nord Pool provides the infrastructure for publishing and distributing these messages. The primary use-cases for UMM are for mid-long term model runs, to ensure that those model inputs have realistic and updated information about the energy market production, transmission and consumption. Wrong, incomplete or missing inputs to those models can impact the computed prices and water-values, leading to sub-optimal decisions made for seasonal and long term disposition of production resources. The goal of this issue is to provide a concise UMM extension of the energy-market model, including the semantics, like state rules, validation of fields, as well as compiling an UMM into a time-series that can be used for computing the available capacity.

Shyft provides key components for a complete solution for dealing with UMM.

  • A strongly typed UMM model that can be loaded/updated from Nord Pool

  • Service with client, server and backend storage

  • The model allows for the user to add annotations specifying end-dates, and availability when needed

  • Functions for deriving availability time-series for assets with UMM

class shyft.energy_market.Umm(*args, **kwargs)

Bases: pybind11_object

Umm Urgent Market Message

In the Nord Pool electricity market, UMM (Urgent Market Messages) are a critical transparency mechanism to inform market participants about events that may affect the market balance, such as production outages, transmission constraints, or capacity changes.

UMMs are governed under EU REMIT (Regulation on Wholesale Energy Market Integrity and Transparency), and Nord Pool provides the infrastructure for publishing and distributing these messages.

The primary use-cases for UMM are for mid-long term model runs, to ensure that those model inputs have realistic and updated information about the energy market production, transmission and consumption.

Wrong, incomplete or missing inputs to those models can impact the computed prices and water-values, leading to sub-optimal decisions made for seasonal and long term disposition of production resources.

Key Features:

  • Construct an message instance by specifying a type, unique id, actor EIC, version 1, and time.

  • Add a new version to the message.

  • Add an users annotation to the message.

  • Enforces the axioms of the message with respect to validation, versions and state.

  • Check if the message assets contains a specfied asset EIC.

  • Provide relative availability avail/nom cap for the message period.

  • Nested class Version, Version.Annotation

  • Nested Enum Status, ObjectType.

  • Part of the UmmModel concept.

  • All measurement units are unprefixed SI units (W)

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm, type: shyft.energy_market.Umm.ObjectType, uid: str, actor_eic: str, version: shyft.energy_market.Umm.Version) -> None

Constructs an message instance by specifying a type, unique id, actor EIC, version 1, and time.

Parameters:
  • type (Umm.ObjectType) – Umm object type

  • uid (str) – Unique id, like UUID of the Umm

  • actor_eic (str) – Actor EIC

  • version (Umm.Version) – Umm version 1, that needs to be specified and conform to UMM rules

  1. __init__(self: shyft.energy_market.Umm, u: shyft.energy_market.Umm) -> None

Constructs an message instance from another message

class ObjectType(self: shyft.energy_market.Umm.ObjectType, value: SupportsInt | SupportsIndex)

Bases: pybind11_object

Umm object type

Members:

PRODUCTION

TRANSMISSION_LINE

CONSUMPTION

OTHER

CONSUMPTION = <ObjectType.CONSUMPTION: 2>
OTHER = <ObjectType.OTHER: 3>
PRODUCTION = <ObjectType.PRODUCTION: 0>
TRANSMISSION_LINE = <ObjectType.TRANSMISSION_LINE: 1>
__init__(self: shyft.energy_market.Umm.ObjectType, value: SupportsInt | SupportsIndex) None
Umm.ObjectType.name -> str
property value
class Status(self: shyft.energy_market.Umm.Status, value: SupportsInt | SupportsIndex)

Bases: pybind11_object

Umm status

Members:

EXPECTED

ACTUAL

ENDED

CANCELLED

ACTUAL = <Status.ACTUAL: 1>
CANCELLED = <Status.CANCELLED: 3>
ENDED = <Status.ENDED: 2>
EXPECTED = <Status.EXPECTED: 0>
__init__(self: shyft.energy_market.Umm.Status, value: SupportsInt | SupportsIndex) None
Umm.Status.name -> str
property value
class Version(*args, **kwargs)

Bases: pybind11_object

Represents a version of the message object, adhering to strict sequential versioning (for example 1..n). It is designed to manage states, capacity information, and external metadata related to the assets within the scope of the message.

Key Features

  • Strict version ordering: each version has a unique identifier that must follow a sequential order.

  • Captures capacity-related details, such as available and nominal capacity.

  • Tracks relevant time periods, human-readable metadata (comments, reasons, etc.), and administrative details.

  • Supports status tracking (for example active, cancelled, and ended), with specific semantics:

    • cancelled: invalidates the entire message object and disallows further versions.

    • ended: indicates that the version’s scope has concluded and may limit further updates according to applicable rules (for example REMIT regulations).

  • Supports structured representation of information needed for regulatory compliance.

This class manages both technical data (capacity, assets, and time periods) and administrative information, providing a complete representation of each version.

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm.Version, id: typing.SupportsInt | typing.SupportsIndex, issued_time: shyft.time_series.time, assets: shyft.energy_market.Umm.Version.AssetList, msg_status: shyft.energy_market.Umm.Status, reason: str, comment: str) -> None

Construct a version instance by specifying a version id, time, assets, capacities, status, nominal cap, reason, and comment.

param id:

Immutable unique id of the version, must follow order 1..n

type id:

int

param issued_time:

Time of issue of the version

type issued_time:

time

param assets:

List of assets in the version, must be non empty for version 1, and same or additive for later versions

type assets:

AssetList

param msg_status:

Status of the version

type msg_status:

Umm.Status

param reason:

Reason for the version, like reason for the update

type reason:

str

param comment:

Comment and additional info for the version

type comment:

str

  1. __init__(self: shyft.energy_market.Umm.Version, v: shyft.energy_market.Umm.Version) -> None

Construct a version instance from another version

class Annotation(*args, **kwargs)

Bases: pybind11_object

Umm version annotation

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm.Version.Annotation, modified_time: shyft.time_series.time, period: shyft.time_series.UtcPeriod, available_cap: typing.SupportsFloat | typing.SupportsIndex, comment: str, user: str) -> None

Construct an annotation instance by specifying a modified time, period, available cap, comment, and user initials.

Parameters:
  • modified_time (time) – time when the annotation was modified

  • period (UtcPeriod) – update to time period for the Umm version

  • available_cap (float) – [W] update to available capacity for the Umm version

  • comment (str) – Comment for the annotation, like reason for the update

  • user (str) – User initials for the user adding the annotation

  1. __init__(self: shyft.energy_market.Umm.Version.Annotation, modified_time: shyft.time_series.time, capacities: shyft.energy_market.Umm.Version.PeriodCapacityList, comment: str, user: str) -> None

Construct an annotation instance by specifying a modified time, period, available cap, comment, and user initials.

Parameters:
  • modified_time (time) – time when the annotation was modified

  • capacities (PeriodCapacity) – period and available capacites for the Umm version

  • comment (str) – Comment for the annotation, like reason for the update

  • user (str) – User initials for the user adding the annotation

  1. __init__(self: shyft.energy_market.Umm.Version.Annotation, a: shyft.energy_market.Umm.Version.Annotation) -> None

Construct an annotation instance from another annotation

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm.Version.Annotation, modified_time: shyft.time_series.time, period: shyft.time_series.UtcPeriod, available_cap: typing.SupportsFloat | typing.SupportsIndex, comment: str, user: str) -> None

Construct an annotation instance by specifying a modified time, period, available cap, comment, and user initials.

Parameters:
  • modified_time (time) – time when the annotation was modified

  • period (UtcPeriod) – update to time period for the Umm version

  • available_cap (float) – [W] update to available capacity for the Umm version

  • comment (str) – Comment for the annotation, like reason for the update

  • user (str) – User initials for the user adding the annotation

  1. __init__(self: shyft.energy_market.Umm.Version.Annotation, modified_time: shyft.time_series.time, capacities: shyft.energy_market.Umm.Version.PeriodCapacityList, comment: str, user: str) -> None

Construct an annotation instance by specifying a modified time, period, available cap, comment, and user initials.

Parameters:
  • modified_time (time) – time when the annotation was modified

  • capacities (PeriodCapacity) – period and available capacites for the Umm version

  • comment (str) – Comment for the annotation, like reason for the update

  • user (str) – User initials for the user adding the annotation

  1. __init__(self: shyft.energy_market.Umm.Version.Annotation, a: shyft.energy_market.Umm.Version.Annotation) -> None

Construct an annotation instance from another annotation

property capacities

period and available capacity list

Type:

PeriodCapacityList

property comment

comment for the annotation

Type:

str

property modified

time of modification of the annotation

Type:

time

property user

user initials for the user adding the annotation

Type:

str

class Asset(*args, **kwargs)

Bases: pybind11_object

Umm version asset

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm.Version.Asset, eic: str, nominal_capacity: typing.SupportsFloat | typing.SupportsIndex, capacities: shyft.energy_market.Umm.Version.PeriodCapacityList) -> None

Create Asset object

Parameters:
  • eic (str) – Unique id for the asset

  • nominal_capacity (float) – [W] nominal capacity for the asset

  • capacities (PeriodCapacityList) – A list of Period and capacities[W]

  1. __init__(self: shyft.energy_market.Umm.Version.Asset, o: shyft.energy_market.Umm.Version.Asset) -> None

Constructs an message instance from another message

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm.Version.Asset, eic: str, nominal_capacity: typing.SupportsFloat | typing.SupportsIndex, capacities: shyft.energy_market.Umm.Version.PeriodCapacityList) -> None

Create Asset object

Parameters:
  • eic (str) – Unique id for the asset

  • nominal_capacity (float) – [W] nominal capacity for the asset

  • capacities (PeriodCapacityList) – A list of Period and capacities[W]

  1. __init__(self: shyft.energy_market.Umm.Version.Asset, o: shyft.energy_market.Umm.Version.Asset) -> None

Constructs an message instance from another message

property annotation

annotation for the asset

Type:

Version.Annotation

property capacities

period and available capacity list

Type:

PeriodCapacityList

property eic

unique id

Type:

str

property nominal_cap

[W] nominal installed capacity

Type:

float

class AssetList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm.Version.AssetList) -> None

  2. __init__(self: shyft.energy_market.Umm.Version.AssetList, arg0: shyft.energy_market.Umm.Version.AssetList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.Umm.Version.AssetList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm.Version.AssetList) -> None

  2. __init__(self: shyft.energy_market.Umm.Version.AssetList, arg0: shyft.energy_market.Umm.Version.AssetList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.Umm.Version.AssetList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.Umm.Version.AssetList, x: shyft.energy_market.Umm.Version.Asset) None

Add an item to the end of the list

clear(self: shyft.energy_market.Umm.Version.AssetList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.Umm.Version.AssetList, L: shyft.energy_market.Umm.Version.AssetList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.Umm.Version.AssetList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.Umm.Version.AssetList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.Umm.Version.Asset) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.Umm.Version.AssetList) -> shyft.energy_market.Umm.Version.Asset

Remove and return the last item

  1. pop(self: shyft.energy_market.Umm.Version.AssetList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.Umm.Version.Asset

Remove and return the item at index i

size(self: shyft.energy_market.Umm.Version.AssetList) int
class PeriodCapacity(*args, **kwargs)

Bases: pybind11_object

Period and the available capacity[W]

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm.Version.PeriodCapacity, period: shyft.time_series.UtcPeriod, available_cap: typing.SupportsFloat | typing.SupportsIndex) -> None

Constructs an PeriodCapacity instance.

Parameters:
  • period (UtcPeriod) – The period for the available capacity

  • available_capacity (float) – [W] 0 or greater available capacity

  1. __init__(self: shyft.energy_market.Umm.Version.PeriodCapacity, pc: shyft.energy_market.Umm.Version.PeriodCapacity) -> None

Constructs an PeriodCapacity instance from another

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm.Version.PeriodCapacity, period: shyft.time_series.UtcPeriod, available_cap: typing.SupportsFloat | typing.SupportsIndex) -> None

Constructs an PeriodCapacity instance.

Parameters:
  • period (UtcPeriod) – The period for the available capacity

  • available_capacity (float) – [W] 0 or greater available capacity

  1. __init__(self: shyft.energy_market.Umm.Version.PeriodCapacity, pc: shyft.energy_market.Umm.Version.PeriodCapacity) -> None

Constructs an PeriodCapacity instance from another

property available_capacity

[W] remaining available capacity

Type:

float

property period

for the capacity

Type:

UtcPeriod

class PeriodCapacityList(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm.Version.PeriodCapacityList) -> None

  2. __init__(self: shyft.energy_market.Umm.Version.PeriodCapacityList, arg0: shyft.energy_market.Umm.Version.PeriodCapacityList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.Umm.Version.PeriodCapacityList, arg0: collections.abc.Iterable) -> None

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm.Version.PeriodCapacityList) -> None

  2. __init__(self: shyft.energy_market.Umm.Version.PeriodCapacityList, arg0: shyft.energy_market.Umm.Version.PeriodCapacityList) -> None

Copy constructor

  1. __init__(self: shyft.energy_market.Umm.Version.PeriodCapacityList, arg0: collections.abc.Iterable) -> None

append(self: shyft.energy_market.Umm.Version.PeriodCapacityList, x: shyft.energy_market.Umm.Version.PeriodCapacity) None

Add an item to the end of the list

clear(self: shyft.energy_market.Umm.Version.PeriodCapacityList) None

Clear the contents

extend(*args, **kwargs)

Overloaded function.

  1. extend(self: shyft.energy_market.Umm.Version.PeriodCapacityList, L: shyft.energy_market.Umm.Version.PeriodCapacityList) -> None

Extend the list by appending all the items in the given list

  1. extend(self: shyft.energy_market.Umm.Version.PeriodCapacityList, L: collections.abc.Iterable) -> None

Extend the list by appending all the items in the given list

insert(self: shyft.energy_market.Umm.Version.PeriodCapacityList, i: SupportsInt | SupportsIndex, x: shyft.energy_market.Umm.Version.PeriodCapacity) None

Insert an item at a given position.

pop(*args, **kwargs)

Overloaded function.

  1. pop(self: shyft.energy_market.Umm.Version.PeriodCapacityList) -> shyft.energy_market.Umm.Version.PeriodCapacity

Remove and return the last item

  1. pop(self: shyft.energy_market.Umm.Version.PeriodCapacityList, i: typing.SupportsInt | typing.SupportsIndex) -> shyft.energy_market.Umm.Version.PeriodCapacity

Remove and return the item at index i

size(self: shyft.energy_market.Umm.Version.PeriodCapacityList) int
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm.Version, id: typing.SupportsInt | typing.SupportsIndex, issued_time: shyft.time_series.time, assets: shyft.energy_market.Umm.Version.AssetList, msg_status: shyft.energy_market.Umm.Status, reason: str, comment: str) -> None

Construct a version instance by specifying a version id, time, assets, capacities, status, nominal cap, reason, and comment.

Parameters:
  • id (int) – Immutable unique id of the version, must follow order 1..n

  • issued_time (time) – Time of issue of the version

  • assets (AssetList) – List of assets in the version, must be non empty for version 1, and same or additive for later versions

  • msg_status (Umm.Status) – Status of the version

  • reason (str) – Reason for the version, like reason for the update

  • comment (str) – Comment and additional info for the version

  1. __init__(self: shyft.energy_market.Umm.Version, v: shyft.energy_market.Umm.Version) -> None

Construct a version instance from another version

property assets

list of assets in the version

Type:

list

property comment

comment for the version

Type:

str

get_relative_availability(self: shyft.energy_market.Umm.Version, eic: str, ignore_annotation: bool = False) shyft.energy_market.Umm.Version.PeriodCapacityList

Get the relative availability of the version

property id

immutable unique id of the version

Type:

int

property issued_time

time of issue of the version

Type:

time

make_next_version(self: shyft.energy_market.Umm.Version, issued_time: shyft.time_series.time) shyft.energy_market.Umm.Version

Create a copy of self with the id incremented by 1, and issued time set to t_now

Parameters:

issued_time (time) – time of issue of the version

property msg_status

status of the version

Type:

Umm.Status

property reason

reason for the version

Type:

str

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.Umm, type: shyft.energy_market.Umm.ObjectType, uid: str, actor_eic: str, version: shyft.energy_market.Umm.Version) -> None

Constructs an message instance by specifying a type, unique id, actor EIC, version 1, and time.

Parameters:
  • type (Umm.ObjectType) – Umm object type

  • uid (str) – Unique id, like UUID of the Umm

  • actor_eic (str) – Actor EIC

  • version (Umm.Version) – Umm version 1, that needs to be specified and conform to UMM rules

  1. __init__(self: shyft.energy_market.Umm, u: shyft.energy_market.Umm) -> None

Constructs an message instance from another message

property actor_eic

immutable Umm actor EIC owning the assets in scope of the message

Type:

str

add_annotation(self: shyft.energy_market.Umm, eic: str, annotation: shyft.energy_market.Umm.Version.Annotation) None

Add an users annotation to the message. The annotation allows user to adjust the period and the available capacity. It also allow to add comment, and user initials for the user adding it. The annotation is validated to ensure Umm is still in a valid state The annotation is added to the current(last) version of the Umm

add_version(self: shyft.energy_market.Umm, version: shyft.energy_market.Umm.Version) None

Add a new version to the message. The version is validated to ensure it holds required axioms, like id should be +1, and other requirement according to the type the message

Parameters:

version (Umm.Version) – The new version to be added

contains(self: shyft.energy_market.Umm, asset_eic: str) bool

Check if the message assets contains a specfied asset EIC

get_relative_availability(self: shyft.energy_market.Umm, eic: str, ignore_annotation: bool = False) shyft.energy_market.Umm.Version.PeriodCapacityList

Get the relative availability of the message

property id

immutable unique uuid of the message

Type:

str

property type

immutable type of message like Production,Consumption,TransmissionLine,Other

Type:

Umm.ObjectType

property versions

list of 1 or more versions, the last one is the current version

Type:

Umm.Version

class shyft.energy_market.UmmModel(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: shyft.energy_market.UmmModel) -> None

  2. __init__(self: shyft.energy_market.UmmModel, id: typing.SupportsInt | typing.SupportsIndex, name: str, json: str) -> None

Create a new UmmModel

  1. __init__(self: shyft.energy_market.UmmModel, m: shyft.energy_market.UmmModel) -> None

Create a copy of m

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.energy_market.UmmModel) -> None

  2. __init__(self: shyft.energy_market.UmmModel, id: typing.SupportsInt | typing.SupportsIndex, name: str, json: str) -> None

Create a new UmmModel

  1. __init__(self: shyft.energy_market.UmmModel, m: shyft.energy_market.UmmModel) -> None

Create a copy of m

Get the related umms for a given asset EIC that overlaps with the filter_period

Parameters:
  • asset_eic (str) – Asset EIC

  • filter_period (UtcPeriod) – UMMS that overlaps with the filter period is returned

  • ignore_annotations (bool) – Ignore annotations when calculating the overlap

get_relative_availabilities(self: shyft.energy_market.UmmModel, assets: collections.abc.Sequence[str], filter_period: shyft.time_series.UtcPeriod, ignore_annotations: bool = False) shyft.time_series.TsVector

Get the relative availabilities for specified list of assets, as time-series that overlaps with the filter_period

Parameters:
  • assets (list) – List of Assets EIC

  • filter_period (UtcPeriod) – UMMS that overlaps with the filter period is returned

  • ignore_annotations (bool) – Ignore annotations when calculating the overlap

get_relative_availability(self: shyft.energy_market.UmmModel, asset_eic: str, filter_period: shyft.time_series.UtcPeriod, ignore_annotations: bool = False) shyft.energy_market.Umm.Version.PeriodCapacityList

Get the relative availabilities, list of tuple[UtcPeriod,float], for a given asset EIC that overlaps with the filter_period

Parameters:
  • asset_eic (str) – Asset EIC

  • filter_period (UtcPeriod) – UMMS that overlaps with the filter period is returned

  • ignore_annotations (bool) – Ignore annotations when calculating the overlap

property id

unique id of the message model

Type:

int

property json

json of the message model

Type:

str

property name

name of the message model

Type:

str

property umms

map of umms in the model

Type:

dict

class shyft.energy_market.UmmClient(self: shyft.energy_market.UmmClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0)

Bases: pybind11_object

The client api for the Umm service.

Creates a python client that can communicate with the corresponding server

__init__(self: shyft.energy_market.UmmClient, host_port: str, timeout_ms: SupportsInt | SupportsIndex, operation_timeout_ms: SupportsInt | SupportsIndex = 0) None

Creates a python client that can communicate with the corresponding server

close(self: shyft.energy_market.UmmClient) None

Close the connection. It will automatically reopen if needed.

get_model_infos(self: shyft.energy_market.UmmClient, mids: collections.abc.Sequence[SupportsInt | SupportsIndex], created_in: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.ModelInfo]

returns all or selected model-info objects based on model-identifiers(mids)

Parameters:
  • mids (IntVector) – empty = all, or a list of known exisiting model-identifiers

  • created_in (UtcPeriod) – For which period you are interested in model-infos.

Returns:

model_infos. Strongly typed list of ModelInfo

Return type:

ModelInfoVector

property host_port

Endpoint network address of the remote server.

Type:

str

property is_open

If the connection to the remote server is (still) open.

Type:

bool

property operation_timeout_ms

Operation timeout for remote server operations, in number milliseconds.

Type:

int

read_model(self: shyft.energy_market.UmmClient, mid: SupportsInt | SupportsIndex) shyft.energy_market.UmmModel

Read and return the model for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting model from the server

Return type:

Model

read_models(self: shyft.energy_market.UmmClient, mids: collections.abc.Sequence[SupportsInt | SupportsIndex]) shyft.energy_market.UmmModelVector

Read and return the model for specified model-identifier (mid)

Parameters:

mids (list[int]) – A strongly typed list of ints, the model-identifers for the wanted models

Returns:

  1. The resulting model from the server

Return type:

Model

property reconnect_count

Number of reconnects to the remote server that have been performed.

Type:

int

remove_model(self: shyft.energy_market.UmmClient, mid: SupportsInt | SupportsIndex) int

Remove the specified model bymodel-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

ec. 0 or error-code?

Return type:

int

store_model(self: shyft.energy_market.UmmClient, m: shyft.energy_market.UmmModel, mi: shyft.time_series.ModelInfo) int

Store the model to backend, if m.id==0 then a new unique model-info is created and used

Parameters:
  • m (Model) – The model to store

  • mi (ModelInfo) – The model-info to store for the model

Returns:

mid. model-identifier for the stored model and model-info

Return type:

int

property timeout_ms

Timout for remote server operations, in number milliseconds.

Type:

int

update_model_info(self: shyft.energy_market.UmmClient, mid: SupportsInt | SupportsIndex, mi: shyft.time_series.ModelInfo) bool

Update the model-info for specified model-identifier(mid)

Parameters:
  • mid (int) – model-identifer

  • mi (ModelInfo) – The new updated model-info

Returns:

ok. true if success

Return type:

bool

class shyft.energy_market.UmmServer(self: shyft.energy_market.UmmServer, root_dir: str, config: shyft.time_series.ServerConfig = shyft.time_series.ServerConfig(stale_duration='1970-01-01T01:00:00Z', stale_sweep_interval='1970-01-01T00:00:00.100000Z', log=shyft.time_series.LogConfig(file='', level=200)))

Bases: pybind11_object

The server-side component for Umm repository.

Creates a server object that serves models from root_dir. The root_dir will be create if it does not exists.

Parameters:
  • root_dir (str) – Path to the root-directory that keeps/will keep the model-files

  • config (ServerConfig) – Configuration of the server

__init__(self: shyft.energy_market.UmmServer, root_dir: str, config: shyft.time_series.ServerConfig = shyft.time_series.ServerConfig(stale_duration='1970-01-01T01:00:00Z', stale_sweep_interval='1970-01-01T00:00:00.100000Z', log=shyft.time_series.LogConfig(file='', level=200))) None

Creates a server object that serves models from root_dir. The root_dir will be create if it does not exists.

Parameters:
  • root_dir (str) – Path to the root-directory that keeps/will keep the model-files

  • config (ServerConfig) – Configuration of the server

get_listening_port(self: shyft.energy_market.UmmServer) int

returns the port number it’s listening at for serving incoming request

get_max_connections(self: shyft.energy_market.UmmServer) int

returns the maximum number of connections to be served concurrently

get_model_infos(self: shyft.energy_market.UmmServer, mids: collections.abc.Sequence[SupportsInt | SupportsIndex], created_in: shyft.time_series.UtcPeriod = UtcPeriod()) list[shyft.time_series.ModelInfo]

returns all or selected model-info objects based on model-identifiers(mids)

Parameters:
  • mids (IntVector) – empty = all, or a list of known exisiting model-identifiers

  • created_in (UtcPeriod) – For which period you are interested in model-infos.

Returns:

model_infos. Strongly typed list of ModelInfo

Return type:

ModelInfoVector

is_running(self: shyft.energy_market.UmmServer) bool

true if server is listening and running

See also

start_server()

read_model(self: shyft.energy_market.UmmServer, mid: SupportsInt | SupportsIndex) shyft.energy_market.UmmModel

Read and return the model for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting model from the server

Return type:

Model

read_model_blob(self: shyft.energy_market.UmmServer, mid: SupportsInt | SupportsIndex) shyft.time_series.ByteVector

Read and return the model blob for specified model-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

  1. The resulting blob model from the server

Return type:

ByteVector

read_models(self: shyft.energy_market.UmmServer, mids: collections.abc.Sequence[SupportsInt | SupportsIndex]) shyft.energy_market.UmmModelVector

Read and return the model for specified model-identifier (mid)

Parameters:

mids (list[int]) – A strongly typed list of ints, the model-identifers for the wanted models

Returns:

  1. The resulting model from the server

Return type:

Model

remove_model(self: shyft.energy_market.UmmServer, mid: SupportsInt | SupportsIndex) int

Remove the specified model bymodel-identifier (mid)

Parameters:

mid (int) – the model-identifer for the wanted model

Returns:

ec. 0 or error-code?

Return type:

int

set_listening_ip(self: shyft.energy_market.UmmServer, ip: str) None

set the listening port for the service

Parameters:

ip (str) – ip or host-name to start listening on

Returns:

nothing.

Return type:

None

set_listening_port(self: shyft.energy_market.UmmServer, port_no: SupportsInt | SupportsIndex) None

set the listening port for the service

Parameters:
  • port_no (int) – a valid and available tcp-ip port number to listen on.

  • 20000 (typically it could be)

Returns:

nothing.

Return type:

None

set_max_connections(self: shyft.energy_market.UmmServer, max_connect: SupportsInt | SupportsIndex) None

limits simultaneous connections to the server (it’s multithreaded, and uses on thread pr. connect)

Parameters:

max_connect (int) – maximum number of connections before denying more connections

See also

get_max_connections()

property stale_connection_close_count

returns count of connection closed due to stale/no communication activity

Type:

int

start_server(self: shyft.energy_market.UmmServer) int

start server listening in background, and processing messages

See also

set_listening_port(port_no),is_running

Returns:

port_no. the port used for listening operations, either the value as by set_listening_port, or if it was unspecified, a new available port

Return type:

in

stop_server(self: shyft.energy_market.UmmServer, timeout: SupportsInt | SupportsIndex = 1000) None

stop serving connections, gracefully.

See also

start_server()

store_model(self: shyft.energy_market.UmmServer, m: shyft.energy_market.UmmModel, mi: shyft.time_series.ModelInfo) int

Store the model to backend, if m.id==0 then a new unique model-info is created and used

Parameters:
  • m (Model) – The model to store

  • mi (ModelInfo) – The model-info to store for the model

Returns:

mid. model-identifier for the stored model and model-info

Return type:

int

update_model_info(self: shyft.energy_market.UmmServer, mid: SupportsInt | SupportsIndex, mi: shyft.time_series.ModelInfo) bool

Update the model-info for specified model-identifier(mid)

Parameters:
  • mid (int) – model-identifer

  • mi (ModelInfo) – The new updated model-info

Returns:

ok. true if success

Return type:

bool

Example Usage

The following example demonstrates how to use the UMM classes, using python requests to do the call, pydandic to parse the json return, and used to build the native strongly typed Shyft UMM model

from collections import defaultdict
from typing import List, Optional, Dict
from shyft.time_series import time, Calendar, UtcPeriod,ModelInfo
from shyft.energy_market import Umm, UmmDict,UmmModel,UmmServer,UmmClient
from pydantic import BaseModel, Field, model_validator
import requests

from pydantic_core import core_schema

def get_pydantic_core_schema_function(cls, handler) -> core_schema.CoreSchema:
    """
    Define the core schema for shyft.time_series.time.
    Relies on the built-in validation of shfyt.time_series.time for input handling.
    """
    return core_schema.json_or_python_schema(
        json_schema=core_schema.any_schema(),  # Accept any input in JSON (str, int, float)
        python_schema=core_schema.union_schema(
            [
                core_schema.is_instance_schema(cls),  # Use as-is if it's already a ShyftTime instance
                core_schema.int_schema(),  # Accept int inputs
                core_schema.float_schema(),  # Accept float inputs
                core_schema.str_schema(),  # Accept string inputs
            ]
        )
    )


# Dynamically assign the function to the ShyftTime class
time.__get_pydantic_core_schema__ = get_pydantic_core_schema_function


# --- Pydantic Models ---


class MarketParticipant(BaseModel):
    acerCode: Optional[str] = None  # Market participant's ACER code
    code: Optional[str] = None  # Market participant's internal code
    eicCode: Optional[str] = None  # Market participant's EIC code
    name: Optional[str] = None  # Name of the market participant


class TimePeriod(BaseModel):
    availableCapacity: Optional[float]  # Available capacity during this time period
    eventStart: time  # Start of the time period
    eventStop: time  # End of the time period
    unavailableCapacity: Optional[float]  # Unavailable capacity during this time period

    @property
    def period(self) -> UtcPeriod:
        return UtcPeriod(time(self.eventStart), time(self.eventStop))

    @property
    def available_capacity(self) -> float:
        return float(self.availableCapacity)


class ProductionUnit(BaseModel):
    areaEic: Optional[str]  # EIC code for the geographical area
    areaName: Optional[str]  # Name of the geographical area
    eic: Optional[str]  # EIC code of the production unit
    fuelType: Optional[int]  # Type of fuel (integer representation)
    installedCapacity: Optional[float]  # Total installed capacity
    name: Optional[str]  # Name of the production unit
    timePeriods: List[TimePeriod]  # Time period information for this production unit


class ConsumptionUnit(BaseModel):
    areaEic: Optional[str]  # EIC code for the geographical area
    areaName: Optional[str]  # Name of the geographical area
    eic: Optional[str]  # EIC code of the production unit
    installedCapacity: Optional[float]  # Total installed capacity
    name: Optional[str]  # Name of the production unit
    timePeriods: List[TimePeriod]  # Time period information for this production unit


class TransmissionUnit(BaseModel):
    name: Optional[str]  # Name of the production unit
    inAreaEic: Optional[str]  # EIC code for the geographical area
    inAreaName: Optional[str]  # Name of the geographical area
    outAreaEic: Optional[str]  # EIC code for the geographical area
    outAreaName: Optional[str]  # Name of the geographical area
    installedCapacity: Optional[float]  # Total installed capacity
    timePeriods: List[TimePeriod]  # Time period information for this production unit


class OtherUnit(BaseModel):
    name: Optional[str]  # Name of the production unit
    eic: Optional[str]  # EIC code for the geographical area
    AreaName: str | None = None  # Name of the geographical area
    areaEic: str | None = None  # EIC code for the geographical area
    installedCapacity: Optional[float]  # Total installed capacity
    timePeriods: List[TimePeriod]  # Time period information for this production unit


class GenerationUnit(BaseModel):
    areaEic: Optional[str]  # EIC code for the geographical area
    areaName: Optional[str]  # Name of the geographical area
    eic: Optional[str]  # EIC code of the production unit
    productionUnitEic: Optional[str]  # eic of the Production Unit..
    productionUnitInstalledCapacity: Optional[int]  # prod unit installed.
    productionUnitName: Optional[str]  # pro unit name
    fuelType: Optional[int]  # Type of fuel (integer representation)
    installedCapacity: Optional[float]  # Total installed capacity
    powerFeedIn: Optional[
        int] = 0  # Power feed-in is the wind power fed in (MW) at the time of the change in the availability
    name: Optional[str]  # Name of the production unit
    timePeriods: List[TimePeriod]  # Time period information for this production unit


def create_asset(
        some_unit: GenerationUnit | OtherUnit | ProductionUnit | ConsumptionUnit | TransmissionUnit) -> Umm.Version.Asset:
    def capacities_of(
            u: GenerationUnit | OtherUnit | ProductionUnit | ConsumptionUnit | TransmissionUnit) -> Umm.Version.PeriodCapacityList:
        return Umm.Version.PeriodCapacityList(
            [Umm.Version.PeriodCapacity(period=x.period, available_cap=x.available_capacity) for x in
             u.timePeriods])

    def eic_of(u: GenerationUnit | OtherUnit | ProductionUnit | ConsumptionUnit | TransmissionUnit) -> str:
        return u.eic if not isinstance(u,
                                       TransmissionUnit) else f'{u.outAreaEic}->{u.inAreaEic}'

    return Umm.Version.Asset(eic=eic_of(some_unit), nominal_capacity=float(some_unit.installedCapacity),
                             capacities=capacities_of(some_unit))


def create_assets(some_units: List[
    GenerationUnit | OtherUnit | ProductionUnit | ConsumptionUnit | TransmissionUnit]) -> Umm.Version.AssetList:
    return Umm.Version.AssetList([create_asset(x) for x in some_units])


class MarketInfoArea(BaseModel):
    code: str
    name: str


class MarketInfoAsset(BaseModel):
    code: str
    name: str


class ApiMessageItem(BaseModel):
    acerRssMessageIds: List[str] | None = None  # A list of message IDs from the RSS feed
    eventStatus: int  # Status of the event
    isOutdated: bool  # Whether the item is outdated
    marketParticipants: List[MarketParticipant] | None = None  # List of market participants
    messageId: str  # Unique ID of the message
    messageType: int  # Type of the message (as an integer)
    productionUnits: List[ProductionUnit] | None = None  # List of production units in the message
    generationUnits: List[GenerationUnit] | None = None  # List of production units in the message
    consumptionUnits: List[ConsumptionUnit] | None = None
    transmissionUnits: List[TransmissionUnit] | None = None
    otherUnits: List[OtherUnit] | None = None
    areas: List[MarketInfoArea] | None = None
    assets: List[MarketInfoAsset] | None = None
    otherArea: str | None = None
    publicationDate: time  # The date the message was published
    publisherId: Optional[str]  # ID of the publisher
    publisherName: Optional[str]  # Name of the publisher
    reasonCode: Optional[int] = 0  # Reason code for the message
    remarks: Optional[str] = ""  # Additional remarks for the message
    unavailabilityReason: Optional[str] = ""  # Reason for unavailability
    unavailabilityType: Optional[int] = 0  # Type of unavailability
    version: int  # Version of the message

    @property
    def issued_time(self) -> time:
        return time(self.publicationDate)

    @property
    def version_assets(self) -> Umm.Version.AssetList:
        def make_assets():
            if self.productionUnits:
                return create_assets(self.productionUnits)
            if self.generationUnits:
                return create_assets(self.generationUnits)
            if self.consumptionUnits:
                return create_assets(self.consumptionUnits)
            if self.transmissionUnits:
                return create_assets(self.transmissionUnits)
            if self.otherUnits:
                return create_assets(self.otherUnits)
            return Umm.Version.AssetList()

        a = make_assets()
        return a

    @property
    def status(self) -> Umm.Status:
        if self.eventStatus == 1:
            return Umm.Status.ACTUAL
        return Umm.Status.CANCELLED  # 3

    @property
    def reason(self) -> str:
        return self.unavailabilityReason

    @property
    def comment(self) -> str:
        return self.remarks

    @model_validator(mode="after")
    def validate_units(cls, values):
        if values.messageType == 5:
            return values
        if (not values.productionUnits and not values.generationUnits
                and not values.consumptionUnits and not values.transmissionUnits and not values.otherUnits
                and not values.areas and not values.assets):
            raise ValueError("some units must be provided.")
        return values


class UmmApiResponse(BaseModel):
    items: List[ApiMessageItem]
    total: int


# --- UMM Client ---

class UmmNordpoolClient:
    BASE_URL = "https://ummapi.nordpoolgroup.com/messages"

    def __init__(self, user_agent: str = "UmmClient/1.0"):
        self.session = requests.Session()
        self.session.headers.update({
            "User-Agent": user_agent,
            "Accept": "application/json"
        })

    def fetch_all_messages(
            self,
            status: Optional[str] = None,
            message_types: Optional[List[str]] = None,
            event_start_date: Optional[time] = None,
            event_stop_date: Optional[time] = None,
            page_limit: int = 1000,
    ) -> Dict[str, ApiMessageItem]:
        all_messages = []
        skip = 0

        while True:
            batch = self._fetch_page(
                status=status,
                message_types=message_types,
                event_start_date=event_start_date,
                event_stop_date=event_stop_date,
                limit=page_limit,
                skip=skip,
            )
            all_messages.extend(batch.items)
            skip += len(batch.items)
            if len(batch.items) < page_limit:
                break  # Last page
        grouped_messages = defaultdict(list)
        for m in all_messages:
            grouped_messages[m.messageId].append(m)
        return grouped_messages

    def _fetch_page(
            self,
            status: Optional[str],
            message_types: Optional[List[str]],
            event_start_date: Optional[time],
            event_stop_date: Optional[time],
            limit: int,
            skip: int,
    ) -> UmmApiResponse:
        params = {
            "limit": limit,
            "skip": skip,
        }
        if status:
            params["status"] = status.upper()
        if message_types:
            params["messageTypes"] = ",".join(message_types).upper()
        if event_start_date:
            params["eventStartDate"] = str(event_start_date)
        if event_stop_date:
            params["eventStopDate"] = str(event_stop_date)
        # this includes allmost all messages, interesting to look at: params["IncludeOutDated"] = "true"
        response = self.session.get(self.BASE_URL, params=params)
        response.raise_for_status()
        return UmmApiResponse.model_validate(response.json(), strict=False, from_attributes=True)


# --- Usage Example ---

if __name__ == "__main__":
    np_client = UmmNordpoolClient()
    umms = UmmDict()
    msg_type_map = {
        "ProductionUnavailability": Umm.ObjectType.PRODUCTION,
        "ConsumptionUnavailability": Umm.ObjectType.CONSUMPTION,
        "TransmissionUnavailability": Umm.ObjectType.TRANSMISSION_LINE,
        "OtherUnavailability": Umm.ObjectType.OTHER,
        "MarketInformation": Umm.ObjectType.OTHER
    }
    for message_type in ["MarketInformation", "ProductionUnavailability", "ConsumptionUnavailability",
                         "TransmissionUnavailability", "OtherUnavailability"]:
        messages = np_client.fetch_all_messages(
            status="active",
            message_types=[message_type],
            event_start_date=time('2025-01-01T00:00:00Z'),
            event_stop_date=time('2030-01-01T00:00:00Z'),
        )

        print(f"Fetched {len(messages)} UMM entries for {message_type}:")
        count = 0
        for uuid, msgs in messages.items():
            umm: Umm|None = None
            versions = sorted(msgs, key=lambda x: x.version)
            v_id: int = 1
            for msg in versions:
                v = Umm.Version(id=msg.version, issued_time=msg.issued_time, assets=msg.version_assets,
                                msg_status=msg.status, reason=msg.reason,
                                comment=msg.comment)
                v_id += 1
                if umm is None:
                    umm = Umm(type=msg_type_map[message_type], uid=uuid, actor_eic=msg.publisherId, version=v)
                else:
                    umm.add_version(v)
            umms[uuid] = umm
            count += 1

    print(len(umms))
    m0: UmmModel = UmmModel()
    m0.id = 0
    m0.name = 'UMM test'
    m0.json = '{}'
    m0.umms = umms
    m0_info: ModelInfo = ModelInfo(id=m0.id, name=f'first umm model', created=time.now(), json='{}')

    # create a server to store it, using /tmp , change to fit you need and environment
    db_dir="/tmp/umm-db"
    s: UmmServer = UmmServer(root_dir=db_dir)
    try:
        port: int = s.start_server()
        # then a client to access the server
        c: UmmClient = UmmClient(host_port=f'localhost:{port}', timeout_ms=1000, operation_timeout_ms=10000)
        m0_id=c.store_model(m=m0,mi=m0_info)
        print(f'Stored model, got unique model id: {m0_id=}')
        m0_read = c.read_model(mid=m0_id)
        print(f'Read model: {m0_read.name=}')
        m0.id=m0_id  # update the local model so comparison works out to equal
        assert m0 == m0_read
    finally:
        del c
        del s

Service

This module contains scripts and setup for starting up the Shyft energy market model services.

UI

The ‘UI’ module utilizes pyside/Qt to express web layouts, json-formatted information, that is feed back the front-end.

The sections of the layout can be filled with charts, tables etc, and where the data-binding of the content of those, can be setup to reflect back to the Shyft energy market servers, like the ‘DStmServer’, ‘DtsServer’, ‘TaskServer’ etc.

Note that currently Shyft does not currently contain a front end framework needed to render this on web, but the examples/demo section of the Shyft repository to contain angular examples using the Shyft services.

There are example that companies have created such front end in angular, data-driven, using these services, to support intraday and day-ahead market operations.

The basic idea here is to enable the cooperation of python skilled business users and professional software developers to work together efficiently.

The professional/dedicated software developers provide the tools/framework as needed, and the python skilled business users can then utilize their domain knowledge to orchestrate and provide operational software.

Thus, the goal is ensures fast time-to-useful software in operations, combining all the skills, energy market domain, front end/ux, and backend high performance services.

Since we currently uses Qt to express the UI layouts, there is no explicit doc for this, as it is standard documentation of Qt that applies to this part.

Note that the Qt/pyside2 is only used as a robust well documented tool to create data structures, from where we harvest/generate a json, using the attributes of Qt.

Any other framework, including python could do the job as well, as long as it at the end, generates the json formatted as required from the front end framework that you use.

To get an idea for how this works, with PySide2/Qt, look into the test_suites for shyft, https://gitlab.com/shyft-os/shyft/-/blob/master/python/test_suites/energy_market/ui/test_ui.py#L35

Shyft Energy Market user interface configuration api

class shyft.energy_market.ui.LayoutInfo(self: shyft.energy_market.stm.LayoutInfo, id: SupportsInt | SupportsIndex, name: str, json: str = '')

Bases: pybind11_object

Provides layout information that can be leveraged by a renderer.

Construct a LayoutInfo from id, name, and json

__init__(self: shyft.energy_market.stm.LayoutInfo, id: SupportsInt | SupportsIndex, name: str, json: str = '') None

Construct a LayoutInfo from id, name, and json

property id

identifying number

Type:

int

property json

Json-string containing layout information

Type:

str

property name

A descriptive name

Type:

str

class shyft.energy_market.ui.ModelInfo(*args, **kwargs)

Bases: pybind11_object

Provides model-information useful for selection and filtering

Overloaded function.

  1. __init__(self: shyft.time_series.ModelInfo) -> None

  2. __init__(self: shyft.time_series.ModelInfo, id: typing.SupportsInt | typing.SupportsIndex, name: str, created: shyft.time_series.time, json: str = ‘’) -> None

Constructs ModelInfo with the supplied parameters

Parameters:
  • id (int) – the unique model id

  • name (str) – any useful name or description

  • created (time) – time of creation

  • json (str) – extra information, preferably a valid json

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: shyft.time_series.ModelInfo) -> None

  2. __init__(self: shyft.time_series.ModelInfo, id: typing.SupportsInt | typing.SupportsIndex, name: str, created: shyft.time_series.time, json: str = ‘’) -> None

Constructs ModelInfo with the supplied parameters

Parameters:
  • id (int) – the unique model id

  • name (str) – any useful name or description

  • created (time) – time of creation

  • json (str) – extra information, preferably a valid json

property created

the time of creation, or last modification of the model

Type:

time

property id

the unique model id, can be used to retrieve the real model

Type:

int

property json

a json formatted string to enable scripting and python to store more information

Type:

str

property name

any useful name or description

Type:

str