pyltm package¶
Module contents¶
pyltm package¶
This is the entry point for pyltm package.
- class pyltm.AggregatedHydroModule¶
Aggregated hydro module
An area can be represented by aggregated hydro.
It’s a simplified representation of hydro-power operating with energy units: energy inflow, energy generation and stored energy.
- property area_name¶
Area name
Required: no
- property comment¶
User comment
Required: no
- property lower_production_limits¶
Lower production limits (MW)
Required: no
- property lower_reservoir_limits¶
Lower reservoir limits (MWh)
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property regulated_power_inflow¶
Regulated power inflow (MW)
Required: yes
- property reservoir_energy¶
MWh.
Required: yes
- Type:
Total reservoir energy. Unit
- property start_reservoir_energy¶
Initial aggregated reservoir energy (MWh)
Required: yes
- property station_power¶
MW.
Required: yes
- Type:
Max station production. Unit
- sum_hydro_energy(self: pyltm._core_pyltm.AggregatedHydroModule, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Aggregated hydro module sum hydro energy
- sum_hydro_power_production(self: pyltm._core_pyltm.AggregatedHydroModule, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Aggregated hydro module sum hydro power production
- property unregulated_power_inflow¶
Unregulated power inflow (MW)
Required: yes
- property upper_production_limits¶
Upper production limits (MW)
Required: no
- property upper_reservoir_limits¶
Upper reservoir limits (MWh)
Required: no
- property what¶
A static property returning the string ‘enmag’
- class pyltm.Area¶
Area for connecting market steps, loads, dclines, hydro power+++.
An area represents an ENMD-file in a classical EMPS/EOPS dataset.
- build_connection_tree(self: pyltm._core_pyltm.Area) str¶
Create a directed acyclic graph in GraphViz dot format
- property comment¶
User comment
Required: no
- property feedback_factors¶
Area feedback factors
Required: no
- property has_detailed_grid¶
Participates in detailed grid or not
Required: no
- have_aggregated_hydro_results(self: pyltm._core_pyltm.Area) bool¶
Returns true if area has aggregated hydro results and is not a battery area. Result is only valid if the object is part of a model.
- have_battery_results(self: pyltm._core_pyltm.Area) bool¶
Returns true if the area has battery results
- have_detailed_hydro_results(self: pyltm._core_pyltm.Area) bool¶
Returns true if the area has detailed hydro results
- have_hydraulic_coupling_results(self: pyltm._core_pyltm.Area) bool¶
Returns true if there are results from hydraulic couplings type 200 or type 300. Result is only valid if the object is part of a model.
- have_market_results(self: pyltm._core_pyltm.Area) bool¶
Returns true if the area has market results. Result is only valid if the object is part of a model.
- have_pump_results(self: pyltm._core_pyltm.Area) bool¶
Returns true if the area has pump results. Result is only valid if the object is part of a model.
- have_water_value_results(self: pyltm._core_pyltm.Area) bool¶
Returns true if the area has water value results
- hydraulic_couplings(self: pyltm._core_pyltm.Area) list[pyltm._core_pyltm.HydraulicCoupling]¶
A list of hydraulic couplings connected to this area
- property id¶
Internal ID
Required: no
- property load_penalty¶
Load penalty price
Required: no
- market_result_price(self: pyltm._core_pyltm.Area, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Area market price results over time
- property max_iterations¶
Max number of iterations for this Area
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- net_trade_on_market_steps(self: pyltm._core_pyltm.Area, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Area net trade on market steps (sum generation - sum consumption)
- property precision¶
Precision for this Area
Required: no
- reservoirs(self: pyltm._core_pyltm.Area) list[pyltm._core_pyltm.Reservoir]¶
A list of reservoirs (with plants) connected to this area
- property spill_cost¶
Spill cost price
Required: no
- sum_hydro_production(self: pyltm._core_pyltm.Area, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Area sum hydro production steps over time
- sum_load(self: pyltm._core_pyltm.Area, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Area sum load over time
- sum_power_used_for_pumping(self: pyltm._core_pyltm.Area, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Aggregated sum of supplied power for pumps
- sum_pumped_power(self: pyltm._core_pyltm.Area, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Aggregated sum of power stored by pumping
- sum_reservoir(self: pyltm._core_pyltm.Area, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Area sum reservoir filling over time
- water_value_results(self: pyltm._core_pyltm.Area, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Water values for area
- property water_value_weights¶
Water value weights
Required: no
- property what¶
A static property returning the string ‘area’
- class pyltm.BatteryModule¶
Battery module
A battery module stores surplus energy and discharges when demand is high. Modelling of batteries is available on area level. It occupies an emps area and excludes other hydro-power.
Connects to a area.
- property area_name¶
Area name
Required: no
- property charging_cost¶
Charging cost (Currency)
Required: yes
- property charging_efficiency¶
Charging efficiency (Factor)
Required: yes
- property comment¶
User comment
Required: no
- property endvalue_type¶
Endvalue type
Required: no
- property exogenous_endvalue¶
Exogenous endvalue (Currency / energy unit)
Required: no
- property max_charging_power¶
Max charging power (MW)
Required: yes
- property max_discharge_power¶
Max discharge power (MW)
Required: yes
- property max_energy_level¶
Max energy level (MWh)
Required: yes
- property metadata¶
User metadata
Required: no
- property min_discharge_power¶
Min discharge power (MW)
Required: yes
- property min_energy_level¶
Min energy level (MWh)
Required: yes
- property name¶
Object name
Required: yes
- property start_battery_energy¶
Initial battery energy. (MWh)
Required: yes
- sum_energy(self: pyltm._core_pyltm.BatteryModule, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Battery module sum energy
- sum_power_production(self: pyltm._core_pyltm.BatteryModule, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Battery module sum power production
- property what¶
A static property returning the string ‘battery’
- class pyltm.BiddingZone¶
Bidding zone - FBMC
Bidding zone is used to place the emps areas in Bidding zones (e.g NO1, NO2, etc). Bidding zones are based on available input of FBMC-paramters (PTDFs)
- property comment¶
User comment
Required: no
- property is_fbmc¶
Is bidding zone a part of the FBMC network (Yes/No)
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property what¶
A static property returning the string ‘bidding_zone’
- class pyltm.Bypass¶
Use a bypass to change the outlet from the default discharge outlet/reservoir to another reservoir. Can also go to the sea.
- property comment¶
User comment
Required: no
- property max_bypass_curve¶
Max bypass curve (m3/sec)
Required: no
- property max_bypass_scale¶
Max bypass scaling factor (factor)
Required: no
- property max_bypass_series_name¶
Max bypass series name (string)
Required: no
- property metadata¶
User metadata
Required: no
- property min_bypass_curve¶
Min bypass curve (m3/sec)
Required: no
- property min_bypass_scale¶
Min bypass scaling factor (factor)
Required: no
- property min_bypass_series_name¶
Min bypass series name (string)
Required: no
- property name¶
Object name
Required: yes
- property what¶
A static property returning the string ‘bypass’
- class pyltm.CalendarMode¶
Members:
ISO
EFI
invalid_calendar_type
- EFI = <CalendarMode.EFI: 1>¶
- ISO = <CalendarMode.ISO: 0>¶
- invalid_calendar_type = <CalendarMode.invalid_calendar_type: 2>¶
- property name¶
- property value¶
- class pyltm.CriticalNetworkElement¶
CNE
Critical network element (CNE) contains the remaining available capacity (RAM), power transfer distribution factors (PTDF) and Bidding zone connection points.
- property active¶
Active timeseries (time/on/off)
Required: yes
- property comment¶
User comment
Required: no
- get_dual_values(self: pyltm._core_pyltm.CriticalNetworkElement, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
FBMC dual values. Results are only valid with model type EMPS.
- get_flow_values(self: pyltm._core_pyltm.CriticalNetworkElement, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
FBMC flow values. Results are only valid with model type EMPS.
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property ptdf¶
Power Transfer Distribution Factor
Required: yes
- property ram¶
Remaining available capacity (MW)
Required: yes
- property what¶
A static property returning the string ‘cne’
- class pyltm.DCLine¶
DCLine connects two areas
- property backward_capacity¶
Defines the capacity from area B to area A
Required: yes
- property backward_cost¶
Backward cost
Required: no
- property comment¶
User comment
Required: no
- property forward_capacity¶
Defines the capacity from area A to area B
Required: yes
- property forward_cost¶
Forward cost
Required: no
- property from_area¶
From area
Required: no
- have_transmission_results(self: pyltm._core_pyltm.DCLine) bool¶
Returns true if there are valid transmission results for this DCLine
- property id¶
Internal ID
Required: no
- property loss_percentage¶
Loss percentage
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property to_area¶
To area
Required: no
- transmission_results(self: pyltm._core_pyltm.DCLine, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Transmission results for DCLine
- property what¶
A static property returning the string ‘dcline’
- class pyltm.ExportTarget¶
Members:
NoExport
User
Hdf5
SQLite
- Hdf5 = <ExportTarget.Hdf5: 2>¶
- NoExport = <ExportTarget.NoExport: 0>¶
- SQLite = <ExportTarget.SQLite: 3>¶
- User = <ExportTarget.User: 1>¶
- property name¶
- property value¶
- class pyltm.Exporter¶
- export_data(self: pyltm._core_pyltm.Exporter, arg0: pyltm._core_pyltm.ExportedData) None¶
- class pyltm.FeedbackFactors¶
- property artificial_minimum_production¶
- property conversion_limit¶
- property feedback_factor¶
- property flexibility_factor¶
- property form_factor¶
- class pyltm.GlobalSettings¶
Global settings.
Global settings defines the common runtime parameters and configuration for the model.
- property allow_validation_failures¶
Ignore validation failures
Required: no
- property calendar_mode¶
Calendar mode
Required: no
- property comment¶
User comment
Required: no
- property currency_cent_unit¶
Currency cent unit
Required: no
- property currency_unit¶
Currency unit
Required: no
- property data_period¶
Data period
Required: no
- property default_load_penalty¶
Default load penalty. Must be higher than the highest price in any other market step.
Required: no
- property default_max_iterations_battery¶
Default max iterations for battery areas
Required: no
- property default_precision_battery¶
Default precision for batteries
Required: no
- property default_spill_cost¶
Default spill cost. Usually non-zero, but very close to zero.
Required: no
- property delete_output_dir¶
Delete runtime directory after execution
Required: no
- property energy_unit¶
Energy unit
Required: no
- property estimate_pq_curve_from_energy_equivalent¶
Estimate PQ-curves from energy equivalent if a reservoir has an energy equivalent != .0 and is not connected to a plant
Required: no
- property etha¶
ETHA
Required: no
- property export_directory_path¶
No description
Required: no
- property export_settings¶
No description
Required: no
- property export_target¶
No description
Required: no
- property extra_environment¶
Expert use only. Additional environment variables to set when executing LTM applications.
Required: no
- property fbmc¶
Flow-Based Market-Coupling
Required: no
- property fbmc_period¶
FBMC active period
Required: no
- property forecast_period¶
Forecast period
Required: no
- property generate_output_dir¶
Generate a runtime subfolder under output_path
Required: no
- property historical_period¶
Historical period
Required: yes
- property historical_type¶
Historical period calendar type
Required: no
- property ignore_stopwords¶
Continue execution even if there are possible errors in EMPS/EOPS logs
Required: no
- property interest_rate¶
Global interest rate
Required: no
- property intraweek_timesteps¶
Former ‘simulation_price_period’ / price segments
Required: no
- property jao_data_source¶
JAO data source (file) with PTDF data
Required: no
- property kronasjer¶
Default currency unit
Required: no
- property ltm_license_file_path¶
Path to LTM license file
Required: no
- property max_iterations¶
Default max iterations for local area water value calculations (vansim)
Required: no
- property metadata¶
User metadata
Required: no
- property model_type¶
EMPS or EOPS model
Required: no
- property name¶
Object name
Required: yes
- property num_price_scenarios¶
No description
Required: no
- property num_processes¶
Number of paralell MPI processess
Required: no
- property output_path¶
Output and runtime directory where LTM will read and write data
Required: yes
- property precision¶
Default precision requirement for water value calculations (max allowed deviation)
Required: no
- property simulation_period¶
EMPS/EOPS simulation period. Previously calc_water_value_flag.
Required: yes
- property simulation_type¶
Parallel or serial simulation
Required: no
- property timesteps_per_week¶
Automatic, sequential time steps / price segments
Required: no
- property unknown_key_policy¶
Policy for what to do with unexpected keys in the JSON model. Strict = all keys must be known, strict_ignore_underscore = ignore keys starting with underscore, ignore_all = all known and unknown keys are allowed.
Required: no
- property water_value_period¶
Water value period
Required: no
- property what¶
A static property returning the string ‘global_settings’
- class pyltm.HistoricalType¶
Members:
EFI
ISO
Civillian
invalid_historical_type
- Civillian = <HistoricalType.Civillian: 2>¶
- EFI = <HistoricalType.EFI: 0>¶
- ISO = <HistoricalType.ISO: 1>¶
- invalid_historical_type = <HistoricalType.invalid_historical_type: 3>¶
- property name¶
- property value¶
- class pyltm.HydraulicCoupling¶
Hydraulic coupling
Join multiple reservoirs into a connected system. Used to add flexibility to the hydro-power modelling. Allows for connecting multiple reservoirs and plants.
- property area_name¶
Area name
Required: no
- property comment¶
User comment
Required: no
- connected_reservoirs(self: pyltm._core_pyltm.HydraulicCoupling) list[pyltm._core_pyltm.Reservoir]¶
For a non-station joined hydraulic coupling (type 200 or 300), returns connected reservoirs.
- discharge(self: pyltm._core_pyltm.HydraulicCoupling, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Hydraulic coupling discharge. Only relevant if HC is connected to a plant.
- property gate_switch_frequency¶
Gate/hatch switch frequency. 0-100. 0 and 100 = no limits, 50 = most limited. Numbers 0-49, 51-100 determines what side of the hatch/gate to prefer. (unit-less)
Required: no
- have_hydraulic_flow_results(self: pyltm._core_pyltm.HydraulicCoupling) bool¶
Are there hydraulic flow results available for this hydraulic coupling. Only available in EOPS, and with a license enabling hydraulic flow results.
- property max_flow¶
Max flow through the coupling, note the unit is an integer (m3/sec)
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- production(self: pyltm._core_pyltm.HydraulicCoupling, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Hydraulic coupling production. Only relevant if HC is connected to a plant.
- property station_joined¶
Is connected to a plant/station. Readonly (bool)
Required: no
- property what¶
A static property returning the string ‘hydraulic_coupling’
- class pyltm.Inflow¶
Inflow series is used for historical series and some time-dependent restrictions on reservoirs and plants.
Optional short-term forecast can be used to override the historical series with a given period.
- property comment¶
User comment
Required: no
- property forecast¶
Optional forecast series (m^3/s)
Required: no
- property forecast_period¶
Optional forecast period
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property series¶
Inflow series (m^3/s)
Required: yes
- property what¶
A static property returning the string ‘inflow’
- class pyltm.Load¶
Load refers to contractual rights to buy or sell power. The load is forecast and time-dependent.
Connects to an area.
- property area_name¶
Area name
Required: no
- property capacity¶
Load capacity (MW)
Required: yes
- property comment¶
User comment
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property what¶
A static property returning the string ‘load’
- class pyltm.LtmApiModel¶
- add(*args, **kwargs)¶
Overloaded function.
add(self: pyltm._core_pyltm.LtmApiModel, what: str, name: str, data: json = None) -> object
add(self: pyltm._core_pyltm.LtmApiModel, object: Union[pyltm._core_pyltm.Area, pyltm._core_pyltm.MarketStep, pyltm._core_pyltm.DCLine, pyltm._core_pyltm.Load, pyltm._core_pyltm.Wind, pyltm._core_pyltm.Solar, pyltm._core_pyltm.BatteryModule, pyltm._core_pyltm.UncontrollableGeneration, pyltm._core_pyltm.UncontrollableGenerationSeries, pyltm._core_pyltm.AggregatedHydroModule, pyltm._core_pyltm.Bypass, pyltm._core_pyltm.HydraulicCoupling, pyltm._core_pyltm.Spill, pyltm._core_pyltm.Reservoir, pyltm._core_pyltm.Plant, pyltm._core_pyltm.Pump, pyltm._core_pyltm.MarketCalibrationArea, pyltm._core_pyltm.Inflow, pyltm._core_pyltm.MainPriceSeries, pyltm._core_pyltm.SecondaryPriceSeries, pyltm._core_pyltm.BiddingZone, pyltm._core_pyltm.CriticalNetworkElement, pyltm._core_pyltm.Watercourse]) -> Union[pyltm._core_pyltm.Area, pyltm._core_pyltm.MarketStep, pyltm._core_pyltm.DCLine, pyltm._core_pyltm.Load, pyltm._core_pyltm.Wind, pyltm._core_pyltm.Solar, pyltm._core_pyltm.BatteryModule, pyltm._core_pyltm.UncontrollableGeneration, pyltm._core_pyltm.UncontrollableGenerationSeries, pyltm._core_pyltm.AggregatedHydroModule, pyltm._core_pyltm.Bypass, pyltm._core_pyltm.HydraulicCoupling, pyltm._core_pyltm.Spill, pyltm._core_pyltm.Reservoir, pyltm._core_pyltm.Plant, pyltm._core_pyltm.Pump, pyltm._core_pyltm.MarketCalibrationArea, pyltm._core_pyltm.Inflow, pyltm._core_pyltm.MainPriceSeries, pyltm._core_pyltm.SecondaryPriceSeries, pyltm._core_pyltm.BiddingZone, pyltm._core_pyltm.CriticalNetworkElement, pyltm._core_pyltm.Watercourse]
- aggregated_hydro_modules(self: pyltm._core_pyltm.LtmApiModel) list[pyltm._core_pyltm.AggregatedHydroModule]¶
- areas(self: pyltm._core_pyltm.LtmApiModel) list[pyltm._core_pyltm.Area]¶
- battery_modules(self: pyltm._core_pyltm.LtmApiModel) list[pyltm._core_pyltm.BatteryModule]¶
- calculate_residual_load(self: pyltm._core_pyltm.LtmApiModel, sample_rate: datetime.timedelta = datetime.timedelta(seconds=3600), output_resolution: datetime.timedelta = datetime.timedelta(days=364)) json¶
Calculates the residual loads for all scenarios with the given sample rate and output resolution
- dclines(self: pyltm._core_pyltm.LtmApiModel) list[pyltm._core_pyltm.DCLine]¶
- property discrepancies¶
If there are any validation errors, the discrepancies will be available through this list.
- property exporter¶
- find(self: pyltm._core_pyltm.LtmApiModel, partial_name: str) list[pyltm._core_pyltm.Area | pyltm._core_pyltm.MarketStep | pyltm._core_pyltm.DCLine | pyltm._core_pyltm.Load | pyltm._core_pyltm.Wind | pyltm._core_pyltm.Solar | pyltm._core_pyltm.BatteryModule | pyltm._core_pyltm.UncontrollableGeneration | pyltm._core_pyltm.UncontrollableGenerationSeries | pyltm._core_pyltm.AggregatedHydroModule | pyltm._core_pyltm.Bypass | pyltm._core_pyltm.HydraulicCoupling | pyltm._core_pyltm.Spill | pyltm._core_pyltm.Reservoir | pyltm._core_pyltm.Plant | pyltm._core_pyltm.Pump | pyltm._core_pyltm.MarketCalibrationArea | pyltm._core_pyltm.Inflow | pyltm._core_pyltm.MainPriceSeries | pyltm._core_pyltm.SecondaryPriceSeries | pyltm._core_pyltm.BiddingZone | pyltm._core_pyltm.CriticalNetworkElement | pyltm._core_pyltm.Watercourse]¶
Finds all objects with partial_name in the name. Returns a list of objects.
Example:
` objects = session.model.find("needle") `
- get(self: pyltm._core_pyltm.LtmApiModel, what: str, name: str) pyltm._core_pyltm.Area | pyltm._core_pyltm.MarketStep | pyltm._core_pyltm.DCLine | pyltm._core_pyltm.Load | pyltm._core_pyltm.Wind | pyltm._core_pyltm.Solar | pyltm._core_pyltm.BatteryModule | pyltm._core_pyltm.UncontrollableGeneration | pyltm._core_pyltm.UncontrollableGenerationSeries | pyltm._core_pyltm.AggregatedHydroModule | pyltm._core_pyltm.Bypass | pyltm._core_pyltm.HydraulicCoupling | pyltm._core_pyltm.Spill | pyltm._core_pyltm.Reservoir | pyltm._core_pyltm.Plant | pyltm._core_pyltm.Pump | pyltm._core_pyltm.MarketCalibrationArea | pyltm._core_pyltm.Inflow | pyltm._core_pyltm.MainPriceSeries | pyltm._core_pyltm.SecondaryPriceSeries | pyltm._core_pyltm.BiddingZone | pyltm._core_pyltm.CriticalNetworkElement | pyltm._core_pyltm.Watercourse | None¶
Gets an object from the model. If the object does not exist, None is returned.
Example:
` plant: Plant = session.model.get("plant", "plant1") `
- get_discharges(self: pyltm._core_pyltm.LtmApiModel, reservoir: pyltm._core_pyltm.Reservoir) dict[str, int]¶
Returns a dictionary with discharge, bypass, and spill module numbers for the a given reservoir
- property global_settings¶
- loads(self: pyltm._core_pyltm.LtmApiModel) list[pyltm._core_pyltm.Load]¶
- market_calibration_areas(self: pyltm._core_pyltm.LtmApiModel) list[pyltm._core_pyltm.MarketCalibrationArea]¶
- market_steps(self: pyltm._core_pyltm.LtmApiModel) list[pyltm._core_pyltm.MarketStep]¶
- remove(self: pyltm._core_pyltm.LtmApiModel, object: pyltm._core_pyltm.Area | pyltm._core_pyltm.MarketStep | pyltm._core_pyltm.DCLine | pyltm._core_pyltm.Load | pyltm._core_pyltm.Wind | pyltm._core_pyltm.Solar | pyltm._core_pyltm.BatteryModule | pyltm._core_pyltm.UncontrollableGeneration | pyltm._core_pyltm.UncontrollableGenerationSeries | pyltm._core_pyltm.AggregatedHydroModule | pyltm._core_pyltm.Bypass | pyltm._core_pyltm.HydraulicCoupling | pyltm._core_pyltm.Spill | pyltm._core_pyltm.Reservoir | pyltm._core_pyltm.Plant | pyltm._core_pyltm.Pump | pyltm._core_pyltm.MarketCalibrationArea | pyltm._core_pyltm.Inflow | pyltm._core_pyltm.MainPriceSeries | pyltm._core_pyltm.SecondaryPriceSeries | pyltm._core_pyltm.BiddingZone | pyltm._core_pyltm.CriticalNetworkElement | pyltm._core_pyltm.Watercourse) pyltm._core_pyltm.Area | pyltm._core_pyltm.MarketStep | pyltm._core_pyltm.DCLine | pyltm._core_pyltm.Load | pyltm._core_pyltm.Wind | pyltm._core_pyltm.Solar | pyltm._core_pyltm.BatteryModule | pyltm._core_pyltm.UncontrollableGeneration | pyltm._core_pyltm.UncontrollableGenerationSeries | pyltm._core_pyltm.AggregatedHydroModule | pyltm._core_pyltm.Bypass | pyltm._core_pyltm.HydraulicCoupling | pyltm._core_pyltm.Spill | pyltm._core_pyltm.Reservoir | pyltm._core_pyltm.Plant | pyltm._core_pyltm.Pump | pyltm._core_pyltm.MarketCalibrationArea | pyltm._core_pyltm.Inflow | pyltm._core_pyltm.MainPriceSeries | pyltm._core_pyltm.SecondaryPriceSeries | pyltm._core_pyltm.BiddingZone | pyltm._core_pyltm.CriticalNetworkElement | pyltm._core_pyltm.Watercourse | None¶
- solar(self: pyltm._core_pyltm.LtmApiModel) list[pyltm._core_pyltm.Solar]¶
- uncontrollable_generation(self: pyltm._core_pyltm.LtmApiModel) list[pyltm._core_pyltm.UncontrollableGeneration]¶
- wind(self: pyltm._core_pyltm.LtmApiModel) list[pyltm._core_pyltm.Wind]¶
- class pyltm.LtmApiModule¶
- static attributes() json¶
- build_area_graph(self: pyltm._core_pyltm.LtmApiModule) str¶
- build_connection_tree(self: pyltm._core_pyltm.LtmApiModule) str¶
- connect(*args, **kwargs)¶
Overloaded function.
connect(self: pyltm._core_pyltm.LtmApiModule, from_ref: pyltm._core_pyltm.PyLtmReference, to_ref: pyltm._core_pyltm.PyLtmReference) -> pyltm._core_pyltm.PyLtmConnection
Connects two model objects
- Args:
object1 (PyLtmReference): connection from object1 object2 (PyLtmReference): connection to object2
- Returns:
PyLtmConnection: connection object
connect(self: pyltm._core_pyltm.LtmApiModule, from_obj: Union[pyltm._core_pyltm.Area, pyltm._core_pyltm.MarketStep, pyltm._core_pyltm.DCLine, pyltm._core_pyltm.Load, pyltm._core_pyltm.Wind, pyltm._core_pyltm.Solar, pyltm._core_pyltm.BatteryModule, pyltm._core_pyltm.UncontrollableGeneration, pyltm._core_pyltm.UncontrollableGenerationSeries, pyltm._core_pyltm.AggregatedHydroModule, pyltm._core_pyltm.Bypass, pyltm._core_pyltm.HydraulicCoupling, pyltm._core_pyltm.Spill, pyltm._core_pyltm.Reservoir, pyltm._core_pyltm.Plant, pyltm._core_pyltm.Pump, pyltm._core_pyltm.MarketCalibrationArea, pyltm._core_pyltm.Inflow, pyltm._core_pyltm.MainPriceSeries, pyltm._core_pyltm.SecondaryPriceSeries, pyltm._core_pyltm.BiddingZone, pyltm._core_pyltm.CriticalNetworkElement, pyltm._core_pyltm.Watercourse], to_obj: Union[pyltm._core_pyltm.Area, pyltm._core_pyltm.MarketStep, pyltm._core_pyltm.DCLine, pyltm._core_pyltm.Load, pyltm._core_pyltm.Wind, pyltm._core_pyltm.Solar, pyltm._core_pyltm.BatteryModule, pyltm._core_pyltm.UncontrollableGeneration, pyltm._core_pyltm.UncontrollableGenerationSeries, pyltm._core_pyltm.AggregatedHydroModule, pyltm._core_pyltm.Bypass, pyltm._core_pyltm.HydraulicCoupling, pyltm._core_pyltm.Spill, pyltm._core_pyltm.Reservoir, pyltm._core_pyltm.Plant, pyltm._core_pyltm.Pump, pyltm._core_pyltm.MarketCalibrationArea, pyltm._core_pyltm.Inflow, pyltm._core_pyltm.MainPriceSeries, pyltm._core_pyltm.SecondaryPriceSeries, pyltm._core_pyltm.BiddingZone, pyltm._core_pyltm.CriticalNetworkElement, pyltm._core_pyltm.Watercourse]) -> pyltm._core_pyltm.PyLtmConnection
Doc
- dump_model(self: pyltm._core_pyltm.LtmApiModule, dump_path: str, model_filename: str = 'model.json', timeseries_filename: str = 'timeseries.h5') None¶
Dumps the model to a JSON file and timeseries to h5-file.
- execute_model(self: pyltm._core_pyltm.LtmApiModule, path: str = '') json¶
Executes a model and returns a JSON-like dictionary.
- export_results(self: pyltm._core_pyltm.LtmApiModule) None¶
- import_directory(self: pyltm._core_pyltm.LtmApiModule, datadir: str, import_market_steps: bool = True, import_loads: bool = True, recalculate_average_yearly_inflow: bool = True, import_detailed_hydro: bool = True, import_wind: bool = True) bool¶
Imports an EMPS/EOPS directory into a LTM-API model Prerequisite for market description: The LTM-application konvtiltser.exe must be run on the dataset. It convert the *.enmd-files to the proper format and creates the file timeseries.h5 with the timeseries for the market description. Several importer options are available, passed as arguments.
- Parameters:
datadir (str) – Path to a classic runtime directory
import_market_step (bool) – Import or skip market steps
import_loads (bool) – Import or skip loads
recalculate_average_yearly_inflow (bool) – Recalculate average yearly inflow from DETD MIDDELÅRSPERIOD to historical period
import_detailed_hydro (bool) – Import or skip detailed hydro
import_wind (bool) – Import or skip wind (may be time consuming if large timeseries are used)
- Returns:
Success or failure of the import
- Return type:
success (bool)
- load(*args, **kwargs)¶
Overloaded function.
load(self: pyltm._core_pyltm.LtmApiModule, model: json = {}) -> str
load(self: pyltm._core_pyltm.LtmApiModule, filename: str = ‘’) -> str
- load_from_ltm_dir(self: pyltm._core_pyltm.LtmApiModule, path: str = '') None¶
Import a classic EMPS/EOPS runtime directory to be able to fetch results.
This creates a minimal LtmApiModel with areas, detailed hydro modules and dclines based on the classic runtime directory. Only used for getting results.
- Parameters:
datadir (str) – Path to a classic runtime directory
- Returns:
void
- property model¶
- static results() json¶
- set_execute_callback(self: pyltm._core_pyltm.LtmApiModule, arg0: Callable[[dict, object], bool], arg1: object) None¶
Sets a user-callback that will be called after every program LTM core has executed
- Parameters:
fn (callback) –
A Python function with signature: def usercallback(program_info: dict, userdata: any):
… return True
userdata (any) – User provided userdata
- validate_model(self: pyltm._core_pyltm.LtmApiModule) list[pyltm._core_pyltm.Discrepancy]¶
- validate_model_post_write(self: pyltm._core_pyltm.LtmApiModule) list[pyltm._core_pyltm.Discrepancy]¶
- write_model(*args, **kwargs)¶
Overloaded function.
write_model(self: pyltm._core_pyltm.LtmApiModule) -> bool
Write the in-memory model to disk
write_model(self: pyltm._core_pyltm.LtmApiModule, model: json = {}) -> bool
Writes the model directly to disk from a JSON/Python Dictionary.
- Args:
model (dict): A dictionary representation of a LtmApi model
- class pyltm.MainPriceSeries¶
Main price series
Main price series allows for specifying exogenous prices. The series is connected to a market_step.
Only one series is allowed.
- property comment¶
User comment
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property percentiles_for_water_values¶
Customize percentiles for the price levels. Adds a price scenario dimension to water values.
Required: no
- property probabilities¶
price scenarios has equal probability.
Required: no
- Type:
Option to customise probabilities of the price scenarios. Overrides default
- property series¶
Price series values (Unknown)
Required: yes
- property what¶
A static property returning the string ‘price_series_main’
- class pyltm.MarketCalibrationArea¶
Market calibration area
Market calibration areas are used to group emps areas. The group of areas is used in water value calculations. Used when a bottle-neck limits exchange between groups.
- property comment¶
User comment
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property what¶
A static property returning the string ‘market_calibration_area’
- class pyltm.MarketStep¶
Market step
A market step represents time-dependent price-elastic power supply/demand. For example import, export, thermal-power etc.
- property area_name¶
Area name
Required: no
- property capacity¶
Capacity time series
Required: yes
- property capacity_vv¶
Capacity time series used for the water value calculation
Required: no
- property comment¶
User comment
Required: no
- property exogenous_price¶
Exogenous price time series
Required: no
- have_results(self: pyltm._core_pyltm.MarketStep) bool¶
True if detailed market results are available.
- property load_name¶
If set, the market step is connected to a load with the given name
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property price¶
Price time series
Required: no
- property price_series_coefficients¶
Coefficients for price series
Required: no
- results(self: pyltm._core_pyltm.MarketStep, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Detailed results for MarketStep.
- property secondary_price_series_name¶
Name of connected seconday price series
Required: no
- property what¶
A static property returning the string ‘market_step’
- class pyltm.ModelType¶
Members:
EMPS
EOPS
invalid_model_type
- EMPS = <ModelType.EMPS: 0>¶
- EOPS = <ModelType.EOPS: 1>¶
- invalid_model_type = <ModelType.invalid_model_type: 2>¶
- property name¶
- property value¶
- class pyltm.Plant¶
A plant represent a hydro-power plant. It receives storable hydro from a reservoir and generates power.
- property area_name¶
Area name
Required: no
- property average_energy_equivalent¶
Average local energy equivalent. Important for spillage, bypass and pumping. (kWh/m3)
Required: yes
- property average_unregulated_inflow¶
Average yearly unregulated inflow. (m^3/s)
Required: yes
Unforeseen downtimes capacity outage for a plant (havari) (MW)
Required: no
- property comment¶
User comment
Required: no
- property discharge_energy_equivalent¶
Local discharge energy equivalent time series, given together with turbine PQ-curves. The time period must be aligned with pq_curves. If using a repeating PQ-curve, discharge energy equivalent must be within the same range. If unsure, use W01 (kWh/m^3)
Required: no
- property gross_head_max_discharge¶
Maximum discharge as function of gross head (m3/s - m)
Required: no
- property max_bypass_curve¶
Max bypass curve (m3/sec)
Required: no
- property max_bypass_scale¶
Max bypass scaling factor. Only used for series from historical.h5 (factor)
Required: no
- property max_bypass_series_name¶
Max bypass series name in historical.h5 (string)
Required: no
- property max_discharge_curve¶
Max discharge curve (m3/sec)
Required: no
- property max_discharge_scale¶
Scale factor of the input series. Only used for series from historical.h5 (factor)
Required: no
- property max_discharge_series_name¶
Series name for max discharge series in historical.h5 (string)
Required: no
- property metadata¶
User metadata
Required: no
- property min_bypass_curve¶
Min bypass curve (m3/sec)
Required: no
- property min_bypass_scale¶
Min bypass scaling factor. Only used for series from historical.h5 (factor)
Required: no
- property min_bypass_series_name¶
Min bypass series name in historical.h5 (string)
Required: no
- property min_discharge_curve¶
Min discharge curve (m3/sec)
Required: no
- property min_discharge_scale¶
Min discharge scaling factor. Only used for series from historical.h5 (factor)
Required: no
- property min_discharge_series_name¶
Min discharge series name in historical.h5 (string)
Required: no
- property name¶
Object name
Required: yes
- property ownership¶
Ownership of this module. In percent (%)
Required: no
- property pq_curves¶
PQ efficiency curves. Must be used with discharge energy equivalent. Timestamps must also be in the same period as discharge energy equivalent. (Time + X=m^3/sec Y=MW)
Required: no
Planned capacity outage for a plant (revision) (MW)
Required: no
- property unregulated_inflow¶
Unregulated inflow time series (m^3/sec)
Required: no
- property unregulated_inflow_name¶
Inflow series name
Required: no
- property what¶
A static property returning the string ‘plant’
- class pyltm.Pump¶
A pump represents pumped hydro. Pumped hydro is stored and available for discharge. Pump uses surplus power to store water in upper reservoirs. There are two kinds of pumps;
Station joined pumps
Standalone pumps
Station joined pump, connect the pump to the plant:
pump->plant.Standalone pump, insert the pump between upper and lower reservoirs:
upper->pump->lower.- property area_name¶
Area name
Required: no
- property average_power¶
Average pump power (MW)
Required: yes
Unforeseen downtimes capacity outage for a pump (havari) (MW)
Required: no
- property comment¶
User comment
Required: no
- property lower_reservoir_reference_curve¶
Lower reservoir reference curve. Pump will stop pumping if lower reservoir goes under this limit. If not set, a default value of an empty lower reservoir will be used. (timestamp, Mm3)
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property ownership¶
Pump ownership share (%)
Required: yes
- property pump_capacity¶
Pump capacity, pump height / flow (meter, m3/sec)
Required: yes
Planned capacity outage for a pump (revision) (MW)
Required: no
- property upper_reservoir_reference_curve¶
Upper reservoir reference curve. Pump will stop pumping if upper reservoir goes over this limit. If not set, a default value of a full upper reservoir will be used. (timestamp, Mm3)
Required: no
- property what¶
A static property returning the string ‘pump’
- class pyltm.PyExporter¶
- class pyltm.PyltmResult¶
- as_tuple(self: pyltm._core_pyltm.PyltmResult) tuple¶
- property data¶
- property results¶
- property time_axis¶
- class pyltm.Reservoir¶
A reservoir is one of the main components in a detailed hydro power system. It stores water, receives inflow and discharges water to other modules and/or plants.
- property area_name¶
Area name
Required: no
- property average_regulated_inflow¶
Average yearly regulated inflow. (m^3/s)
Required: yes
- bypass(self: pyltm._core_pyltm.Reservoir, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Reservoir bypass over time (price segment resolution).
- property comment¶
User comment
Required: no
- property degree_of_regulation¶
Reservoir regulation capacity (reguleringsgrad) (factor)
Required: no
- discharge(self: pyltm._core_pyltm.Reservoir, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Reservoir discharge over time (price segment resolution).
- flow(self: pyltm._core_pyltm.Reservoir, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Flow exchange results for hydraulic coupling. Only available with EOPS, and a license enabling flow exchange results.
- property gross_head¶
Nominal gross head/level (brutto fallhoyde) (m)
Required: no
- property hc_has_gate¶
Hydraulic coupling has gate
Override has_gate in a hydraulic system per module
Required: no
- property hc_max_flow¶
Hydraulic coupling max flow
Override max_flow in a hydraulic system per module
Required: no
- inflow(self: pyltm._core_pyltm.Reservoir, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Reservoir inflow over time (price segment resolution).
- property initial_volume¶
Reservoir initial volume. (Mm3)
Required: no
- property max_bypass_curve¶
Max bypass curve
Time dependent curve for maximum allowed bypass (m3/sec)
Required: no
- property max_bypass_scale¶
Max bypass scaling factor (factor)
Required: no
- property max_bypass_series_name¶
Max bypass series name (string)
Required: no
- property max_discharge¶
Maximum production discharge (m^3/sec)
Required: yes
- property max_discharge_curve¶
Max discharge curve (m3/sec)
Required: no
- property max_discharge_scale¶
Scale factor of the input series (factor)
Required: no
- property max_discharge_series_name¶
Series name for max discharge series (string)
Required: no
- property max_volume¶
Maximum volume of this reservoir (Million m^3)
Required: no
- property max_volume_curve¶
Restriction 1, reservoir max volume (Mm3)
Required: no
- property max_volume_curve_hard_limit¶
Restriction 1, reservoir has max volume hard limit (bool)
Required: no
- property metadata¶
User metadata
Required: no
- property min_bypass_curve¶
Min bypass curve (m3/sec)
Required: no
- property min_bypass_scale¶
Min bypass scaling factor (factor)
Required: no
- property min_bypass_series_name¶
Min bypass series name (string)
Required: no
- property min_discharge_curve¶
Min discharge curve (m3/sec)
Required: no
- property min_discharge_scale¶
Min discharge scaling factor (factor)
Required: no
- property min_discharge_series_name¶
Min discharge series name (string)
Required: no
- property min_volume_curve¶
Restriction 2, reservoir min volume (Mm3)
Required: no
- property min_volume_curve_hard_limit¶
Restriction 2, reservoir has min volume hard limit (bool)
Required: no
- property module_number¶
Automatically generated DETD module number. Used by LTM to build relations between modules.
Required: yes
- property name¶
Object name
Required: yes
- production(self: pyltm._core_pyltm.Reservoir, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Reservoir/plant production over time (price segment resolution).
- property reference_curve¶
Reservoir reference curve (Million m^3)
Required: yes
- property regulated_inflow¶
Regulated inflow time series (m^3/sec)
Required: no
- property regulated_inflow_name¶
Inflow series name
Required: no
- reservoir(self: pyltm._core_pyltm.Reservoir, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Reservoir filling over time (price segment resolution).
- property reservoir_type¶
Regulation or buffer reservoir
Required: no
- spill(self: pyltm._core_pyltm.Reservoir, time_axis: bool = True) pyltm._core_pyltm.PyltmResult¶
Reservoir spill over time (price segment resolution).
- property tailrace_elevation¶
Plant tailrace elevation (utlopskote stasjon) (m)
Required: no
- property volume_curve¶
Reservoir volume curve (meter / Mm3)
Required: no
- property what¶
A static property returning the string ‘reservoir’
- class pyltm.ReservoirType¶
Members:
REGULATION
BUFFER
invalid_reservoir_type
- BUFFER = <ReservoirType.BUFFER: 1>¶
- REGULATION = <ReservoirType.REGULATION: 0>¶
- invalid_reservoir_type = <ReservoirType.invalid_reservoir_type: 2>¶
- property name¶
- property value¶
- class pyltm.SecondaryPriceSeries¶
Secondary price series
Secondary price series is used to set exogenous prices different from the main price series. Several price series can be defined.
The series is connected to a market step.
- property comment¶
User comment
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property probabilities¶
Option to customise probabilities of the price scenarios. Use to override the default where each price scenario receives equal probability.
Required: no
- property series¶
Price series values1. Given as a flattened Txy of 1931_1, 1931_2, 1932_1, … (Unknown)
Required: yes
- property what¶
A static property returning the string ‘price_series_secondary’
- class pyltm.SimulationType¶
Members:
Serial
Parallel
invalid_simulation_type
- Parallel = <SimulationType.Parallel: 1>¶
- Serial = <SimulationType.Serial: 0>¶
- invalid_simulation_type = <SimulationType.invalid_simulation_type: 2>¶
- property name¶
- property value¶
- class pyltm.Solar¶
Solar power production. Connects to an area.
- property area_name¶
Area name
Required: no
- property capacity¶
Solar power (MW)
Required: yes
- property comment¶
User comment
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property what¶
A static property returning the string ‘solar’
- class pyltm.Spill¶
Use a spill to change the outlet from the default discharge outlet to another reservoir. Can also go to the sea.
- property comment¶
User comment
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property what¶
A static property returning the string ‘spill’
- class pyltm.Txy¶
- property external_reference¶
- property is_periodic¶
Is a repeating timeseries. Only relevant for TxyLin
- property ltm_core_linear_interpolation¶
Will be linearized in LTM Core. Only relevant for TxyLin
- property name¶
Optional name.
- property scenarios¶
Array of double for values corresponding to time in timestaps.
- property timestamps¶
Array of strings with timestamps.
- property unit¶
Unit for values in scenarios.
- class pyltm.TxyLin¶
- property external_reference¶
- property name¶
Optional name.
- property scenarios¶
Array of double for values corresponding to time in timestaps.
- property timestamps¶
Array of strings with timestamps.
- property unit¶
Unit for values in scenarios.
- class pyltm.V10DatasetConverter¶
- export_exogenous_prices(self: pyltm._core_pyltm.V10DatasetConverter, externalDataType: pyltm._core_pyltm.ExternalDataType, externalDataFilename: str = '', filename: str = 'exogenous_prices.h5') json¶
- export_historical(self: pyltm._core_pyltm.V10DatasetConverter, externalDataType: pyltm._core_pyltm.ExternalDataType, externalDataFilename: str = '', filename: str = 'historical.h5', scaleFactor: float = 1.0) json¶
- export_tidsseriedata(self: pyltm._core_pyltm.V10DatasetConverter, externalDataType: pyltm._core_pyltm.ExternalDataType, externalDataFilename: str = '', filename: str = 'TidsserieData.h5') json¶
- read_revisjonsplan_stas(*args, **kwargs)¶
Overloaded function.
read_revisjonsplan_stas(self: pyltm._core_pyltm.V10DatasetConverter, filename: str) -> json
read_revisjonsplan_stas(self: pyltm._core_pyltm.V10DatasetConverter) -> json
- class pyltm.Watercourse¶
Water course exists as an object placeholder. Currently not used.
- property area_name¶
Area name
Required: no
- property comment¶
User comment
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property what¶
A static property returning the string ‘watercourse’
- class pyltm.Wind¶
Wind power generation. Connects to an area.
- property area_name¶
Area name
Required: no
- property capacity¶
Wind power (MW)
Required: yes
- property comment¶
User comment
Required: no
- property metadata¶
User metadata
Required: no
- property name¶
Object name
Required: yes
- property what¶
A static property returning the string ‘wind’
- class pyltm.WindData¶