From 300db6ac4a2e1ebf87661fbf5b728f27f54a73b0 Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Thu, 24 Jul 2025 13:08:29 +0200 Subject: [PATCH 01/15] Sort TableDefinitions and changelog alphabetically Add SOCP as option to Network -> v0.1.2 --- TableDefinitions.xml | 144 ++++++++++++++++---------------- changelog-LEGOExcels.md | 130 ++++++++++++++-------------- data/example/Power_Network.xlsx | Bin 14045 -> 13990 bytes 3 files changed, 139 insertions(+), 135 deletions(-) diff --git a/TableDefinitions.xml b/TableDefinitions.xml index 5497860..7ea80a0 100644 --- a/TableDefinitions.xml +++ b/TableDefinitions.xml @@ -1,56 +1,41 @@ - - + + v0.1.0 - Global - Scenarios and Probabilities - 30.0 + Data Packages + 45.0 - + - - + - - v0.1.2 - Power - Relation among periods and representative periods - 30.0 - - - - - - - - - - - - v0.1.3 - Power - Weights of representative periods - 30.0 + + v0.1.0 + Data Sources + 45.0 - - - - - + + + + + + - - v0.1.3 - Power - Weights of representative hours + + v0.1.0 + Global - Scenarios and Probabilities 30.0 - - - - - - + + + + + @@ -77,8 +62,36 @@ + + v0.1.2 + Power - Demand + 30.0 + + + + + + + + + + + + v0.1.2 + Power - Relation among periods and representative periods + 30.0 + + + + + + + + + + - v0.1.1 + v0.1.2 Power - Network 45.0 @@ -103,20 +116,6 @@ - - v0.1.2 - Power - Demand - 30.0 - - - - - - - - - - v0.1.1 Power - Thermal Generators @@ -197,29 +196,30 @@ - - v0.1.0 - Data Sources - 45.0 + + v0.1.3 + Power - Weights of representative hours + 30.0 - - - - - - + + + + + - - v0.1.0 - Data Packages - 45.0 + + v0.1.3 + Power - Weights of representative periods + 30.0 - - - + + + + + @@ -557,7 +557,7 @@ Technical Representation Technical representation of line in model - [DC-OPF,TP,SN] + [SOCP,DC-OPF,TP,SN] 26.0 general diff --git a/changelog-LEGOExcels.md b/changelog-LEGOExcels.md index bbdf67c..fc5a816 100644 --- a/changelog-LEGOExcels.md +++ b/changelog-LEGOExcels.md @@ -1,61 +1,22 @@ -# Global_Scenarios - -## v0.1.0 - -Very first version. - -# Power_Hindex - -## v0.1.1 → v0.1.2 - -Adjust column widths. - -## v0.1.0 → v0.1.1 - -Fix description for columns 'rp' and 'k' to be more general. +# Data_Packages -## v0.0.2r → v0.1.0 +## v0.0.2 → v0.1.0 Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in -formatting and description texts. - -# Power_WeightsRP - -## v0.1.2 → v0.1.3 - -Adjust column widths and number formatting of weights. - -## v0.1.1 → v0.1.2 - -Fix formatting of pWeight_rp column. - -## v0.1.0 → v0.1.1 +formatting and description texts. Change of identifier from 'packageName' to 'dataPackage'. -Fix description for column 'rp' to be more general. +# Data_Sources ## v0.0.2 → v0.1.0 Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in -formatting and description texts. - -# Power_WeightsK - -## v0.1.2 → v0.1.3 - -Adjust column widths. - -## v0.1.1 → v0.1.2 - -Fix formatting of pWeight_k column. - -## v0.1.0 → v0.1.1 +formatting and description texts. Change of identifier from 'sourceName' to 'dataSource'. -Fix description for column 'k' to be more general. +# Global_Scenarios -## v0.0.2r → v0.1.0 +## v0.1.0 -Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in -formatting and description texts. +Very first version. # Power_BusInfo @@ -109,17 +70,6 @@ formatting and description texts. | Power_BusInfo | O8 (and others) | 'Yes' | '1' | Entered Value Changed. | | Power_BusInfo | A4 | 'Background color: Color [Window], Foreground color: Color [WindowText], Font: [Font: Name=Microsoft Sans Serif, Size=11, Units=3, GdiCharSet=1, GdiVerticalFont=False], Format code: ' | 'Background color: Color [A=255, R=216, G=216, B=216], Foreground color: Color [WindowText], Font: [Font: Name=Microsoft Sans Serif, Size=11, Units=3, GdiCharSet=1, GdiVerticalFont=False], Format code: ' | Cell Formatting Changed | -# Power_Network - -## v0.1.0 → v0.1.1 - -Fix comment in 'excl' column, adjust columnd widths. - -## v0.0.4r → v0.1.0 - -Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in -formatting and description texts. - # Power_Demand ## v0.1.1 → v0.1.2 @@ -168,6 +118,21 @@ formatting and description texts. | Power_Network | L8 (and others) | 'No' | '0' | Entered Value Changed. | | Power_Network | A4 | 'Background color: Color [Window], Foreground color: Color [WindowText], Font: [Font: Name=Microsoft Sans Serif, Size=11, Units=3, GdiCharSet=1, GdiVerticalFont=False], Format code: ' | 'Background color: Color [A=255, R=216, G=216, B=216], Foreground color: Color [WindowText], Font: [Font: Name=Microsoft Sans Serif, Size=11, Units=3, GdiCharSet=1, GdiVerticalFont=False], Format code: ' | Cell Formatting Changed | +# Power_Hindex + +## v0.1.1 → v0.1.2 + +Adjust column widths. + +## v0.1.0 → v0.1.1 + +Fix description for columns 'rp' and 'k' to be more general. + +## v0.0.2r → v0.1.0 + +Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in +formatting and description texts. + # Power_ThermalGen ## v0.1.0 → v0.1.1 @@ -313,16 +278,55 @@ formatting and description texts. Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in formatting and description texts. -# Data_Sources +# Power_WeightsK -## v0.0.2 → v0.1.0 +## v0.1.2 → v0.1.3 + +Adjust column widths. + +## v0.1.1 → v0.1.2 + +Fix formatting of pWeight_k column. + +## v0.1.0 → v0.1.1 + +Fix description for column 'k' to be more general. + +## v0.0.2r → v0.1.0 Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in -formatting and description texts. Change of identifier from 'sourceName' to 'dataSource'. +formatting and description texts. -# Data_Packages +# Power_WeightsRP + +## v0.1.2 → v0.1.3 + +Adjust column widths and number formatting of weights. + +## v0.1.1 → v0.1.2 + +Fix formatting of pWeight_rp column. + +## v0.1.0 → v0.1.1 + +Fix description for column 'rp' to be more general. ## v0.0.2 → v0.1.0 Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in -formatting and description texts. Change of identifier from 'packageName' to 'dataPackage'. +formatting and description texts. + +# Power_Network + +## \>v0.1.1 + +Please see git history of `TabbleDefinitions.xml`. + +## v0.1.0 → v0.1.1 + +Fix comment in 'excl' column, adjust columnd widths. + +## v0.0.4r → v0.1.0 + +Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in +formatting and description texts. diff --git a/data/example/Power_Network.xlsx b/data/example/Power_Network.xlsx index e0bf995babd72b8fc0e8dc8bb5f287d4fcc1187f..d2c543ff1be7a6528fdd14fb5a32f72ceea994dd 100644 GIT binary patch delta 11461 zcmeI2Ra9Ne_NO=Q?(QBOf(CaB?gV!df;$U$-?+QG6EwJMaECxbfDj;9u-+&4o^$`_ z^h5VckNeX5VXskZ%vJTPIm+fYYx8aCTQpTg7+72o2!sgYx4BJ3>jNMU{RA}@kz>fq z2`CT<3-YvZG*@+YeDA_;?&xgE=K0p4BvJYG00(N=^LVn)aVZH!RO1`5Y%vKl>IjU%oIhz3 z1*tyIQDJ`F{Jv<{?5u<({MKRkrPpNL_63T>U2;`EII&dzF8jE@XWMOcxP!*MB&k3lr~k9^$~9B8+<$4PXE)N{A48IWg`ub@5w#I<@!g$!TR85 z*E@iBp8pm4Qp1;D4x~vo-G*zs$3&MwU%nh7=B4-RiQsrw-A@#~gye>tOR zH5Yk_5e%f~DMxxu%E$5Ql{k~LECGiJ-2U9+*ew!S)@bK0F_^_}O&-QC&R z+OaG}sHQt-b7OULeRU$IyBo-9)+?590nX@SuV-lVX|Xp&!8VBs&Dn~n;|8=itd`(8 zHLqyb!V+JuOt+#n16o{G%j7kKVqDgPrcH?(-HmMM@j-qb~9;$lX#!qw@D$Sd?< zYixRWa(=JGr4KwHb``x?<&l|2CmJ%3$IlAfv6A1Ny}E8)Nrjsd0MbMue1^s6cC5=B zx-4Q9@*P9$c6OrPgcuCk{j{WWma*Fwiw7C5CoL|279t9T;WOHOnz375E`N5SJh|br zgL8P%yDU_WC{%uKbyG#>(x&KjYu7Mta|1J9yCvJrm8;Xq{Fbqg+Qg&Dupc~~x&&9A z^;%fRZa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W^XNxt2QRV7Z}tDoxc`xP$M%={-}(1n>Gz*s@bAn4TQK5( pJqa6w!K55eFb64Aoe%A=82@u~{!2C(jKT>G;G;wG=lVVMzW@-j4Br3% From d4622d32e2d181c08937de14c73417b8dc0e8c4e Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Thu, 24 Jul 2025 13:23:01 +0200 Subject: [PATCH 02/15] Sort tests alphabetically --- tests/test_ExcelReaderWriter.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_ExcelReaderWriter.py b/tests/test_ExcelReaderWriter.py index cbbd61e..0df6829 100644 --- a/tests/test_ExcelReaderWriter.py +++ b/tests/test_ExcelReaderWriter.py @@ -9,18 +9,18 @@ case_study_folder = "data/example/" ew = ExcelWriter() combinations = [ + ("Data_Packages", f"{case_study_folder}Data_Packages.xlsx", ExcelReader.get_dData_Packages, ew.write_dData_Packages), + ("Data_Sources", f"{case_study_folder}Data_Sources.xlsx", ExcelReader.get_dData_Sources, ew.write_dData_Sources), ("Global_Scenarios", f"{case_study_folder}Global_Scenarios.xlsx", ExcelReader.get_dGlobal_Scenarios, ew.write_dGlobal_Scenarios), - ("Power_Hindex", f"{case_study_folder}Power_Hindex.xlsx", ExcelReader.get_dPower_Hindex, ew.write_dPower_Hindex), - ("Power_WeightsRP", f"{case_study_folder}Power_WeightsRP.xlsx", ExcelReader.get_dPower_WeightsRP, ew.write_dPower_WeightsRP), - ("Power_WeightsK", f"{case_study_folder}Power_WeightsK.xlsx", ExcelReader.get_dPower_WeightsK, ew.write_dPower_WeightsK), ("Power_BusInfo", f"{case_study_folder}Power_BusInfo.xlsx", ExcelReader.get_dPower_BusInfo, ew.write_dPower_BusInfo), - ("Power_Network", f"{case_study_folder}Power_Network.xlsx", ExcelReader.get_dPower_Network, ew.write_dPower_Network), ("Power_Demand", f"{case_study_folder}Power_Demand.xlsx", ExcelReader.get_dPower_Demand, ew.write_dPower_Demand), + ("Power_Hindex", f"{case_study_folder}Power_Hindex.xlsx", ExcelReader.get_dPower_Hindex, ew.write_dPower_Hindex), + ("Power_Network", f"{case_study_folder}Power_Network.xlsx", ExcelReader.get_dPower_Network, ew.write_dPower_Network), ("Power_ThermalGen", f"{case_study_folder}Power_ThermalGen.xlsx", ExcelReader.get_dPower_ThermalGen, ew.write_dPower_ThermalGen), ("Power_VRES", f"{case_study_folder}Power_VRES.xlsx", ExcelReader.get_dPower_VRES, ew.write_VRES), ("Power_VRESProfiles", f"{case_study_folder}Power_VRESProfiles.xlsx", ExcelReader.get_dPower_VRESProfiles, ew.write_VRESProfiles), - ("Data_Sources", f"{case_study_folder}Data_Sources.xlsx", ExcelReader.get_dData_Sources, ew.write_dData_Sources), - ("Data_Packages", f"{case_study_folder}Data_Packages.xlsx", ExcelReader.get_dData_Packages, ew.write_dData_Packages), + ("Power_WeightsK", f"{case_study_folder}Power_WeightsK.xlsx", ExcelReader.get_dPower_WeightsK, ew.write_dPower_WeightsK), + ("Power_WeightsRP", f"{case_study_folder}Power_WeightsRP.xlsx", ExcelReader.get_dPower_WeightsRP, ew.write_dPower_WeightsRP), ] From b6060180b43e7f3eae3d96bb7de1cead08a2740c Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:26:34 +0200 Subject: [PATCH 03/15] Add Power_Storage to TableDefinitions --- CaseStudy.py | 10 +-- ExcelReader.py | 13 ++++ ExcelWriter.py | 9 +++ TableDefinitions.xml | 107 ++++++++++++++++++++++++++++++++ changelog-LEGOExcels.md | 4 ++ data/example/Power_Storage.xlsx | Bin 0 -> 9489 bytes tests/test_ExcelReaderWriter.py | 1 + 7 files changed, 135 insertions(+), 9 deletions(-) create mode 100644 data/example/Power_Storage.xlsx diff --git a/CaseStudy.py b/CaseStudy.py index 3d57f26..8185863 100644 --- a/CaseStudy.py +++ b/CaseStudy.py @@ -129,7 +129,7 @@ def __init__(self, self.dPower_Storage = dPower_Storage else: self.power_storage_file = power_storage_file - self.dPower_Storage = self.get_dPower_Storage() + self.dPower_Storage = ExcelReader.get_dPower_Storage(self.data_folder + self.power_vresprofiles_file) if self.dPower_Parameters["pEnablePowerImportExport"]: if dPower_ImpExpHubs is not None: @@ -330,14 +330,6 @@ def get_dPower_RoR(self): dPower_RoR['scenario'] = 'ScenarioA' # TODO: Fill this dynamically, once the Excel file is updated return dPower_RoR - def get_dPower_Storage(self): - dPower_Storage = self.read_generator_data(self.data_folder + self.power_storage_file) - - # If column 'scenario' is not present, add it - if 'scenario' not in dPower_Storage.columns: - dPower_Storage['scenario'] = 'ScenarioA' # TODO: Fill this dynamically, once the Excel file is updated - return dPower_Storage - def get_dPower_Inflows(self): dPower_Inflows = pd.read_excel(self.data_folder + self.power_inflows_file, skiprows=[0, 1, 3, 4, 5]) dPower_Inflows = dPower_Inflows.drop(dPower_Inflows.columns[0], axis=1) diff --git a/ExcelReader.py b/ExcelReader.py index e753250..3ad489e 100644 --- a/ExcelReader.py +++ b/ExcelReader.py @@ -177,6 +177,19 @@ def get_dPower_Demand(excel_file_path: str, keep_excluded_entries: bool = False, return dPower_Demand +def get_dPower_Storage(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: + """ + Read the dPower_Storage 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 do_not_convert_values: Skip the conversion of values + :return: dPower_Storage + """ + dPower_Storage = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["g"], True, keep_excluded_entries) + + return dPower_Storage + + def get_dPower_ThermalGen(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: """ Read the dPower_ThermalGen data from the Excel file. diff --git a/ExcelWriter.py b/ExcelWriter.py index 319fbe0..b500e09 100644 --- a/ExcelWriter.py +++ b/ExcelWriter.py @@ -258,6 +258,15 @@ def write_dPower_Demand(self, dPower_Demand: pd.DataFrame, folder_path: str) -> self._write_Excel_from_definition(dPower_Demand, folder_path, "Power_Demand") + def write_dPower_Storage(self, dPower_Storage: pd.DataFrame, folder_path: str) -> None: + """ + Write the dPower_Storage DataFrame to an Excel file in LEGO format. + :param dPower_Storage: DataFrame containing the dPower_Storage data. + :param folder_path: Path to the folder where the Excel file will be saved. + :return: None + """ + self._write_Excel_from_definition(dPower_Storage, folder_path, "Power_Storage") + def write_dPower_ThermalGen(self, dPower_ThermalGen: pd.DataFrame, folder_path: str) -> None: """ Write the dPower_ThermalGen DataFrame to an Excel file in LEGO format. diff --git a/TableDefinitions.xml b/TableDefinitions.xml index 7ea80a0..7ce31e0 100644 --- a/TableDefinitions.xml +++ b/TableDefinitions.xml @@ -116,6 +116,43 @@ + + v0.0.1 + Power - Storage + 60.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + v0.1.1 Power - Thermal Generators @@ -232,6 +269,13 @@ 15.0 general + + Charge Efficiency + Efficiency of charging the storage unit + [%, 0-1] + 21.0 + rightFloat2 + CO2Emis Specific CO2 emissions of the unit @@ -267,6 +311,13 @@ 23.86 general + + Discharge Efficiency + Efficiency of discharging the storage unit + [%, 0-1] + 21.0 + rightFloat2 + Efficiency Efficiency calculated as 1/input for 1 MWh, i.e. 0.5 (or 50%) if 2 MWh fuel are required for 1 MWh electricity @@ -288,6 +339,13 @@ 15.0 rightInt + + Energy to Power Ratio + Energy to power ratio of the storage unit + [h] + 22.0 + rightFloat1 + Excl. @@ -344,6 +402,13 @@ 15.0 rightFloat1 + + Initial Reserve + Initial reserve of the storage unit + [%, 0-1] + 15.0 + rightFloat2 + InvestCost Annualized investment cost per MW @@ -351,6 +416,27 @@ 15.0 rightFloat2 + + InvestCostPerMW + Annualized investment cost per MW of MaxProd + [€/MW] + 20.0 + rightFloat2 + + + InvestCostPerMWh + Annualized investment cost per MWh of storage capacity + [€/MWh] + 20.0 + rightFloat2 + + + IsLDS + Whether the storage unit is a long-duration storage (1) or not (0) + [0, 1] + 20.0 + rightInt + To Node To which node @@ -393,6 +479,13 @@ 15.0 rightFloat4 + + MaxCons + Maximum consumption of the unit + [MW] + 15.0 + rightFloat1 + MaxInvest Maximum number of units that can be invested in @@ -421,6 +514,13 @@ 15.0 rightFloat1 + + MinReserve + Minimum reserve of the storage unit + [%, 0-1] + 15.0 + rightFloat2 + MinUpTime Minimum time the unit has to be on after a startup @@ -631,6 +731,13 @@ 41.0 general + + Self Discharge + Self discharge of the storage unit + [%, 0-1] + 20.0 + rightFloat2 + Source(s) List of used sources (detailing which values are from where) diff --git a/changelog-LEGOExcels.md b/changelog-LEGOExcels.md index fc5a816..e2faa5c 100644 --- a/changelog-LEGOExcels.md +++ b/changelog-LEGOExcels.md @@ -133,6 +133,10 @@ Fix description for columns 'rp' and 'k' to be more general. Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in formatting and description texts. +# Power_Storage + +Please see git history of `TabbleDefinitions.xml`. + # Power_ThermalGen ## v0.1.0 → v0.1.1 diff --git a/data/example/Power_Storage.xlsx b/data/example/Power_Storage.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..007ded9f55f944155b2bb61c7bbf19383eb13142 GIT binary patch literal 9489 zcmaKS1ymf_wsu2scMINVaCg_>?iQ?Z_dw9#?jEdh_uvGAySuvtCjkQd%*?%a?(p9G zyI0kz>Q&$F+TS{7+u2I8Z=kRM0010-%ITMmWWT(0(#zfG%YpWCnA)2tIoUfnGktJy zVDzxHksp^w{Kkv~v(c&I)|3`bT!11j5T4yO&glBNk=8co{_GS=$j;Mq;B6jb7&%pA zs>B83jx8H&KeF%~@Lq6uC^tNJ=VK+ys()k+0crsW@tdAJ+j+mwEJ)lVTTRu6GmMfT z*YRXg_gY?Ms-7(^cHSCllCl*-1hjoGO2G(BS)LR+=;sL4VQkgxy&?PGrqG?REx1bm zPyt!6TkPoN)rTPf0QCP>!NlIl><=Blaoq|%%t*n8W<%|+36KeS<+y0nv9YO8TR1#x z8k6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hF7W!TfT2_Z zZ0NAqJp5`t_68Wo!{|uox|JByWCz4^uNuj5wIot92h(O=uxtt(DzmDlh;zk>1>wQA zm3EW>O9Kc5)W+kmr$}MgE=o(T3x>;%2j!6_v_IlD;697D++T1KyIs6unC*DGrQ(Iz zhZmL!{$lvA+4SE$|I76Wpae1_eXhdT1>hCWal`)*fvNAH`>EoZk*JWVW^=2-8(R-wRe z7z3RN#xkbvFu~UgEEJ-@a;o{2V_d4af^6gZcnk5L( z)+E{Kxu=dVCQ{no#BYq|bhaJR=EXN9;M6#@!ak#JaI4%|P+ovm!b#PEO{Cd-SD@TB zpaXmU7|@VmPH8YJ_oQNXy|`U>4;^W5@tC&8guxjg!RJ}?Qicu#*dQ5sd7!i?l_}wKDS+M@ZHc?ql-@g zGfv`81Uy3~h@votbT?Nv17qaV;lu0Y?61yvemkgpC7*$_Wx&}$7}TKri#C?0DvDv&wr!;-D2?? z{<`(xZ}`f~-~TU-2(Jaa-g^4CfJT2Jxc?ZR|FIGETFUDb@!wMXAX;CDdU=iiHDP=$ z<#lfKw-h*>Kc)PCGo{zkUWdAWOAC343IAnQ|E1ag8u-2z_&TKgTc88}p9235FkeGo zd#}Ht!bJb@Wv_v+y}{o=TH^mG@o(So8vNSO{SA&F`4jwqn7!9>UfYtty-kY2vPmmqwB?2o(u2lP?>ApigX literal 0 HcmV?d00001 diff --git a/tests/test_ExcelReaderWriter.py b/tests/test_ExcelReaderWriter.py index 0df6829..c187e93 100644 --- a/tests/test_ExcelReaderWriter.py +++ b/tests/test_ExcelReaderWriter.py @@ -16,6 +16,7 @@ ("Power_Demand", f"{case_study_folder}Power_Demand.xlsx", ExcelReader.get_dPower_Demand, ew.write_dPower_Demand), ("Power_Hindex", f"{case_study_folder}Power_Hindex.xlsx", ExcelReader.get_dPower_Hindex, ew.write_dPower_Hindex), ("Power_Network", f"{case_study_folder}Power_Network.xlsx", ExcelReader.get_dPower_Network, ew.write_dPower_Network), + ("Power_Storage", f"{case_study_folder}Power_Storage.xlsx", ExcelReader.get_dPower_Storage, ew.write_dPower_Storage), ("Power_ThermalGen", f"{case_study_folder}Power_ThermalGen.xlsx", ExcelReader.get_dPower_ThermalGen, ew.write_dPower_ThermalGen), ("Power_VRES", f"{case_study_folder}Power_VRES.xlsx", ExcelReader.get_dPower_VRES, ew.write_VRES), ("Power_VRESProfiles", f"{case_study_folder}Power_VRESProfiles.xlsx", ExcelReader.get_dPower_VRESProfiles, ew.write_VRESProfiles), From a75a8d5791d798827aae80a39e35a0e4eaf22b76 Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:36:19 +0200 Subject: [PATCH 04/15] Remove RoR (RoR is moved to VRES, long-duration to storage) --- CaseStudy.py | 42 +----------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/CaseStudy.py b/CaseStudy.py index 8185863..5478486 100644 --- a/CaseStudy.py +++ b/CaseStudy.py @@ -20,7 +20,6 @@ def __init__(self, power_businfo_file: str = "Power_BusInfo.xlsx", dPower_BusInfo: pd.DataFrame = None, power_network_file: str = "Power_Network.xlsx", dPower_Network: pd.DataFrame = None, power_thermalgen_file: str = "Power_ThermalGen.xlsx", dPower_ThermalGen: pd.DataFrame = None, - power_ror_file: str = "Power_RoR.xlsx", dPower_RoR: pd.DataFrame = None, power_vres_file: str = "Power_VRES.xlsx", dPower_VRES: pd.DataFrame = None, power_demand_file: str = "Power_Demand.xlsx", dPower_Demand: pd.DataFrame = None, power_inflows_file: str = "Power_Inflows.xlsx", dPower_Inflows: pd.DataFrame = None, @@ -99,12 +98,6 @@ def __init__(self, self.dPower_ThermalGen = ExcelReader.get_dPower_ThermalGen(self.data_folder + self.power_thermalgen_file) if self.dPower_Parameters["pEnableRoR"]: - if dPower_RoR is not None: - self.dPower_RoR = dPower_RoR - else: - self.power_ror_file = power_ror_file - self.dPower_RoR = self.get_dPower_RoR() - if dPower_Inflows is not None: self.dPower_Inflows = dPower_Inflows else: @@ -170,7 +163,6 @@ def scale_CaseStudy(self): self.scale_dPower_ThermalGen() if self.dPower_Parameters["pEnableRoR"]: - self.scale_dPower_RoR() self.scale_dPower_Inflows() if self.dPower_Parameters["pEnableVRES"]: @@ -243,13 +235,6 @@ def scale_dPower_ThermalGen(self): self.dPower_ThermalGen['Qmin'] = self.dPower_ThermalGen['Qmin'].fillna(0) * self.reactive_power_scaling_factor self.dPower_ThermalGen['Qmax'] = self.dPower_ThermalGen['Qmax'].fillna(0) * self.reactive_power_scaling_factor - def scale_dPower_RoR(self): - self.dPower_RoR['InvestCostEUR'] = self.dPower_RoR['MaxProd'] * self.power_scaling_factor * (self.dPower_RoR['InvestCostPerMW'] + self.dPower_RoR['InvestCostPerMWh'] * self.dPower_RoR['Ene2PowRatio']) * (self.cost_scaling_factor / self.power_scaling_factor) - self.dPower_RoR['MaxProd'] *= self.power_scaling_factor - - self.dPower_RoR['Qmin'] = self.dPower_RoR['Qmin'].fillna(0) * self.reactive_power_scaling_factor - self.dPower_RoR['Qmax'] = self.dPower_RoR['Qmax'].fillna(0) * self.reactive_power_scaling_factor - def scale_dPower_Inflows(self): self.dPower_Inflows["Inflow"] *= self.power_scaling_factor @@ -322,14 +307,6 @@ def yesNo_to_bool(df: pd.DataFrame, columns_to_be_changed: list[str]): raise ValueError(f"Value for {column} must be either 'Yes' or 'No'.") return df - def get_dPower_RoR(self): - dPower_RoR = self.read_generator_data(self.data_folder + self.power_ror_file) - - # If column 'scenario' is not present, add it - if 'scenario' not in dPower_RoR.columns: - dPower_RoR['scenario'] = 'ScenarioA' # TODO: Fill this dynamically, once the Excel file is updated - return dPower_RoR - def get_dPower_Inflows(self): dPower_Inflows = pd.read_excel(self.data_folder + self.power_inflows_file, skiprows=[0, 1, 3, 4, 5]) dPower_Inflows = dPower_Inflows.drop(dPower_Inflows.columns[0], axis=1) @@ -523,12 +500,6 @@ def merge_single_node_buses(self): row['i'] = new_bus_name self.dPower_ThermalGen.loc[i] = row - # Adapt dPower_RoR - for i, row in self.dPower_RoR.iterrows(): - if row['i'] in connected_buses: - row['i'] = new_bus_name - self.dPower_RoR.loc[i] = row - # Adapt dPower_VRES for i, row in self.dPower_VRES.iterrows(): if row['i'] in connected_buses: @@ -559,16 +530,6 @@ def merge_single_node_buses(self): self.dPower_VRESProfiles = self.dPower_VRESProfiles.groupby(['rp', 'i', 'k', 'tec']).mean() # TODO: Aggregate using more complex method (capacity * productionCapacity * ... * / Total Production Capacity) self.dPower_VRESProfiles.sort_index(inplace=True) - # Function to read generator data - @staticmethod - def read_generator_data(file_path): - d_generator = pd.read_excel(file_path, skiprows=[0, 1, 3, 4, 5]) - d_generator = d_generator.drop(d_generator.columns[0], axis=1) - d_generator = d_generator[(d_generator["ExisUnits"] > 0) | (d_generator["EnableInvest"] > 0)] # Filter out all generators that are not existing and not investable - d_generator = d_generator.rename(columns={d_generator.columns[0]: "g", d_generator.columns[1]: "tec", d_generator.columns[2]: "i"}) - d_generator = d_generator.set_index('g') - return d_generator - # Create transition matrix from Hindex def get_rpTransitionMatrices(self): rps = sorted(self.dPower_Hindex.index.get_level_values('rp').unique().tolist()) @@ -681,8 +642,7 @@ def filter_scenario(self, scenario_name) -> Self: if hasattr(caseStudy, "dPower_ThermalGen"): caseStudy._filter_dataframe("dPower_ThermalGen", scenario_name) - if hasattr(caseStudy, "dPower_RoR") and len(caseStudy.dPower_RoR) > 0: - caseStudy._filter_dataframe("dPower_RoR", scenario_name) + if hasattr(caseStudy, "dPower_Inflows"): caseStudy._filter_dataframe("dPower_Inflows", scenario_name) if hasattr(caseStudy, "dPower_VRES"): caseStudy._filter_dataframe("dPower_VRES", scenario_name) From 52ab50977504f3d6177fe314182f43d5c88925f5 Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:49:39 +0200 Subject: [PATCH 05/15] Add Power_Inflows to TableDefinitions --- CaseStudy.py | 14 +------------- ExcelReader.py | 16 ++++++++++++++++ ExcelWriter.py | 9 +++++++++ TableDefinitions.xml | 24 +++++++++++++++++++++++- data/example/Power_Inflows.xlsx | Bin 0 -> 9245 bytes tests/test_ExcelReaderWriter.py | 1 + 6 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 data/example/Power_Inflows.xlsx diff --git a/CaseStudy.py b/CaseStudy.py index 5478486..3a49d6d 100644 --- a/CaseStudy.py +++ b/CaseStudy.py @@ -102,7 +102,7 @@ def __init__(self, self.dPower_Inflows = dPower_Inflows else: self.power_inflows_file = power_inflows_file - self.dPower_Inflows = self.get_dPower_Inflows() + self.dPower_Inflows = ExcelReader.get_dPower_Inflows(self.data_folder + self.power_thermalgen_file) if self.dPower_Parameters["pEnableVRES"]: if dPower_VRES is not None: @@ -307,18 +307,6 @@ def yesNo_to_bool(df: pd.DataFrame, columns_to_be_changed: list[str]): raise ValueError(f"Value for {column} must be either 'Yes' or 'No'.") return df - def get_dPower_Inflows(self): - dPower_Inflows = pd.read_excel(self.data_folder + self.power_inflows_file, skiprows=[0, 1, 3, 4, 5]) - dPower_Inflows = dPower_Inflows.drop(dPower_Inflows.columns[0], axis=1) - dPower_Inflows = dPower_Inflows.rename(columns={dPower_Inflows.columns[0]: "rp", dPower_Inflows.columns[1]: "g"}) - dPower_Inflows = dPower_Inflows.melt(id_vars=['rp', 'g'], var_name='k', value_name='Inflow') - dPower_Inflows = dPower_Inflows.set_index(['rp', 'g', 'k']) - - # If column 'scenario' is not present, add it - if 'scenario' not in dPower_Inflows.columns: - dPower_Inflows['scenario'] = 'ScenarioA' # TODO: Fill this dynamically, once the Excel file is updated - return dPower_Inflows - def get_dPower_ImpExpHubs(self): dPower_ImpExpHubs = pd.read_excel(self.data_folder + self.power_impexphubs_file, skiprows=[0, 1, 3, 4, 5]) dPower_ImpExpHubs = dPower_ImpExpHubs.drop(dPower_ImpExpHubs.columns[0], axis=1) diff --git a/ExcelReader.py b/ExcelReader.py index 3ad489e..4a25174 100644 --- a/ExcelReader.py +++ b/ExcelReader.py @@ -95,6 +95,22 @@ 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, do_not_convert_values: bool = False) -> pd.DataFrame: + """ + Read the dPower_Inflows data from the Excel file. + :param excel_file_path: Path to the Excel file + :param keep_excluded_entries: Unused but kept for compatibility with other functions + :param do_not_convert_values: To not convert values + :return: dPower_Inflows + """ + dPower_Inflows = __read_pivoted_file(excel_file_path, "v0.1.0", ['rp', 'k', 'g'], 'k', ['rp', 'g', 'dataPackage', 'dataSource', 'id'], False, False) + + if keep_excluded_entries: + printer.warning("'keep_excluded_entries' is set for 'get_dPower_Inflows', although nothing is excluded anyway - please check if this is intended.") + + return dPower_Inflows + + def get_dPower_WeightsRP(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: """ Read the dPower_WeightsRP data from the Excel file. diff --git a/ExcelWriter.py b/ExcelWriter.py index b500e09..c6c706d 100644 --- a/ExcelWriter.py +++ b/ExcelWriter.py @@ -212,6 +212,15 @@ def write_dPower_Hindex(self, dPower_Hindex: pd.DataFrame, folder_path: str) -> """ self._write_Excel_from_definition(dPower_Hindex, folder_path, "Power_Hindex") + def write_dPower_Inflows(self, dPower_Inflows: pd.DataFrame, folder_path: str) -> None: + """ + Write the dPower_Inflows DataFrame to an Excel file in LEGO format. + :param dPower_Inflows: DataFrame containing the dPower_Inflows data. + :param folder_path: Path to the folder where the Excel file will be saved. + :return: None + """ + self._write_Excel_from_definition(dPower_Inflows, folder_path, "Power_Inflows") + def write_dPower_WeightsRP(self, dPower_WeightsRP: pd.DataFrame, folder_path: str) -> None: """ Write the dPower_WeightsRP DataFrame to an Excel file in LEGO format. diff --git a/TableDefinitions.xml b/TableDefinitions.xml index 7ce31e0..487d494 100644 --- a/TableDefinitions.xml +++ b/TableDefinitions.xml @@ -90,6 +90,20 @@ + + v0.0.1 + Power - Inflows + 60.0 + + + + + + + + + + v0.1.2 Power - Network @@ -137,7 +151,7 @@ - + @@ -806,6 +820,14 @@ 10.57 rightInt + + + k + Inflow for each unit at this k + [MWh] + 10.57 + rightFloat2 + diff --git a/data/example/Power_Inflows.xlsx b/data/example/Power_Inflows.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..c58dab201d61c9913b186297a14df06b13970799 GIT binary patch literal 9245 zcmb7q1yo$ivi6|C1{gHJU?Gs;?(RW@2A2c~?(Po3-5oMO@W9{%4;tJdI0W|q!QbSZ zckele|GvA{KeKvz@7}w<>8e#-($z|G2#9z9000HB>ikPvs#oDv66|gW*05pC*w#qN z!Pd@^`K_HDlbf}b!iWNTCkqDhN}GyHeOfr#M@$L9@a&cmCg|H#k8SRcvB5W4cMXZ(U$F?hbM z)mQCIGD(>_k0gt^R`V&-bggM}@O^$kUiux3hP~xMEfj$($D2Zr^bnysh_9OcW5D*- z7^&?^6QR;SSg2a&WZ8pFeGm=+0R5c>BU=ZP-#kF#IuyHDFhUGWcE31h0BIz(m?#t} zC|Oav868>}wI`&)l$+~|7y4VjXp9-W4`oA31IqvQu=3+rRV%zeP~6Reo@*LdJ^tqda{C4i%A20U0w|QR|!I z^5Wr|HZ)_xF2w#Kk&ONL7N(=adaN`8NJIaiGt-*|*}f_5lybsXn;@O+LcN8L;> ztkHY8{Oh2&j^-{4(6pcfMe<;fW|Wn?aa@pZn=}{pU^4I^UZE*N0FhzmW>`{sYn#XY z?2zf*cF2dsQ#Zpo=7s6zdgi4S4YubXQ5K@2%Hwu4h`fHSwmG1S$GaaFr|Ww_1d5y+ z-r%(EiViU|)$}fOVew6nxmDg%X=6igeFig;Q8i_4TLTK{COP{r{6V!SlL9zg4N;oL z575&qtFO27OF||iJA9;U{x&QmniRgnwnZC?+8W|6DqN^6U4?yYrOh{*UY) zS>AlZmWjURrEo{R0;c3|lB@JaMmDk|9jKZYFEqU`UQ63h&3tOFc{YdOA`Y61@ zy{CuF-)ByU949hAzm|=QF|VO2a-td9W+(2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3Z6;w-a-yMm86L38kMsvM>Sp4G3#fiXV%+4E7FT`0^dXR`Tb;uv8FlM9Cs2Q6@ zKu`AF(2KmPKo@?QA5lNcs}aEfury}w>S>>$+(7L-<#86nGDCDLMk^BElmUhHPeXb4{wt}l5%+IVK)TW>0d3HJsjXyQMG{HH?wUDW^U!UQn` zSulbtaW(-@izoBo3z^FB2|ol}f&3*tmv$bIbO2tFHnC`pB)44}n=*5Rd-5yK@Z+4B z(F~aM?vnvN@`Ldur&sZ4qRtD}D7?`XcSLJZ%)!eYj(WefsXTGS23CIW zF@Wqk=fCCOXMs!kyw~%VITpecmF^o3Osvl#k%B0UvL(q)Oy9TW7)fh+ks%mPYp>g- z%}A_DqNs6dh6Q7-@TgpwQJOqJS}3oZhcXNxm;@$i+Ga5(8^7f3>5!(=a_#*`|9d(m;-<|8htp z>5Y;{Z4CphW?S@W?jjdR=mNWdiE^Ru)zNr$j#-olA94G;h5`GhAt=?|#C~P8iiO@9 z6}e%(C`DWA8}RW%6mhEDV^205L8}ifXDj^Y3{@bBajJ~{xP3wQ&{5JToB^HH@2i0^ z3hAifPfWL)#f7N6jqdZR4{)OTPCkzu5Y#RSDaeIvNII;N)MFSR%!BGBdn)4X# zame}?+92U$&i-Qn`xx+XX!sW(6jr~2P4BNj@iFOR2lf}K4EP`J>@neEhwv968|lB9 z_?LTlO#Il;{Y9KY_6PC*VfG&5Jhml&;dqe)0RO?VD9ItgPKE#g7_cuDESTP)_ Date: Thu, 24 Jul 2025 14:55:39 +0200 Subject: [PATCH 06/15] Sort functions in ExcelReader and -Writer alphabetically --- ExcelReader.py | 158 ++++++++++++++++++++++++------------------------- ExcelWriter.py | 82 ++++++++++++------------- 2 files changed, 120 insertions(+), 120 deletions(-) diff --git a/ExcelReader.py b/ExcelReader.py index 4a25174..718640a 100644 --- a/ExcelReader.py +++ b/ExcelReader.py @@ -56,6 +56,42 @@ 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, do_not_convert_values: bool = False) -> pd.DataFrame: + """ + Read the dData_Packages data from the Excel file. + :param excel_file_path: Path to the Excel file + :param keep_excluded_entries: Unused but kept for compatibility with other functions + :param do_not_convert_values: Unused but kept for compatibility with other functions + :return: dData_Packages + """ + dData_Packages = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["dataPackage"], False, False) + + if keep_excluded_entries: + printer.warning("'keep_excluded_entries' is set for 'get_dData_Packages', although nothing is excluded anyway - please check if this is intended.") + if do_not_convert_values: + printer.warning("'do_not_convert_values' is set for 'get_dData_Packages', although no values are converted anyway - please check if this is intended.") + + return dData_Packages + + +def get_dData_Sources(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: + """ + Read the dData_Sources data from the Excel file. + :param excel_file_path: Path to the Excel file + :param keep_excluded_entries: Unused but kept for compatibility with other functions + :param do_not_convert_values: Unused but kept for compatibility with other functions + :return: dData_Sources + """ + dData_Sources = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["dataSource"], False, False) + + if keep_excluded_entries: + printer.warning("'keep_excluded_entries' is set for 'get_dData_Sources', although nothing is excluded anyway - please check if this is intended.") + if do_not_convert_values: + printer.warning("'do_not_convert_values' is set for 'get_dData_Sources', although no values are converted anyway - please check if this is intended.") + + return dData_Sources + + def get_dGlobal_Scenarios(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: """ Read the dGlobal_Scenarios data from the Excel file. @@ -77,90 +113,71 @@ def get_dGlobal_Scenarios(excel_file_path: str, keep_excluded_entries: bool = Fa return dGlobal_Scenarios -def get_dPower_Hindex(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_BusInfo(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: """ - Read the dPower_Hindex data from the Excel file. + Read the dPower_BusInfo data from the Excel file. :param excel_file_path: Path to the Excel file - :param keep_excluded_entries: Unused but kept for compatibility with other functions + :param keep_excluded_entries: Do not exclude any entries which are marked to be excluded in the Excel file :param do_not_convert_values: Unused but kept for compatibility with other functions - :return: dPower_Hindex + :return: dPower_BusInfo """ - dPower_Hindex = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["p", "rp", "k"], False, False) + dPower_BusInfo = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["i"], True, keep_excluded_entries) - if keep_excluded_entries: - printer.warning("'keep_excluded_entries' is set for 'get_dPower_Hindex', although nothing is excluded anyway - please check if this is intended.") if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dPower_Hindex', although no values are converted anyway - please check if this is intended.") + printer.warning("'do_not_convert_values' is set for 'get_dPower_BusInfo', although no values are converted anyway - please check if this is intended.") - return dPower_Hindex + return dPower_BusInfo -def get_dPower_Inflows(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_Demand(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: """ - Read the dPower_Inflows data from the Excel file. + Read the dPower_Demand data from the Excel file. :param excel_file_path: Path to the Excel file :param keep_excluded_entries: Unused but kept for compatibility with other functions - :param do_not_convert_values: To not convert values - :return: dPower_Inflows + :param do_not_convert_values: Skip the conversion of values + :return: dPower_Demand """ - dPower_Inflows = __read_pivoted_file(excel_file_path, "v0.1.0", ['rp', 'k', 'g'], 'k', ['rp', 'g', 'dataPackage', 'dataSource', 'id'], False, False) + + dPower_Demand = __read_pivoted_file(excel_file_path, "v0.1.2", ['rp', 'k', 'i'], 'k', ['rp', 'i', 'dataPackage', 'dataSource', 'id'], False, False) if keep_excluded_entries: - printer.warning("'keep_excluded_entries' is set for 'get_dPower_Inflows', although nothing is excluded anyway - please check if this is intended.") + printer.warning("'keep_excluded_entries' is set for 'get_dPower_Demand', although nothing is excluded anyway - please check if this is intended.") - return dPower_Inflows + return dPower_Demand -def get_dPower_WeightsRP(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_Hindex(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: """ - Read the dPower_WeightsRP data from the Excel file. + Read the dPower_Hindex data from the Excel file. :param excel_file_path: Path to the Excel file :param keep_excluded_entries: Unused but kept for compatibility with other functions :param do_not_convert_values: Unused but kept for compatibility with other functions - :return: dPower_WeightsRP + :return: dPower_Hindex """ - dPower_WeightsRP = __read_non_pivoted_file(excel_file_path, "v0.1.3", ["rp"], False, False) + dPower_Hindex = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["p", "rp", "k"], False, False) if keep_excluded_entries: - printer.warning("'keep_excluded_entries' is set for 'get_dPower_WeightsRP', although nothing is excluded anyway - please check if this is intended.") + printer.warning("'keep_excluded_entries' is set for 'get_dPower_Hindex', although nothing is excluded anyway - please check if this is intended.") if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dPower_WeightsRP', although no values are converted anyway - please check if this is intended.") + printer.warning("'do_not_convert_values' is set for 'get_dPower_Hindex', although no values are converted anyway - please check if this is intended.") - return dPower_WeightsRP + return dPower_Hindex -def get_dPower_WeightsK(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_Inflows(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: """ - Read the dPower_WeightsK data from the Excel file. + Read the dPower_Inflows data from the Excel file. :param excel_file_path: Path to the Excel file :param keep_excluded_entries: Unused but kept for compatibility with other functions - :param do_not_convert_values: Unused but kept for compatibility with other functions - :return: dPower_WeightsK + :param do_not_convert_values: To not convert values + :return: dPower_Inflows """ - dPower_WeightsK = __read_non_pivoted_file(excel_file_path, "v0.1.3", ["k"], False, False) + dPower_Inflows = __read_pivoted_file(excel_file_path, "v0.1.0", ['rp', 'k', 'g'], 'k', ['rp', 'g', 'dataPackage', 'dataSource', 'id'], False, False) if keep_excluded_entries: - printer.warning("'keep_excluded_entries' is set for 'get_dPower_WeightsK', although nothing is excluded anyway - please check if this is intended.") - if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dPower_WeightsK', although no values are converted anyway - please check if this is intended.") - - return dPower_WeightsK - - -def get_dPower_BusInfo(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: - """ - Read the dPower_BusInfo 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 do_not_convert_values: Unused but kept for compatibility with other functions - :return: dPower_BusInfo - """ - dPower_BusInfo = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["i"], True, keep_excluded_entries) - - if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dPower_BusInfo', although no values are converted anyway - please check if this is intended.") + printer.warning("'keep_excluded_entries' is set for 'get_dPower_Inflows', although nothing is excluded anyway - please check if this is intended.") - return dPower_BusInfo + return dPower_Inflows def get_dPower_Network(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: @@ -176,23 +193,6 @@ def get_dPower_Network(excel_file_path: str, keep_excluded_entries: bool = False return dPower_Network -def get_dPower_Demand(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: - """ - Read the dPower_Demand data from the Excel file. - :param excel_file_path: Path to the Excel file - :param keep_excluded_entries: Unused but kept for compatibility with other functions - :param do_not_convert_values: Skip the conversion of values - :return: dPower_Demand - """ - - dPower_Demand = __read_pivoted_file(excel_file_path, "v0.1.2", ['rp', 'k', 'i'], 'k', ['rp', 'i', 'dataPackage', 'dataSource', 'id'], False, False) - - if keep_excluded_entries: - printer.warning("'keep_excluded_entries' is set for 'get_dPower_Demand', although nothing is excluded anyway - please check if this is intended.") - - return dPower_Demand - - def get_dPower_Storage(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: """ Read the dPower_Storage data from the Excel file. @@ -250,40 +250,40 @@ def get_dPower_VRESProfiles(excel_file_path: str, keep_excluded_entries: bool = return dPower_VRESProfiles -def get_dData_Sources(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_WeightsK(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: """ - Read the dData_Sources data from the Excel file. + Read the dPower_WeightsK data from the Excel file. :param excel_file_path: Path to the Excel file :param keep_excluded_entries: Unused but kept for compatibility with other functions :param do_not_convert_values: Unused but kept for compatibility with other functions - :return: dData_Sources + :return: dPower_WeightsK """ - dData_Sources = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["dataSource"], False, False) + dPower_WeightsK = __read_non_pivoted_file(excel_file_path, "v0.1.3", ["k"], False, False) if keep_excluded_entries: - printer.warning("'keep_excluded_entries' is set for 'get_dData_Sources', although nothing is excluded anyway - please check if this is intended.") + printer.warning("'keep_excluded_entries' is set for 'get_dPower_WeightsK', although nothing is excluded anyway - please check if this is intended.") if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dData_Sources', although no values are converted anyway - please check if this is intended.") + printer.warning("'do_not_convert_values' is set for 'get_dPower_WeightsK', although no values are converted anyway - please check if this is intended.") - return dData_Sources + return dPower_WeightsK -def get_dData_Packages(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_WeightsRP(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: """ - Read the dData_Packages data from the Excel file. + Read the dPower_WeightsRP data from the Excel file. :param excel_file_path: Path to the Excel file :param keep_excluded_entries: Unused but kept for compatibility with other functions :param do_not_convert_values: Unused but kept for compatibility with other functions - :return: dData_Packages + :return: dPower_WeightsRP """ - dData_Packages = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["dataPackage"], False, False) + dPower_WeightsRP = __read_non_pivoted_file(excel_file_path, "v0.1.3", ["rp"], False, False) if keep_excluded_entries: - printer.warning("'keep_excluded_entries' is set for 'get_dData_Packages', although nothing is excluded anyway - please check if this is intended.") + printer.warning("'keep_excluded_entries' is set for 'get_dPower_WeightsRP', although nothing is excluded anyway - please check if this is intended.") if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dData_Packages', although no values are converted anyway - please check if this is intended.") + printer.warning("'do_not_convert_values' is set for 'get_dPower_WeightsRP', although no values are converted anyway - please check if this is intended.") - return dData_Packages + return dPower_WeightsRP def compare_Excels(source_path: str, target_path: str, dont_check_formatting: bool = False) -> bool: diff --git a/ExcelWriter.py b/ExcelWriter.py index c6c706d..7ea49cd 100644 --- a/ExcelWriter.py +++ b/ExcelWriter.py @@ -194,78 +194,78 @@ def _write_Excel_from_definition(self, data: pd.DataFrame, folder_path: str, exc wb.save(path) printer.information(f"Saved Excel file to '{path}' after {time.time() - start_time:.2f} seconds") - def write_dGlobal_Scenarios(self, dGlobal_Scenarios: pd.DataFrame, folder_path: str) -> None: + def write_dData_Packages(self, dData_Packages: pd.DataFrame, folder_path: str) -> None: """ - Write the dGlobal_Scenarios DataFrame to an Excel file in LEGO format. - :param dGlobal_Scenarios: DataFrame containing the dGlobal_Scenarios data. + Write the dData_Packages DataFrame to an Excel file in LEGO format. + :param dData_Packages: DataFrame containing the dData_Packages data. :param folder_path: Path to the folder where the Excel file will be saved. :return: None """ - self._write_Excel_from_definition(dGlobal_Scenarios, folder_path, "Global_Scenarios") + self._write_Excel_from_definition(dData_Packages, folder_path, "Data_Packages") - def write_dPower_Hindex(self, dPower_Hindex: pd.DataFrame, folder_path: str) -> None: + def write_dData_Sources(self, dData_Sources: pd.DataFrame, folder_path: str) -> None: """ - Write the dPower_Hindex DataFrame to an Excel file in LEGO format. - :param dPower_Hindex: DataFrame containing the dPower_Hindex data. + Write the dData_Sources DataFrame to an Excel file in LEGO format. + :param dData_Sources: DataFrame containing the dData_Sources data. :param folder_path: Path to the folder where the Excel file will be saved. :return: None """ - self._write_Excel_from_definition(dPower_Hindex, folder_path, "Power_Hindex") + self._write_Excel_from_definition(dData_Sources, folder_path, "Data_Sources") - def write_dPower_Inflows(self, dPower_Inflows: pd.DataFrame, folder_path: str) -> None: + def write_dPower_BusInfo(self, dPower_BusInfo: pd.DataFrame, folder_path: str) -> None: """ - Write the dPower_Inflows DataFrame to an Excel file in LEGO format. - :param dPower_Inflows: DataFrame containing the dPower_Inflows data. + Write the dPower_BusInfo DataFrame to an Excel file in LEGO format. + :param dPower_BusInfo: DataFrame containing the dPower_BusInfo data. :param folder_path: Path to the folder where the Excel file will be saved. :return: None """ - self._write_Excel_from_definition(dPower_Inflows, folder_path, "Power_Inflows") + self._write_Excel_from_definition(dPower_BusInfo, folder_path, "Power_BusInfo") - def write_dPower_WeightsRP(self, dPower_WeightsRP: pd.DataFrame, folder_path: str) -> None: + def write_dGlobal_Scenarios(self, dGlobal_Scenarios: pd.DataFrame, folder_path: str) -> None: """ - Write the dPower_WeightsRP DataFrame to an Excel file in LEGO format. - :param dPower_WeightsRP: DataFrame containing the dPower_WeightsRP data. + Write the dGlobal_Scenarios DataFrame to an Excel file in LEGO format. + :param dGlobal_Scenarios: DataFrame containing the dGlobal_Scenarios data. :param folder_path: Path to the folder where the Excel file will be saved. :return: None """ - self._write_Excel_from_definition(dPower_WeightsRP, folder_path, "Power_WeightsRP") + self._write_Excel_from_definition(dGlobal_Scenarios, folder_path, "Global_Scenarios") - def write_dPower_WeightsK(self, dPower_WeightsK: pd.DataFrame, folder_path: str) -> None: + def write_dPower_Demand(self, dPower_Demand: pd.DataFrame, folder_path: str) -> None: """ - Write the dPower_WeightsK DataFrame to an Excel file in LEGO format. - :param dPower_WeightsK: DataFrame containing the dPower_WeightsK data. + Write the dPower_Demand DataFrame to an Excel file in LEGO format. + :param dPower_Demand: DataFrame containing the dPower_Demand data. :param folder_path: Path to the folder where the Excel file will be saved. :return: None """ - self._write_Excel_from_definition(dPower_WeightsK, folder_path, "Power_WeightsK") - def write_dPower_BusInfo(self, dPower_BusInfo: pd.DataFrame, folder_path: str) -> None: + self._write_Excel_from_definition(dPower_Demand, folder_path, "Power_Demand") + + def write_dPower_Hindex(self, dPower_Hindex: pd.DataFrame, folder_path: str) -> None: """ - Write the dPower_BusInfo DataFrame to an Excel file in LEGO format. - :param dPower_BusInfo: DataFrame containing the dPower_BusInfo data. + Write the dPower_Hindex DataFrame to an Excel file in LEGO format. + :param dPower_Hindex: DataFrame containing the dPower_Hindex data. :param folder_path: Path to the folder where the Excel file will be saved. :return: None """ - self._write_Excel_from_definition(dPower_BusInfo, folder_path, "Power_BusInfo") + self._write_Excel_from_definition(dPower_Hindex, folder_path, "Power_Hindex") - def write_dPower_Network(self, dPower_Network: pd.DataFrame, folder_path: str) -> None: + def write_dPower_Inflows(self, dPower_Inflows: pd.DataFrame, folder_path: str) -> None: """ - Write the dPower_Network DataFrame to an Excel file in LEGO format. - :param dPower_Network: DataFrame containing the dPower_Network data. + Write the dPower_Inflows DataFrame to an Excel file in LEGO format. + :param dPower_Inflows: DataFrame containing the dPower_Inflows data. :param folder_path: Path to the folder where the Excel file will be saved. :return: None """ - self._write_Excel_from_definition(dPower_Network, folder_path, "Power_Network") + self._write_Excel_from_definition(dPower_Inflows, folder_path, "Power_Inflows") - def write_dPower_Demand(self, dPower_Demand: pd.DataFrame, folder_path: str) -> None: + def write_dPower_Network(self, dPower_Network: pd.DataFrame, folder_path: str) -> None: """ - Write the dPower_Demand DataFrame to an Excel file in LEGO format. - :param dPower_Demand: DataFrame containing the dPower_Demand data. + Write the dPower_Network DataFrame to an Excel file in LEGO format. + :param dPower_Network: DataFrame containing the dPower_Network data. :param folder_path: Path to the folder where the Excel file will be saved. :return: None """ - - self._write_Excel_from_definition(dPower_Demand, folder_path, "Power_Demand") + self._write_Excel_from_definition(dPower_Network, folder_path, "Power_Network") def write_dPower_Storage(self, dPower_Storage: pd.DataFrame, folder_path: str) -> None: """ @@ -303,23 +303,23 @@ def write_VRESProfiles(self, dPower_VRESProfiles: pd.DataFrame, folder_path: str """ self._write_Excel_from_definition(dPower_VRESProfiles, folder_path, "Power_VRESProfiles") - def write_dData_Sources(self, dData_Sources: pd.DataFrame, folder_path: str) -> None: + def write_dPower_WeightsK(self, dPower_WeightsK: pd.DataFrame, folder_path: str) -> None: """ - Write the dData_Sources DataFrame to an Excel file in LEGO format. - :param dData_Sources: DataFrame containing the dData_Sources data. + Write the dPower_WeightsK DataFrame to an Excel file in LEGO format. + :param dPower_WeightsK: DataFrame containing the dPower_WeightsK data. :param folder_path: Path to the folder where the Excel file will be saved. :return: None """ - self._write_Excel_from_definition(dData_Sources, folder_path, "Data_Sources") + self._write_Excel_from_definition(dPower_WeightsK, folder_path, "Power_WeightsK") - def write_dData_Packages(self, dData_Packages: pd.DataFrame, folder_path: str) -> None: + def write_dPower_WeightsRP(self, dPower_WeightsRP: pd.DataFrame, folder_path: str) -> None: """ - Write the dData_Packages DataFrame to an Excel file in LEGO format. - :param dData_Packages: DataFrame containing the dData_Packages data. + Write the dPower_WeightsRP DataFrame to an Excel file in LEGO format. + :param dPower_WeightsRP: DataFrame containing the dPower_WeightsRP data. :param folder_path: Path to the folder where the Excel file will be saved. :return: None """ - self._write_Excel_from_definition(dData_Packages, folder_path, "Data_Packages") + self._write_Excel_from_definition(dPower_WeightsRP, folder_path, "Power_WeightsRP") def model_to_excel(model: pyomo.core.Model, target_path: str) -> None: From a9fdebffb4af87936bbfe10fe10555ee4c442676 Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Thu, 24 Jul 2025 15:02:25 +0200 Subject: [PATCH 07/15] Remove unused do_not_convert_values from ExcelReader --- ExcelReader.py | 63 ++++++++------------------------- tests/test_ExcelReaderWriter.py | 2 +- 2 files changed, 16 insertions(+), 49 deletions(-) diff --git a/ExcelReader.py b/ExcelReader.py index 718640a..9d853f1 100644 --- a/ExcelReader.py +++ b/ExcelReader.py @@ -56,55 +56,45 @@ 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, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dData_Packages(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dData_Packages data from the Excel file. :param excel_file_path: Path to the Excel file :param keep_excluded_entries: Unused but kept for compatibility with other functions - :param do_not_convert_values: Unused but kept for compatibility with other functions :return: dData_Packages """ dData_Packages = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["dataPackage"], False, False) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dData_Packages', although nothing is excluded anyway - please check if this is intended.") - if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dData_Packages', although no values are converted anyway - please check if this is intended.") return dData_Packages -def get_dData_Sources(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dData_Sources(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dData_Sources data from the Excel file. :param excel_file_path: Path to the Excel file :param keep_excluded_entries: Unused but kept for compatibility with other functions - :param do_not_convert_values: Unused but kept for compatibility with other functions :return: dData_Sources """ dData_Sources = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["dataSource"], False, False) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dData_Sources', although nothing is excluded anyway - please check if this is intended.") - if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dData_Sources', although no values are converted anyway - please check if this is intended.") return dData_Sources -def get_dGlobal_Scenarios(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dGlobal_Scenarios(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dGlobal_Scenarios data from the Excel file. :param excel_file_path: Path to the Excel file - :param keep_excluded_entries: Unused but kept for compatibility with other functions - :param do_not_convert_values: Unused but kept for compatibility with other functions + :param keep_excluded_entries: Do not exclude any entries which are marked to be excluded in the Excel file :return: dGlobal_Scenarios """ dGlobal_Scenarios = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["scenarioID"], True, keep_excluded_entries) - if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dGlobal_Scenarios', although no values are converted anyway - please check if this is intended.") - # Check that there is only one sheet with the name 'Scenario' check = dGlobal_Scenarios["scenario"].to_numpy() if not (check[0] == check).all(): @@ -113,31 +103,25 @@ 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, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_BusInfo(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dPower_BusInfo 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 do_not_convert_values: Unused but kept for compatibility with other functions :return: dPower_BusInfo """ dPower_BusInfo = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["i"], True, keep_excluded_entries) - if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dPower_BusInfo', although no values are converted anyway - please check if this is intended.") - return dPower_BusInfo -def get_dPower_Demand(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_Demand(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dPower_Demand data from the Excel file. :param excel_file_path: Path to the Excel file :param keep_excluded_entries: Unused but kept for compatibility with other functions - :param do_not_convert_values: Skip the conversion of values :return: dPower_Demand """ - dPower_Demand = __read_pivoted_file(excel_file_path, "v0.1.2", ['rp', 'k', 'i'], 'k', ['rp', 'i', 'dataPackage', 'dataSource', 'id'], False, False) if keep_excluded_entries: @@ -146,30 +130,26 @@ 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, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_Hindex(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dPower_Hindex data from the Excel file. :param excel_file_path: Path to the Excel file :param keep_excluded_entries: Unused but kept for compatibility with other functions - :param do_not_convert_values: Unused but kept for compatibility with other functions :return: dPower_Hindex """ dPower_Hindex = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["p", "rp", "k"], False, False) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dPower_Hindex', although nothing is excluded anyway - please check if this is intended.") - if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dPower_Hindex', although no values are converted anyway - please check if this is intended.") return dPower_Hindex -def get_dPower_Inflows(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_Inflows(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dPower_Inflows data from the Excel file. :param excel_file_path: Path to the Excel file :param keep_excluded_entries: Unused but kept for compatibility with other functions - :param do_not_convert_values: To not convert values :return: dPower_Inflows """ dPower_Inflows = __read_pivoted_file(excel_file_path, "v0.1.0", ['rp', 'k', 'g'], 'k', ['rp', 'g', 'dataPackage', 'dataSource', 'id'], False, False) @@ -180,12 +160,11 @@ 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, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_Network(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dPower_Network 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 do_not_convert_values: Unused but kept for compatibility with other functions :return: dPower_Network """ dPower_Network = __read_non_pivoted_file(excel_file_path, "v0.1.1", ["i", "j", "c"], True, keep_excluded_entries) @@ -193,12 +172,11 @@ 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, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_Storage(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dPower_Storage 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 do_not_convert_values: Skip the conversion of values :return: dPower_Storage """ dPower_Storage = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["g"], True, keep_excluded_entries) @@ -206,12 +184,11 @@ 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, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_ThermalGen(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dPower_ThermalGen 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 do_not_convert_values: Skip the conversion of values :return: dPower_thermalGen """ dPower_ThermalGen = __read_non_pivoted_file(excel_file_path, "v0.1.1", ["g"], True, keep_excluded_entries) @@ -219,12 +196,11 @@ 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, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_VRES(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dPower_VRES 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 do_not_convert_values: Skip the conversion of values :return: dPower_VRES """ dPower_VRES = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["g"], True, keep_excluded_entries) @@ -232,56 +208,47 @@ def get_dPower_VRES(excel_file_path: str, keep_excluded_entries: bool = False, d return dPower_VRES -def get_dPower_VRESProfiles(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_VRESProfiles(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dPower_VRESProfiles data from the Excel file. :param excel_file_path: Path to the Excel file :param keep_excluded_entries: Unused but kept for compatibility with other functions - :param do_not_convert_values: Unused but kept for compatibility with other functions :return: dPower_VRES """ dPower_VRESProfiles = __read_pivoted_file(excel_file_path, "v0.1.0", ['rp', 'k', 'g'], 'k', ['rp', 'g', 'dataPackage', 'dataSource', 'id'], False, False) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dPower_WeightsK', although nothing is excluded anyway - please check if this is intended.") - if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dPower_WeightsK', although no values are converted anyway - please check if this is intended.") return dPower_VRESProfiles -def get_dPower_WeightsK(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_WeightsK(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dPower_WeightsK data from the Excel file. :param excel_file_path: Path to the Excel file :param keep_excluded_entries: Unused but kept for compatibility with other functions - :param do_not_convert_values: Unused but kept for compatibility with other functions :return: dPower_WeightsK """ dPower_WeightsK = __read_non_pivoted_file(excel_file_path, "v0.1.3", ["k"], False, False) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dPower_WeightsK', although nothing is excluded anyway - please check if this is intended.") - if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dPower_WeightsK', although no values are converted anyway - please check if this is intended.") return dPower_WeightsK -def get_dPower_WeightsRP(excel_file_path: str, keep_excluded_entries: bool = False, do_not_convert_values: bool = False) -> pd.DataFrame: +def get_dPower_WeightsRP(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: """ Read the dPower_WeightsRP data from the Excel file. :param excel_file_path: Path to the Excel file :param keep_excluded_entries: Unused but kept for compatibility with other functions - :param do_not_convert_values: Unused but kept for compatibility with other functions :return: dPower_WeightsRP """ dPower_WeightsRP = __read_non_pivoted_file(excel_file_path, "v0.1.3", ["rp"], False, False) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dPower_WeightsRP', although nothing is excluded anyway - please check if this is intended.") - if do_not_convert_values: - printer.warning("'do_not_convert_values' is set for 'get_dPower_WeightsRP', although no values are converted anyway - please check if this is intended.") return dPower_WeightsRP diff --git a/tests/test_ExcelReaderWriter.py b/tests/test_ExcelReaderWriter.py index cc0d7ac..917bc8a 100644 --- a/tests/test_ExcelReaderWriter.py +++ b/tests/test_ExcelReaderWriter.py @@ -30,7 +30,7 @@ def test_read_and_write(excel_definition_id, file_path, read, write, tmp_path): printer.information(f"Writing '{excel_definition_id}', read from '{file_path}'") - data = read(file_path, True, True) + data = read(file_path, True) write(data, str(tmp_path)) printer.information(f"Comparing '{tmp_path}/{excel_definition_id}.xlsx' against source file '{file_path}'") From 76fbc3b6ce1b66bfc591d5b4cdfc404429e70993 Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Thu, 24 Jul 2025 15:07:45 +0200 Subject: [PATCH 08/15] Update list of files in ExcelWriter (when called as main) --- ExcelWriter.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ExcelWriter.py b/ExcelWriter.py index 7ea49cd..1c8f020 100644 --- a/ExcelWriter.py +++ b/ExcelWriter.py @@ -374,18 +374,20 @@ def model_to_excel(model: pyomo.core.Model, target_path: str) -> None: printer.separator() combinations = [ + ("Data_Packages", f"{args.caseStudyFolder}Data_Packages.xlsx", ExcelReader.get_dData_Packages, ew.write_dData_Packages), + ("Data_Sources", f"{args.caseStudyFolder}Data_Sources.xlsx", ExcelReader.get_dData_Sources, ew.write_dData_Sources), ("Global_Scenarios", f"{args.caseStudyFolder}Global_Scenarios.xlsx", ExcelReader.get_dGlobal_Scenarios, ew.write_dGlobal_Scenarios), - ("Power_Hindex", f"{args.caseStudyFolder}Power_Hindex.xlsx", ExcelReader.get_dPower_Hindex, ew.write_dPower_Hindex), - ("Power_WeightsRP", f"{args.caseStudyFolder}Power_WeightsRP.xlsx", ExcelReader.get_dPower_WeightsRP, ew.write_dPower_WeightsRP), - ("Power_WeightsK", f"{args.caseStudyFolder}Power_WeightsK.xlsx", ExcelReader.get_dPower_WeightsK, ew.write_dPower_WeightsK), ("Power_BusInfo", f"{args.caseStudyFolder}Power_BusInfo.xlsx", ExcelReader.get_dPower_BusInfo, ew.write_dPower_BusInfo), - ("Power_Network", f"{args.caseStudyFolder}Power_Network.xlsx", ExcelReader.get_dPower_Network, ew.write_dPower_Network), ("Power_Demand", f"{args.caseStudyFolder}Power_Demand.xlsx", ExcelReader.get_dPower_Demand, ew.write_dPower_Demand), + ("Power_Hindex", f"{args.caseStudyFolder}Power_Hindex.xlsx", ExcelReader.get_dPower_Hindex, ew.write_dPower_Hindex), + ("Power_Inflows", f"{args.caseStudyFolder}Power_Inflows.xlsx", ExcelReader.get_dPower_Inflows, ew.write_dPower_Inflows), + ("Power_Network", f"{args.caseStudyFolder}Power_Network.xlsx", ExcelReader.get_dPower_Network, ew.write_dPower_Network), + ("Power_Storage", f"{args.caseStudyFolder}Power_Storage.xlsx", ExcelReader.get_dPower_Storage, ew.write_dPower_Storage), ("Power_ThermalGen", f"{args.caseStudyFolder}Power_ThermalGen.xlsx", ExcelReader.get_dPower_ThermalGen, ew.write_dPower_ThermalGen), ("Power_VRES", f"{args.caseStudyFolder}Power_VRES.xlsx", ExcelReader.get_dPower_VRES, ew.write_VRES), ("Power_VRESProfiles", f"{args.caseStudyFolder}Power_VRESProfiles.xlsx", ExcelReader.get_dPower_VRESProfiles, ew.write_VRESProfiles), - ("Data_Sources", f"{args.caseStudyFolder}Data_Sources.xlsx", ExcelReader.get_dData_Sources, ew.write_dData_Sources), - ("Data_Packages", f"{args.caseStudyFolder}Data_Packages.xlsx", ExcelReader.get_dData_Packages, ew.write_dData_Packages), + ("Power_WeightsK", f"{args.caseStudyFolder}Power_WeightsK.xlsx", ExcelReader.get_dPower_WeightsK, ew.write_dPower_WeightsK), + ("Power_WeightsRP", f"{args.caseStudyFolder}Power_WeightsRP.xlsx", ExcelReader.get_dPower_WeightsRP, ew.write_dPower_WeightsRP), ] for excel_definition_id, file_path, read, write in combinations: From ad9e9467ade7c0778da840755e958f18e19e8c24 Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Thu, 24 Jul 2025 15:17:15 +0200 Subject: [PATCH 09/15] Add Power_Inflows to changelog, move Power_Network to alphabetical pos. --- changelog-LEGOExcels.md | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/changelog-LEGOExcels.md b/changelog-LEGOExcels.md index e2faa5c..e84ef1d 100644 --- a/changelog-LEGOExcels.md +++ b/changelog-LEGOExcels.md @@ -133,6 +133,25 @@ Fix description for columns 'rp' and 'k' to be more general. Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in formatting and description texts. +# Power_Inflows + +Please see git history of `TabbleDefinitions.xml`. + +# Power_Network + +## \>v0.1.1 + +Please see git history of `TabbleDefinitions.xml`. + +## v0.1.0 → v0.1.1 + +Fix comment in 'excl' column, adjust columnd widths. + +## v0.0.4r → v0.1.0 + +Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in +formatting and description texts. + # Power_Storage Please see git history of `TabbleDefinitions.xml`. @@ -319,18 +338,3 @@ Fix description for column 'rp' to be more general. Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in formatting and description texts. - -# Power_Network - -## \>v0.1.1 - -Please see git history of `TabbleDefinitions.xml`. - -## v0.1.0 → v0.1.1 - -Fix comment in 'excl' column, adjust columnd widths. - -## v0.0.4r → v0.1.0 - -Switching to "scripted" method when writing Excel-File (instead of copying from template), thus slight changes in -formatting and description texts. From 40fa0053a2ceed747a85bf7198ee2f15ca971ed1 Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Thu, 24 Jul 2025 15:44:31 +0200 Subject: [PATCH 10/15] Add switch to fail on wrong version when reading Excel files Add comments for functions in ExcelReader --- ExcelReader.py | 128 +++++++++++++++++++++----------- tests/test_ExcelReaderWriter.py | 2 +- 2 files changed, 85 insertions(+), 45 deletions(-) diff --git a/ExcelReader.py b/ExcelReader.py index 9d853f1..227252c 100644 --- a/ExcelReader.py +++ b/ExcelReader.py @@ -9,27 +9,40 @@ printer = Printer.getInstance() -def __check_LEGOExcel_version(excel_file_path: str, version_specifier: str): +def __check_LEGOExcel_version(excel_file_path: str, version_specifier: str, fail_on_wrong_version: bool = False): + """ + Check if the Excel file has the correct version specifier. + :param excel_file_path: Path to the Excel file + :param version_specifier: Expected version specifier (e.g., "v0.1.0") + :param fail_on_wrong_version: If True, raise an error if the version of the Excel file does not match the expected version + :return: None + :raises ValueError: If the version specifier does not match and fail_on_wrong_version + """ # Check if the file has the correct version specifier wb = openpyxl.load_workbook(excel_file_path) for sheet in wb.sheetnames: if wb[sheet].cell(row=2, column=3).value != version_specifier: - printer.error(f"Excel file '{excel_file_path}' does not have the correct version specifier in sheet '{sheet}'. Expected '{version_specifier}' but got '{wb[sheet].cell(row=2, column=3).value}'.") - printer.error(f"Trying to work with it any way, but this can have unintended consequences!") + if fail_on_wrong_version: + raise ValueError(f"Excel file '{excel_file_path}' does not have the correct version specifier. Expected '{version_specifier}' but got '{wb[sheet].cell(row=2, column=3).value}'.") + else: + printer.error(f"Excel file '{excel_file_path}' does not have the correct version specifier in sheet '{sheet}'. Expected '{version_specifier}' but got '{wb[sheet].cell(row=2, column=3).value}'.") + printer.error(f"Trying to work with it any way, but this can have unintended consequences!") pass -# Function to read generator data -def __read_generator_data(file_path): - d_generator = pd.read_excel(file_path, skiprows=[0, 1, 2, 4, 5, 6]) - d_generator = d_generator[d_generator["excl"].isnull()] # Only keep rows that are not excluded (i.e., have no value in the "Excl." column) - d_generator = d_generator[(d_generator["ExisUnits"] > 0) | (d_generator["EnableInvest"] > 0)] # Filter out all generators that are not existing and not invest-able - d_generator = d_generator.set_index('g') - return d_generator - - -def __read_non_pivoted_file(excel_file_path: str, version_specifier: str, indices: list[str], has_excl_column: bool, keep_excl_columns: bool = False) -> pd.DataFrame: - __check_LEGOExcel_version(excel_file_path, version_specifier) +def __read_non_pivoted_file(excel_file_path: str, version_specifier: str, indices: list[str], has_excl_column: bool, + keep_excl_columns: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame: + """ + Read a non-pivoted Excel file and return the data as a DataFrame. + :param excel_file_path: Path to the Excel file + :param version_specifier: Version specifier to check against the Excel file + :param indices: List of columns to set as index in the DataFrame + :param has_excl_column: If True, the DataFrame has an "Excl." column that indicates whether a row should be excluded + :param keep_excl_columns: If True, keep the "Excl." column in the DataFrame + :param fail_on_wrong_version: If True, raise an error if the version of the Excel file does not match the expected version + :return: DataFrame containing the data from the Excel file + """ + __check_LEGOExcel_version(excel_file_path, version_specifier, fail_on_wrong_version) xls = pd.ExcelFile(excel_file_path) data = pd.DataFrame() @@ -48,22 +61,36 @@ def __read_non_pivoted_file(excel_file_path: str, version_specifier: str, indice return data -def __read_pivoted_file(excel_file_path: str, version_specifier: str, indices: list[str], pivoted_variable_name: str, melt_indices: list[str], has_excl_column: bool, keep_excluded_columns: bool = False) -> pd.DataFrame: - df = __read_non_pivoted_file(excel_file_path, version_specifier, [], has_excl_column, keep_excluded_columns) +def __read_pivoted_file(excel_file_path: str, version_specifier: str, indices: list[str], pivoted_variable_name: str, melt_indices: list[str], has_excl_column: bool, + keep_excluded_columns: bool = False, fail_on_wrong_version: bool = False) -> pd.DataFrame: + """ + Read a pivoted Excel file and return the data as a DataFrame. + :param excel_file_path: Path to the Excel file + :param version_specifier: Version specifier to check against the Excel file + :param indices: List of columns to set as index in the DataFrame + :param pivoted_variable_name: Name of the variable that was pivoted in the Excel + :param melt_indices: List of columns to keep as identifiers when melting the DataFrame + :param has_excl_column: If True, the DataFrame has an "Excl." column that indicates whether a row should be excluded + :param keep_excluded_columns: If True, keep the "Excl." column in the DataFrame + :param fail_on_wrong_version: If True, raise an error if the version of the Excel file does not match the expected version + :return: DataFrame containing the data from the Excel file + """ + df = __read_non_pivoted_file(excel_file_path, version_specifier, [], has_excl_column, keep_excluded_columns, fail_on_wrong_version) df = df.melt(id_vars=melt_indices + ["scenario"], var_name=pivoted_variable_name, value_name="value") df = df.set_index(indices) return df -def get_dData_Packages(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: +def get_dData_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 :param keep_excluded_entries: Unused but kept for compatibility with other functions + :param fail_on_wrong_version: If True, raise an error if the version of the Excel file does not match the expected version :return: dData_Packages """ - dData_Packages = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["dataPackage"], False, False) + dData_Packages = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["dataPackage"], False, False, fail_on_wrong_version) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dData_Packages', although nothing is excluded anyway - please check if this is intended.") @@ -71,14 +98,15 @@ 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) -> pd.DataFrame: +def get_dData_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 :param keep_excluded_entries: Unused but kept for compatibility with other functions + :param fail_on_wrong_version: If True, raise an error if the version of the Excel file does not match the expected version :return: dData_Sources """ - dData_Sources = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["dataSource"], False, False) + dData_Sources = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["dataSource"], False, False, fail_on_wrong_version) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dData_Sources', although nothing is excluded anyway - please check if this is intended.") @@ -86,14 +114,15 @@ 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) -> pd.DataFrame: +def get_dGlobal_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 :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: dGlobal_Scenarios """ - dGlobal_Scenarios = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["scenarioID"], True, keep_excluded_entries) + dGlobal_Scenarios = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["scenarioID"], True, keep_excluded_entries, fail_on_wrong_version) # Check that there is only one sheet with the name 'Scenario' check = dGlobal_Scenarios["scenario"].to_numpy() @@ -103,26 +132,28 @@ 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) -> pd.DataFrame: +def get_dPower_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 :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_BusInfo """ - dPower_BusInfo = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["i"], True, keep_excluded_entries) + dPower_BusInfo = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["i"], True, keep_excluded_entries, fail_on_wrong_version) return dPower_BusInfo -def get_dPower_Demand(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: +def get_dPower_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 :param keep_excluded_entries: Unused but kept for compatibility with other functions + :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_Demand """ - dPower_Demand = __read_pivoted_file(excel_file_path, "v0.1.2", ['rp', 'k', 'i'], 'k', ['rp', 'i', 'dataPackage', 'dataSource', 'id'], False, False) + dPower_Demand = __read_pivoted_file(excel_file_path, "v0.1.2", ['rp', 'k', 'i'], 'k', ['rp', 'i', 'dataPackage', 'dataSource', 'id'], False, False, fail_on_wrong_version) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dPower_Demand', although nothing is excluded anyway - please check if this is intended.") @@ -130,14 +161,15 @@ 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) -> pd.DataFrame: +def get_dPower_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 :param keep_excluded_entries: Unused but kept for compatibility with other functions + :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_Hindex """ - dPower_Hindex = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["p", "rp", "k"], False, False) + dPower_Hindex = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["p", "rp", "k"], False, False, fail_on_wrong_version) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dPower_Hindex', although nothing is excluded anyway - please check if this is intended.") @@ -145,14 +177,15 @@ 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) -> pd.DataFrame: +def get_dPower_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 :param keep_excluded_entries: Unused but kept for compatibility with other functions + :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_Inflows """ - dPower_Inflows = __read_pivoted_file(excel_file_path, "v0.1.0", ['rp', 'k', 'g'], 'k', ['rp', 'g', 'dataPackage', 'dataSource', 'id'], False, False) + dPower_Inflows = __read_pivoted_file(excel_file_path, "v0.0.1", ['rp', 'k', 'g'], 'k', ['rp', 'g', 'dataPackage', 'dataSource', 'id'], False, False, fail_on_wrong_version) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dPower_Inflows', although nothing is excluded anyway - please check if this is intended.") @@ -160,62 +193,67 @@ 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) -> pd.DataFrame: +def get_dPower_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 :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_Network """ - dPower_Network = __read_non_pivoted_file(excel_file_path, "v0.1.1", ["i", "j", "c"], True, keep_excluded_entries) + dPower_Network = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["i", "j", "c"], True, keep_excluded_entries, fail_on_wrong_version) return dPower_Network -def get_dPower_Storage(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: +def get_dPower_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 :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_Storage """ - dPower_Storage = __read_non_pivoted_file(excel_file_path, "v0.1.2", ["g"], True, keep_excluded_entries) + dPower_Storage = __read_non_pivoted_file(excel_file_path, "v0.0.1", ["g"], True, keep_excluded_entries, fail_on_wrong_version) return dPower_Storage -def get_dPower_ThermalGen(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: +def get_dPower_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 :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_thermalGen """ - dPower_ThermalGen = __read_non_pivoted_file(excel_file_path, "v0.1.1", ["g"], True, keep_excluded_entries) + dPower_ThermalGen = __read_non_pivoted_file(excel_file_path, "v0.1.1", ["g"], True, keep_excluded_entries, fail_on_wrong_version) return dPower_ThermalGen -def get_dPower_VRES(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: +def get_dPower_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 :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_VRES """ - dPower_VRES = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["g"], True, keep_excluded_entries) + dPower_VRES = __read_non_pivoted_file(excel_file_path, "v0.1.0", ["g"], True, keep_excluded_entries, fail_on_wrong_version) return dPower_VRES -def get_dPower_VRESProfiles(excel_file_path: str, keep_excluded_entries: bool = False) -> pd.DataFrame: +def get_dPower_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 :param keep_excluded_entries: Unused but kept for compatibility with other functions + :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_VRES """ - dPower_VRESProfiles = __read_pivoted_file(excel_file_path, "v0.1.0", ['rp', 'k', 'g'], 'k', ['rp', 'g', 'dataPackage', 'dataSource', 'id'], False, False) + dPower_VRESProfiles = __read_pivoted_file(excel_file_path, "v0.1.0", ['rp', 'k', 'g'], 'k', ['rp', 'g', 'dataPackage', 'dataSource', 'id'], False, False, fail_on_wrong_version) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dPower_WeightsK', although nothing is excluded anyway - please check if this is intended.") @@ -223,14 +261,15 @@ 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) -> pd.DataFrame: +def get_dPower_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 :param keep_excluded_entries: Unused but kept for compatibility with other functions + :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_WeightsK """ - dPower_WeightsK = __read_non_pivoted_file(excel_file_path, "v0.1.3", ["k"], False, False) + dPower_WeightsK = __read_non_pivoted_file(excel_file_path, "v0.1.3", ["k"], False, False, fail_on_wrong_version) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dPower_WeightsK', although nothing is excluded anyway - please check if this is intended.") @@ -238,14 +277,15 @@ 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) -> pd.DataFrame: +def get_dPower_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 :param keep_excluded_entries: Unused but kept for compatibility with other functions + :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_WeightsRP """ - dPower_WeightsRP = __read_non_pivoted_file(excel_file_path, "v0.1.3", ["rp"], False, False) + dPower_WeightsRP = __read_non_pivoted_file(excel_file_path, "v0.1.3", ["rp"], False, False, fail_on_wrong_version) if keep_excluded_entries: printer.warning("'keep_excluded_entries' is set for 'get_dPower_WeightsRP', although nothing is excluded anyway - please check if this is intended.") diff --git a/tests/test_ExcelReaderWriter.py b/tests/test_ExcelReaderWriter.py index 917bc8a..cc0d7ac 100644 --- a/tests/test_ExcelReaderWriter.py +++ b/tests/test_ExcelReaderWriter.py @@ -30,7 +30,7 @@ def test_read_and_write(excel_definition_id, file_path, read, write, tmp_path): printer.information(f"Writing '{excel_definition_id}', read from '{file_path}'") - data = read(file_path, True) + data = read(file_path, True, True) write(data, str(tmp_path)) printer.information(f"Comparing '{tmp_path}/{excel_definition_id}.xlsx' against source file '{file_path}'") From 31e8e89c93cf262d643181e02931331f3ec00088 Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Thu, 24 Jul 2025 15:53:02 +0200 Subject: [PATCH 11/15] Fix wrong file selection for Inflows & Storage, fix scaling for Inflows --- CaseStudy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CaseStudy.py b/CaseStudy.py index 3a49d6d..be5b13c 100644 --- a/CaseStudy.py +++ b/CaseStudy.py @@ -102,7 +102,7 @@ def __init__(self, self.dPower_Inflows = dPower_Inflows else: self.power_inflows_file = power_inflows_file - self.dPower_Inflows = ExcelReader.get_dPower_Inflows(self.data_folder + self.power_thermalgen_file) + self.dPower_Inflows = ExcelReader.get_dPower_Inflows(self.data_folder + self.power_inflows_file) if self.dPower_Parameters["pEnableVRES"]: if dPower_VRES is not None: @@ -122,7 +122,7 @@ def __init__(self, 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_vresprofiles_file) + self.dPower_Storage = ExcelReader.get_dPower_Storage(self.data_folder + self.power_storage_file) if self.dPower_Parameters["pEnablePowerImportExport"]: if dPower_ImpExpHubs is not None: @@ -236,7 +236,7 @@ def scale_dPower_ThermalGen(self): self.dPower_ThermalGen['Qmax'] = self.dPower_ThermalGen['Qmax'].fillna(0) * self.reactive_power_scaling_factor def scale_dPower_Inflows(self): - self.dPower_Inflows["Inflow"] *= self.power_scaling_factor + self.dPower_Inflows["value"] *= self.power_scaling_factor def scale_dPower_VRES(self): if "MinProd" not in self.dPower_VRES.columns: From 64944b25ab67c26b359082c0a0cc7a2003c99fa8 Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Thu, 24 Jul 2025 17:04:19 +0200 Subject: [PATCH 12/15] Improve read-in handling for Power_Inflows and Power_VRES_Profiles --- CaseStudy.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/CaseStudy.py b/CaseStudy.py index be5b13c..064866e 100644 --- a/CaseStudy.py +++ b/CaseStudy.py @@ -1,4 +1,5 @@ import copy +import os import warnings from typing import Optional, Self @@ -97,13 +98,6 @@ def __init__(self, self.power_thermalgen_file = power_thermalgen_file self.dPower_ThermalGen = ExcelReader.get_dPower_ThermalGen(self.data_folder + self.power_thermalgen_file) - if self.dPower_Parameters["pEnableRoR"]: - if dPower_Inflows is not None: - self.dPower_Inflows = dPower_Inflows - else: - self.power_inflows_file = power_inflows_file - self.dPower_Inflows = ExcelReader.get_dPower_Inflows(self.data_folder + self.power_inflows_file) - if self.dPower_Parameters["pEnableVRES"]: if dPower_VRES is not None: self.dPower_VRES = dPower_VRES @@ -113,7 +107,7 @@ def __init__(self, if dPower_VRESProfiles is not None: self.dPower_VRESProfiles = dPower_VRESProfiles - else: + 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) @@ -124,6 +118,13 @@ def __init__(self, self.power_storage_file = power_storage_file self.dPower_Storage = ExcelReader.get_dPower_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) + if self.dPower_Parameters["pEnablePowerImportExport"]: if dPower_ImpExpHubs is not None: self.dPower_ImpExpHubs = dPower_ImpExpHubs @@ -162,7 +163,7 @@ def scale_CaseStudy(self): if self.dPower_Parameters["pEnableThermalGen"]: self.scale_dPower_ThermalGen() - if self.dPower_Parameters["pEnableRoR"]: + if self.dPower_Inflows is not None: self.scale_dPower_Inflows() if self.dPower_Parameters["pEnableVRES"]: @@ -287,7 +288,7 @@ def get_dPower_Parameters(self): dPower_Parameters = dPower_Parameters.dropna(how="all") dPower_Parameters = dPower_Parameters.set_index('General') - self.yesNo_to_bool(dPower_Parameters, ['pEnableChDisPower', 'pFixStInterResToIniReserve', 'pEnableSoftLineLoadLimits', 'pEnableThermalGen', 'pEnableRoR', 'pEnableVRES', 'pEnableStorage', 'pEnablePowerImportExport', 'pEnableSOCP']) + self.yesNo_to_bool(dPower_Parameters, ['pEnableChDisPower', 'pFixStInterResToIniReserve', 'pEnableSoftLineLoadLimits', 'pEnableThermalGen', 'pEnableVRES', 'pEnableStorage', 'pEnablePowerImportExport', 'pEnableSOCP']) # Transform to make it easier to access values dPower_Parameters = dPower_Parameters.drop(dPower_Parameters.columns[1:], axis=1) # Drop all columns but "Value" (rest is just for information in the Excel) From 402a1d0d986a72a7501a4d14d1c3993b97ae4ff5 Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Thu, 24 Jul 2025 17:33:21 +0200 Subject: [PATCH 13/15] Add safety check for Power_Storage --- CaseStudy.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CaseStudy.py b/CaseStudy.py index 064866e..5622e80 100644 --- a/CaseStudy.py +++ b/CaseStudy.py @@ -262,6 +262,10 @@ def scale_dPower_Storage(self): self.dPower_Storage['Qmin'] = self.dPower_Storage['Qmin'].fillna(0) * self.reactive_power_scaling_factor self.dPower_Storage['Qmax'] = self.dPower_Storage['Qmax'].fillna(0) * self.reactive_power_scaling_factor + # Check if any DisEffic or ChEffic is nan, if so, raise an error + if self.dPower_Storage['DisEffic'].isna().any() or self.dPower_Storage['ChEffic'].isna().any(): + raise ValueError("DisEffic and ChEffic in 'Power_Storage.xlsx' must not contain NaN values. Please check the data.") + def scale_dPower_ImpExpHubs(self): self.dPower_ImpExpHubs["Pmax Import"] *= self.power_scaling_factor self.dPower_ImpExpHubs["Pmax Export"] *= self.power_scaling_factor From 58d890746f8f262447898c779bef873a08f9f411 Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Fri, 25 Jul 2025 12:01:50 +0200 Subject: [PATCH 14/15] Add check to only include existing or investable generators --- CaseStudy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CaseStudy.py b/CaseStudy.py index 5622e80..ae0aa4f 100644 --- a/CaseStudy.py +++ b/CaseStudy.py @@ -202,7 +202,6 @@ def scale_dPower_Demand(self): self.dPower_Demand["value"] *= self.power_scaling_factor def scale_dPower_ThermalGen(self): - self.dPower_ThermalGen = self.dPower_ThermalGen[self.dPower_ThermalGen["excl"].isnull()] # Only keep rows that are not excluded (i.e., have no value in the "Excl." column) self.dPower_ThermalGen = self.dPower_ThermalGen[(self.dPower_ThermalGen["ExisUnits"] > 0) | (self.dPower_ThermalGen["EnableInvest"] > 0)] # Filter out all generators that are not existing and not investable self.dPower_ThermalGen['EFOR'] = self.dPower_ThermalGen['EFOR'].fillna(0) # Fill NaN values with 0 for EFOR @@ -240,6 +239,7 @@ def scale_dPower_Inflows(self): self.dPower_Inflows["value"] *= self.power_scaling_factor def scale_dPower_VRES(self): + self.dPower_VRES = self.dPower_VRES[(self.dPower_VRES["ExisUnits"] > 0) | ((self.dPower_VRES["EnableInvest"] > 0) & (self.dPower_VRES["MaxInvest"] > 0))] # Filter out all generators that are not existing and not investable if "MinProd" not in self.dPower_VRES.columns: self.dPower_VRES['MinProd'] = 0 @@ -251,6 +251,7 @@ def scale_dPower_VRES(self): self.dPower_VRES['Qmax'] = self.dPower_VRES['Qmax'].fillna(0) * self.reactive_power_scaling_factor def scale_dPower_Storage(self): + self.dPower_Storage = self.dPower_Storage[(self.dPower_Storage["ExisUnits"] > 0) | ((self.dPower_Storage["EnableInvest"] > 0) & (self.dPower_Storage["MaxInvest"] > 0))] # Filter out all generators that are not existing and not investable self.dPower_Storage['IniReserve'] = self.dPower_Storage['IniReserve'].fillna(0) self.dPower_Storage['MinReserve'] = self.dPower_Storage['MinReserve'].fillna(0) self.dPower_Storage['MinProd'] = self.dPower_Storage["MinProd"].fillna(0) From da538861f4e1aa2a03c6597971a86b829f62e448 Mon Sep 17 00:00:00 2001 From: "Felix C. A. Auer" <10127354+FelixCAAuer@users.noreply.github.com> Date: Fri, 25 Jul 2025 13:07:31 +0200 Subject: [PATCH 15/15] Fix typo in warning message (found by Copilot) --- ExcelReader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ExcelReader.py b/ExcelReader.py index 227252c..fa209b8 100644 --- a/ExcelReader.py +++ b/ExcelReader.py @@ -256,7 +256,7 @@ def get_dPower_VRESProfiles(excel_file_path: str, keep_excluded_entries: bool = dPower_VRESProfiles = __read_pivoted_file(excel_file_path, "v0.1.0", ['rp', 'k', 'g'], 'k', ['rp', 'g', 'dataPackage', 'dataSource', 'id'], False, False, fail_on_wrong_version) if keep_excluded_entries: - printer.warning("'keep_excluded_entries' is set for 'get_dPower_WeightsK', although nothing is excluded anyway - please check if this is intended.") + printer.warning("'keep_excluded_entries' is set for 'get_dPower_VRESProfiles', although nothing is excluded anyway - please check if this is intended.") return dPower_VRESProfiles