Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
43ac75b
Update all setting up files
erikfilias Aug 29, 2022
4996d01
Create __init__.py
erikfilias Aug 29, 2022
2aa1268
Create README.md
erikfilias Aug 29, 2022
437ae1b
Create Create_openTEPES_RTS-GMLC.py
erikfilias Aug 29, 2022
9a95086
Create 1-parse-SourceData-to-Dictionaries.py
erikfilias Aug 29, 2022
9ebcd77
Update Create_openTEPES_RTS-GMLC.py
erikfilias Aug 30, 2022
f4c4ea8
Update 1-parse-SourceData-to-Dictionaries.py
erikfilias Aug 30, 2022
c6e47a9
Update __init__.py
erikfilias Aug 30, 2022
985d5af
Update all
erikfilias Aug 30, 2022
b544423
Update all
erikfilias Aug 30, 2022
a34597d
Update all
erikfilias Aug 30, 2022
52b9c09
Update SourceDataToDictionaries.py
erikfilias Aug 30, 2022
82eaefd
Update all
erikfilias Aug 30, 2022
cbae213
Create oT_Dict_Technology_RTS-GMLC.csv
erikfilias Aug 30, 2022
fdb3d99
Update __init__.py
erikfilias Aug 30, 2022
9931788
Create SourceDataToData.py
erikfilias Aug 30, 2022
6b5a72f
Update SourceDataToDictionaries.py
erikfilias Aug 30, 2022
b1490e3
Update SourceDataToData.py
erikfilias Aug 30, 2022
976b03e
Updating all
erikfilias Aug 31, 2022
9102158
update all
erikfilias Aug 31, 2022
b36cc25
Update SourceDataToData.py
erikfilias Sep 1, 2022
5b0ae83
Update all
erikfilias Sep 1, 2022
a4996e9
Update all
erikfilias Sep 1, 2022
81448c1
Update all
erikfilias Sep 1, 2022
28f9e21
Update all
erikfilias Sep 1, 2022
3cf3dea
Update all
erikfilias Sep 1, 2022
096007f
Update SourceDataToData.py
erikfilias Sep 1, 2022
db81db0
Update all
erikfilias Sep 1, 2022
86ff1b1
Update all
erikfilias Sep 1, 2022
bd30f22
Update SourceDataToData.cpython-39.pyc
erikfilias Sep 1, 2022
48ecdbe
Update all
erikfilias Sep 1, 2022
11fcaf0
Update all
erikfilias Sep 2, 2022
0155831
Update oT_Data_Parameter_RTS-GMLC.csv
erikfilias Sep 2, 2022
2ab0df1
Update README.md
erikfilias Sep 2, 2022
afb241c
Update README.md
erikfilias Sep 2, 2022
20b55a7
Delete .gitignore
erikfilias Sep 2, 2022
ec779db
Delete RTS-GMLC.iml
erikfilias Sep 2, 2022
612bf1d
Delete profiles_settings.xml
erikfilias Sep 2, 2022
29cf2ba
Delete misc.xml
erikfilias Sep 2, 2022
eaafa1a
Delete modules.xml
erikfilias Sep 2, 2022
deb424a
Delete vcs.xml
erikfilias Sep 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Libraries
import time
import pandas as pd


def GettingDataTo_oTDict(_path_data, _path_file, CaseName):
print('Transforming data to get the oT_Dict files ****')

StartTime = time.time()

# reading data from the folder SourceData
df_bus = pd.read_csv(_path_data+'/SourceData/bus.csv' )
df_branch = pd.read_csv(_path_data+'/SourceData/branch.csv')
df_gen = pd.read_csv(_path_data+'/SourceData/gen.csv' )

# reading data from the folder timeseries_data_file
df_TS_CSP = pd.read_csv(_path_data + '/timeseries_data_files/CSP/DAY_AHEAD_Natural_Inflow.csv')


