Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 12 additions & 12 deletions CaseStudy.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self,
self.dGlobal_Scenarios = dGlobal_Scenarios
else:
self.global_scenarios_file = global_scenarios_file
self.dGlobal_Scenarios = ExcelReader.get_dGlobal_Scenarios(self.data_folder + self.global_scenarios_file)
self.dGlobal_Scenarios = ExcelReader.get_Global_Scenarios(self.data_folder + self.global_scenarios_file)

if dPower_Parameters is not None:
self.dPower_Parameters = dPower_Parameters
Expand All @@ -57,37 +57,37 @@ def __init__(self,
self.dPower_BusInfo = dPower_BusInfo
else:
self.power_businfo_file = power_businfo_file
self.dPower_BusInfo = ExcelReader.get_dPower_BusInfo(self.data_folder + self.power_businfo_file)
self.dPower_BusInfo = ExcelReader.get_Power_BusInfo(self.data_folder + self.power_businfo_file)

if dPower_Network is not None:
self.dPower_Network = dPower_Network
else:
self.power_network_file = power_network_file
self.dPower_Network = ExcelReader.get_dPower_Network(self.data_folder + self.power_network_file)
self.dPower_Network = ExcelReader.get_Power_Network(self.data_folder + self.power_network_file)

if dPower_Demand is not None:
self.dPower_Demand = dPower_Demand
else:
self.power_demand_file = power_demand_file
self.dPower_Demand = ExcelReader.get_dPower_Demand(self.data_folder + self.power_demand_file)
self.dPower_Demand = ExcelReader.get_Power_Demand(self.data_folder + self.power_demand_file)

if dPower_WeightsRP is not None:
self.dPower_WeightsRP = dPower_WeightsRP
else:
self.power_weightsrp_file = power_weightsrp_file
self.dPower_WeightsRP = ExcelReader.get_dPower_WeightsRP(self.data_folder + self.power_weightsrp_file)
self.dPower_WeightsRP = ExcelReader.get_Power_WeightsRP(self.data_folder + self.power_weightsrp_file)

if dPower_WeightsK is not None:
self.dPower_WeightsK = dPower_WeightsK
else:
self.power_weightsk_file = power_weightsk_file
self.dPower_WeightsK = ExcelReader.get_dPower_WeightsK(self.data_folder + self.power_weightsk_file)
self.dPower_WeightsK = ExcelReader.get_Power_WeightsK(self.data_folder + self.power_weightsk_file)

if dPower_Hindex is not None:
self.dPower_Hindex = dPower_Hindex
else:
self.power_hindex_file = power_hindex_file
self.dPower_Hindex = ExcelReader.get_dPower_Hindex(self.data_folder + self.power_hindex_file)
self.dPower_Hindex = ExcelReader.get_Power_Hindex(self.data_folder + self.power_hindex_file)

self.rpTransitionMatrixAbsolute, self.rpTransitionMatrixRelativeTo, self.rpTransitionMatrixRelativeFrom = self.get_rpTransitionMatrices()

Expand All @@ -96,34 +96,34 @@ def __init__(self,
self.dPower_ThermalGen = dPower_ThermalGen
else:
self.power_thermalgen_file = power_thermalgen_file
self.dPower_ThermalGen = ExcelReader.get_dPower_ThermalGen(self.data_folder + self.power_thermalgen_file)
self.dPower_ThermalGen = ExcelReader.get_Power_ThermalGen(self.data_folder + self.power_thermalgen_file)

if self.dPower_Parameters["pEnableVRES"]:
if dPower_VRES is not None:
self.dPower_VRES = dPower_VRES
else:
self.power_vres_file = power_vres_file
self.dPower_VRES = ExcelReader.get_dPower_VRES(self.data_folder + self.power_vres_file)
self.dPower_VRES = ExcelReader.get_Power_VRES(self.data_folder + self.power_vres_file)

if dPower_VRESProfiles is not None:
self.dPower_VRESProfiles = dPower_VRESProfiles
elif os.path.isfile(self.data_folder + power_vresprofiles_file):
self.power_vresprofiles_file = power_vresprofiles_file
self.dPower_VRESProfiles = ExcelReader.get_dPower_VRESProfiles(self.data_folder + self.power_vresprofiles_file)
self.dPower_VRESProfiles = ExcelReader.get_Power_VRESProfiles(self.data_folder + self.power_vresprofiles_file)

if self.dPower_Parameters["pEnableStorage"]:
if dPower_Storage is not None:
self.dPower_Storage = dPower_Storage
else:
self.power_storage_file = power_storage_file
self.dPower_Storage = ExcelReader.get_dPower_Storage(self.data_folder + self.power_storage_file)
self.dPower_Storage = ExcelReader.get_Power_Storage(self.data_folder + self.power_storage_file)

if self.dPower_Parameters["pEnableVRES"] or self.dPower_Parameters["pEnableStorage"]:
if dPower_Inflows is not None:
self.dPower_Inflows = dPower_Inflows
elif os.path.isfile(self.data_folder + power_inflows_file):
self.power_inflows_file = power_inflows_file
self.dPower_Inflows = ExcelReader.get_dPower_Inflows(self.data_folder + self.power_inflows_file)
self.dPower_Inflows = ExcelReader.get_Power_Inflows(self.data_folder + self.power_inflows_file)

if self.dPower_Parameters["pEnablePowerImportExport"]:
if dPower_ImpExpHubs is not None:
Expand Down
41 changes: 27 additions & 14 deletions ExcelReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __read_pivoted_file(excel_file_path: str, version_specifier: str, indices: l
return df


def get_dData_Packages(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Data_Packages(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dData_Packages data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -98,7 +98,7 @@ def get_dData_Packages(excel_file_path: str, keep_excluded_entries: bool = False
return dData_Packages


def get_dData_Sources(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Data_Sources(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dData_Sources data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -114,7 +114,7 @@ def get_dData_Sources(excel_file_path: str, keep_excluded_entries: bool = False,
return dData_Sources


def get_dGlobal_Scenarios(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Global_Scenarios(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dGlobal_Scenarios data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -132,7 +132,7 @@ def get_dGlobal_Scenarios(excel_file_path: str, keep_excluded_entries: bool = Fa
return dGlobal_Scenarios


def get_dPower_BusInfo(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Power_BusInfo(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dPower_BusInfo data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -145,7 +145,7 @@ def get_dPower_BusInfo(excel_file_path: str, keep_excluded_entries: bool = False
return dPower_BusInfo


def get_dPower_Demand(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Power_Demand(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dPower_Demand data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -161,7 +161,7 @@ def get_dPower_Demand(excel_file_path: str, keep_excluded_entries: bool = False,
return dPower_Demand


def get_dPower_Hindex(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Power_Hindex(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dPower_Hindex data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -177,7 +177,7 @@ def get_dPower_Hindex(excel_file_path: str, keep_excluded_entries: bool = False,
return dPower_Hindex


def get_dPower_Inflows(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Power_Inflows(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dPower_Inflows data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -193,7 +193,7 @@ def get_dPower_Inflows(excel_file_path: str, keep_excluded_entries: bool = False
return dPower_Inflows


def get_dPower_Network(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Power_Network(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dPower_Network data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -206,7 +206,7 @@ def get_dPower_Network(excel_file_path: str, keep_excluded_entries: bool = False
return dPower_Network


def get_dPower_Storage(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Power_Storage(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dPower_Storage data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -219,7 +219,7 @@ def get_dPower_Storage(excel_file_path: str, keep_excluded_entries: bool = False
return dPower_Storage


def get_dPower_ThermalGen(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Power_ThermalGen(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dPower_ThermalGen data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -232,7 +232,7 @@ def get_dPower_ThermalGen(excel_file_path: str, keep_excluded_entries: bool = Fa
return dPower_ThermalGen


def get_dPower_VRES(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Power_VRES(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dPower_VRES data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -245,7 +245,7 @@ def get_dPower_VRES(excel_file_path: str, keep_excluded_entries: bool = False, f
return dPower_VRES


def get_dPower_VRESProfiles(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Power_VRESProfiles(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dPower_VRESProfiles data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -261,7 +261,7 @@ def get_dPower_VRESProfiles(excel_file_path: str, keep_excluded_entries: bool =
return dPower_VRESProfiles


def get_dPower_WeightsK(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Power_WeightsK(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dPower_WeightsK data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -277,7 +277,7 @@ def get_dPower_WeightsK(excel_file_path: str, keep_excluded_entries: bool = Fals
return dPower_WeightsK


def get_dPower_WeightsRP(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
def get_Power_WeightsRP(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dPower_WeightsRP data from the Excel file.
:param excel_file_path: Path to the Excel file
Expand All @@ -293,6 +293,19 @@ def get_dPower_WeightsRP(excel_file_path: str, keep_excluded_entries: bool = Fal
return dPower_WeightsRP


def get_Power_Wind_TechnicalDetails(excel_file_path: str, keep_excluded_entries: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame:
"""
Read the dPower_Wind_TechnicalDetails data from the Excel file.
:param excel_file_path: Path to the Excel file
:param keep_excluded_entries: Do not exclude any entries which are marked to be excluded in the Excel file
:param fail_on_wrong_version: If True, raise an error if the version of the Excel file does not match the expected version
:return: dPower_Wind_TechnicalDetails
"""
dPower_Wind_TechnicalDetails = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["g"], True, keep_excluded_entries, fail_on_wrong_version)

return dPower_Wind_TechnicalDetails


def compare_Excels(source_path: str, target_path: str, dont_check_formatting: bool = False) -> bool:
"""
Compare two Excel files for differences in formatting and values.
Expand Down
Loading
Loading