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
Bases:
pybind11_objectCatchment 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: int, 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:
- property id
- property json
- property name
- property obj
a python object
- Type:
object
- property ts
- class shyft.energy_market.core.CatchmentList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.CatchmentList) -> None
__init__(self: shyft.energy_market.CatchmentList, arg0: shyft.energy_market.CatchmentList) -> None
Copy constructor
__init__(self: shyft.energy_market.CatchmentList, arg0: 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.
extend(self: shyft.energy_market.CatchmentList, L: shyft.energy_market.CatchmentList) -> None
Extend the list by appending all the items in the given list
extend(self: shyft.energy_market.CatchmentList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.CatchmentList, i: int, 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.
pop(self: shyft.energy_market.CatchmentList) -> shyft.energy_market.Catchment
Remove and return the last item
pop(self: shyft.energy_market.CatchmentList, i: int) -> shyft.energy_market.Catchment
Remove and return the item at index
i
- size(self: shyft.energy_market.CatchmentList) int
- class shyft.energy_market.core.Client
Bases:
pybind11_objectThe client-api for the energy_market
- __init__(self: shyft.energy_market.Client, host_port: str, timeout_ms: int, operation_timeout_ms: int = 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: list[int], created_in: shyft.time_series.UtcPeriod = [not-valid-period>) 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: int) 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:
The resulting model from the server
- Return type:
- read_models(self: shyft.energy_market.Client, mids: list[int]) 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:
The resulting model from the server
- Return type:
- property reconnect_count
Number of reconnects to the remote server that have been performed.
- Type:
int
- remove_model(self: shyft.energy_market.Client, mid: int) 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
- property timeout_ms
Timout for remote server operations, in number milliseconds.
- Type:
int
- update_model_info(self: shyft.energy_market.Client, mid: int, 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
Bases:
pybind11_objectMembers:
main
bypass
flood
input
- __init__(self: shyft.energy_market.ConnectionRole, value: int) None
- bypass = <ConnectionRole.bypass: 1>
- flood = <ConnectionRole.flood: 2>
- input = <ConnectionRole.input: 3>
- main = <ConnectionRole.main: 0>
- property name
- property value
- class shyft.energy_market.core.Gate
Bases:
pybind11_objectA 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: int, 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:
- property id
- property json
- property name
- property obj
a python object
- Type:
object
- property ts
- class shyft.energy_market.core.GateList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.GateList) -> None
__init__(self: shyft.energy_market.GateList, arg0: shyft.energy_market.GateList) -> None
Copy constructor
__init__(self: shyft.energy_market.GateList, arg0: 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.
extend(self: shyft.energy_market.GateList, L: shyft.energy_market.GateList) -> None
Extend the list by appending all the items in the given list
extend(self: shyft.energy_market.GateList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.GateList, i: int, 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.
pop(self: shyft.energy_market.GateList) -> shyft.energy_market.Gate
Remove and return the last item
pop(self: shyft.energy_market.GateList, i: int) -> 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_objectA 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:
- 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:
- 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:
- class shyft.energy_market.core.HydroComponentList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.HydroComponentList) -> None
__init__(self: shyft.energy_market.HydroComponentList, arg0: shyft.energy_market.HydroComponentList) -> None
Copy constructor
__init__(self: shyft.energy_market.HydroComponentList, arg0: 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.
extend(self: shyft.energy_market.HydroComponentList, L: shyft.energy_market.HydroComponentList) -> None
Extend the list by appending all the items in the given list
extend(self: shyft.energy_market.HydroComponentList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.HydroComponentList, i: int, 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.
pop(self: shyft.energy_market.HydroComponentList) -> shyft.energy_market.HydroComponent
Remove and return the last item
pop(self: shyft.energy_market.HydroComponentList, i: int) -> shyft.energy_market.HydroComponent
Remove and return the item at index
i
- size(self: shyft.energy_market.HydroComponentList) int
- class shyft.energy_market.core.HydroConnection
Bases:
pybind11_objectA 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:
- property target
target of the hydro-connection, Reservoir|Unit|Waterway
- Type:
- shyft.energy_market.core.HydroConnectionList
alias of
list
- class shyft.energy_market.core.HydroGraphTraversal
Bases:
pybind11_objectA 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.
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
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.
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
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.
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
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.
path_to_ocean(arg0: shyft.energy_market.HydroComponentList, arg1: shyft.energy_market.ConnectionRole) -> None
finds path to ocean for a given hydro component
path_to_ocean(arg0: shyft.energy_market.HydroComponentList) -> None
finds path to ocean for a given hydro component
- class shyft.energy_market.core.HydroPowerSystem
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.HydroPowerSystem, name: str) -> None
creates an empty hydro power system with the specified name
__init__(self: shyft.energy_market.HydroPowerSystem, id: int, 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: int, name: str, json: str = '') shyft.energy_market.Unit
- create_catchment(self: shyft.energy_market.HydroPowerSystem, id: int, name: str, json: str = '') shyft.energy_market.Catchment
create and add catchment to the system
- create_gate(self: shyft.energy_market.HydroPowerSystem, id: int, name: str, json: str = '') shyft.energy_market.Gate
- create_power_plant(self: shyft.energy_market.HydroPowerSystem, id: int, name: str, json: str = '') shyft.energy_market.PowerPlant
- create_power_station(self: shyft.energy_market.HydroPowerSystem, id: int, name: str, json: str = '') shyft.energy_market.PowerPlant
- create_reservoir(self: shyft.energy_market.HydroPowerSystem, id: int, name: str, json: str = '') shyft.energy_market.Reservoir
- create_river(self: shyft.energy_market.HydroPowerSystem, id: int, name: str, json: str = '') shyft.energy_market.Waterway
- create_tunnel(self: shyft.energy_market.HydroPowerSystem, id: int, name: str, json: str = '') shyft.energy_market.Waterway
- create_unit(self: shyft.energy_market.HydroPowerSystem, id: int, 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:
- 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: int) 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: int) 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: int) 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: int) 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: int) 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
- 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:
- 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
Bases:
pybind11_objectclass 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: int, name: str, json: str = '') shyft.energy_market.Unit
creates a new unit with the specified parameters
- create_catchment(self: shyft.energy_market.HydroPowerSystemBuilder, id: int, name: str, json: str = '') shyft.energy_market.Catchment
create and add catchmment to the system
- create_gate(self: shyft.energy_market.HydroPowerSystemBuilder, id: int, 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: int, 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: int, 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: int, name: str, json: str = '') shyft.energy_market.Reservoir
creates and adds a reservoir to the system
- create_river(self: shyft.energy_market.HydroPowerSystemBuilder, id: int, name: str, json: str = '') shyft.energy_market.Waterway
create and add river to the system
- create_tunnel(self: shyft.energy_market.HydroPowerSystemBuilder, id: int, name: str, json: str = '') shyft.energy_market.Waterway
create and add river to the system
- create_unit(self: shyft.energy_market.HydroPowerSystemBuilder, id: int, 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: int, name: str, json: str = '') shyft.energy_market.Waterway
create and add river to the system
- create_waterway(self: shyft.energy_market.HydroPowerSystemBuilder, id: int, name: str, json: str = '') shyft.energy_market.Waterway
create and add river to the system
- class shyft.energy_market.core.HydroPowerSystemList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.HydroPowerSystemList) -> None
__init__(self: shyft.energy_market.HydroPowerSystemList, arg0: shyft.energy_market.HydroPowerSystemList) -> None
Copy constructor
__init__(self: shyft.energy_market.HydroPowerSystemList, arg0: 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.
extend(self: shyft.energy_market.HydroPowerSystemList, L: shyft.energy_market.HydroPowerSystemList) -> None
Extend the list by appending all the items in the given list
extend(self: shyft.energy_market.HydroPowerSystemList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.HydroPowerSystemList, i: int, 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.
pop(self: shyft.energy_market.HydroPowerSystemList) -> shyft.energy_market.HydroPowerSystem
Remove and return the last item
pop(self: shyft.energy_market.HydroPowerSystemList, i: int) -> shyft.energy_market.HydroPowerSystem
Remove and return the item at index
i
- size(self: shyft.energy_market.HydroPowerSystemList) int
- shyft.energy_market.core.IntStringDict
alias of
dict
- shyft.energy_market.core.StringTimeSeriesDict
alias of
dict
- class shyft.energy_market.core.Model
Bases:
pybind11_objectThe 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
- __init__(self: shyft.energy_market.Model, id: int, 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: int, 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:
See also
add_area
- create_power_line(self: shyft.energy_market.Model, a: shyft.energy_market.ModelArea, b: shyft.energy_market.ModelArea, id: int, 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:
- Returns:
pl. the newly created power-line, that is now a part of the model
- Return type:
- create_power_module(self: shyft.energy_market.Model, model_area: shyft.energy_market.ModelArea, id: int, 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:
- 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:
- 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
Bases:
pybind11_objectThe 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
- __init__(self: shyft.energy_market.ModelArea, model: shyft.energy_market.Model, id: int, 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: int, 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:
- property custom
- property detailed_hydro
detailed hydro description.
See also
HydroPowerSystem
- Type:
- 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 name
- property obj
a python object
- Type:
object
- property power_modules
power-modules in this area, a dictionary using power-module unique id
- Type:
- property ts
- class shyft.energy_market.core.ModelBuilder
Bases:
pybind11_objectThis class helps building an EMPS model, step by step
- __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: int, 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:
See also
add_area
- create_power_line(self: shyft.energy_market.ModelBuilder, id: int, 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:
- Returns:
pl. the newly created power-line, that is now a part of the model
- Return type:
- create_power_module(self: shyft.energy_market.ModelBuilder, id: int, 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:
- class shyft.energy_market.core.ModelInfo
Bases:
pybind11_objectProvides model-information useful for selection and filtering
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.time_series.ModelInfo) -> None
__init__(self: shyft.time_series.ModelInfo, id: int, 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 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
- class shyft.energy_market.core.Point
Bases:
pybind11_objectSimply a point (x,y)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.Point) -> None
__init__(self: shyft.energy_market.Point, x: float, y: float) -> None
construct a point with x and y
__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
Bases:
pybind11_objectThe 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
- __init__(self: shyft.energy_market.PowerLine, model: shyft.energy_market.Model, area_1: shyft.energy_market.ModelArea, area_2: shyft.energy_market.ModelArea, id: int, 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 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 name
- property obj
a python object
- Type:
object
- property ts
- class shyft.energy_market.core.PowerLineList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.PowerLineList) -> None
__init__(self: shyft.energy_market.PowerLineList, arg0: shyft.energy_market.PowerLineList) -> None
Copy constructor
__init__(self: shyft.energy_market.PowerLineList, arg0: 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.
extend(self: shyft.energy_market.PowerLineList, L: shyft.energy_market.PowerLineList) -> None
Extend the list by appending all the items in the given list
extend(self: shyft.energy_market.PowerLineList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.PowerLineList, i: int, x: shyft.energy_market.PowerLine) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.PowerLineList) -> shyft.energy_market.PowerLine
Remove and return the last item
pop(self: shyft.energy_market.PowerLineList, i: int) -> 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
Bases:
pybind11_objectThe 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
- __init__(self: shyft.energy_market.PowerModule, area: shyft.energy_market.ModelArea, id: int, 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 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
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.PowerModuleDict) -> None
__init__(self: shyft.energy_market.PowerModuleDict, arg0: shyft.energy_market.PowerModuleDict) -> None
CopyConstructor
- get(self: shyft.energy_market.PowerModuleDict, key: int, 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.energy_market.ItemsView
- keys(self: shyft.energy_market.PowerModuleDict) shyft.energy_market.KeysView
- values(self: shyft.energy_market.PowerModuleDict) shyft.energy_market.ValuesView
- class shyft.energy_market.core.PowerPlant
Bases:
pybind11_objectA 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: int, 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 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:
- 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
- class shyft.energy_market.core.PowerPlantList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.PowerPlantList) -> None
__init__(self: shyft.energy_market.PowerPlantList, arg0: shyft.energy_market.PowerPlantList) -> None
Copy constructor
__init__(self: shyft.energy_market.PowerPlantList, arg0: 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.
extend(self: shyft.energy_market.PowerPlantList, L: shyft.energy_market.PowerPlantList) -> None
Extend the list by appending all the items in the given list
extend(self: shyft.energy_market.PowerPlantList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.PowerPlantList, i: int, 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.
pop(self: shyft.energy_market.PowerPlantList) -> shyft.energy_market.PowerPlant
Remove and return the last item
pop(self: shyft.energy_market.PowerPlantList, i: int) -> shyft.energy_market.PowerPlant
Remove and return the item at index
i
- size(self: shyft.energy_market.PowerPlantList) int
- class shyft.energy_market.core.Reservoir
Bases:
HydroComponent- __init__(self: shyft.energy_market.Reservoir, id: int, 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
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.ReservoirList) -> None
__init__(self: shyft.energy_market.ReservoirList, arg0: shyft.energy_market.ReservoirList) -> None
Copy constructor
__init__(self: shyft.energy_market.ReservoirList, arg0: 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.
extend(self: shyft.energy_market.ReservoirList, L: shyft.energy_market.ReservoirList) -> None
Extend the list by appending all the items in the given list
extend(self: shyft.energy_market.ReservoirList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.ReservoirList, i: int, 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.
pop(self: shyft.energy_market.ReservoirList) -> shyft.energy_market.Reservoir
Remove and return the last item
pop(self: shyft.energy_market.ReservoirList, i: int) -> shyft.energy_market.Reservoir
Remove and return the item at index
i
- size(self: shyft.energy_market.ReservoirList) int
- class shyft.energy_market.core.Run
Bases:
pybind11_objectProvides a Run concept, goes through states, created->prepinput->running->collect_result->frozen
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.Run) -> None
__init__(self: shyft.energy_market.Run, id: int, name: str, created: shyft.time_series.time, json: str = ‘’, mid: int = 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
Bases:
pybind11_objectThe client-api for the generic run-repository
- __init__(self: shyft.energy_market.RunClient, host_port: str, timeout_ms: int, operation_timeout_ms: int = 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: list[int], created_in: shyft.time_series.UtcPeriod = [not-valid-period>) 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: int) 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:
The resulting model from the server
- Return type:
- read_models(self: shyft.energy_market.RunClient, mids: list[int]) 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:
The resulting model from the server
- Return type:
- property reconnect_count
Number of reconnects to the remote server that have been performed.
- Type:
int
- remove_model(self: shyft.energy_market.RunClient, mid: int) 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
- property timeout_ms
Timout for remote server operations, in number milliseconds.
- Type:
int
- update_model_info(self: shyft.energy_market.RunClient, mid: int, 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
Bases:
pybind11_objectThe server-side component for the skeleton generic run repository
- __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: list[int], created_in: shyft.time_series.UtcPeriod = [not-valid-period>) 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: int) 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:
The resulting model from the server
- Return type:
- read_model_blob(self: shyft.energy_market.RunServer, mid: int) list[str]
Read and return the model blob for specified model-identifier (mid)
- Parameters:
mid (int) – the model-identifer for the wanted model
- Returns:
The resulting blob model from the server
- Return type:
ByteVector
- read_models(self: shyft.energy_market.RunServer, mids: list[int]) 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:
The resulting model from the server
- Return type:
- remove_model(self: shyft.energy_market.RunServer, mid: int) 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: int) 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: int) 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: int = 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
- update_model_info(self: shyft.energy_market.RunServer, mid: int, 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
Bases:
pybind11_objectThe server-side component for the skeleton energy_market model repository
- __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: list[int], created_in: shyft.time_series.UtcPeriod = [not-valid-period>) 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: int) 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:
The resulting model from the server
- Return type:
- read_model_blob(self: shyft.energy_market.Server, mid: int) list[str]
Read and return the model blob for specified model-identifier (mid)
- Parameters:
mid (int) – the model-identifer for the wanted model
- Returns:
The resulting blob model from the server
- Return type:
ByteVector
- read_models(self: shyft.energy_market.Server, mids: list[int]) 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:
The resulting model from the server
- Return type:
- remove_model(self: shyft.energy_market.Server, mid: int) 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: int) 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: int) 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: int = 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
- update_model_info(self: shyft.energy_market.Server, mid: int, 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
Bases:
pybind11_objectDescribes the capabilities of a turbine.
Members:
turbine_none
turbine_forward
turbine_backward
turbine_reversible
- __init__(self: shyft.energy_market.TurbineCapability, value: int) None
- property name
- 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
Bases:
pybind11_objectComplete 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.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.TurbineDescription) -> None
__init__(self: shyft.energy_market.TurbineDescription, operating_zones: shyft.energy_market.TurbineOperatingZoneList) -> None
__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: float) 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
Bases:
pybind11_objectA 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.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.TurbineOperatingZone) -> None
__init__(self: shyft.energy_market.TurbineOperatingZone, efficiency_curves: shyft.energy_market.XyPointCurveWithZList) -> None
__init__(self: shyft.energy_market.TurbineOperatingZone, efficiency_curves: shyft.energy_market.XyPointCurveWithZList, production_min: float, production_max: float) -> None
__init__(self: shyft.energy_market.TurbineOperatingZone, efficiency_curves: shyft.energy_market.XyPointCurveWithZList, production_min: float, production_max: float, production_nominal: float, fcr_min: float, fcr_max: float) -> None
__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:
- evaluate(self: shyft.energy_market.TurbineOperatingZone, x: float, z: float) float
Evaluate the efficiency curves at a point (x, z)
- 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
Bases:
HydroComponentAn 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: int, name: str, json: str, hps: shyft.energy_market.HydroPowerSystem) None
- 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:
- property power_station
return the hydro power plant associated with this unit
- Type:
- class shyft.energy_market.core.UnitList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.UnitList) -> None
__init__(self: shyft.energy_market.UnitList, arg0: shyft.energy_market.UnitList) -> None
Copy constructor
__init__(self: shyft.energy_market.UnitList, arg0: 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.
extend(self: shyft.energy_market.UnitList, L: shyft.energy_market.UnitList) -> None
Extend the list by appending all the items in the given list
extend(self: shyft.energy_market.UnitList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.UnitList, i: int, 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.
pop(self: shyft.energy_market.UnitList) -> shyft.energy_market.Unit
Remove and return the last item
pop(self: shyft.energy_market.UnitList, i: int) -> 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
Bases:
HydroComponentThe waterway can be a river or a tunnel, and connects the reservoirs, units(turbine).
- __init__(self: shyft.energy_market.Waterway, id: int, 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:
- input_from(*args, **kwargs)
Overloaded function.
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.
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.
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.
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.
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.
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:
- property upstream_role
the role the water way has relative to the component above
- class shyft.energy_market.core.WaterwayList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.WaterwayList) -> None
__init__(self: shyft.energy_market.WaterwayList, arg0: shyft.energy_market.WaterwayList) -> None
Copy constructor
__init__(self: shyft.energy_market.WaterwayList, arg0: 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.
extend(self: shyft.energy_market.WaterwayList, L: shyft.energy_market.WaterwayList) -> None
Extend the list by appending all the items in the given list
extend(self: shyft.energy_market.WaterwayList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.WaterwayList, i: int, 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.
pop(self: shyft.energy_market.WaterwayList) -> shyft.energy_market.Waterway
Remove and return the last item
pop(self: shyft.energy_market.WaterwayList, i: int) -> shyft.energy_market.Waterway
Remove and return the item at index
i
- size(self: shyft.energy_market.WaterwayList) int
- class shyft.energy_market.core.XyPointCurve
Bases:
pybind11_objectA curve described using points, piecewise linear.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.XyPointCurve) -> None
__init__(self: shyft.energy_market.XyPointCurve, points: shyft.energy_market.XyPointList) -> None
__init__(self: shyft.energy_market.XyPointCurve, x_vector: list[float], y_vector: list[float]) -> None
__init__(self: shyft.energy_market.XyPointCurve, clone: shyft.energy_market.XyPointCurve) -> None
Create a clone.
- calculate_x(*args, **kwargs)
Overloaded function.
calculate_x(self: shyft.energy_market.XyPointCurve, x: float) -> float
interpolating and extending
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.
calculate_y(self: shyft.energy_market.XyPointCurve, x: float) -> float
interpolating and extending
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
Bases:
pybind11_objectA XyPointCurve with a reference value z.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.XyPointCurveWithZ) -> None
__init__(self: shyft.energy_market.XyPointCurveWithZ, other: shyft.energy_market.XyPointCurveWithZ) -> None
__init__(self: shyft.energy_market.XyPointCurveWithZ, xy_point_curve: shyft.energy_market.XyPointCurve, z: float) -> None
- property xy_point_curve
describes the function at z
- Type:
- property z
z value
- Type:
float
- class shyft.energy_market.core.XyPointCurveWithZList
Bases:
pybind11_objectA strongly typed list of XyPointCurveWithZ.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.XyPointCurveWithZList) -> None
__init__(self: shyft.energy_market.XyPointCurveWithZList, arg0: shyft.energy_market.XyPointCurveWithZList) -> None
Copy constructor
__init__(self: shyft.energy_market.XyPointCurveWithZList, arg0: 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: float, z: float) float
Evaluate the curve at the point (x, z)
- extend(*args, **kwargs)
Overloaded function.
extend(self: shyft.energy_market.XyPointCurveWithZList, L: shyft.energy_market.XyPointCurveWithZList) -> None
Extend the list by appending all the items in the given list
extend(self: shyft.energy_market.XyPointCurveWithZList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.XyPointCurveWithZList, i: int, x: shyft.energy_market.XyPointCurveWithZ) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.XyPointCurveWithZList) -> shyft.energy_market.XyPointCurveWithZ
Remove and return the last item
pop(self: shyft.energy_market.XyPointCurveWithZList, i: int) -> 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
Bases:
pybind11_objectA 3D curve consisting of one or more 2D curves parametrised over a third variable.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.XyzPointCurve) -> None
__init__(self: shyft.energy_market.XyzPointCurve, curves: shyft.energy_market.XyPointCurveWithZList) -> None
Create from a list.
__init__(self: shyft.energy_market.XyzPointCurve, curves: shyft.energy_market.XyzPointCurveDict) -> None
- property curves
- evaluate(self: shyft.energy_market.XyzPointCurve, x: float, z: float) float
Evaluate the curve at the point (x, z)
- get_curve(self: shyft.energy_market.XyzPointCurve, z: float) shyft.energy_market.XyPointCurve
get the curve assigned to the value
- gradient(self: shyft.energy_market.XyzPointCurve, arg0: float, arg1: float) Annotated[list[float], FixedSize(2)]
- set_curve(self: shyft.energy_market.XyzPointCurve, z: float, xy: shyft.energy_market.XyPointCurve) None
Assign an XyzPointCurve to a z-value
- shyft.energy_market.core.compressed_size(*args, **kwargs)
Overloaded function.
compressed_size(double_vector: list[float], accuracy: float) -> int
compressed_size(float_vector: list[float], accuracy: float) -> int
- shyft.energy_market.core.points_from_x_y(x: list[float], y: list[float]) shyft.energy_market.XyPointList
- class shyft.energy_market.core.run_state
Bases:
pybind11_objectDescribes 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: int) None
- property name
- property value
- shyft.energy_market.core.downstream_reservoirs(component: shyft.energy_market.HydroComponent, max_dist: int = 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:
- shyft.energy_market.core.downstream_units(component: shyft.energy_market.HydroComponent, max_dist: int = 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:
- shyft.energy_market.core.upstream_reservoirs(component: shyft.energy_market.HydroComponent, max_dist: int = 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:
- shyft.energy_market.core.upstream_units(component: shyft.energy_market.HydroComponent, max_dist: int = 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:
- 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.
Shyft Energy Market detailed model
- class shyft.energy_market.stm.AbsoluteConstraint
Bases:
pybind11_objectA 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:
- property limit
The threshold related to the constraint
- Type:
- class shyft.energy_market.stm.ApplicationClient
Bases:
pybind11_object- __init__(self: shyft.energy_market.stm.ApplicationClient, host_port: str, timeout_ms: int, operation_timeout_ms: int = 0) None
- add_case(self: shyft.energy_market.stm.ApplicationClient, model_id: int, cse: shyft.energy_market.stm.StmCase) tuple[bool]
- add_task_ref(self: shyft.energy_market.stm.ApplicationClient, model_id: int, case_id: int, model_ref: shyft.energy_market.stm.StmModelRef) tuple[bool]
- get_case_by_id(self: shyft.energy_market.stm.ApplicationClient, model_id: int, case_id: int) tuple[shyft.energy_market.stm.StmCase]
- get_case_by_name(self: shyft.energy_market.stm.ApplicationClient, model_id: int, case_name: str) tuple[shyft.energy_market.stm.StmCase]
- get_layout_infos(self: shyft.energy_market.stm.ApplicationClient, model_ids: list[int], period: shyft.time_series.UtcPeriod | None) tuple[list[shyft.time_series.ModelInfo]]
- get_task_infos(self: shyft.energy_market.stm.ApplicationClient, model_ids: list[int], period: shyft.time_series.UtcPeriod | None) tuple[list[shyft.time_series.ModelInfo]]
- get_task_ref(self: shyft.energy_market.stm.ApplicationClient, model_id: int, case_id: int, model_key: str) tuple[shyft.energy_market.stm.StmModelRef]
- read_layout(self: shyft.energy_market.stm.ApplicationClient, model_id: int) tuple[shyft.energy_market.stm.LayoutInfo]
- read_layout_with_args(self: shyft.energy_market.stm.ApplicationClient, model_id: int, layout_name: str, args: str, store_layout: bool) tuple[shyft.energy_market.stm.LayoutInfo]
- read_layouts(self: shyft.energy_market.stm.ApplicationClient, model_ids: list[int]) tuple[list[shyft.energy_market.stm.LayoutInfo]]
- read_task(self: shyft.energy_market.stm.ApplicationClient, model_id: int) tuple[shyft.energy_market.stm.StmTask]
- read_tasks(self: shyft.energy_market.stm.ApplicationClient, model_ids: list[int]) tuple[list[shyft.energy_market.stm.StmTask]]
- remove_case_by_id(self: shyft.energy_market.stm.ApplicationClient, model_id: int, case_id: int) tuple[bool]
- remove_case_by_name(self: shyft.energy_market.stm.ApplicationClient, model_id: int, case_name: str) tuple[bool]
- remove_layout(self: shyft.energy_market.stm.ApplicationClient, model_id: int) tuple[bool]
- remove_task(self: shyft.energy_market.stm.ApplicationClient, model_id: int) tuple[bool]
- remove_task_ref(self: shyft.energy_market.stm.ApplicationClient, model_id: int, case_id: int, 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: int, args: str) tuple[bool]
- update_case(self: shyft.energy_market.stm.ApplicationClient, mode_id: int, case_: shyft.energy_market.stm.StmCase) tuple[()]
- update_layout_info(self: shyft.energy_market.stm.ApplicationClient, model_id: int | None, model_info: shyft.time_series.ModelInfo) tuple[bool]
- update_task_info(self: shyft.energy_market.stm.ApplicationClient, model_id: int | None, model_info: shyft.time_series.ModelInfo) tuple[bool]
- class shyft.energy_market.stm.ApplicationServer
Bases:
pybind11_object- __init__(self: shyft.energy_market.stm.ApplicationServer, ip: str, port: int, 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: int = 1000) None
- class shyft.energy_market.stm.Busbar
Bases:
pybind11_objectA hub connected by transmission lines
- class TsTriplet
Bases:
pybind11_objectDescribes .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: int, 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.
- 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
- 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
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.BusbarList) -> None
__init__(self: shyft.energy_market.stm.BusbarList, arg0: shyft.energy_market.stm.BusbarList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.BusbarList, arg0: 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.
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
extend(self: shyft.energy_market.stm.BusbarList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.BusbarList, i: int, x: shyft.energy_market.stm.Busbar) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.BusbarList) -> shyft.energy_market.stm.Busbar
Remove and return the last item
pop(self: shyft.energy_market.stm.BusbarList, i: int) -> 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
Bases:
CatchmentStm catchment.
- __init__(self: shyft.energy_market.stm.Catchment, uid: int, 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
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.CatchmentList) -> None
__init__(self: shyft.energy_market.stm.CatchmentList, arg0: list[shyft.energy_market.stm.Catchment]) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.CatchmentList, arg0: Iterable) -> None
- append(self: list[shyft.energy_market.stm.Catchment], x: shyft.energy_market.stm.Catchment) None
Add an item to the end of the list
- clear(self: list[shyft.energy_market.stm.Catchment]) None
Clear the contents
- extend(*args, **kwargs)
Overloaded function.
extend(self: list[shyft.energy_market.stm.Catchment], L: list[shyft.energy_market.stm.Catchment]) -> None
Extend the list by appending all the items in the given list
extend(self: list[shyft.energy_market.stm.Catchment], L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: list[shyft.energy_market.stm.Catchment], i: int, x: shyft.energy_market.stm.Catchment) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: list[shyft.energy_market.stm.Catchment]) -> shyft.energy_market.stm.Catchment
Remove and return the last item
pop(self: list[shyft.energy_market.stm.Catchment], i: int) -> shyft.energy_market.stm.Catchment
Remove and return the item at index
i
- size(self: list[shyft.energy_market.stm.Catchment]) int
- class shyft.energy_market.stm.Contract
Bases:
pybind11_objectA 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_objectContract.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 ContractRelation
Bases:
pybind11_objectA 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
The related contract
- Type:
- property relation_type
Free to use integer to describe relation type
- Type:
_u16
- class ContractRelationList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.Contract.ContractRelationList) -> None
__init__(self: shyft.energy_market.stm.Contract.ContractRelationList, arg0: shyft.energy_market.stm.Contract.ContractRelationList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.Contract.ContractRelationList, arg0: 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.
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
extend(self: shyft.energy_market.stm.Contract.ContractRelationList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.Contract.ContractRelationList, i: int, x: shyft.energy_market.stm.Contract.ContractRelation) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.Contract.ContractRelationList) -> shyft.energy_market.stm.Contract.ContractRelation
Remove and return the last item
pop(self: shyft.energy_market.stm.Contract.ContractRelationList, i: int) -> 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: int, name: str, json: str, sys: shyft.energy_market.stm.StmSystem) None
- property active
Contract status (dead/alive).
- Type:
_ts
- add_relation(self: shyft.energy_market.stm.Contract, id: int, contract: shyft.energy_market.stm.Contract, relation_type: int) 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 constraint
Constrant of this contract.
- Type:
- 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 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_
- 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:
- 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:
- 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 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:
- class shyft.energy_market.stm.ContractList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.ContractList) -> None
__init__(self: shyft.energy_market.stm.ContractList, arg0: shyft.energy_market.stm.ContractList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.ContractList, arg0: 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.
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
extend(self: shyft.energy_market.stm.ContractList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.ContractList, i: int, x: shyft.energy_market.stm.Contract) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.ContractList) -> shyft.energy_market.stm.Contract
Remove and return the last item
pop(self: shyft.energy_market.stm.ContractList, i: int) -> 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
Bases:
pybind11_objectStm 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: int, 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
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.ContractPortfolioList) -> None
__init__(self: shyft.energy_market.stm.ContractPortfolioList, arg0: shyft.energy_market.stm.ContractPortfolioList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.ContractPortfolioList, arg0: 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.
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
extend(self: shyft.energy_market.stm.ContractPortfolioList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.ContractPortfolioList, i: int, x: shyft.energy_market.stm.ContractPortfolio) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.ContractPortfolioList) -> shyft.energy_market.stm.ContractPortfolio
Remove and return the last item
pop(self: shyft.energy_market.stm.ContractPortfolioList, i: int) -> 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
Bases:
pybind11_objectClient 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: int, operation_timeout_ms: int = 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 = [not-valid-period>) 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 = [not-valid-period>) 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: list[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:
Requested model
- Return type:
- 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:
- get_ts(self: shyft.energy_market.stm.DStmClient, mid: str, ts_urls: list[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:
- 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: list[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: list[tuple[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]]) 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: list[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
Bases:
pybind11_objectA server object serving distributed, ‘live’ STM systems. The server contains an DTSS that handles time series for the models stored in the server.
- __init__(self: shyft.energy_market.stm.DStmServer, j_config: shyft.energy_market.stm.JanitorConfig = JanitorConfig(duration='1970-01-01T00:00:10Z', stale_threshold='1970-01-01T00:00:30Z'), 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
- 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: 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:
- 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
- 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
Clear master-slave mode if set, cleanly shut down connection to master dtss.
- 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
- create_model(self: shyft.energy_market.stm.DStmServer, mid: str) bool
Create a new model
- Parameters:
mid (str) – ID of new model
- Returns:
Empty model with ID set to ‘mid’
- Return type:
- Raises:
RuntimeError – If ‘mid’ already is ID of a model
- 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 = [not-valid-period>) 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:
Found system
- Return type:
- 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:
- 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: list[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: list[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: list[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: int) 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: int, master_poll_time: float, unsubscribe_threshold: int, unsubscribe_max_delay: float) None
Set master-slave mode, redirecting all IO calls on this dtss to the master ip:port dtss. This instance of the dtss is kept in sync with changes done on the master using subscription to changes on the master Calculations, and caches are still done locally unloading the computational efforts from the master.
- Parameters:
ip (str) – The ip address where the master dtss is running
port (int) – The port number for the master dtss
master_poll_time (time) – [s] max time between each update from master, typicall 0.1 s is ok
unsubscribe_threshold (int) – minimum number of unsubscribed time-series before also unsubscribing from the master
unsubscribe_max_delay (time) – maximum time to delay unsubscriptions, regardless number
- start_server(self: shyft.energy_market.stm.DStmServer) int
- start_web_api(self: shyft.energy_market.stm.DStmServer, host_ip: str, port: int, doc_root: str, fg_threads: int = 2, bg_threads: int = 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: int = 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.Gate
Bases:
GateStm gate.
- class Discharge
Bases:
pybind11_objectAttribute collection
- class Constraints
Bases:
pybind11_objectAttribute 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:
- 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_objectAttribute collection
- class Constraints
Bases:
pybind11_objectConstraint 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:
- 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: int, 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
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.GateList) -> None
__init__(self: shyft.energy_market.stm.GateList, arg0: list[shyft.energy_market.stm.Gate]) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.GateList, arg0: Iterable) -> None
- append(self: list[shyft.energy_market.stm.Gate], x: shyft.energy_market.stm.Gate) None
Add an item to the end of the list
- clear(self: list[shyft.energy_market.stm.Gate]) None
Clear the contents
- extend(*args, **kwargs)
Overloaded function.
extend(self: list[shyft.energy_market.stm.Gate], L: list[shyft.energy_market.stm.Gate]) -> None
Extend the list by appending all the items in the given list
extend(self: list[shyft.energy_market.stm.Gate], L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: list[shyft.energy_market.stm.Gate], i: int, x: shyft.energy_market.stm.Gate) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: list[shyft.energy_market.stm.Gate]) -> shyft.energy_market.stm.Gate
Remove and return the last item
pop(self: list[shyft.energy_market.stm.Gate], i: int) -> shyft.energy_market.stm.Gate
Remove and return the item at index
i
- size(self: list[shyft.energy_market.stm.Gate]) int
- class shyft.energy_market.stm.HpsClient
Bases:
pybind11_objectThe client api for the hydro-power-system repostory server.
- __init__(self: shyft.energy_market.stm.HpsClient, host_port: str, timeout_ms: int, operation_timeout_ms: int = 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: list[int], created_in: shyft.time_series.UtcPeriod = [not-valid-period>) 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: int) 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:
The resulting model from the server
- Return type:
- read_models(self: shyft.energy_market.stm.HpsClient, mids: list[int]) 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:
The resulting model from the server
- Return type:
- 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: int) 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
- property timeout_ms
Timout for remote server operations, in number milliseconds.
- Type:
int
- update_model_info(self: shyft.energy_market.stm.HpsClient, mid: int, 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
Bases:
pybind11_objectThe server-side component for the hydro-power-system model repository.
- __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: list[int], created_in: shyft.time_series.UtcPeriod = [not-valid-period>) 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: int) 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:
The resulting model from the server
- Return type:
- read_model_blob(self: shyft.energy_market.stm.HpsServer, mid: int) list[str]
Read and return the model blob for specified model-identifier (mid)
- Parameters:
mid (int) – the model-identifer for the wanted model
- Returns:
The resulting blob model from the server
- Return type:
ByteVector
- read_models(self: shyft.energy_market.stm.HpsServer, mids: list[int]) 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:
The resulting model from the server
- Return type:
- remove_model(self: shyft.energy_market.stm.HpsServer, mid: int) 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: int) 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: int) 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: int = 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
- update_model_info(self: shyft.energy_market.stm.HpsServer, mid: int, 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
Bases:
HydroPowerSystemA 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.
- __init__(self: shyft.energy_market.stm.HydroPowerSystem, uid: int, name: str) None
Create hydro power system with unique uid.
- create_aggregate(self: shyft.energy_market.stm.HydroPowerSystem, uid: int, name: str, json: str = '') shyft.energy_market.stm.Unit
Create stm unit.
- Returns:
unit. The new unit.
- Return type:
- create_catchment(self: shyft.energy_market.stm.HydroPowerSystem, uid: int, name: str, json: str = '') shyft.energy_market.stm.Catchment
Create stm catchment .
- Returns:
catchment. The new catchment.
- Return type:
- create_gate(self: shyft.energy_market.stm.HydroPowerSystem, uid: int, name: str, json: str = '') shyft.energy_market.stm.Gate
Create stm gate.
- Returns:
gate. The new gate.
- Return type:
- create_power_plant(self: shyft.energy_market.stm.HydroPowerSystem, uid: int, name: str, json: str = '') shyft.energy_market.stm.PowerPlant
Create stm power plant that keeps units.
- Returns:
power_plant. The new PowerPlant.
- Return type:
- create_reservoir(self: shyft.energy_market.stm.HydroPowerSystem, uid: int, name: str, json: str = '') shyft.energy_market.stm.Reservoir
Create stm reservoir with unique uid.
- Returns:
reservoir. The new reservoir.
- Return type:
- create_reservoir_aggregate(self: shyft.energy_market.stm.HydroPowerSystem, uid: int, name: str, json: str = '') shyft.energy_market.stm.ReservoirAggregate
Create stm reservoir aggregate with unique uid.
- Returns:
reservoir_aggregate. The new ReservoirAggregate.
- Return type:
- create_river(self: shyft.energy_market.stm.HydroPowerSystem, uid: int, name: str, json: str = '') shyft.energy_market.stm.Waterway
Create stm waterway (a tunnel or river).
- Returns:
waterway. The new waterway.
- Return type:
- create_tunnel(self: shyft.energy_market.stm.HydroPowerSystem, uid: int, name: str, json: str = '') shyft.energy_market.stm.Waterway
Create stm waterway (a tunnel or river).
- Returns:
waterway. The new waterway.
- Return type:
- create_unit(self: shyft.energy_market.stm.HydroPowerSystem, uid: int, name: str, json: str = '') shyft.energy_market.stm.Unit
Create stm unit.
- Returns:
unit. The new unit.
- Return type:
- create_waterway(self: shyft.energy_market.stm.HydroPowerSystem, uid: int, name: str, json: str = '') shyft.energy_market.stm.Waterway
Create stm waterway (a tunnel or river).
- Returns:
waterway. The new waterway.
- Return type:
- property custom
- find_catchment_by_id(self: shyft.energy_market.stm.HydroPowerSystem, arg0: int) 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: int) 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: int) 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: int) 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: int) 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: int) 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: int) 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:
- 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:
- 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:
- 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
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.HydroPowerSystemList) -> None
__init__(self: shyft.energy_market.stm.HydroPowerSystemList, arg0: shyft.energy_market.stm.HydroPowerSystemList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.HydroPowerSystemList, arg0: 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.
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
extend(self: shyft.energy_market.stm.HydroPowerSystemList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.HydroPowerSystemList, i: int, x: shyft.energy_market.stm.HydroPowerSystem) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.HydroPowerSystemList) -> shyft.energy_market.stm.HydroPowerSystem
Remove and return the last item
pop(self: shyft.energy_market.stm.HydroPowerSystemList, i: int) -> 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
Bases:
pybind11_objectA 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.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.JanitorConfig) -> None
__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
Bases:
pybind11_objectProvides layout information that can be leveraged by a renderer.
- __init__(self: shyft.energy_market.stm.LayoutInfo, id: int, 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
Bases:
pybind11_objectA log entry.
- __init__(self: shyft.energy_market.stm.LogEntry) None
- property code
- property message
- property severity
- property time
- class shyft.energy_market.stm.LogSeverity
Bases:
pybind11_objectLog 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: int) None
- property name
- property value
- class shyft.energy_market.stm.ManagedServerState
Bases:
pybind11_objectDescribes 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: int) None
- property name
- property value
- class shyft.energy_market.stm.MarketArea
Bases:
pybind11_objectA 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_objectdescribes 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_
- class TsTriplet
Bases:
pybind11_objectdescribes .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_objectdescribes .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: int, 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: int, 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:
- property custom
- 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 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:
- 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:
- property ts
- class shyft.energy_market.stm.MarketAreaList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.MarketAreaList) -> None
__init__(self: shyft.energy_market.stm.MarketAreaList, arg0: shyft.energy_market.stm.MarketAreaList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.MarketAreaList, arg0: 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.
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
extend(self: shyft.energy_market.stm.MarketAreaList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.MarketAreaList, i: int, x: shyft.energy_market.stm.MarketArea) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.MarketAreaList) -> shyft.energy_market.stm.MarketArea
Remove and return the last item
pop(self: shyft.energy_market.stm.MarketAreaList, i: int) -> 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
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.ModelRefList) -> None
__init__(self: shyft.energy_market.stm.ModelRefList, arg0: shyft.energy_market.stm.ModelRefList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.ModelRefList, arg0: 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.
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
extend(self: shyft.energy_market.stm.ModelRefList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.ModelRefList, i: int, x: shyft.energy_market.stm.StmModelRef) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.ModelRefList) -> shyft.energy_market.stm.StmModelRef
Remove and return the last item
pop(self: shyft.energy_market.stm.ModelRefList, i: int) -> 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
Bases:
pybind11_objectDescribes 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: int) None
- property name
- property value
- class shyft.energy_market.stm.Network
Bases:
pybind11_objectA network consisting of busbars and transmission lines.
- __init__(self: shyft.energy_market.stm.Network, uid: int, name: str, json: str, sys: shyft.energy_market.stm.StmSystem) None
- property busbars
List of busbars.
- Type:
- create_busbar(self: shyft.energy_market.stm.Network, uid: int, name: str, json: str = '') shyft.energy_market.stm.Busbar
Create stm busbar with unique uid.
- Returns:
busbar. The new busbar.
- Return type:
- create_transmission_line(self: shyft.energy_market.stm.Network, uid: int, 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:
- 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:
- property ts
- class shyft.energy_market.stm.NetworkList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.NetworkList) -> None
__init__(self: shyft.energy_market.stm.NetworkList, arg0: shyft.energy_market.stm.NetworkList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.NetworkList, arg0: 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.
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
extend(self: shyft.energy_market.stm.NetworkList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.NetworkList, i: int, x: shyft.energy_market.stm.Network) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.NetworkList) -> shyft.energy_market.stm.Network
Remove and return the last item
pop(self: shyft.energy_market.stm.NetworkList, i: int) -> 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_objectA grouping of time-series related to a constraint with a penalty cost
- __init__(*args, **kwargs)
- property cost
The cost of violating the constraint
- Type:
- property flag
Flag indicating whether the constraint is active or not
- Type:
- property limit
The threshold related to the constraint
- Type:
- property penalty
Incurred cost of violating the constraint
- Type:
- class shyft.energy_market.stm.PowerModule
Bases:
pybind11_objectA power module representing consumption.
- class Power
Bases:
pybind11_objectUnit.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: int, 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 system
The owner of this object.
- property tag
Url tag.
- Type:
str
- property ts
- class shyft.energy_market.stm.PowerModuleList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.PowerModuleList) -> None
__init__(self: shyft.energy_market.stm.PowerModuleList, arg0: shyft.energy_market.stm.PowerModuleList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.PowerModuleList, arg0: 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.
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
extend(self: shyft.energy_market.stm.PowerModuleList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.PowerModuleList, i: int, x: shyft.energy_market.stm.PowerModule) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.PowerModuleList) -> shyft.energy_market.stm.PowerModule
Remove and return the last item
pop(self: shyft.energy_market.stm.PowerModuleList, i: int) -> 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_objectA 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:
- class shyft.energy_market.stm.PowerPlant
Bases:
PowerPlantA 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_objectDescribes 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_objectAttribute 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_objectDescribes 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_objectAttribute 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_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: int, 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:
- property custom
- 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:
- property reserve
Reserve attributes.
- Type:
_Reserve
- property tag
Url tag.
- Type:
str
- property ts
Unavailability, time series.
- Type:
_ts
- class shyft.energy_market.stm.PowerPlantList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.PowerPlantList) -> None
__init__(self: shyft.energy_market.stm.PowerPlantList, arg0: shyft.energy_market.stm.PowerPlantList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.PowerPlantList, arg0: 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.
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
extend(self: shyft.energy_market.stm.PowerPlantList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.PowerPlantList, i: int, x: shyft.energy_market.stm.PowerPlant) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.PowerPlantList) -> shyft.energy_market.stm.PowerPlant
Remove and return the last item
pop(self: shyft.energy_market.stm.PowerPlantList, i: int) -> 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
Bases:
ReservoirStm 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:
- 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:
- property min
[masl],[money] Tactical minimum volume constraint.
- Type:
- __init__(*args, **kwargs)
- property max
[m3] Volume constraint maximum, time series.
- Type:
_ts
- property min
[m3] Volume constraint minimum, time series.
- Type:
_ts
- 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
- 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:
- 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 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
- __init__(self: shyft.energy_market.stm.Reservoir, uid: int, 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 json
- property level
Level attributes.
- Type:
_Level
- property name
- property obj
a python object
- Type:
object
- property tag
Url tag.
- Type:
str
- property ts
- property volume_level_mapping
Volume capacity description, time-dependent x=[masl], y=[m3].
- Type:
_t_xy_
- property water_value
water-value attributes.
- Type:
- class shyft.energy_market.stm.ReservoirAggregate
Bases:
pybind11_objectA reservoir_aggregate keeping stm reservoirs.
After creating the reservoirs, create the reservoir aggregate, and add the reservoirs to it.
- class Inflow
Bases:
pybind11_objectAttribute 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_objectAttribute collection
- class Constraints
Bases:
pybind11_objectAttribute 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:
- 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: int, 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 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
- class shyft.energy_market.stm.ReservoirAggregateList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.ReservoirAggregateList) -> None
__init__(self: shyft.energy_market.stm.ReservoirAggregateList, arg0: list[shyft.energy_market.stm.ReservoirAggregate]) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.ReservoirAggregateList, arg0: Iterable) -> None
- append(self: list[shyft.energy_market.stm.ReservoirAggregate], x: shyft.energy_market.stm.ReservoirAggregate) None
Add an item to the end of the list
- clear(self: list[shyft.energy_market.stm.ReservoirAggregate]) None
Clear the contents
- extend(*args, **kwargs)
Overloaded function.
extend(self: list[shyft.energy_market.stm.ReservoirAggregate], L: list[shyft.energy_market.stm.ReservoirAggregate]) -> None
Extend the list by appending all the items in the given list
extend(self: list[shyft.energy_market.stm.ReservoirAggregate], L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: list[shyft.energy_market.stm.ReservoirAggregate], i: int, x: shyft.energy_market.stm.ReservoirAggregate) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: list[shyft.energy_market.stm.ReservoirAggregate]) -> shyft.energy_market.stm.ReservoirAggregate
Remove and return the last item
pop(self: list[shyft.energy_market.stm.ReservoirAggregate], i: int) -> shyft.energy_market.stm.ReservoirAggregate
Remove and return the item at index
i
- size(self: list[shyft.energy_market.stm.ReservoirAggregate]) int
- class shyft.energy_market.stm.ReservoirList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.ReservoirList) -> None
__init__(self: shyft.energy_market.stm.ReservoirList, arg0: shyft.energy_market.stm.ReservoirList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.ReservoirList, arg0: 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.
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
extend(self: shyft.energy_market.stm.ReservoirList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.ReservoirList, i: int, x: shyft.energy_market.stm.Reservoir) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.ReservoirList) -> shyft.energy_market.stm.Reservoir
Remove and return the last item
pop(self: shyft.energy_market.stm.ReservoirList, i: int) -> 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_objectA 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
- class shyft.energy_market.stm.ServerStatus
Bases:
pybind11_objectStatus of a managed compute server
- __init__(*args, **kwargs)
- property address
- property last_send
- property model_id
- property state
- class shyft.energy_market.stm.ShopCommand
Bases:
pybind11_objectA 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.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.ShopCommand, command: str) -> None
Create from a single string in shop command language syntax.
__init__(self: shyft.energy_market.stm.ShopCommand, keyword: str, specifier: str, options: list[str], objects: list[str]) -> None
Create from individual components.
- property keyword
keyword of the command
- static log_file(*args, **kwargs)
Overloaded function.
log_file() -> shyft.energy_market.stm.ShopCommand
Shop command string ‘log file’.
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: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /all <value>’.
- static penalty_cost_discharge(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /discharge <value>’.
- static penalty_cost_gate_ramping(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /gate /ramping <value>’.
- static penalty_cost_load(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /load <value>’.
- static penalty_cost_overflow(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /overflow <value>’.
- static penalty_cost_overflow_time_adjust(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /overflow_time_adjust <value>’.
- static penalty_cost_powerlimit(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /powerlimit <value>’.
- static penalty_cost_reserve(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /reserve <value>’.
- static penalty_cost_reservoir_endpoint(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /reservoir /endpoint <value>’.
- static penalty_cost_reservoir_ramping(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /reservoir /ramping <value>’.
- static penalty_cost_soft_p_penalty(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /soft_p_penalty <value>’.
- static penalty_cost_soft_q_penalty(value: float) 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.
print_pqcurves_all() -> shyft.energy_market.stm.ShopCommand
Shop command string ‘print pqcurves /all’.
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.
print_pqcurves_convex() -> shyft.energy_market.stm.ShopCommand
Shop command string ‘print pqcurves /convex’.
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.
print_pqcurves_final() -> shyft.energy_market.stm.ShopCommand
Shop command string ‘print pqcurves /final’.
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.
print_pqcurves_original() -> shyft.energy_market.stm.ShopCommand
Shop command string ‘print pqcurves /original’.
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: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set capacity /all <value>’.
- static set_capacity_bypass(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set capacity /bypass <value>’.
- static set_capacity_gate(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set capacity /gate <value>’.
- static set_capacity_spill(value: float) 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: int) shyft.energy_market.stm.ShopCommand
Shop command string ‘set com_dec_period <value>’.
- static set_droop_discretization_limit(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set droop_discretization_limit <value>’.
- static set_dyn_flex_mip(value: int) 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: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set fcr_d_band <value>’.
- static set_fcr_n_band(value: float) 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: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set gen_turn_off_limit <value>’.
- static set_headopt_feedback(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set headopt_feedback <value>’.
- static set_max_num_threads(value: int) 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: float) 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: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set nseg /all <value>’.
- static set_nseg_down(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set nseg /down <value>’.
- static set_nseg_up(value: float) 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: int) shyft.energy_market.stm.ShopCommand
Shop command string ‘set ramping <value>’.
- static set_reserve_ramping_cost(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set reserve_ramping_cost <value>’.
- static set_reserve_slack_cost(value: float) 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: int) 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: int) shyft.energy_market.stm.ShopCommand
Shop command string ‘start sim <iterations>’.
- class shyft.energy_market.stm.StmCase
Bases:
pybind11_objectProvided 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.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.StmCase) -> None
__init__(self: shyft.energy_market.stm.StmCase, id: int, name: str, created: shyft.time_series.time, json: str = ‘’, labels: list[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.
- 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:
- 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
Bases:
pybind11_objectThe client api for the stm repository server.
- __init__(self: shyft.energy_market.stm.StmClient, host_port: str, timeout_ms: int, operation_timeout_ms: int = 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: list[int], created_in: shyft.time_series.UtcPeriod = [not-valid-period>) 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: int) 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:
The resulting model from the server
- Return type:
- read_models(self: shyft.energy_market.stm.StmClient, mids: list[int]) 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:
The resulting model from the server
- Return type:
- 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: int) 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
- property timeout_ms
Timout for remote server operations, in number milliseconds.
- Type:
int
- update_model_info(self: shyft.energy_market.stm.StmClient, mid: int, 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
Bases:
pybind11_objectReference to a model, and where to find it.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.StmModelRef) -> None
__init__(self: shyft.energy_market.stm.StmModelRef, host: str, port_num: int, api_port_num: int, model_key: str, stm_key: int = 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
__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
Bases:
pybind11_objectDescribes 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: int) None
- property name
- property value
- class shyft.energy_market.stm.StmServer
Bases:
pybind11_objectThe server-side component for the stm energy_market model repository.
- __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: list[int], created_in: shyft.time_series.UtcPeriod = [not-valid-period>) 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: int) 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:
The resulting model from the server
- Return type:
- read_model_blob(self: shyft.energy_market.stm.StmServer, mid: int) list[str]
Read and return the model blob for specified model-identifier (mid)
- Parameters:
mid (int) – the model-identifer for the wanted model
- Returns:
The resulting blob model from the server
- Return type:
ByteVector
- read_models(self: shyft.energy_market.stm.StmServer, mids: list[int]) 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:
The resulting model from the server
- Return type:
- remove_model(self: shyft.energy_market.stm.StmServer, mid: int) 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: int) 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: int) 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: int = 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
- update_model_info(self: shyft.energy_market.stm.StmServer, mid: int, 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
Bases:
pybind11_objectA complete stm system, with market areas, and hydro power systems.
- __init__(self: shyft.energy_market.stm.StmSystem, uid: int, name: str, json: str = '') None
Create stm system.
- add_unit_group(self: shyft.energy_market.stm.StmSystem, id: int, 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:
- property contract_portfolios
- property contracts
- create_hydro_power_system(self: shyft.energy_market.stm.StmSystem, uid: int, 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:
- create_market_area(self: shyft.energy_market.stm.StmSystem, uid: int, 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:
- create_network(self: shyft.energy_market.stm.StmSystem, uid: int, name: str, json: str = '') shyft.energy_market.stm.Network
Create stm network with unique uid.
- Returns:
network. The new network.
- Return type:
- create_power_module(self: shyft.energy_market.stm.StmSystem, uid: int, 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:
- create_wind_farm(self: shyft.energy_market.stm.StmSystem, uid: int, name: str, json: str = '') shyft.energy_market.stm.WindFarm
Create stm network with unique uid.
- Returns:
wind_farm. The new wind farm.
- Return type:
- property custom
- fix_uplinks(self: shyft.energy_market.stm.StmSystem) bool
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:
- 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:
- 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: list[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 | 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 | None
Set an attribute specified by url.
- set_attrs(self: shyft.energy_market.stm.StmSystem, attrs: list[tuple[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]]) 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
Bases:
pybind11_objectTask 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.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.StmTask) -> None
__init__(self: shyft.energy_market.stm.StmTask, id: int, name: str, created: shyft.time_series.time, json: str = ‘’, labels: list[str] = [], cases: list[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:
- property cases
Set of runs connected to task.
- Type:
StmCaseVector
- get_case(*args, **kwargs)
Overloaded function.
get_case(self: shyft.energy_market.stm.StmTask, cid: int) -> 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:
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:
- 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.
remove_case(self: shyft.energy_market.stm.StmTask, id: int) -> bool
Remove a case from task based on id.
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
Bases:
pybind11_objectThe client api for the Stm Task repository.
- __init__(self: shyft.energy_market.stm.StmTaskClient, host_port: str, timeout_ms: int, operation_timeout_ms: int = 0) None
Creates a python client that can communicate with the corresponding server
- add_case(self: shyft.energy_market.stm.StmTaskClient, mid: int, case: shyft.energy_market.stm.StmCase) None
Add a case to a task on 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 provided case has the same id or name as a case already in task.
- add_model_ref(self: shyft.energy_market.stm.StmTaskClient, mid: int, cid: int, 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: int, fx_arg: str) bool
Execute the serverside fx, passing supplied arguments.
- Parameters:
mid (str) – ID of task 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_case(*args, **kwargs)
Overloaded function.
get_case(self: shyft.energy_market.stm.StmTaskClient, mid: int, cid: int) -> 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:
get_case(self: shyft.energy_market.stm.StmTaskClient, mid: int, 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: list[int], created_in: shyft.time_series.UtcPeriod = [not-valid-period>) 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: int, cid: int, 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 requested model reference.
- Return type:
- 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: int) 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:
The resulting model from the server
- Return type:
- read_models(self: shyft.energy_market.stm.StmTaskClient, mids: list[int]) 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:
The resulting model from the server
- Return type:
- property reconnect_count
Number of reconnects to the remote server that have been performed.
- Type:
int
- remove_case(*args, **kwargs)
Overloaded function.
remove_case(self: shyft.energy_market.stm.StmTaskClient, mid: int, cid: int) -> 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 task.
- Return type:
Boolean
remove_case(self: shyft.energy_market.stm.StmTaskClient, mid: int, 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 case was successfully removed from task.
- Return type:
Boolean
- remove_model(self: shyft.energy_market.stm.StmTaskClient, mid: int) 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: int, cid: int, 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
- property timeout_ms
Timout for remote server operations, in number milliseconds.
- Type:
int
- update_case(self: shyft.energy_market.stm.StmTaskClient, mid: int, case: shyft.energy_market.stm.StmCase) None
- Parameters:
mid (int) – Task ID.
case (StmCase) – Case to be updated inplace within task.
- update_model_info(self: shyft.energy_market.stm.StmTaskClient, mid: int, 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: int, cid: int, 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
Bases:
pybind11_objectThe server-side component for the STM Task repository.
- __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: list[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 web-api) invoke 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 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: list[int], created_in: shyft.time_series.UtcPeriod = [not-valid-period>) 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: int) 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:
The resulting model from the server
- Return type:
- read_model_blob(self: shyft.energy_market.stm.StmTaskServer, mid: int) 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:
The resulting blob model from the server
- Return type:
ByteVector
- read_models(self: shyft.energy_market.stm.StmTaskServer, mids: list[int]) 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:
The resulting model from the server
- Return type:
- remove_auth_tokens(self: shyft.energy_market.stm.StmTaskServer, tokens: list[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: int) 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: int) 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: int) 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: int, doc_root: str, fg_threads: int = 2, bg_threads: int = 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: int = 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
- update_model_info(self: shyft.energy_market.stm.StmTaskServer, mid: int, 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
Bases:
pybind11_objectA transmission line connecting two busbars.
- __init__(self: shyft.energy_market.stm.TransmissionLine, uid: int, 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.
- 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 name
- property network
The owner of this object.
- property obj
a python object
- Type:
object
- property tag
Url tag.
- Type:
str
- property ts
- class shyft.energy_market.stm.TransmissionLineList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.TransmissionLineList) -> None
__init__(self: shyft.energy_market.stm.TransmissionLineList, arg0: shyft.energy_market.stm.TransmissionLineList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.TransmissionLineList, arg0: 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.
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
extend(self: shyft.energy_market.stm.TransmissionLineList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.TransmissionLineList, i: int, x: shyft.energy_market.stm.TransmissionLine) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.TransmissionLineList) -> shyft.energy_market.stm.TransmissionLine
Remove and return the last item
pop(self: shyft.energy_market.stm.TransmissionLineList, i: int) -> 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
Bases:
pybind11_objectTs evaluation error
- __init__(self: shyft.energy_market.stm.TsEvaluationError) None
- property what
- class shyft.energy_market.stm.Unit
Bases:
UnitStm unit (turbine and generator assembly).
- class BestProfit
Bases:
pybind11_objectDescribes 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_objectUnit.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_objectUnit.Discharge attributes, flow[m3/s].
- class Constraint
Bases:
pybind11_objectConstraints 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:
- 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_objectUnit.Production attributes, effect[W].
- class Constraint
Bases:
pybind11_objectContains 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:
- 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_objectDescribes 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_objectContains the pump constraints.
- __init__(*args, **kwargs)
- property min_downstream_level
[masl] Minimum level downstream pump.
- Type:
_ts
- class Reserve
Bases:
pybind11_objectUnit.Reserve contains all operational reserve related attributes.
- class FcrDroop
Bases:
pybind11_objectPer 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_objectDescribes the up and down pair of reserve specification.
- __init__(*args, **kwargs)
- class Spec
Bases:
pybind11_objectDescribes 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_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_mip
FCR flag.
- Type:
_ts
- 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 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
- __init__(self: shyft.energy_market.stm.Unit, uid: int, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem) None
- property best_profit
BP curves.
- Type:
- property custom
- 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:
- property production_discharge_relation
PQ curves.
- property pump_constraint
Pump constraint attributes.
- Type:
- property pump_description
Time-dependent description of pump efficiency.
- Type:
_t_xy_z_list
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 tag
Url tag.
- Type:
str
- property ts
- property turbine_description
Time-dependent description of turbine efficiency.
- Type:
_turbine_description
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_objectA 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_objectThis 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_objectA 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
- class MemberList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.UnitGroup.MemberList) -> None
__init__(self: shyft.energy_market.stm.UnitGroup.MemberList, arg0: shyft.energy_market.stm.UnitGroup.MemberList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.UnitGroup.MemberList, arg0: 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.
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
extend(self: shyft.energy_market.stm.UnitGroup.MemberList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.UnitGroup.MemberList, i: int, x: shyft.energy_market.stm.UnitGroup.Member) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.UnitGroup.MemberList) -> shyft.energy_market.stm.UnitGroup.Member
Remove and return the last item
pop(self: shyft.energy_market.stm.UnitGroup.MemberList, i: int) -> 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_objectThis 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:
- 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:
- property members
unit group members
- Type:
- property name
- property obj
a python object
- Type:
object
- property obligation
Obligation schedule, cost, results and penalty.
- Type:
- 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
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.UnitGroupList) -> None
__init__(self: shyft.energy_market.stm.UnitGroupList, arg0: shyft.energy_market.stm.UnitGroupList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.UnitGroupList, arg0: 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.
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
extend(self: shyft.energy_market.stm.UnitGroupList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.UnitGroupList, i: int, x: shyft.energy_market.stm.UnitGroup) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.UnitGroupList) -> shyft.energy_market.stm.UnitGroup
Remove and return the last item
pop(self: shyft.energy_market.stm.UnitGroupList, i: int) -> 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
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.UnitList) -> None
__init__(self: shyft.energy_market.stm.UnitList, arg0: shyft.energy_market.stm.UnitList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.UnitList, arg0: 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.
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
extend(self: shyft.energy_market.stm.UnitList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.UnitList, i: int, x: shyft.energy_market.stm.Unit) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.UnitList) -> shyft.energy_market.stm.Unit
Remove and return the last item
pop(self: shyft.energy_market.stm.UnitList, i: int) -> 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_objectA 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
- class shyft.energy_market.stm.UrlResolveError
Bases:
pybind11_objectUrl resolve error
- __init__(*args, **kwargs)
- property what
- class shyft.energy_market.stm.Waterway
Bases:
WaterwayStm waterway.
- class Discharge
Bases:
pybind11_objectAttribute collection
- class Constraints
Bases:
pybind11_objectThe 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_objectAttribute collection
- class Costs
Bases:
pybind11_objectAttribute 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_objectAttribute 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)
- __init__(*args, **kwargs)
- property constraint
Discharge constraint attributes
- Type:
- 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_objectAttribute collection
- class DeltaMeter
Bases:
pybind11_objectDelta 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:
- property upstream_ref
[m3/s] Discharge constraint min flow.
- Type:
_t_xy
- class Geometry
Bases:
pybind11_objectAttribute 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: int, name: str, json: str, hps: shyft.energy_market.stm.HydroPowerSystem) None
- add_gate(*args, **kwargs)
Overloaded function.
add_gate(self: shyft.energy_market.stm.Waterway, uid: int, name: str, json: str = ‘’) -> shyft.energy_market.stm.Gate
Create and add a new gate to the waterway.
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
- flattened_attributes(self: shyft.energy_market.stm.Waterway) dict
Flat dict containing all component attributes.
- property flow_description
Flow describing attributes.
- Type:
- 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
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.WaterwayList) -> None
__init__(self: shyft.energy_market.stm.WaterwayList, arg0: list[shyft.energy_market.stm.Waterway]) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.WaterwayList, arg0: Iterable) -> None
- append(self: list[shyft.energy_market.stm.Waterway], x: shyft.energy_market.stm.Waterway) None
Add an item to the end of the list
- clear(self: list[shyft.energy_market.stm.Waterway]) None
Clear the contents
- extend(*args, **kwargs)
Overloaded function.
extend(self: list[shyft.energy_market.stm.Waterway], L: list[shyft.energy_market.stm.Waterway]) -> None
Extend the list by appending all the items in the given list
extend(self: list[shyft.energy_market.stm.Waterway], L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: list[shyft.energy_market.stm.Waterway], i: int, x: shyft.energy_market.stm.Waterway) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: list[shyft.energy_market.stm.Waterway]) -> shyft.energy_market.stm.Waterway
Remove and return the last item
pop(self: list[shyft.energy_market.stm.Waterway], i: int) -> shyft.energy_market.stm.Waterway
Remove and return the item at index
i
- size(self: list[shyft.energy_market.stm.Waterway]) int
- class shyft.energy_market.stm.WindFarm
Bases:
pybind11_objectA 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_objectWindFarm.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_objectWindFarm.production attributes, amount power produced[W].
- class Constraint
Bases:
pybind11_objectContains 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:
- 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_objectWindFarm.Reserve contains all operational reserve related attributes.
- class Pair
Bases:
pybind11_objectDescribes the up and down pair of reserve specification.
- __init__(*args, **kwargs)
- class Spec
Bases:
pybind11_objectDescribes 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)
- __init__(self: shyft.energy_market.stm.WindFarm, uid: int, name: str, json: str, sys: shyft.energy_market.stm.StmSystem) None
- add_wind_turbines(self: shyft.energy_market.stm.WindFarm, wind_turbines: list[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.
- create_wind_turbine(self: shyft.energy_market.stm.WindFarm, id: int, 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:
- 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:
- property system
The owner of this object.
- property tag
Url tag.
- Type:
str
- property ts
[] 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:
- class shyft.energy_market.stm.WindFarmList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.WindFarmList) -> None
__init__(self: shyft.energy_market.stm.WindFarmList, arg0: shyft.energy_market.stm.WindFarmList) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.WindFarmList, arg0: 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.
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
extend(self: shyft.energy_market.stm.WindFarmList, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: shyft.energy_market.stm.WindFarmList, i: int, x: shyft.energy_market.stm.WindFarm) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: shyft.energy_market.stm.WindFarmList) -> shyft.energy_market.stm.WindFarm
Remove and return the last item
pop(self: shyft.energy_market.stm.WindFarmList, i: int) -> 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_objectA 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
Bases:
pybind11_objectA Wind turbine, wiki-wind-turbine. is a part of wind park.
- class Cost
Bases:
pybind11_objectWindTurbine.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_objectWindTurbine.production attributes, amount power produced[W].
- class Constraint
Bases:
pybind11_objectContains 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_objectWindTurbine.Reserve contains all operational reserve related attributes.
- class Pair
Bases:
pybind11_objectDescribes the up and down pair of reserve specification.
- __init__(*args, **kwargs)
- class Spec
Bases:
pybind11_objectDescribes 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)
- __init__(*args, **kwargs)
- property constraint
relevant for production
- Type:
- 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: int, name: str, json: str = '') None
Create wind turbine with unique id and name, can later be added to a wind farm.
- 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:
- property tag
Url tag.
- Type:
str
- property ts
- class shyft.energy_market.stm.WindTurbineList
Bases:
pybind11_object- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.WindTurbineList) -> None
__init__(self: shyft.energy_market.stm.WindTurbineList, arg0: list[shyft.energy_market.stm.WindTurbine]) -> None
Copy constructor
__init__(self: shyft.energy_market.stm.WindTurbineList, arg0: Iterable) -> None
- append(self: list[shyft.energy_market.stm.WindTurbine], x: shyft.energy_market.stm.WindTurbine) None
Add an item to the end of the list
- clear(self: list[shyft.energy_market.stm.WindTurbine]) None
Clear the contents
- extend(*args, **kwargs)
Overloaded function.
extend(self: list[shyft.energy_market.stm.WindTurbine], L: list[shyft.energy_market.stm.WindTurbine]) -> None
Extend the list by appending all the items in the given list
extend(self: list[shyft.energy_market.stm.WindTurbine], L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: list[shyft.energy_market.stm.WindTurbine], i: int, x: shyft.energy_market.stm.WindTurbine) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: list[shyft.energy_market.stm.WindTurbine]) -> shyft.energy_market.stm.WindTurbine
Remove and return the last item
pop(self: list[shyft.energy_market.stm.WindTurbine], i: int) -> shyft.energy_market.stm.WindTurbine
Remove and return the item at index
i
- size(self: list[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.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: str, timeout_ms: int, operation_timeout_ms: int = 0)[source]
Bases:
objectA client to the Server.
- __init__(host_port: str, timeout_ms: int, operation_timeout_ms: int = 0) None[source]
Create a client with the host port host_port
- send(request: StartRequest | GetStatusRequest | GetAttrsRequest | SetAttrsRequest | StopRequest | PlanRequest | GetPlanRequest) StartReply | GetStatusReply | GetAttrsReply | SetAttrsReply | StopReply | PlanReply | GetPlanReply[source]
- 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:
objectCompute reply
- 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:
objectCompute request
- urls: list[str]
- class shyft.energy_market.stm.compute.GetPlanReply[source]
Bases:
objectCompute reply
- summary: _OptimizationSummary
- class shyft.energy_market.stm.compute.GetStatusRequest[source]
Bases:
objectCompute request
- log_index: int | None
- class shyft.energy_market.stm.compute.ManagedServerState
Bases:
pybind11_objectDescribes 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: int) None
- property name
- property value
- class shyft.energy_market.stm.compute.PlanRequest[source]
Bases:
objectCompute request
- commands: list[ShopCommand]
- class shyft.energy_market.stm.compute.Server(config: ServerConfig = Ellipsis)[source]
Bases:
objectA server for running heavy STM computations.
- __init__(config: ServerConfig = Ellipsis) None[source]
- 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:
ServerConfigCompute server config
- clean_run_files: bool
- log: LogConfig
- persistent_storage_path: str
- __init__() None
- __init__(base0: shyft.time_series.ServerConfig, /, clean_run_files: bool, persistent_storage_path: str) None
Helper for @overload to raise when called.
- class shyft.energy_market.stm.compute.ServerStatus
Bases:
pybind11_objectStatus 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:
objectCompute reply
- attrs: list[bool]
- class shyft.energy_market.stm.compute.SetAttrsRequest[source]
Bases:
objectCompute request
- 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.StartRequest[source]
Bases:
objectCompute request
- model_id: str
- class shyft.energy_market.stm.compute.State(value: int)[source]
Bases:
objectDescribes the possible states of a compute server
Members:
IDLE
STARTED
RUNNING
DONE
- property name: str
- property value: int
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
Bases:
pybind11_objectA 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.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.energy_market.stm.ShopCommand, command: str) -> None
Create from a single string in shop command language syntax.
__init__(self: shyft.energy_market.stm.ShopCommand, keyword: str, specifier: str, options: list[str], objects: list[str]) -> None
Create from individual components.
- property keyword
keyword of the command
- static log_file(*args, **kwargs)
Overloaded function.
log_file() -> shyft.energy_market.stm.ShopCommand
Shop command string ‘log file’.
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: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /all <value>’.
- static penalty_cost_discharge(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /discharge <value>’.
- static penalty_cost_gate_ramping(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /gate /ramping <value>’.
- static penalty_cost_load(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /load <value>’.
- static penalty_cost_overflow(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /overflow <value>’.
- static penalty_cost_overflow_time_adjust(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /overflow_time_adjust <value>’.
- static penalty_cost_powerlimit(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /powerlimit <value>’.
- static penalty_cost_reserve(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /reserve <value>’.
- static penalty_cost_reservoir_endpoint(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /reservoir /endpoint <value>’.
- static penalty_cost_reservoir_ramping(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /reservoir /ramping <value>’.
- static penalty_cost_soft_p_penalty(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘penalty cost /soft_p_penalty <value>’.
- static penalty_cost_soft_q_penalty(value: float) 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.
print_pqcurves_all() -> shyft.energy_market.stm.ShopCommand
Shop command string ‘print pqcurves /all’.
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.
print_pqcurves_convex() -> shyft.energy_market.stm.ShopCommand
Shop command string ‘print pqcurves /convex’.
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.
print_pqcurves_final() -> shyft.energy_market.stm.ShopCommand
Shop command string ‘print pqcurves /final’.
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.
print_pqcurves_original() -> shyft.energy_market.stm.ShopCommand
Shop command string ‘print pqcurves /original’.
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: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set capacity /all <value>’.
- static set_capacity_bypass(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set capacity /bypass <value>’.
- static set_capacity_gate(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set capacity /gate <value>’.
- static set_capacity_spill(value: float) 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: int) shyft.energy_market.stm.ShopCommand
Shop command string ‘set com_dec_period <value>’.
- static set_droop_discretization_limit(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set droop_discretization_limit <value>’.
- static set_dyn_flex_mip(value: int) 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: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set fcr_d_band <value>’.
- static set_fcr_n_band(value: float) 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: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set gen_turn_off_limit <value>’.
- static set_headopt_feedback(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set headopt_feedback <value>’.
- static set_max_num_threads(value: int) 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: float) 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: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set nseg /all <value>’.
- static set_nseg_down(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set nseg /down <value>’.
- static set_nseg_up(value: float) 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: int) shyft.energy_market.stm.ShopCommand
Shop command string ‘set ramping <value>’.
- static set_reserve_ramping_cost(value: float) shyft.energy_market.stm.ShopCommand
Shop command string ‘set reserve_ramping_cost <value>’.
- static set_reserve_slack_cost(value: float) 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: int) 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: int) 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:
objectA shop commander, utility for sending individual commands to the shop core.
- execute(command: ShopCommand) None[source]
Execute command object.
- executed() list[ShopCommand][source]
Get executed commands as objects.
- log_file() None
- log_file(filename: str) None
Helper for @overload to raise when called.
- penalty_cost_discharge(value: float) None[source]
Shop command string ‘penalty cost /discharge <value>’.
- penalty_cost_gate_ramping(value: float) None[source]
Shop command string ‘penalty cost /gate /ramping <value>’.
- penalty_cost_overflow(value: float) None[source]
Shop command string ‘penalty cost /overflow <value>’.
- penalty_cost_overflow_time_adjust(value: float) None[source]
Shop command string ‘penalty cost /overflow_time_adjust <value>’.
- penalty_cost_powerlimit(value: float) None[source]
Shop command string ‘penalty cost /powerlimit <value>’.
- penalty_cost_reserve(value: float) None[source]
Shop command string ‘penalty cost /reserve <value>’.
- penalty_cost_reservoir_endpoint(value: float) None[source]
Shop command string ‘penalty cost /reservoir /endpoint <value>’.
- penalty_cost_reservoir_ramping(value: float) None[source]
Shop command string ‘penalty cost /reservoir /ramping <value>’.
- penalty_cost_soft_p_penalty(value: float) None[source]
Shop command string ‘penalty cost /soft_p_penalty <value>’.
- penalty_cost_soft_q_penalty(value: float) None[source]
Shop command string ‘penalty cost /soft_q_penalty <value>’.
- penalty_flag_discharge(on: bool) None[source]
Shop command string ‘penalty flag /on|/off /discharge’.
- penalty_flag_gate_max_q_con(on: bool) None[source]
Shop command string ‘penalty flag /on|/off /gate /max_q_con’.
- penalty_flag_gate_min_q_con(on: bool) None[source]
Shop command string ‘penalty flag /on|/off /gate /min_q_con’.
- penalty_flag_gate_ramping(on: bool) None[source]
Shop command string ‘penalty flag /on|/off /gate /ramping’.
- penalty_flag_plant_max_p_con(on: bool) None[source]
Shop command string ‘penalty flag /on|/off /plant /max_p_con’.
- penalty_flag_plant_max_q_con(on: bool) None[source]
Shop command string ‘penalty flag /on|/off /plant /max_q_con’.
- penalty_flag_plant_min_p_con(on: bool) None[source]
Shop command string ‘penalty flag /on|/off /plant /min_p_con’.
- penalty_flag_plant_min_q_con(on: bool) None[source]
Shop command string ‘penalty flag /on|/off /plant /min_q_con’.
- penalty_flag_plant_schedule(on: bool) None[source]
Shop command string ‘penalty flag /on|/off /plant /schedule’.
- penalty_flag_powerlimit(on: bool) None[source]
Shop command string ‘penalty flag /on|/off /powerlimit’.
- penalty_flag_reservoir_endpoint(on: bool) None[source]
Shop command string ‘penalty flag /on|/off /reservoir /endpoint’.
- penalty_flag_reservoir_ramping(on: bool) None[source]
Shop command string ‘penalty flag /on|/off /reservoir /ramping’.
- print_bp_curves_all_combinations() None[source]
Shop command string ‘print bp_curves /all_combinations’.
- print_bp_curves_current_combination() None[source]
Shop command string ‘print bp_curves /current_combination’.
- print_bp_curves_no_vertical_step() None[source]
Shop command string ‘print bp_curves /no_vertical_step’.
- print_mc_curves_down(filename: str) None[source]
Shop command string ‘print mc_curves /down <filename>’.
- print_mc_curves_down_mod(filename: str) None[source]
Shop command string ‘print mc_curves /down /mod <filename>’.
- print_mc_curves_down_pq(filename: str) None[source]
Shop command string ‘print mc_curves /down /pq <filename>’.
- print_mc_curves_down_pq_mod(filename: str) None[source]
Shop command string ‘print mc_curves /down /pq /mod <filename>’.
- print_mc_curves_mod(filename: str) None[source]
Shop command string ‘print mc_curves /mod <filename>’.
- print_mc_curves_pq(filename: str) None[source]
Shop command string ‘print mc_curves /pq <filename>’.
- print_mc_curves_pq_mod(filename: str) None[source]
Shop command string ‘print mc_curves /pq /mod <filename>’.
- print_mc_curves_up(filename: str) None[source]
Shop command string ‘print mc_curves /up <filename>’.
- print_mc_curves_up_down(filename: str) None[source]
Shop command string ‘print mc_curves /up /down <filename>’.
- print_mc_curves_up_down_mod(filename: str) None[source]
Shop command string ‘print mc_curves /up /down /mod <filename>’.
- print_mc_curves_up_down_pq(filename: str) None[source]
Shop command string ‘print mc_curves /up /down /pq <filename>’.
- print_mc_curves_up_down_pq_mod(filename: str) None[source]
Shop command string ‘print mc_curves /up /down /pq /mod <filename>’.
- print_mc_curves_up_mod(filename: str) None[source]
Shop command string ‘print mc_curves /up /mod <filename>’.
- print_mc_curves_up_pq(filename: str) None[source]
Shop command string ‘print mc_curves /up /pq <filename>’.
- print_mc_curves_up_pq_mod(filename: str) None[source]
Shop command string ‘print mc_curves /up /pq /mod <filename>’.
- print_pqcurves_all() None
- print_pqcurves_all(filename: str) None
Helper for @overload to raise when called.
- print_pqcurves_convex() None
- print_pqcurves_convex(filename: str) None
Helper for @overload to raise when called.
- print_pqcurves_final() None
- print_pqcurves_final(filename: str) None
Helper for @overload to raise when called.
- print_pqcurves_original() None
- print_pqcurves_original(filename: str) None
Helper for @overload to raise when called.
- return_scenario_result_table(filename: str) None[source]
Shop command string ‘return scenario_result_table <filename>’.
- return_shopsimres_gen(filename: str) None[source]
Shop command string ‘return shopsimres /gen <filename>’.
- save_shopsimseries(filename: str) None[source]
Shop command string ‘save shopsimseries <filename>’.
- save_xmlshopsimseries(filename: str) None[source]
Shop command string ‘save xmlshopsimseries <filename>’.
- set_droop_discretization_limit(value: float) None[source]
Shop command string ‘set droop_discretization_limit <value>’.
- set_gen_turn_off_limit(value: float) None[source]
Shop command string ‘set gen_turn_off_limit <value>’.
- set_headopt_feedback(value: float) None[source]
Shop command string ‘set headopt_feedback <value>’.
- set_mipgap(absolute: bool, value: float) None[source]
Shop command string ‘set mipgap /absolute|/relative <value>’.
- set_parallel_mode_deterministic() None[source]
Shop command string ‘set parallel_mode /deterministic’.
- set_parallel_mode_opportunistic() None[source]
Shop command string ‘set parallel_mode /opportunistic’.
- set_power_head_optimization(on: bool) None[source]
Shop command string ‘set power_head_optimization /on|/off’.
- set_reserve_ramping_cost(value: float) None[source]
Shop command string ‘set reserve_ramping_cost <value>’.
- set_reserve_slack_cost(value: float) None[source]
Shop command string ‘set reserve_slack_cost <value>’.
- 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:
objectA shop system, managing a session to the shop core.
- static environment_string() str[source]
Get all environment variables as a newline delimited string value.
- static optimize(stm_system: StmSystem, time_axis: TimeAxis, commands: list[ShopCommand], logging_to_stdstreams: bool, logging_to_files: bool) None[source]
- static optimize2(stm_system: StmSystem, time_begin: time, time_end: time, time_step: time, commands: list[ShopCommand], logging_to_stdstreams: bool, logging_to_files: bool) None[source]
- __init__(arg0: shyft.time_series.UtcPeriod, arg1: shyft.time_series.time) None
- __init__(arg0: shyft.time_series.TimeAxis) None
Helper for @overload to raise when called.
- export_yaml_string(input_only: bool = False, output_only: bool = False, compress_txy: bool = False, compress_connection: bool = False) str[source]
- get_log_buffer(limit: int) list[shyft.energy_market.stm.LogEntry]
- get_log_buffer() list[shyft.energy_market.stm.LogEntry]
Helper for @overload to raise when called.
- property commander: ShopCommander
Get shop commander object.
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
Bases:
pybind11_objectProvides layout information that can be leveraged by a renderer.
- __init__(self: shyft.energy_market.stm.LayoutInfo, id: int, 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
Bases:
pybind11_objectProvides model-information useful for selection and filtering
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: shyft.time_series.ModelInfo) -> None
__init__(self: shyft.time_series.ModelInfo, id: int, 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 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