# Extracting regions
pRegions = pd.Series(['Region_1'])
pRegions.to_frame(name='Region').to_csv(_path_file+'/RTS-GMLC/oT_Dict_Region_'+CaseName+'.csv', sep=',', index=False)

# Extracting areas
IdxAreas = df_bus['Area'].unique()
pAreas = pd.Series(['Area_'+str(int(i)) for i in IdxAreas])
pAreas.to_frame(name='Area').to_csv(_path_file+'/RTS-GMLC/oT_Dict_Area_'+CaseName+'.csv', sep=',', index=False)

# Extracting zones
IdxZones = df_bus['Zone'].unique()
pZones = pd.Series(['Zone_'+str(int(i)) for i in IdxZones])
pZones.to_frame(name='Zone').to_csv(_path_file+'/RTS-GMLC/oT_Dict_Zone_'+CaseName+'.csv', sep=',', index=False)

# Extracting nodes
IdxNodes = df_bus['Bus ID'].unique()
pNodes = pd.Series(['Node_'+str(int(i)) for i in IdxNodes])
pNodes.to_frame(name='Node').to_csv(_path_file+'/RTS-GMLC/oT_Dict_Node_'+CaseName+'.csv', sep=',', index=False)

# From Node to Zone
Nodes = ['Node_' + str(int(df_bus['Bus ID'][i])) for i in df_bus.index]
Zones = ['Zone_' + str(int(df_bus['Zone' ][i])) for i in df_bus.index]
pNodeToZone = pd.DataFrame({'Node': Nodes, 'Zone': Zones})
pNodeToZone.to_csv(_path_file+'/RTS-GMLC/oT_Dict_NodeToZone_'+CaseName+'.csv', sep=',', index=False)

# From Zone to Area
Areas = ['Area_' + str(int(df_bus['Area'][i])) for i in df_bus.index]
pZoneToArea = pd.DataFrame({'Zone': Zones, 'Area': Areas}).set_index(['Zone', 'Area'])
pZoneToArea = pZoneToArea[~pZoneToArea.index.duplicated(keep='first')].reset_index()
pZoneToArea.to_csv(_path_file+'/RTS-GMLC/oT_Dict_ZoneToArea_'+CaseName+'.csv', sep=',', index=False)

# From Area to Region
pAreaToRegion = pAreas.to_frame('Area')
pAreaToRegion['Region'] = 'Region_1'
pAreaToRegion.to_csv(_path_file + '/RTS-GMLC/oT_Dict_AreaToRegion_' + CaseName + '.csv', sep=',', index=False)

# Defining circuits
pCircuit = pd.Series(['eac1', 'eac2', 'eac3', 'eac4'])
pCircuit.to_frame(name='Circuit').to_csv(_path_file + '/RTS-GMLC/oT_Dict_Circuit_' + CaseName + '.csv', sep=',', index=False)

# Determining generators
IdxGenerator = df_gen['GEN UID'].unique()
pGenerator = pd.Series([i for i in IdxGenerator])
pGenerator.to_frame(name='Generator').to_csv(_path_file+'/RTS-GMLC/oT_Dict_Generation_'+CaseName+'.csv', sep=',', index=False)

# Defining line types
pLineType = pd.Series(['AC', 'DC'])
pLineType.to_frame(name='LineType').to_csv(_path_file + '/RTS-GMLC/oT_Dict_Line_' + CaseName + '.csv', sep=',', index=False)

# Defining load levels
df_TS_CSP['Month' ] = df_TS_CSP.Month.map("{:02}".format)
df_TS_CSP['Day' ] = df_TS_CSP.Day.map("{:02}".format)
df_TS_CSP['Period'] = df_TS_CSP.Period.map("{:02}".format)
LoadLevels = [str(df_TS_CSP['Month'][i])+str(df_TS_CSP['Day'][i])+str(df_TS_CSP['Period'][i]) for i in df_TS_CSP.index]
pLoadLevels = pd.DataFrame({'LoadLevel': LoadLevels})
pLoadLevels.to_csv(_path_file + '/RTS-GMLC/oT_Dict_LoadLevel_' + CaseName + '.csv', sep=',', index=False)

