Market Coefficients Module¶
This module provides functions for analyzing supply and demand market data to prepare values for the price zone coefficients based on EPEX Spot data format. As well as cleaning data downloaded from ENTSO-E for load and generation trends.
functions are found in pyflow_acdc.Market_Coeff
Price Zone Coefficient Analysis¶
Obtain price zone coefficients¶
- price_zone_coef_data(df, start, end, increase_eq_price=50)¶
Analyzes market data to generate price zone coefficients.
Parameter
Type
Description
Default
Units
dfDataFrame
Market data
Required
startint
Start hour
Required
hour
endint
End hour
Required
hour
increase_eq_pricefloat
Price increase for equilibrium
50
€/MWh
Returns a list of dictionaries containing:
Date- Date of the dataHour- Hour of the dataSell- Supply curve dataPurchase- Demand curve dataIntegrated_sets- Benefit of consumption and cost of generation from integral of supply and demand curvesDem_data_points- Number of demand data pointsGen_data_points- Number of supply data pointsmax_gen- Maximum supply valuemin_demand- Minimum demand valueMarket_price- Market clearing priceVolume_eq- Market clearing volumepoly- Dictionary containing polynomial coefficientsprediction_BC- Predicted benefit of consumptionprediction_CG- Predicted cost of generationVolume_0- Volume where first positive price is supplied
And timing information with the following keys:
load data- Time taken to load dataavg process- Average time taken to process datatot process- Total time taken to process data
Export data to csv¶
- price_zone_data_pd(data, save_csv=None)¶
Converts market data to pandas DataFrame and saves it to a csv file.
Parameter
Type
Description
Default
datadict
Market data
Required
save_csvstr
Save csv file
None
Visualization¶
Generates plots of market curves.
- plot_curves(data, hour, name=None)¶
Creates visualization of market curves.
Parameter
Type
Description
Default
Units
datadict
Market data
Required
hourint
Hour to plot
Required
hour
namestr
Output filename
None
Creates subplots showing:
Supply and demand curves
Cost of generation curve
Integrated supply and demand
Price curves
Example
pyf.plot_curves(market_data, hour=12, name='Belgium')
ENTSO-E Data Cleaning¶
For the use of entsoe data cleaning, the data has to be structured as follows:
path
|-- key0
| |-- AGGREGATED_GENERATION_PER_TYPE_GENERATION_{year_0-1}12312300-{year_0}12312300.csv
| |-- GUI_TOTAL_LOAD_DAYAHEAD_{year_0-1}12312300-{year_0}12312300.csv
| |-- AGGREGATED_GENERATION_PER_TYPE_GENERATION_{year_1-1}12312300-{year_1}12312300.csv
| |-- GUI_TOTAL_LOAD_DAYAHEAD_{year_1-1}12312300-{year_1}12312300.csv
| |-- ...
|-- key1
| |-- ...
|-- ...
This is the name of the files when downloaded from ENTSO-E transparency platform.
- clean_entsoe_data(key_list, year_list, production_types=[], output_excel=None,path=None):
Process generation and load data for multiple areas/years and save to Excel.
Parameter
Type
Description
Default
key_listlist
List of keys
Required
year_listlist
List of years
Required
production_typeslist
Reduced list of production types
All
output_excelstr
Output excel file
output_data.xlsx
pathstr
Path to save the excel file
Current working directory
Returns
Excel file containing the following sheets:
Maximum values- Contains maximum values for each columnyear_0- Contains normalized data for the first yearyear_n- Contains normalized data for subsequent years