From a97583d31d1b3ba6d884dbb2b4f5e576de864647 Mon Sep 17 00:00:00 2001 From: ARNER Kevin Date: Tue, 16 Jul 2019 16:20:37 +0200 Subject: [PATCH] Matrice Croisee --- ProcessOutputs_Eficas/Data_for_interface | Bin 39853 -> 41023 bytes ProcessOutputs_Eficas/Matrice.py | 64 ++++ ProcessOutputs_Eficas/TEST.py | 185 ++++++++++ .../TreatOutputs/Processor.py | 316 +++++++++++++----- .../{Processor_new.py => Processor_old.py} | 213 +++++------- ProcessOutputs_Eficas/TreatOutputs/TEST.py | 139 -------- .../TreatOutputs/WriteFuncs.py | 2 +- .../TreatOutputs/WriteFuncsCsv.py | 2 +- ProcessOutputs_Eficas/TreatOutputs/dicoN1.py | 2 +- .../TreatOutputs/dicoN1_process.py | 2 +- .../TreatOutputs/dicoProcessor.py | 4 +- 11 files changed, 571 insertions(+), 358 deletions(-) create mode 100644 ProcessOutputs_Eficas/Matrice.py create mode 100644 ProcessOutputs_Eficas/TEST.py rename ProcessOutputs_Eficas/TreatOutputs/{Processor_new.py => Processor_old.py} (83%) delete mode 100644 ProcessOutputs_Eficas/TreatOutputs/TEST.py diff --git a/ProcessOutputs_Eficas/Data_for_interface b/ProcessOutputs_Eficas/Data_for_interface index 76e4e94c50a0719235e52fc1b0ddbfa4c41cae7c..54d27e72f1199e7f027e8e5e9c104004e32aef81 100644 GIT binary patch literal 41023 zcmchgcVHA%*T#bd!G?kjD=JECND``wB!m!R5`rY)isBL>Kq4m0g+)b2vG=YBQbhp~ z5qmG#d+)vX-n)M1Jaf;?o!zquQNK5TOlIf#-MQzPd*`;@ot?3U@8#qs+UMltR5nd* zGK1>JHhFD)Z;eDdI#f~LScfBP`rcZ(iQaUmxXDbZA6uK0|J6;?>Kdol*CxZA;;P}* z#brgw>Z*|?Lr2k0vZBme+xOb$;+!>AC5fR$l_lOfiOuMIVX|MH7Y)xu_+ntRoB)xPOYn~ zHT8AX^<&3QtV?Dd88*CX*zmHVp;gII)z#I#VR%d5+lme6(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max Violation' +""" +input_excel = pd.ExcelFile(input_path) + +sheet_names_all = {} + +for name in sheets: + + if 'Voltage' in name: + max_sheet = filename + ' Max' + name[len(filename):] + min_sheet = filename + ' Min' + name[len(filename):] + occu_sheet = filename + ' Occurence' + name[len(filename):] + + sheet_names_all[name]=[max_sheet, min_sheet, occu_sheet] + + + elif 'Flows' in name: + max_sheet = filename + ' Max' + name[len(filename):] + occu_sheet = filename + ' Occurence' + name[len(filename):] + + sheet_names_all[name]=[max_sheet, occu_sheet] + +# nomColonne = "'" + 'Component_List_For_'+ str(name) + "'" +# nomColonne = nomColonne.replace('_ ',' _') +# +# nomLigne = "'" + 'Contingency_List_For_'+ str(name) +"'" +# nomLigne = nomLigne.replace('_ ',' _') +# +# Options.selectedDoubleCol[str(name)] = dico['CONTINGENCY_PROCESSING'][nomColonne] +# Options.selectedDoubleRow[str(name)] = dico['CONTINGENCY_PROCESSING'][nomLigne] + + +for sheet_keys in sheet_names_all.keys(): + + """ + On cree une DataFrame pour l'onglet/sheet actuel + Selon le nom de l onglet/sheet, on precise l intitule de la valeur que l on va recuperer + On cree des listes repertoriant les noms des composants et contingences en faisant appel aux elements selectionnes par l utilisateur + Ces elements sont stockes dans dicoN1_process + """ + + df = input_excel.parse(sheet_keys) + + """ + On compte le nombre de cas simules + """ + nb_cases = 0 + + for col in df.columns: + if 'Case' in col: + nb_cases+=1 + + conting_label = 'Contingency' + + """ + Soit on observe des tensions (Voltage) et dans ce cas la, trois grandeurs vont nous interesser (Max/Min/Occurence) + Soit on observe des flux (Flows) et dans ce cas la, deux grandeurs vont nous interesser (Max/Occurence) + """ + if 'Voltage' in sheet_keys: + + compo_label = 'Bus' + ite = 0 + + for sheet in sheet_names_all[sheet_keys]: + + """ + On vient recuperer differentes valeurs en fonction de l onglet dans lequel on se trouve (Max/Min/Occurence) + """ + if 'Max' in sheet: + value_label = 'Max Voltage' + elif 'Min' in sheet: + value_label = 'Min Voltage' + elif 'Occurence' in sheet: + value_label = 'Number of Violations' + + + for k in dico['CONTINGENCY_PROCESSING'].keys(): + + if 'Voltage' in k and 'Component' in k: + compo = dico['CONTINGENCY_PROCESSING'][k] + elif 'Voltage' in k and 'Contingency' in k: + conting = dico['CONTINGENCY_PROCESSING'][k] + + """ + On fait appel a la fonction fill_matrice afin de creer notre matrice croisee dynamique + """ + output_excel = fill_matrice(df, compo_label, compo, conting_label, conting, value_label, nb_cases) + + """ + On importe notre matrice au format excel + """ + output_excel.to_excel(writer, sheet_name = sheet_names_all[sheet_keys][ite]) + ite += 1 + + elif 'Flows' in sheet_keys: + + compo_label = 'Branch' + ite = 0 + + for sheet in sheet_names_all[sheet_keys]: + + """ + On vient recuperer differentes valeurs en fonction de l onglet dans lequel on se trouve (Max/Occurence) + """ + + if 'Max' in sheet: + value_label = 'Max Violation' + elif 'Occurence' in sheet: + value_label = 'Number of Violations' + + + for k in dico['CONTINGENCY_PROCESSING'].keys(): + + if 'Flows' in k and 'Component' in k: + compo = dico['CONTINGENCY_PROCESSING'][k] + elif 'Flows' in k and 'Contingency' in k: + conting = dico['CONTINGENCY_PROCESSING'][k] + + """ + On fait appel a la fonction fill_matrice afin de creer notre matrice croisee dynamique + """ + output_excel = fill_matrice(df, compo_label, compo, conting_label, conting, value_label, nb_cases) + + """ + On importe notre matrice au format excel + """ + output_excel.to_excel(writer, sheet_name = sheet_names_all[sheet_keys][ite]) + ite += 1 + + else: + break + + +writer.save() + +""" +Ajustez la taille des colonnes et lignes automatiquement +""" + +excel = win32.gencache.EnsureDispatch('Excel.Application') +wb = excel.Workbooks.Open(output_path) + +autofit_sheet_names = [] + +for k in sheet_names_all.keys(): + for v in sheet_names_all[k]: + autofit_sheet_names.append(v) + +for sheet_to_autofit in autofit_sheet_names: + ws = wb.Worksheets(sheet_to_autofit) + ws.Columns.AutoFit() + +wb.Save() +excel.Application.Quit() diff --git a/ProcessOutputs_Eficas/TreatOutputs/Processor.py b/ProcessOutputs_Eficas/TreatOutputs/Processor.py index ef0eed92..d93e5d6b 100644 --- a/ProcessOutputs_Eficas/TreatOutputs/Processor.py +++ b/ProcessOutputs_Eficas/TreatOutputs/Processor.py @@ -75,63 +75,178 @@ def processXLS(dico): print('je suis dans processor') UpdateProcessorOptions(dico) - indexes = {} - toGather = {} - data = {} - totalData = {} - - if Options.csvFileName.endswith('xls'): - # Step 1 : get the indexes of each columns to process - wb = xlrd.open_workbook(Options.csvFileName) - sheets = wb.sheet_names() - # Now get data from the selected columns. data and TotalData are filled in gatherxlsData and are accessible here - gatherXlsData(wb, sheets, data, totalData) - elif Options.csvFileName.endswith('csv'): - - ACCCresultsfolder = os.path.dirname(Options.csvFileName) #os.path.join(Options.FolderList[0], "ACCCresults") - sheets =[] - for file in os.listdir(ACCCresultsfolder): - if file.endswith('.csv') and (' Voltage ' in file or ' FlowsDif ' in file or ' Flows ' in file or ' LoadShed ' in file) : - name = str(file[0:-4]) - nomCle = "'"+'Component_List_For_'+str(name)+"'" - nomCle = nomCle.replace('_ ',' _') - if nomCle in dico['CONTINGENCY_PROCESSING'].keys(): - sheets.append(file[0:-4]) - gatherCsvData(sheets, data, totalData) - # Now we process the gathered data depending on the required calculus - processedData = {} + wb = xlrd.open_workbook(Options.csvFileName) + sheets = wb.sheet_names() + input_path = dico['CONTINGENCY_PROCESSING']['XLS_file'] + filename = dico['CONTINGENCY_SELECTION']['case_name'] + output_path = os.path.join(dico['CASE_SELECTION']['PSEN_results_folder'],filename + '.xlsx') + + """ + Cette commande va permettre d ouvrir le fichier resultat dans lequel on va enregistrer differents onglets + Uniquement a la fin de toutes les ecritures, nous viendrons le sauvegarder + """ + writer = pd.ExcelWriter(output_path, engine='xlsxwriter') + + """ + On importe le fichier excel et on cree une DataFrame pour chaque Onglet/Sheet du fichier + On recupere egalement les noms des Onglets/Sheets afin de pouvoir adapter les intitules des composants et des valeurs + + Voltage ==> 'Bus' ; 'Max Voltage' + Flows ==> 'Branch' ; 'Max Violation' + """ + input_excel = pd.ExcelFile(input_path) + + sheet_names_all = {} + for name in sheets: - - try: - - nomColonne = 'Component_List_For_'+str(name) - nomColonne = nomColonne.replace('_ ',' _') + if 'Voltage' in name: + max_sheet = filename + ' Max' + name[len(filename):] + min_sheet = filename + ' Min' + name[len(filename):] + occu_sheet = filename + ' Occurence' + name[len(filename):] + + sheet_names_all[name]=[max_sheet, min_sheet, occu_sheet] + + + elif 'Flows' in name: + max_sheet = filename + ' Max' + name[len(filename):] + occu_sheet = filename + ' Occurence' + name[len(filename):] + + sheet_names_all[name]=[max_sheet, occu_sheet] + + nomColonne = "'" + 'Component_List_For_'+ str(name) + "'" + nomColonne = nomColonne.replace('_ ',' _') + + nomLigne = "'" + 'Contingency_List_For_'+ str(name) +"'" + nomLigne = nomLigne.replace('_ ',' _') + + Options.selectedDoubleCol[str(name)] = dico['CONTINGENCY_PROCESSING'][nomColonne] + Options.selectedDoubleRow[str(name)] = dico['CONTINGENCY_PROCESSING'][nomLigne] + + + for sheet_keys in sheet_names_all.keys(): + + """ + On cree une DataFrame pour l'onglet/sheet actuel + Selon le nom de l onglet/sheet, on precise l intitule de la valeur que l on va recuperer + On cree des listes repertoriant les noms des composants et contingences en faisant appel aux elements selectionnes par l utilisateur + Ces elements sont stockes dans dicoN1_process + """ + + df = input_excel.parse(sheet_keys) + + """ + On compte le nombre de cas simules + """ + nb_cases = 0 + + for col in df.columns: + if 'Case' in col: + nb_cases+=1 + + conting_label = 'Contingency' + + """ + Soit on observe des tensions (Voltage) et dans ce cas la, trois grandeurs vont nous interesser (Max/Min/Occurence) + Soit on observe des flux (Flows) et dans ce cas la, deux grandeurs vont nous interesser (Max/Occurence) + """ + if 'Voltage' in sheet_keys: - nomLigne = 'Contingency_List_For_'+str(name) - nomLigne = nomLigne.replace('_ ',' _') + compo_label = 'Bus' + ite = 0 + + for sheet in sheet_names_all[sheet_keys]: + + """ + On vient recuperer differentes valeurs en fonction de l onglet dans lequel on se trouve (Max/Min/Occurence) + """ + if 'Max' in sheet: + value_label = 'Max Voltage' + elif 'Min' in sheet: + value_label = 'Min Voltage' + elif 'Occurence' in sheet: + value_label = 'Number of Violations' + + for k in dico['CONTINGENCY_PROCESSING'].keys(): + + if 'Voltage' in k and 'Component' in k: + compo = dico['CONTINGENCY_PROCESSING'][k] + elif 'Voltage' in k and 'Contingency' in k: + conting = dico['CONTINGENCY_PROCESSING'][k] + + """ + On fait appel a la fonction fill_matrice afin de creer notre matrice croisee dynamique + """ + output_excel = fill_matrice(df, compo_label, compo, conting_label, conting, value_label, nb_cases) + + """ + On importe notre matrice au format excel + """ + output_excel.to_excel(writer, sheet_name = sheet_names_all[sheet_keys][ite]) + ite += 1 + + elif 'Flows' in sheet_keys: + + compo_label = 'Branch' + ite = 0 + + for sheet in sheet_names_all[sheet_keys]: + + """ + On vient recuperer differentes valeurs en fonction de l onglet dans lequel on se trouve (Max/Occurence) + """ + + if 'Max' in sheet: + value_label = 'Max Violation' + elif 'Occurence' in sheet: + value_label = 'Number of Violations' + + + for k in dico['CONTINGENCY_PROCESSING'].keys(): + + if 'Flows' in k and 'Component' in k: + compo = dico['CONTINGENCY_PROCESSING'][k] + elif 'Flows' in k and 'Contingency' in k: + conting = dico['CONTINGENCY_PROCESSING'][k] + + """ + On fait appel a la fonction fill_matrice afin de creer notre matrice croisee dynamique + """ + output_excel = fill_matrice(df, compo_label, compo, conting_label, conting, value_label, nb_cases) + + """ + On importe notre matrice au format excel + """ + output_excel.to_excel(writer, sheet_name = sheet_names_all[sheet_keys][ite]) + ite += 1 + + else: + break + + writer.save() + """ + Ajustez la taille des colonnes et lignes automatiquement + """ - if nomColonne not in dico['CONTINGENCY_PROCESSING'].keys(): - continue - - Options.selectedDoubleCol[str(name)] = dico['CONTINGENCY_PROCESSING'][nomColonne] - Options.selectedDoubleRow[str(name)] = dico['CONTINGENCY_PROCESSING'][nomLigne] + excel = win32.gencache.EnsureDispatch('Excel.Application') + wb = excel.Workbooks.Open(output_path) - print('apres select') - processedData[name] = [[]] - - processedData[name] = Compute.createDoubleArray(totalData[name], processedData[name], name) - - xlsToOutput(processedData[name]) + autofit_sheet_names = [] - - except KeyError: - print("error dans ecriture acc results") - pass + for k in sheet_names_all.keys(): + for v in sheet_names_all[k]: + autofit_sheet_names.append(v) + + for sheet_to_autofit in autofit_sheet_names: + ws = wb.Worksheets(sheet_to_autofit) + ws.Columns.AutoFit() + + wb.Save() + excel.Application.Quit() @@ -256,43 +371,7 @@ def gatherCsvData(sheets, data, totalData): h.close() - # except: #python 3 - # for name in sheets: - # ACCCresultsfolder = os.path.dirname(Options.csvFileName) - # ACCCresultsfile = os.path.join(ACCCresultsfolder,name + '.csv') - # h = open(ACCCresultsfile,"r", newline='') - # crd = csv.reader(h,delimiter=";") - - # data[name] = [] - # totalData[name] = [] - - # for i, row in enumerate(crd): - # totalData[name].append([]) - # data[name].append([]) - - # for j in range(len(row)): - ##Store data anyway in totalData - # if i == 0: - # totalData[name][i] = [j] - # try: - # totalData[name][i].append(float(row[j])) - # except: - # totalData[name][i].append(row[j]) - # try: - # if j == 0: - # try: - # if row[0] in Options.selectedDoubleRow[name] and row[1] in Options.selectedDoubleCol[name]: - # pass - # else: - # break - # except: - # break - # if i == 0: - # data[name][i] = [j] - # data[name][i].append(float(row[j])) - # except: - # data[name][i].append('N/A') - # h.close() + def isData(row): for item in row: @@ -614,9 +693,74 @@ def xlsToXls(indexes, data): newWb.save(name) print('Processing over. The file has been saved under ' + name + '.') + +def fill_matrice(dataframe, component_label, component, contingency_label, contingency, value_label, nb_cases): + + import pandas as pd + + """ + On range ces listes par ordre alphabetique + """ + component.sort() + contingency.sort() + + """ + On vient creer le squelette de notre matrice, on la remplit de 0 + """ + output_excel = pd.DataFrame(index = component, columns = contingency) + output_excel = output_excel.fillna(0) + + + """ + On vient ranger nos lignes et colonnes par ordre alphabetique, de la meme maniere que les listes component et contingency + """ + output_excel.sort_index(axis = 1, ascending = True, inplace =True) + output_excel.sort_index(axis = 0, ascending = True, inplace = True) + + if value_label != 'Number of Violations': + + for i in range(len(component)): + + for j in range(len(contingency)): + + """ + Cette commande permet de venir selectionner la valeur du componentsant X impacte par la contingence Y + """ + valeur = dataframe[(dataframe[component_label] == component[i]) & (dataframe[contingency_label] == contingency[j])][value_label] + + + """ + Cette commande permet de venir remplir notre matrice avec les valeurs recuperees dans la DataFrame d origine + """ + try: + output_excel.loc[component[i], contingency[j]] = float(valeur) + except: + pass + + else: + + for i in range(len(component)): + + for j in range(len(contingency)): + + """ + Cette commande permet de venir selectionner la valeur du componentsant X impacte par la contingence Y + """ + nb_viol = dataframe[(dataframe[component_label] == component[i]) & (dataframe[contingency_label] == contingency[j])][value_label] + valeur = nb_viol/nb_cases + + """ + Cette commande permet de venir remplir notre matrice avec les valeurs recuperees dans la DataFrame d origine + """ + try: + output_excel.loc[component[i], contingency[j]] = float(int(valeur*100))/100 + except: + pass + + return output_excel if __name__ == '__main__': - from dicoProcessor import dico + from dicoN1_process import Dico as dico - processXLS(dico) + processXLS(dico) \ No newline at end of file diff --git a/ProcessOutputs_Eficas/TreatOutputs/Processor_new.py b/ProcessOutputs_Eficas/TreatOutputs/Processor_old.py similarity index 83% rename from ProcessOutputs_Eficas/TreatOutputs/Processor_new.py rename to ProcessOutputs_Eficas/TreatOutputs/Processor_old.py index 83c3af79..ca3f597d 100644 --- a/ProcessOutputs_Eficas/TreatOutputs/Processor_new.py +++ b/ProcessOutputs_Eficas/TreatOutputs/Processor_old.py @@ -18,7 +18,6 @@ import os import pandas as pd import win32com.client as win32 - def getXLSinfo(filename): wb = xlrd.open_workbook(filename) sheets = wb.sheet_names() @@ -75,142 +74,66 @@ def getCSVinfo(csvfilename): def processXLS(dico): print('je suis dans processor') - - # """ - # On renseigne les chemins vers les fichiers d'entrée et de sortie - # """ - - # input_path = dico['CONTINGENCY_PROCESSING']['XLS_file'] - - # filename = dico['CONTINGENCY_SELECTION']['case_name'] + '.xlsx' - # output_path = os.path.join(dico['CASE_SELECTION']['PSEN_results_folder'],filename) - - - # """ - # Cette commande va permettre d'ouvrir le fichier résultat dans lequel on va enregistrer différents onglets - # Uniquement à la fin de totues les écritures, nous viendrons le sauvegarder - # """ - # writer = pd.ExcelWriter(output_path, engine='xlsxwriter') - - - - # """ - # On importe le fichier excel et on crée une DataFrame pour chaque Onglet/Sheet du fichier - # On récupère également les noms des Onglets/Sheets afin de pouvoir adapter les intitulés des composants et des valeurs - - # Voltage ==> 'Bus' ; 'Max Voltage' - # Flows ==> 'Branch' ; 'Max Violation' - # """ - # input_excel = pd.ExcelFile(input_path) - - # sheet_names_all = dico['CONTINGENCY_PROCESSING']['TabList'] - + UpdateProcessorOptions(dico) + indexes = {} + toGather = {} + data = {} + totalData = {} - # for sheet in sheet_names_all: + if Options.csvFileName.endswith('xls'): + # Step 1 : get the indexes of each columns to process + wb = xlrd.open_workbook(Options.csvFileName) + sheets = wb.sheet_names() + # Now get data from the selected columns. data and TotalData are filled in gatherxlsData and are accessible here + gatherXlsData(wb, sheets, data, totalData) + # elif Options.csvFileName.endswith('csv'): + + # ACCCresultsfolder = os.path.dirname(Options.csvFileName) #os.path.join(Options.FolderList[0], "ACCCresults") + # sheets =[] + # for file in os.listdir(ACCCresultsfolder): + # if file.endswith('.csv') and (' Voltage ' in file or ' FlowsDif ' in file or ' Flows ' in file or ' LoadShed ' in file) : + # name = str(file[0:-4]) + # nomCle = "'"+'Component_List_For_'+str(name)+"'" + # nomCle = nomCle.replace('_ ',' _') + # if nomCle in dico['CONTINGENCY_PROCESSING'].keys(): + # sheets.append(file[0:-4]) + # gatherCsvData(sheets, data, totalData) - - # """ - # On crée une DataFrame pour l'onglet/sheet actuel - # Selon le nom de l'onglet/sheet, on précise l'intitulé de la valeur que l'on va récupérer - + # Now we process the gathered data depending on the required calculus + # processedData = {} - # On crée des listes répertoriant les noms des composants et contingingences en faisant appel aux éléments sélectionnés par l'utilisateur - # Ces éléments sont stockes dans dicoN1_process + # for name in sheets: - # """ - - # df = input_excel.parse(sheet) - - # conting_label = 'Contingency' - - # if 'Voltage' in sheet: - - # compo_label = 'Bus' - # value_label = 'Max Voltage' + # try: - # for k in dico['CONTINGENCY_PROCESSING'].keys(): - - # if 'Voltage' in k and 'Component' in k: - # compo = dico['CONTINGENCY_PROCESSING'][k] - - # elif 'Voltage' in k and 'Contingency' in k: - # conting = dico['CONTINGENCY_PROCESSING'][k] - + # nomColonne = 'Component_List_For_'+str(name) + # nomColonne = nomColonne.replace('_ ',' _') - # elif 'Flows' in sheet: + # nomLigne = 'Contingency_List_For_'+str(name) + # nomLigne = nomLigne.replace('_ ',' _') - # compo_label = 'Branch' - # value_label = 'Max Violation' - - # for k in dico['CONTINGENCY_PROCESSING'].keys(): - - # if 'Flows' in k and 'Component' in k: - # compo = dico['CONTINGENCY_PROCESSING'][k] + # if nomColonne not in dico['CONTINGENCY_PROCESSING'].keys(): + # continue - # elif 'Flows' in k and 'Contingency' in k: - # conting = dico['CONTINGENCY_PROCESSING'][k] - - - # """ - # On range ces listes par ordre alphabétique - # """ - # compo.sort() - # conting.sort() - - # """ - # On vient créer le squelette de notre matrice, on la remplit de 0 - # """ - # output_excel = pd.DataFrame(index = compo, columns = conting) - # output_excel = output_excel.fillna(0) - - - # """ - # On vient ranger nos lignes et colonnes par ordre alphabétique, de la même manière que les listes compo et conting - # """ - # output_excel.sort_index(axis = 1, ascending = True, inplace =True) - # output_excel.sort_index(axis = 0, ascending = True, inplace = True) - - - # for i in range(len(compo)): + # Options.selectedDoubleCol[str(name)] = dico['CONTINGENCY_PROCESSING'][nomColonne] + # Options.selectedDoubleRow[str(name)] = dico['CONTINGENCY_PROCESSING'][nomLigne] - # for j in range(len(conting)): - # """ - # Cette commande permet de venir selectionner la valeur du composant X impacté par la contingence Y - - # """ - # valeur = df[(df[compo_label] == compo[i]) & (df[conting_label] == conting[j])][value_label] - - - # """ - # Cette commande permet de venir remplir notre matrice avec les valeurs récupérés dans la DataFrame d'origine - # """ - # try: - # output_excel.loc[compo[i], conting[j]] = float(valeur) - # except: - # pass - + # print('options') + # print(type(Options.selectedDoubleCol[str(name)])) - # """ - # On importe notre matrice au format excel - # """ - # output_excel.to_excel(writer, sheet_name = sheet) - - # writer.save() + # print('apres select') + # processedData[name] = [[]] + + # processedData[name] = Compute.createDoubleArray(totalData[name], processedData[name], name) + + # xlsToOutput(processedData[name]) - # """ - # Ajustez la taille des colonnes et lignes automatiquement - # """ + + # except KeyError: + # print("error dans ecriture acc results") + # pass - # excel = win32.gencache.EnsureDispatch('Excel.Application') - # wb = excel.Workbooks.Open(output_path) - # for sheet_to_autofit in sheet_names_all: - # ws = wb.Worksheets(sheet_to_autofit) - # ws.Columns.AutoFit() - - # wb.Save() - # excel.Application.Quit() - def processXLS_out(dico): @@ -333,7 +256,43 @@ def gatherCsvData(sheets, data, totalData): h.close() - + # except: #python 3 + # for name in sheets: + # ACCCresultsfolder = os.path.dirname(Options.csvFileName) + # ACCCresultsfile = os.path.join(ACCCresultsfolder,name + '.csv') + # h = open(ACCCresultsfile,"r", newline='') + # crd = csv.reader(h,delimiter=";") + + # data[name] = [] + # totalData[name] = [] + + # for i, row in enumerate(crd): + # totalData[name].append([]) + # data[name].append([]) + + # for j in range(len(row)): + ##Store data anyway in totalData + # if i == 0: + # totalData[name][i] = [j] + # try: + # totalData[name][i].append(float(row[j])) + # except: + # totalData[name][i].append(row[j]) + # try: + # if j == 0: + # try: + # if row[0] in Options.selectedDoubleRow[name] and row[1] in Options.selectedDoubleCol[name]: + # pass + # else: + # break + # except: + # break + # if i == 0: + # data[name][i] = [j] + # data[name][i].append(float(row[j])) + # except: + # data[name][i].append('N/A') + # h.close() def isData(row): for item in row: @@ -658,6 +617,6 @@ def xlsToXls(indexes, data): if __name__ == '__main__': - from dicodicoN1_process import Dico as dico + from dicoN1_process import Dico as dico - processXLS(dico) + processXLS(dico) \ No newline at end of file diff --git a/ProcessOutputs_Eficas/TreatOutputs/TEST.py b/ProcessOutputs_Eficas/TreatOutputs/TEST.py deleted file mode 100644 index b47c12c2..00000000 --- a/ProcessOutputs_Eficas/TreatOutputs/TEST.py +++ /dev/null @@ -1,139 +0,0 @@ -# -*- coding: utf-8 -*- -""" -On importe nos modules et on renseigne les chemins vers les fichiers d'entrée et de sortie -""" -import os -import pandas as pd -import win32com.client as win32 -from dicoN1_process import Dico as dico - -input_path = dico['CONTINGENCY_PROCESSING']['XLS_file'] - -filename = dico['CONTINGENCY_SELECTION']['case_name'] + '.xlsx' -output_path = os.path.join(dico['CASE_SELECTION']['PSEN_results_folder'],filename) - - -""" -Cette commande va permettre d'ouvrir le fichier résultat dans lequel on va enregistrer différents onglets -Uniquement à la fin de totues les écritures, nous viendrons le sauvegarder -""" -writer = pd.ExcelWriter(output_path, engine='xlsxwriter') - - - -""" -On importe le fichier excel et on crée une DataFrame pour chaque Onglet/Sheet du fichier -On récupère également les noms des Onglets/Sheets afin de pouvoir adapter les intitulés des composants et des valeurs - -Voltage ==> 'Bus' ; 'Max Voltage' -Flows ==> 'Branch' ; 'Max Violation' -""" -input_excel = pd.ExcelFile(input_path) - -sheet_names_all = dico['CONTINGENCY_PROCESSING']['TabList'] - - -for sheet in sheet_names_all: - - - """ - On crée une DataFrame pour l'onglet/sheet actuel - Selon le nom de l'onglet/sheet, on précise l'intitulé de la valeur que l'on va récupérer - - - On crée des listes répertoriant les noms des composants et contingingences en faisant appel aux éléments sélectionnés par l'utilisateur - Ces éléments sont stockes dans dicoN1_process - - """ - - df = input_excel.parse(sheet) - - conting_label = 'Contingency' - - if 'Voltage' in sheet: - - compo_label = 'Bus' - value_label = 'Max Voltage' - - for k in dico['CONTINGENCY_PROCESSING'].keys(): - - if 'Voltage' in k and 'Component' in k: - compo = dico['CONTINGENCY_PROCESSING'][k] - - elif 'Voltage' in k and 'Contingency' in k: - conting = dico['CONTINGENCY_PROCESSING'][k] - - - elif 'Flows' in sheet: - - compo_label = 'Branch' - value_label = 'Max Violation' - - for k in dico['CONTINGENCY_PROCESSING'].keys(): - - if 'Flows' in k and 'Component' in k: - compo = dico['CONTINGENCY_PROCESSING'][k] - - elif 'Flows' in k and 'Contingency' in k: - conting = dico['CONTINGENCY_PROCESSING'][k] - - - """ - On range ces listes par ordre alphabétique - """ - compo.sort() - conting.sort() - - """ - On vient créer le squelette de notre matrice, on la remplit de 0 - """ - output_excel = pd.DataFrame(index = compo, columns = conting) - output_excel = output_excel.fillna(0) - - - """ - On vient ranger nos lignes et colonnes par ordre alphabétique, de la même manière que les listes compo et conting - """ - output_excel.sort_index(axis = 1, ascending = True, inplace =True) - output_excel.sort_index(axis = 0, ascending = True, inplace = True) - - - for i in range(len(compo)): - - for j in range(len(conting)): - """ - Cette commande permet de venir selectionner la valeur du composant X impacté par la contingence Y - - """ - valeur = df[(df[compo_label] == compo[i]) & (df[conting_label] == conting[j])][value_label] - - - """ - Cette commande permet de venir remplir notre matrice avec les valeurs récupérés dans la DataFrame d'origine - """ - try: - output_excel.loc[compo[i], conting[j]] = float(valeur) - except: - pass - - - """ - On importe notre matrice au format excel - """ - output_excel.to_excel(writer, sheet_name = sheet) - -writer.save() - -""" -Ajustez la taille des colonnes et lignes automatiquement -""" - -excel = win32.gencache.EnsureDispatch('Excel.Application') -wb = excel.Workbooks.Open(output_path) - -for sheet_to_autofit in sheet_names_all: - ws = wb.Worksheets(sheet_to_autofit) - ws.Columns.AutoFit() - -wb.Save() -excel.Application.Quit() \ No newline at end of file diff --git a/ProcessOutputs_Eficas/TreatOutputs/WriteFuncs.py b/ProcessOutputs_Eficas/TreatOutputs/WriteFuncs.py index e0f9c4cc..c061d24a 100644 --- a/ProcessOutputs_Eficas/TreatOutputs/WriteFuncs.py +++ b/ProcessOutputs_Eficas/TreatOutputs/WriteFuncs.py @@ -337,7 +337,7 @@ def writeFlowsLines(book, outputExcel, case, SavFileList, ContList, LineList, Fl except: flow_idx += 1 sheet.write(flow_idx, 1, "Contingency") - sheet.write(flow_idx, 2, "Nb. Violations") + sheet.write(flow_idx, 2, "Number of Violations") sheet.write(flow_idx, 3, "Max Violation") sheet.write(flow_idx, 4, "Rate (MVA)") sheet_num = 0 diff --git a/ProcessOutputs_Eficas/TreatOutputs/WriteFuncsCsv.py b/ProcessOutputs_Eficas/TreatOutputs/WriteFuncsCsv.py index 5b0d21a3..dc881b97 100644 --- a/ProcessOutputs_Eficas/TreatOutputs/WriteFuncsCsv.py +++ b/ProcessOutputs_Eficas/TreatOutputs/WriteFuncsCsv.py @@ -176,7 +176,7 @@ def writeVoltages(book, case, SavFileList, ContList, Voltages, BusNominal, Ops) def writeFlowsLines(book, outputExcel, case, SavFileList, ContList, LineList, Flows, BranchesDico, FlowMax, Ops): rows = [] - row = ["Branch", "Contingency", "Nb. Violations", "Max Violation", "Rate (MVA)"] + row = ["Branch", "Contingency", "Number of Violations", "Max Violation", "Rate (MVA)"] FlowsWriter = book[0] VoltagesWriter = book[1] diff --git a/ProcessOutputs_Eficas/TreatOutputs/dicoN1.py b/ProcessOutputs_Eficas/TreatOutputs/dicoN1.py index c2f4fd8b..c7548186 100644 --- a/ProcessOutputs_Eficas/TreatOutputs/dicoN1.py +++ b/ProcessOutputs_Eficas/TreatOutputs/dicoN1.py @@ -1 +1 @@ -Dico ={'CASE_SELECTION': {'TransformersList': [], 'PSEN_results_csvfile': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35/simulationDClog_complete_07h31m35.csv', 'DecimalSeparator': ',', 'MaxDepth': 5, 'NewCsvFile': 'CleanedData.csv', 'PSEN_results_csvfile_cleaned': False, 'Python3_path': 'C:/Python35', 'PF_path': 'C:\\Program Files\\DIgSILENT\\PowerFactory 2017 SP1\\Python\\3.5', 'LinesList': ['90.0'], 'PSEN_results_folder': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35', 'OutputNewCsv': False, 'BusesList': ['90.0']}, 'N_PROCESSING_OPTIONS': {'Output_bus_values': False, 'Output_transformer_values': False, 'Output_lines_values': True}} \ No newline at end of file +Dico ={'CONTINGENCY_SELECTION': {'TripLines': True, 'csv_file': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35/Test.csv', 'SelectionMethod': 'CaseSelectionFromFile', 'case_name': 'testuno', 'TripTransfos': False, 'TripGenerators': True}, 'CASE_SELECTION': {'TransformersList': [], 'PSEN_results_csvfile': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35/simulationDClog_complete_07h31m35.csv', 'DecimalSeparator': ',', 'MaxDepth': 5, 'NewCsvFile': 'CleanedData.csv', 'PSEN_results_csvfile_cleaned': False, 'Python3_path': 'C:/Python35', 'PF_path': 'C:\\Program Files\\DIgSILENT\\PowerFactory 2017 SP1\\Python\\3.5', 'LinesList': ['90.0'], 'PSEN_results_folder': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35', 'OutputNewCsv': False, 'BusesList': ['90.0']}, 'CONTINGENCY_OPTIONS': {'ActiveLimits': True, 'Vmin': 0.95, 'FlowLimitTransformers': 100, 'AdjustTaps': False, 'VarLimits': True, 'FlowLimitLines': 100, 'FlatStart': False, 'AdjustShunts': False, 'Vmax': 1.05, 'output_file_format': 'xls', 'DispatchMode': 'ReferenceMachine'}} \ No newline at end of file diff --git a/ProcessOutputs_Eficas/TreatOutputs/dicoN1_process.py b/ProcessOutputs_Eficas/TreatOutputs/dicoN1_process.py index be66361f..5a0bdb1d 100644 --- a/ProcessOutputs_Eficas/TreatOutputs/dicoN1_process.py +++ b/ProcessOutputs_Eficas/TreatOutputs/dicoN1_process.py @@ -1 +1 @@ -Dico ={'CONTINGENCY_PROCESSING': {'XLS_file': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35/ACCCresults.xls', "'Contingency_List_For_testuno Flows 0'": ['CERVIONE_GHISONACCIA'], "'Component_List_For_testuno Flows 0'": ['Aspretto_Aspretto_Vazzio_Vazzio_ASPRETTO_VAZZIO__LI'], 'TabList': ['testuno Voltage 0', 'testuno Flows 0'], "'Component_List_For_testuno Voltage 0'": ['Corsica_Corsica'], "'Contingency_List_For_testuno Voltage 0'": ['CASTIRLA_CORSICA']}, 'CONTINGENCY_SELECTION': {'TripLines': True, 'csv_file': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35/Test.csv', 'SelectionMethod': 'CaseSelectionFromFile', 'case_name': 'testuno', 'TripTransfos': False, 'TripGenerators': True}, 'CASE_SELECTION': {'TransformersList': [], 'PSEN_results_csvfile': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35/simulationDClog_complete_07h31m35.csv', 'DecimalSeparator': ',', 'MaxDepth': 5, 'NewCsvFile': 'CleanedData.csv', 'PSEN_results_csvfile_cleaned': False, 'Python3_path': 'C:/Python35', 'PF_path': 'C:\\Program Files\\DIgSILENT\\PowerFactory 2017 SP1\\Python\\3.5', 'LinesList': ['90.0'], 'PSEN_results_folder': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35', 'OutputNewCsv': False, 'BusesList': ['90.0']}, 'CONTINGENCY_OPTIONS': {'ActiveLimits': True, 'Vmin': 0.95, 'FlowLimitTransformers': 100, 'AdjustTaps': False, 'VarLimits': True, 'FlowLimitLines': 100, 'FlatStart': False, 'AdjustShunts': False, 'Vmax': 1.05, 'output_file_format': 'xls', 'DispatchMode': 'ReferenceMachine'}} \ No newline at end of file +Dico ={'CONTINGENCY_PROCESSING': {'XLS_file': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35/ACCCresults.xls', "'Contingency_List_For_testuno Flows 0'": ['FURIANI_LUCCIANA1'], "'Component_List_For_testuno Flows 0'": ['Aspretto_Aspretto_Vazzio_Vazzio_ASPRETTO_VAZZIO__LI'], 'TabList': ['testuno Voltage 0', 'testuno Flows 0'], "'Component_List_For_testuno Voltage 0'": ['Corte_Corte'], "'Contingency_List_For_testuno Voltage 0'": ['CORTE_MOROSAGLIA']}, 'CONTINGENCY_SELECTION': {'TripLines': True, 'csv_file': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35/Test.csv', 'SelectionMethod': 'CaseSelectionFromFile', 'case_name': 'testuno', 'TripTransfos': False, 'TripGenerators': True}, 'CASE_SELECTION': {'TransformersList': [], 'PSEN_results_csvfile': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35/simulationDClog_complete_07h31m35.csv', 'DecimalSeparator': ',', 'MaxDepth': 5, 'NewCsvFile': 'CleanedData.csv', 'PSEN_results_csvfile_cleaned': False, 'Python3_path': 'C:/Python35', 'PF_path': 'C:\\Program Files\\DIgSILENT\\PowerFactory 2017 SP1\\Python\\3.5', 'LinesList': ['90.0'], 'PSEN_results_folder': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35', 'OutputNewCsv': False, 'BusesList': ['90.0']}, 'CONTINGENCY_OPTIONS': {'ActiveLimits': True, 'Vmin': 0.95, 'FlowLimitTransformers': 100, 'AdjustTaps': False, 'VarLimits': True, 'FlowLimitLines': 100, 'FlatStart': False, 'AdjustShunts': False, 'Vmax': 1.05, 'output_file_format': 'xls', 'DispatchMode': 'ReferenceMachine'}} \ No newline at end of file diff --git a/ProcessOutputs_Eficas/TreatOutputs/dicoProcessor.py b/ProcessOutputs_Eficas/TreatOutputs/dicoProcessor.py index f1e33748..9324ab8d 100644 --- a/ProcessOutputs_Eficas/TreatOutputs/dicoProcessor.py +++ b/ProcessOutputs_Eficas/TreatOutputs/dicoProcessor.py @@ -1,5 +1,5 @@ # dico = {'XLS_file': 'X:/Etudes/DEWA_SOLAR/DEWA_2020/tir8/Results/N_20180319_14h06m36/ACCCresults - save/FiveHundred Voltage 0_save.csv', 'TabList': ['FiveHundred Voltage 0_save'], 'Contingency_List_For_FiveHundred__Voltage__0_save': ['Contingency', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR4__3WNDTR4', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR3__3WNDTR3', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR2__3WNDTR2', 'HCCP_PH1_ST1__HSYANCOAL__TRT1'], "'Contingency_List_For_FiveHundred Voltage 0_save'": ['Contingency', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR4__3WNDTR4', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR3__3WNDTR3', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR2__3WNDTR2', 'HCCP_PH1_ST1__HSYANCOAL__TRT1'], 'Component_List_For_FiveHundred__Voltage__0_save': ['Bus', 'SKLN', 'MSJA']} -dico = {'CONTINGENCY_PROCESSING': {'XLS_file': 'X:/Etudes/DEWA_SOLAR/DEWA_2020/tir8/Results/N_20180319_14h06m36/ACCCresults - save/FiveHundred Voltage 0.csv', 'TabList': ['FiveHundred Voltage 0'], "'Component_List_For_FiveHundred Voltage 0'": ['SKLN', 'MSJA'], "'Contingency_List_For_FiveHundred Voltage 0'": ['MUSH_400_KV__MUSH_132_KV__MUSH_TR4__3WNDTR4', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR3__3WNDTR3', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR2__3WNDTR2', 'HCCP_PH1_ST1__HSYANCOAL__TRT1']}, 'CONTINGENCY_SELECTION': {'N1TransformersList': [], 'TripLines': True, 'N1LinesList': [], 'N1BusesList': [], 'TripBuses': False, 'N1AreaList': [], 'TripTransfos': True, 'TripGenerators': True}, 'CASE_SELECTION': {'NewCsvFile': 'CleanedData.csv', 'DecimalSeparator': '.', 'PSSPY_path': 'C:\\Program Files (x86)\\PTI\\PSSE34\\PSSPY27', 'PSEN_results_csvfile_cleaned': False, 'MaxDepth': 5, 'PSSE_path': 'C:\\Program Files (x86)\\PTI\\PSSE34\\PSSBIN', 'OutputNewCsv': False}, 'CONTINGENCY_OPTIONS': {'SolutionMethod': '1 - FNSL', 'AdjustSwitchedShunts': '0 - Disable', 'Vmin': 0.9, 'FlowLimitTransformers':120, 'Tolerance': 0.5, 'VarLimits': 99, 'FlowLimitLines': 120, 'FlatStart': False, 'AdjustDCtaps': '0 - Disable', 'output_file_format': 'xls', 'AdjustTaps': '1 - Stepping', 'Vmax': 1.1, 'ContingencyRate': 'a', 'DispatchMode': '1 - Reserve'}, 'N_PROCESSING_OPTIONS': {'Output_bus_values': True, 'Output_transformer_values': True, 'Output_lines_values': True}} +# dico = {'CONTINGENCY_PROCESSING': {'XLS_file': 'X:/Etudes/DEWA_SOLAR/DEWA_2020/tir8/Results/N_20180319_14h06m36/ACCCresults - save/FiveHundred Voltage 0.csv', 'TabList': ['FiveHundred Voltage 0'], "'Component_List_For_FiveHundred Voltage 0'": ['SKLN', 'MSJA'], "'Contingency_List_For_FiveHundred Voltage 0'": ['MUSH_400_KV__MUSH_132_KV__MUSH_TR4__3WNDTR4', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR3__3WNDTR3', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR2__3WNDTR2', 'HCCP_PH1_ST1__HSYANCOAL__TRT1']}, 'CONTINGENCY_SELECTION': {'N1TransformersList': [], 'TripLines': True, 'N1LinesList': [], 'N1BusesList': [], 'TripBuses': False, 'N1AreaList': [], 'TripTransfos': True, 'TripGenerators': True}, 'CASE_SELECTION': {'NewCsvFile': 'CleanedData.csv', 'DecimalSeparator': '.', 'PSSPY_path': 'C:\\Program Files (x86)\\PTI\\PSSE34\\PSSPY27', 'PSEN_results_csvfile_cleaned': False, 'MaxDepth': 5, 'PSSE_path': 'C:\\Program Files (x86)\\PTI\\PSSE34\\PSSBIN', 'OutputNewCsv': False}, 'CONTINGENCY_OPTIONS': {'SolutionMethod': '1 - FNSL', 'AdjustSwitchedShunts': '0 - Disable', 'Vmin': 0.9, 'FlowLimitTransformers':120, 'Tolerance': 0.5, 'VarLimits': 99, 'FlowLimitLines': 120, 'FlatStart': False, 'AdjustDCtaps': '0 - Disable', 'output_file_format': 'xls', 'AdjustTaps': '1 - Stepping', 'Vmax': 1.1, 'ContingencyRate': 'a', 'DispatchMode': '1 - Reserve'}, 'N_PROCESSING_OPTIONS': {'Output_bus_values': True, 'Output_transformer_values': True, 'Output_lines_values': True}} @@ -10,4 +10,4 @@ dico = {'CONTINGENCY_PROCESSING': {'XLS_file': 'X:/Etudes/DEWA_SOLAR/DEWA_2020/t # ent_List_For_FiveHundred__Voltage__0_save': ['Bus', 'SKLN', 'MSJA']} -# dico ={'CONTINGENCY_PROCESSING': {"'Component_List_For_MinAvgVolt Flows 0'": ['Aspretto_Aspretto_Vazzio_Vazzio_ASPRETTO_VAZZIO__LI'], 'XLS_file': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33/ACCCresults.xls', "'Component_List_For_MinAvgVolt Voltage 0'": ['Castirla_Castirla'], "'Contingency_List_For_MinAvgVolt Flows 0'": ['LUCCIANA_HTB_2 [Lucciana]'], "'Contingency_List_For_MinAvgVolt Voltage 0'": ['FURIANI_ZI_OLETTA'], 'TabList': ['MinAvgVolt Flows 0', 'MinAvgVolt Voltage 0']}, 'CONTINGENCY_SELECTION': {'TripTransfos': False, 'TripLines': True, 'AvgLowVoltage': 1, 'SelectionMethod': 'SelectWorstCases', 'TripGenerators': True}, 'CASE_SELECTION': {'TransformersList': [], 'PSEN_results_csvfile': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33/simulationDClog_complete_09h33m33.csv', 'DecimalSeparator': ',', 'MaxDepth': 5, 'NewCsvFile': 'CleanedData.csv', 'PSEN_results_csvfile_cleaned': False, 'Python3_path': 'C:/Python35', 'PF_path': 'C:\\Program Files\\DIgSILENT\\PowerFactory 2017 SP1\\Python\\3.5', 'LinesList': ['90.0'], 'PSEN_results_folder': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33', 'OutputNewCsv': False, 'BusesList': ['90.0']}, 'CONTINGENCY_OPTIONS': {'ActiveLimits': True, 'Vmin': 0.95, 'FlowLimitTransformers': 100, 'AdjustTaps': False, 'VarLimits': True, 'FlowLimitLines': 100, 'FlatStart': False, 'AdjustShunts': False, 'Vmax': 1.05, 'output_file_format': 'xls', 'DispatchMode': 'ReferenceMachine'}} +dico ={'CONTINGENCY_PROCESSING': {'XLS_file': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35/ACCCresults.xls', "'Contingency_List_For_testuno Flows 0'": ['VAZ_G10 [Vazzio]', 'CERVIONE_GHISONACCIA'], "'Component_List_For_testuno Flows 0'": ['Aspretto_Aspretto_Vazzio_Vazzio_ASPRETTO_VAZZIO__LI'], 'TabList': ['testuno Voltage 0', 'testuno Flows 0'], "'Component_List_For_testuno Voltage 0'": ['Corsica_Corsica', 'SainteLucie_SainteLucie'], "'Contingency_List_For_testuno Voltage 0'": ['CASTIRLA_CORSICA', 'FURIANI_ZI_OLETTA']}, 'CONTINGENCY_SELECTION': {'TripLines': True, 'csv_file': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35/Test.csv', 'SelectionMethod': 'CaseSelectionFromFile', 'case_name': 'testuno', 'TripTransfos': False, 'TripGenerators': True}, 'CASE_SELECTION': {'TransformersList': [], 'PSEN_results_csvfile': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35/simulationDClog_complete_07h31m35.csv', 'DecimalSeparator': ',', 'MaxDepth': 5, 'NewCsvFile': 'CleanedData.csv', 'PSEN_results_csvfile_cleaned': False, 'Python3_path': 'C:/Python35', 'PF_path': 'C:\\Program Files\\DIgSILENT\\PowerFactory 2017 SP1\\Python\\3.5', 'LinesList': ['90.0'], 'PSEN_results_folder': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35', 'OutputNewCsv': False, 'BusesList': ['90.0']}, 'CONTINGENCY_OPTIONS': {'ActiveLimits': True, 'Vmin': 0.95, 'FlowLimitTransformers': 100, 'AdjustTaps': False, 'VarLimits': True, 'FlowLimitLines': 100, 'FlatStart': False, 'AdjustShunts': False, 'Vmax': 1.05, 'output_file_format': 'xls', 'DispatchMode': 'ReferenceMachine'}} \ No newline at end of file -- 2.39.2