# Defining the Period
IdxPeriod = df_TS_CSP['Year'].unique()
pPeriod = pd.Series([i for i in IdxPeriod])
pPeriod.to_frame(name='Period').to_csv(_path_file+'/RTS-GMLC/oT_Dict_Period_'+CaseName+'.csv', sep=',', index=False)

# Defining the Scenario
pScenarios = pd.Series(['sc01'])
pScenarios.to_frame(name='Scenario').to_csv(_path_file+'/RTS-GMLC/oT_Dict_Scenario_'+CaseName+'.csv', sep=',', index=False)

# Defining the Stage
pStage = pd.Series(['st0'])
pStage.to_frame(name='Stage').to_csv(_path_file+'/RTS-GMLC/oT_Dict_Stage_'+CaseName+'.csv', sep=',', index=False)

# Defining the storage type
pStorageType = pd.Series(['Daily', 'Weekly'])
pStorageType.to_frame(name='StorageType').to_csv(_path_file+'/RTS-GMLC/oT_Dict_Storage_'+CaseName+'.csv', sep=',', index=False)

# Defining the generation technologies
IdxTechno = df_gen['Fuel'].unique()
pTechnology = pd.Series([i for i in IdxTechno])
pTechnology.to_frame(name='Technology').to_csv(_path_file+'/RTS-GMLC/oT_Dict_Technology_'+CaseName+'.csv', sep=',', index=False)

oT_Dict_Time = time.time() - StartTime
print('oT_Dict files generation ... ', round(oT_Dict_Time), 's')
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
Open Generation, Storage, and Transmission Operation and Expansion Planning Model with RES and ESS (openTEPES)


Args:
case: Name of the folder where the CSV files of the case are found
dir: Main path where the case folder can be found
solver: Name of the solver

Returns:
Output results in CSV files that are found in the case folder.

# Examples:
# >>> import openTEPES as oT
# >>> oT.routine("9n", "C:\\Users\\UserName\\Documents\\GitHub\\openTEPES", "glpk")
"""
# __version__ = "4.8.0"

from .SourceDataToDictionaries import GettingDataTo_oTDict
from .SourceDataToData import GettingDataTo_oTData
Binary file not shown.
Binary file not shown.
Binary file not shown.
19 changes: 19 additions & 0 deletions RTS_Data/FormattedData/openTEPES/Create_openTEPES_RTS-GMLC.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Libraries
import os
import pandas as pd

import Create_openTEPES_InputData as ID

CaseName = 'RTS-GMLC'

# Setting up the path
_path_data = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', '..'))
_path_file = os.path.dirname(__file__)

print('*** Creating the case RTS-GLC in openTEPES format ****')

ID.GettingDataTo_oTDict(_path_data, _path_file, CaseName)

ID.GettingDataTo_oTData(_path_data, _path_file, CaseName)

print('*** End ****')
9 changes: 9 additions & 0 deletions RTS_Data/FormattedData/openTEPES/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**The workflow to create the input data for openTEPES based on the RTS-GMLC is as follows:**

1. Run the python script Create_openTEPES_RTS-GMLC.py in the openTEPES directory. This file will import data from the SourceData folder and then write files out into the subfolder *RTS-GMLC*, which are used in the next step.
2. The files (CSV files) in the subfolder *RTS-GMLC* are in the openTEPES format which are classified between dictionaries and data. Then, the openTEPES should be installed by:
```
pip install openTEPES
```
3. Execute the openTEPES following the instruction (those written in its repository). Give the path of the subfolder *openTEPES* and the CaseName (RTS-GMLC).
4. The solution will be on the subfolder *RTS-GMLC* in CSV and HTML files.
Loading