#-------------------# Pour execution avec output et error dans le bash
def runPSEN(self):
# #-------------------#
- # #if self.modified or self.fichier==None : self.saveFile()
- # self.saveFile()
- #
- # #lancement avec le .bat
- # path1 = os.path.abspath(os.path.join(os.path.abspath(__file__), '../','../','PSEN_Eficas','PSEN'))
- # WrapperFilePath = os.path.join(path1, 'PSSEWrapper.py')
- # import subprocess
- # p = subprocess.Popen(['python',WrapperFilePath])
- # (out,err)=p.communicate()
- # print out
- # print err
-
+ print('editor > runPSEN ')
self.saveFile()
# lancement avec le .bat
def runPSEN_N1(self):
#-------------------#
+ print('editor > runPSEN_N1 ')
self.saveFile()
- #cmd = os.path.abspath(os.path.join(os.path.abspath(__file__), '../','../','PSEN_N1','run.py'))
- #cmd = "from run import runPSEN_N1; dico="+str(dico)
-
- #textePython=("python "+ cmd + " "+ str(dico))
- #self._viewTextExecute( textePython,"psen_run",".sh")
-
path1 = os.path.abspath(os.path.join(os.path.abspath(__file__), '../','../','ProcessOutputs_Eficas','TreatOutputs'))
sys.path.append(path1)
#-------------------# Pour execution avec output et error dans le bash
def process_N1(self):
#-------------------#
-
+ print('editor > process_N1')
path1 = os.path.abspath(os.path.join(os.path.abspath(__file__), '../','../','ProcessOutputs_Eficas','TreatOutputs'))
sys.path.append(path1)
#-------------------# Pour execution avec output et error dans le bash
def process_VP(self):
#-------------------#
+
+ print('editor > process_VP')
if 'dicoImbrique' in generator.plugins:
self.generator=generator.plugins['dicoImbrique']()
jdc_formate=self.generator.gener(self.jdc)
#--------------------------------#
def ajoutCommentaire(self):
#--------------------------------#
+
+ print('editor > ajoutCommentaire ')
if self.tree.selectedItems()==[] :
QMessageBox.warning( self, tr("Pas de noeud selectionne"),tr("Selectionnez un Noeud \nLe commentaire sera place apres le noeud selectionne"))
return
#--------------------------------#
def _newJDC( self ,units = None):
#--------------------------------#
+
+ print('editor > _newJDC')
"""
Initialise un nouveau JDC vierge
"""
if hasattr(self.readercata.cata[0],'TEXTE_NEW_JDC') : texte=self.readercata.cata[0].TEXTE_NEW_JDC
- #if self.code == "CF" : texte = self._new_CF()
- # texte=self.newTexteCND
+
jdc=self.readercata.cata[0].JdC( procedure =texte,
appli=self,
#--------------------------------#
def _newJDCInclude( self ,units = None):
#--------------------------------#
+
+ print('editor > _newJDCInclude')
"""
Initialise un nouveau JDC vierge
"""
#-------------------------------#
def readFile(self, fn):
#--------------------------------#
+ print('editor > readFile')
"""
Public slot to read the text from a file.
@param fn filename to read from (string or QString)
#-----------------------#
def get_source(self,file):
#-----------------------#
-
+ print('editor > get_source')
# Il faut convertir le contenu du fichier en fonction du format
if self.format in convert.plugins :
# Le convertisseur existe on l'utilise
#-----------------------------------------------------------------------#
def _viewText(self, txt, caption = "FILE_VIEWER",largeur=1200,hauteur=600):
#--------------------------------------------------------------------#
+
+ print('editor > _viewText')
w = ViewText( self.QWParent,self ,caption,txt,largeur,hauteur)
w.show()
#
#----------------------------------------------#
def __generateTempFilename(self, prefix, suffix):
#----------------------------------------------#
+ print('editor > _generateTempFilename')
import tempfile
(fd, filename) = tempfile.mkstemp(prefix=prefix, suffix=suffix)
os.close(fd)
#----------------------------------------------#
def _viewTextExecute(self, txt, prefix, suffix):
#----------------------------------------------#
+ print('editor > _viewTextExecute')
self.w = ViewText( self.QWParent )
self.w.setWindowTitle( "execution" )
self.monExe=QProcess(self.w)
#-----------------------#
def generDico(self):
#-----------------------#
+
+ print('editor > generDico')
if 'dico' in generator.plugins:
self.generator=generator.plugins['dico']()
jdc_formate=self.generator.gener(self.jdc)
#-----------------------#
def gestionParam(self):
#-----------------------#
+
+ print('editor > gestionParam')
w = MonWidgetCreeParam( self)
w.show()
#-----------------------#
def viewJdcSource(self):
#-----------------------#
+ print('editor > viewJdcSource')
if self.fichier == None : return
f=open(self.fichier,'r')
texteSource=f.read()
#-----------------------#
def viewJdcPy(self):
#-----------------------#
+
+ print('editor > viewJdcPy')
strSource = str( self.get_text_JDC(self.format) )
self._viewText(strSource, "JDC_RESULTAT")
#-----------------------#
def viewJdcRapport(self):
#-----------------------#
+
+ print('editor > viewJdcRapport')
strRapport = six.text_type( self.jdc.report() )
# on ajoute les regles
#-----------------------#
def viewJdcRegles(self):
#-----------------------#
+
+ print('editor > _viewJdcRegles')
if self.tree :self.tree.AppelleBuildLBRegles()
#----------------#
def closeIt(self):
#----------------#
+ print('editor > closeIt')
"""
Public method called by the viewmanager to finally get rid of us.
"""
#----------------------------------------------#
def affiche_infos(self,message,couleur=Qt.black):
#----------------------------------------------#
+
+ print('editor > affiche_infos')
if self.sb:
mapalette=self.sb.palette()
mapalette.setColor( QPalette.WindowText, couleur )
#------------------------------#
def affiche_alerte(self,titre,message):
#------------------------------#
+ print('editor > affiche_alerte')
# appele par I_MACRO_ETAPE
QMessageBox.information( self, titre, message)
#-----------------------------------#
def affiche_commentaire(self,message):
#-----------------------------------#
+
+ print('editor > affiche_commentaire')
self.labelCommentaire.setText(message)
QTimer.singleShot(6000, self.rendInvisible)
#----------------------#
def rendInvisible(self):
#----------------------#
+
+ print('editor > rendInvisible')
self.labelCommentaire.setText("")
#-------------------#
def init_modif(self):
#-------------------#
+ print('editor > init_modif')
"""
Met l'attribut modified a 'o' : utilise par Eficas pour savoir
si un JDC doit etre sauvegarde avant destruction ou non
#---------------------------------------#
def chercheNoeudSelectionne(self,copie=1):
#---------------------------------------#
+
+ print('editor > chercheNoeudSelectionne')
"""
appele par Cut et Copy pour positionner self.node_selected
"""
#---------------------#
def handleSupprimer(self):
#---------------------#
+ print('editor > handleSupprimer')
self.chercheNoeudSelectionne()
if len(self.node_selected) == 0 : return
self.QWParent.noeud_a_editer = []
#---------------------#
def handleRechercher(self):
#---------------------#
+ print('editor > handleRechercher')
from .monRecherche import DRecherche
monRechercheDialg=DRecherche(parent=self,fl=0)
monRechercheDialg.show()
#--------------------------------#
def handleRechercherDsCatalogue(self):
#-----------------------------#
+
+ print('editor > handleRechercherDsCatalogue')
from .monRechercheCatalogue import DRechercheCatalogue
monRechercheDialg=DRechercheCatalogue(self.QWParent,self)
monRechercheDialg.show()
#---------------------#
def handleDeplier(self):
#---------------------#
+
+ print('editor > handleDeplier')
if self.tree == None : return
#self.tree.collapseAll()
if self.deplier :
#---------------------#
def handleEditCut(self):
#---------------------#
+
+ print('editor > handleEditCut')
"""
Stocke dans Eficas.noeud_a_editer le noeud a couper
"""
#-----------------------#
def handleEditCopy(self):
#-----------------------#
+ print('editor > handleEditCopy')
"""
Stocke dans Eficas.noeud_a_editer le noeud a copier
"""
#------------------------#
def handleEditPaste(self):
#------------------------#
+
+ print('editor > handleEditPaste')
"""
Lance la copie de l'objet place dans self.QWParent.noeud_a_editer
Ne permet que la copie d'objets de type Commande ou MCF
#----------------------------------#
def handleEditPasteMultiple(self):
#----------------------------------#
-
+ print('editor > handleEditPasteMultiple')
# On ne garde que les niveaux "Etape"
# On insere dans l'ordre du JDC
listeNoeudsACouper=[]
#---------------------#
def getFileName(self):
#---------------------#
+ print('editor > getFileName')
return self.fichier
#---------------------------#
def get_file_variable(self) :
#---------------------------#
+ print('editor > get_file_variable')
titre = tr("Choix d'un fichier XML")
texte = tr("Le fichier contient une commande MODEL\n")
texte = texte+tr('Donnez le nom du fichier XML qui contient la description des variables')
#--------------------------------------------------#
def writeFile(self, fn, txt = None,formatLigne="beautifie"):
#--------------------------------------------------#
+ print('editor > writeFile')
"""
Public slot to write the text to a file.
#-----------------------------------------------------------#
def get_text_JDC(self,format,pourRun=0,formatLigne="beautifie"):
#-----------------------------------------------------------#
+ print('editor > get_text_JDC')
if self.code == "MAP" and not(format in generator.plugins): format = "MAP"
if format in generator.plugins:
#----------------------#
def get_Dico(self):
#---------------------#
+ print('editor > get_Dico')
if 'dicoImbrique' in generator.plugins:
self.generator=generator.plugins['dicoImbrique']()
jdc_formate=self.generator.gener(self.jdc)
#------------#
def run(self):
#------------#
+ print('editor > run')
fonction="run"+self.code
#print fonction
if fonction in JDCEditor.__dict__: JDCEditor.__dict__[fonction](self,)
#------------#
def saveRun(self):
#------------#
+ print('editor > saveRun')
fonction="saveRun"+self.code
if fonction in JDCEditor.__dict__: JDCEditor.__dict__[fonction](self,)
#---------------#
def runMAP(self):
#---------------#
-
+ print('editor > runMAP')
if not(self.jdc.isvalid()):
QMessageBox.critical( self, tr( "Execution impossible "),tr("le JDC doit etre valide pour une execution MAP"))
return
#-------------------#
def runZCRACKS(self):
#-------------------#
+ print('editor > runZCRACKS')
if not(self.jdc.isvalid()):
QMessageBox.critical( self, tr( "Execution impossible "),tr("le JDC doit etre valide pour une execution "))
return
#-------------------#
def runCARMELCND(self):
#-------------------#
- #if not(self.jdc.isvalid()):
- # QMessageBox.critical( self, tr( "Execution impossible "),tr("le JDC doit etre valide pour une execution "))
- # return
+
+ print('editor > runCARMELCND')
if self.modified or self.fichier==None :
QMessageBox.critical( self, tr( "Execution impossible "),tr("Sauvegarder SVP avant l'execution "))
return
#-------------------#
def runCarmelCS(self):
#-------------------#
+ print('editor > runCarmelCS')
try :
commande="runSession pilotyacsCS.py"
os.system(commande)
#-----------------------------------------------------#
def determineNomFichier(self,path,extension):
#-----------------------------------------------------#
+
+ print('editor > determineNomFichier')
if self.appli.code in DictExtensions:
chaine1=DictExtensions[self.appli.code]+" (*."+DictExtensions[self.appli.code]+");;"
extensions= tr(chaine1+ "All Files (*)")
#-----------------#
def saveRunMAP(self):
#-----------------#
+
+ print('editor > saveRunMAP')
extension=".input"
if not(self.jdc.isvalid()):
QMessageBox.critical( self, tr( "Sauvegarde de l'input impossible "),
#-----------------#
def saveRunPSEN(self):
#-----------------#
- print( "saveRunPSEN")
+
+
+ print('editor > saveRunPSEN')
self.saveFile()
return
#-----------------------------------------#
def cherche_Groupes(self):
#-----------------------------------------#
+
+ print('editor > cherche_Groupes')
listeMA,listeNO=self.get_text_JDC("GroupMA")
return listeMA,listeNO
#-----------------------------------------#
def cherche_Dico(self):
#-----------------------------------------#
+
+ print('editor > cherche_Dico')
dicoCourant={}
format = self.appliEficas.format_fichier
if format in generator.plugins:
#-----------------------------------------#
def handleAjoutGroup(self,listeGroup):
#-----------------------------------------#
+ print('editor > handleAjoutGroup')
try :
#if 1:
from ajoutGroupe import handleAjoutGroupFiltre
- #print listeGroup
+
handleAjoutGroupFiltre(self,listeGroup)
- #print "apres handleAjoutGroupFiltre"
+
except :
#else :
pass
#-----------------------------------------------------------------#
def saveFileLegerAs(self, fileName = None) :
#-----------------------------------------------------------------#
+ print('editor > saveFileLegerAs')
if fileName != None :
self.fichier = fileName
return self.saveFileLeger()
#-----------------------------------------------------------------#
def saveFileLeger(self, path = None, saveas= 0,formatLigne="beautifie"):
#-----------------------------------------------------------------#
+
+ print('editor > saveFileLeger')
extension='.casR'
fn = self.fichier
#saveas=True # Pour forcer le nom
#-----------------------------------------------------------------#
def saveFile(self, path = None, saveas= 0,formatLigne="beautifie"):
#-----------------------------------------------------------------#
+
+ print('editor > saveFile')
"""
Public slot to save the text to a file.
#----------------------------------------------#
def sauveLigneFile(self):
#----------------------------------------------#
+
+ print('editor > sauveLigneFile')
self.modified=1
return self.saveFile(formatLigne="Ligne")
#----------------------------------------------#
def saveFileAs(self, path = None,fileName=None):
#----------------------------------------------#
+
+ print('editor > saveFileAs')
"""
Public slot to save a file with a new name.
#---------------------------------------------#
def get_file(self,unite=None,fic_origine = ''):
#---------------------------------------------#
+
+ print('editor > get_file')
# appele par I_JDC
ulfile = None
jdcText = ""
#-----------------------------------#
def updateJdc(self, itemApres,texte):
#------------------------------------#
+
+ print('editor > updateJdc')
# ajoute une etape de JdC a partir d un texte
monItem=itemApres
etape=monItem.item.object
#-----------------------------------#
def updateJdcEtape(self, itemApres,texte):
#------------------------------------#
+
+ print('editor > updateJdcEtape')
# ajoute une etape de JdC a partir d un texte
monItem=itemApres
etape=monItem.item.object
#----------------------------------------------#
def ajoutMCFact(self,etape,MCFils,listeAvant=()):
#----------------------------------------------#
+
+ print('editor > ajoutMCFact')
# dans le JDC
- print ('ajoutMCFact')
ouChercher=etape
print (ouChercher)
for mot in listeAvant :
def getValeur(self,nomEtape,MCFils,listeAvant=()):
#-------------------------------------#
# dans le JDC
-
+ print('editor > getValeur')
ouChercher=None
for e in self.jdc.etapes:
if e.nom == nomEtape : ouChercher=e; break
def setValeur(self,nomEtape,MCFils,valeur,listeAvant=()):
#--------------------------------------------------------#
# dans le JDC
-
+ print('editor > setValeur')
ouChercher=None
for e in self.jdc.etapes:
if e.nom == nomEtape : ouChercher=e; break
#-------------------------------------#
def deleteEtape(self,etape):
#-------------------------------------#
+ print('editor > deleteEtape')
self.jdc.suppentite(etape)
#-------------------------------------#
def deleteMC(self,etape,MCFils,listeAvant=()):
#-------------------------------------#
+
+ print('editor > deleteMC')
ouChercher=etape
for mot in listeAvant :
ouChercher=ouChercher.get_child(mot,restreint="oui")
#-------------------------------------#
def ajoutMC(self,etape,MCFils,valeurs,listeAvant=()):
#-------------------------------------#
- print('debut ajoutMC')
+
+ print('editor > ajoutMC')
ouChercher=etape
for mot in listeAvant :
ouChercher=ouChercher.get_child(mot,restreint="oui")
#-----------------------------------------------------------#
def changeIntoMC(self,etape,MCFils,valeurs, listeAvant=()):
#-----------------------------------------------------------#
+
+ print('editor > changeIntoMC')
ouChercher=etape
for mot in listeAvant :
ouChercher=ouChercher.get_child(mot,restreint="oui")
#-------------------------------------#
def changeIntoDefMC(self,etape,listeMC,valeurs):
#-------------------------------------#
+
+ print('editor > changeIntoDefMC')
definitionEtape=getattr(self.jdc.cata[0],etape)
ouChercher=definitionEtape
if len(listeMC) > 1 :
#-------------------------------------------------------------#
def deleteDefinitionMC(self,etape,listeAvant,nomDuMC):
#-------------------------------------------------------------#
- #print 'in deleteDefinitionMC', etape,listeAvant,nomDuMC
+ print('editor > deleteDefinitionMC')
definitionEtape=getattr(self.jdc.cata[0],etape)
ouChercher=definitionEtape
for k in listeAvant :
#-------------------------------------------------------------#
def ajoutDefinitionMC(self,etape,listeAvant,nomDuMC,typ,**args):
#-------------------------------------------------------------#
- # print('debut ajoutDefinitionMC')
- # traceback.print_stack()
+ print('editor > ajoutDefinitionMC')
definitionEtape=getattr(self.jdc.cata[0],etape)
ouChercher=definitionEtape
for k in listeAvant :
ouChercher.ordre_mc.append(nomDuMC)
if nomDuMC in self.dicoNouveauxMC : del self.dicoNouveauxMC[nomDuMC]
self.dicoNouveauxMC[nomDuMC]=('ajoutDefinitionMC',etape,listeAvant,nomDuMC,typ,args)
- # print( self.dicoNouveauxMC)
- # print('fin ajoutDefinitionMC')
+
#----------------------------------------------------#
def changeIntoMCandSet(self,etape,MCFils,into,valeurs):
#----------------------------------------------------#
+
+ print('editor > changeIntoMCandSet')
monMC=etape.get_child(MCFils,restreint="oui")
if monMC== None : monMC= etape.addentite(MCFils)
monMC.definition.into=into
def reCalculeValiditeMCApresChgtInto(self,nomEtape,MCFils,listeAvant=()):
#-------------------------------------------------------------------#
# dans le JDC
+ print('editor > reCalculeValiditeMCApresChgtInto')
for e in self.jdc.etapes:
if e.nom == nomEtape : ouChercher=e; break
#-------------------------------------#
# dans le MDD
- #if isinstance (etape, str):
- # for e in self.jdc.etapes:
- # if e.nom == etape : etape=e; break
- #if etape == None : return
+ print('editor > changeDefautDefMC')
definitionEtape=getattr(self.jdc.cata[0],nomEtape)
ouChercher=definitionEtape
if len(listeMC) > 1 :
def ajoutDefinitionMCFact(self,nomEtape,listeAvant,nomDuMC,listeMC,**args):
#---------------------------------------------------------------------#
# dans le MDD
- # print ('ajoutDefinitionMCFact', nomDuMC)
+ print('editor > ajoutDefinitionMCFact')
definitionEtape=getattr(self.jdc.cata[0],nomEtape)
ouChercher=definitionEtape
for k in listeAvant :
ouChercher.entites[nomDuMC]=nouveauFact
ouChercher.ordre_mc.append(nomDuMC)
self.dicoNouveauxFact[nomDuMC]=('ajoutDefinitionMC',nomEtape,listeAvant,nomDuMC,listeMC,args)
- #print self.dicoNouveauxMC
+
#-------------------------------------#
def ajoutVersionCataDsJDC(self,txt):
#-------------------------------------#
+
+ print('editor > ajoutVersionCataDsJDC')
if not hasattr(self.readercata.cata[0],'VERSION_CATALOGUE'): return txt
ligneVersion="#VERSION_CATALOGUE:"+self.readercata.cata[0].VERSION_CATALOGUE+":FIN VERSION_CATALOGUE\n"
texte=txt+ligneVersion
#-------------------------------------#
def verifieVersionCataDuJDC(self,text):
#-------------------------------------#
+
+ print('editor > verifieVersionCataDuJDC')
memeVersion=False
indexDeb=text.find("#VERSION_CATALOGUE:")
indexFin=text.find(":FIN VERSION_CATALOGUE")
#-------------------------------#
def traduitCatalogue(self,texte):
#-------------------------------#
+
+ print('editor > traduitCatalogue')
nomTraducteur="traduit"+self.readercata.code+self.versionCataDuJDC+"To"+self.versionCata
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),"../Traducteur")))
try :
#------------------------------#
def verifieCHECKSUM(self,text):
#------------------------------#
+
+ print('editor > verifieCHECKSUM')
indexDeb=text.find("#CHECKSUM:")
if indexDeb < 0 :
return 1, text
#---------------------------#
def get_checksum(self,texte):
#---------------------------#
+
+ print('editor > get_checksum')
newtexte=texte.replace('"','\\"')
commande='echo "'+newtexte+'"|md5sum'
a=os.popen(commande)
#---------------------------#
def _new_CF(self):
#---------------------------#
+
+ print('editor > _new_CF')
texte="CONDUITE_FORCEE();"
return texte
#---------------------------#
def _newTELEMAC(self):
#---------------------------#
+
+ print('editor > _newTELEMAC')
#texte="INITIALIZATION();BOUNDARY_CONDITIONS();GENERAL_PARAMETERS();PHYSICAL_PARAMETERS();NUMERICAL_PARAMETERS();"
texte="COMPUTATION_ENVIRONMENT();HYDRO();GENERAL_PARAMETERS();NUMERICAL_PARAMETERS()"
#texte="TRACERS();"
#---------------------------#
def _newPSEN(self):
#---------------------------#
+
+ print('editor > _newPSEN')
if 'PF_PARAMETERS' in self.Ordre_Des_Commandes:
texte = "DIRECTORY() ;PF_PARAMETERS() ; SIMULATION() ; sansnom=DISTRIBUTION() ; sansnom=DISTRIBUTION() ; CORRELATION() ;"
else:
#---------------------------#
def _newPSEN_N1(self):
#---------------------------#
+
+ print('editor > _newPSEN_N1')
texte=""
# if 'PF_PARAMETERS' in self.Ordre_Des_Commandes:
#---------------------------#
def _newZCRACKS(self):
#---------------------------#
+
+ print('editor > _newZCRACKS')
texte="MAILLAGES();REMESHING();"
return texte
#---------------------------#
def _newJDCCND(self):
#---------------------------#
+
+ print('editor > _newJDCCND')
extensions=tr('Fichiers Med (*.med);;''Tous les Fichiers (*)')
#if self.salome == 0 :
def BoutonFileSelected(self):
#---------------------------#
+ print('editor > BoutonFileSelected')
QSfichier=self.openfile.selectedFiles()[0]
self.fichierMED=str(QSfichier)
from acquiertGroupes import getGroupes
#-----------------------------
def BoutonSalomePressed(self):
#----------------------------
+
+ print('editor > BoutonSalomePressed')
Msg,self.listeGroupes=self.appliEficas.ChercheGrpMailleInSalome()
self.fichierMED="A_partir_de_SMESH"
self.nomMaillage="A_partir_de_SMESH"
#-----------------------------------------
def initSplitterSizes(self, nbWidget=3):
#-----------------------------------------
- #print ("je passe ds initSplitterSizes", nbWidget)
+ print('editor > initSplitterSizes')
if self.code in [ 'Adao', 'ADAO', ] : self.splitterSizes3=[1,1550,150]
elif self.code in [ 'MAP'] : self.splitterSizes3=[700,300]
else : self.splitterSizes3=[150,1000,300]
def restoreSplitterSizes(self,nbWidget=3):
#----------------------------------------
- #traceback.print_stack()
- #print ("je passe ds restoreSplitterSizes")
+ print('editor > restoreSplitterSizes')
if not(hasattr(self,'splitter')) : return
if nbWidget==2 : newSizes=self.splitterSizes2
if nbWidget==3 : newSizes=self.splitterSizes3
#-----------------------------------------
def saveSplitterSizes(self,event):
#-----------------------------------------
- #print ("je passe ds saveSplitterSizes")
+
+ print('editor > saveSplitterSizes')
if self.inhibeSplitter : return
if self.widgetOptionnel == None : self.splitterSizes2 = self.splitter.sizes()[0:2]
else : self.splitterSizes3 = self.splitter.sizes()[0:3]
#------------------------
def fermeOptionnel(self):
#------------------------
+
+ print('editor > fermeOptionnel')
if self.widgetOptionnel == None : return
self.inhibeSplitter=1
#------------------------
def ajoutOptionnel(self):
#------------------------
- #if len(self.splitterSizes) == 2 : self.splitterSizes.append(self.oldSizeWidgetOptionnel)
- #else : self.splitterSizes[2] = self.oldSizeWidgetOptionnel # ceinture pour les close bizarres
- #self.splitterSizes[1] = self.splitterSizes[1] - self.splitterSizes[2]
-
+
+ print('editor > ajoutOptionnel')
self.restoreSplitterSizes(3)
#------------------------
def fermeArbre(self):
#------------------------
- #print (self.widgetTree)
+ print('editor > fermeArbre')
self.oldWidgetTree=self.widgetTree
self.widgetTree.hide()
- #self.widgetTree=None
+
#------------------------
def ouvreArbre(self):
#------------------------
- #print ('je passe la')
- #print (self.widgetTree)
- #self.widgetTree=self.oldWidgetTree
+ print('editor > ouvreArbre')
self.widgetTree.show()
- #self.restoreSplitterSizes(3)
+
#-----------------------------
def getTreeIndex(self,noeud):
#----------------------------
+
+ print('editor > getTreeIndex')
indexNoeud=-1
if noeud in noeud.treeParent.children :
indexNoeud=noeud.treeParent.children.index(noeud)
import numpy as np
from utils import cleanName
-
+ print('ExtractGeneratorLoadLineandTransfoDico > ExtractGeneratorLoadLineandTransfoDico')
"""""""""""""""""
PSSE Initialization
"""""""""""""""""
import os,pickle
import sys, subprocess
import numpy as np
-
+
+ print('ExtractGeneratorLoadLineandTransfoDico > PFExtractGeneratorLoadLineandTransfoDico')
path1=os.getcwd()
filew=open('temp.txt','w')
filew.write(NetworkFile+'\n')
+++ /dev/null
-"""
-
- Objectif de ce module: extraire des donnees pour afficher
- dans l'interface Eficas
-
-"""
-
-NoBreakersandSwitches = True
-#_____________ TODO : demander a Claire si il faut absolument garder cela
-# si oui, eventuellement en faire une option propre
-
-import os
-import sys
-import numpy as np
-import pickle
-from utils import nettoyeName
-
-
-def initPSSE(PSSE_PATH, PSSPY_PATH):
-#_____________________________________
-# Initialisation de PSSE
-# Appel de ExtractGeneratorLoadLineandTransfoDico
-
- sys.path.append(PSSPY_PATH)
- os.environ['PATH'] += ';' + PSSE_PATH + ';'
-
- import psspy
- import redirect
-
- # Initialisation PSSE
- psspy.psseinit(10000)
- _i = psspy.getdefaultint()
- _f = psspy.getdefaultreal()
- _s = psspy.getdefaultchar()
- redirect.psse2py()
-
- # Silent execution of PSSe
- islct=6 # 6=no output; 1=standard
- psspy.progress_output(islct)
-
-
-def ExtractGeneratorLoadLineandTransfoDico(NetworkFile,PSSE_PATH, PSSPY_PATH,debug=False):
-# ________________________________________________________________________________________
-# Genere un dictionnaire qui contient reseau pour interface Eficas a partir d un fichier PSSE
-# Return des 5 dicos et ecriture dans le fichier temp.txt
-
- # Initialisation PSS
- if debug :
- print('initialisation PSSE')
-
- initPSSE(PSSE_PATH, PSSPY_PATH)
-
- # Extration du Reseau
- psspy.case(NetworkFile)
-
- """
- Extract Loads
- """
-
- if debug :
- print ("Read Load")
-
- sid = -1 # all buses
- flag = 1 # all in service loads/generators (4 all loads/generators)
-
- string = ['NUMBER']
- ierr,iarray = psspy.aloadint(sid,flag,string)
- string = ['NAME','ID','EXNAME']
- ierr,carray = psspy.aloadchar(sid,flag,string)
- string = ['mvaact']
- ierr, xdata = psspy.aloadcplx(sid, flag, string)
-
-
- LoadDico = {} # [Bus name, load ID, extended bus name, bus number]
-
- for i in range(len(iarray[0])):
- idname = "Lo" + carray[1][i].strip()
- loadname = carray[0][i].strip()+ "__" + idname
- loadname = nettoyeName(loadname)
-
- LoadDico[loadname] = {}
- LoadDico[loadname]['NAME'] = carray[0][i].strip()
- LoadDico[loadname]['ID'] = carray[1][i]
- LoadDico[loadname]['EXNAME'] = carray[2][i]
- LoadDico[loadname]['NUMBER'] = iarray[0][i]
- LoadDico[loadname]['P'] = np.real(xdata)[0][i]
- LoadDico[loadname]['Q'] = np.imag(xdata)[0][i]
-
-
- """""""""""""""""""""
- Extract Genrators
- """""""""""""""""""""
-
- if debug :
- print ("Read Generators")
-
- sid = -1 # all buses
- flag = 1 # all in service loads/generators (4 all loads/generators)
-
- string = ['NUMBER']
- ierr,iarray = psspy.amachint(sid,flag,string)
- string = ['NAME','ID','EXNAME']
- ierr,carray = psspy.amachchar(sid,flag,string)
- rstrings = ['pgen','qgen','mbase','pmax','qmax','pmin','qmin']
- ierr, rarray = psspy.amachreal(sid, flag, rstrings)
-
- MachineDico = {} # [Bus name, machine ID, extended bus name, bus number]
-
- for i in range(len(iarray[0])):
- idname = "Gr" + carray[1][i].strip()
- machinename = carray[0][i].strip()+ "__" + idname
- machinename = nettoyeName(machinename)
-
- MachineDico[machinename] = {}
- MachineDico[machinename]['NAME'] = carray[0][i].strip()
- MachineDico[machinename]['ID'] = carray[1][i]
- MachineDico[machinename]['EXNAME'] = carray[2][i]
- MachineDico[machinename]['NUMBER'] = iarray[0][i]
- MachineDico[machinename]['P'] = rarray[0][i]
- MachineDico[machinename]['Q'] = rarray[1][i]
- MachineDico[machinename]['PMAX'] = rarray[3][i]
- MachineDico[machinename]['QMAX'] = rarray[4][i]
- MachineDico[machinename]['PMIN'] = rarray[5][i]
- MachineDico[machinename]['QMIN'] = rarray[6][i]
-
- """""""""""""""""""""
- Extract Motors
- """""""""""""""""""""
-
- if debug :
- print ("Read Motors")
-
- sid = -1 # all buses
- flag = 1 # all in service loads/generators (4 all loads/generators)
-
- string = ['NUMBER','PSETCODE','BASECODE']
- ierr,iarray = psspy.aindmacint(sid,flag,string)
- string = ['NAME','ID','EXNAME']
- ierr,carray = psspy.aindmacchar(sid,flag,string)
- rstrings = ['psetpoint','mbase','p','q']
- ierr, rarray = psspy.aindmacreal(sid, flag, rstrings)
-
- MotorDico = {} # [Bus name, machine ID, extended bus name, bus number]
-
- for i in range(len(iarray[0])):
- idname = "Mo" + carray[1][i].strip()
- motorname = carray[0][i].strip()+ "__" + idname
- motorname = nettoyeName(motorname)
-
- MotorDico[motorname] = {}
- MotorDico[motorname]['NAME'] = carray[0][i].strip()
- MotorDico[motorname]['ID'] = carray[1][i]
- MotorDico[motorname]['EXNAME'] = carray[2][i]
- MotorDico[motorname]['NUMBER'] = iarray[0][i]
- MotorDico[motorname]['PSETCODE'] = iarray[1][i]
- MotorDico[motorname]['BASECODE'] = iarray[2][i]
- MotorDico[motorname]['PSETPOINT'] = rarray[0][i]
- MotorDico[motorname]['MBASE'] = rarray[1][i]
- MotorDico[motorname]['P'] = rarray[2][i]
- MotorDico[motorname]['Q'] = rarray[3][i]
-
- """""""""""""""""""""
- Extract Lines
- """""""""""""""""""""
-
- if debug :
- print ("Read Lines")
-
- sid = -1
- owner = 1
- ties = 1
- flag = 2 # 6 for two-winding transfos
- entry = 1 # each branch once, not both directions
-
- string = ['FROMNUMBER','TONUMBER']
- ierr,iarray = psspy.abrnint(sid,owner,ties,flag,entry,string)
- string = ['FROMNAME','TONAME','FROMEXNAME','TOEXNAME','ID']
- ierr,carray = psspy.abrnchar(sid,owner,ties,flag,entry,string)
-
- LineDico = {} #[Bus name 1, Bus name 2, ID, extended bus name 1, extended bus name 2, bus number 1, bus number 2]
-
- for i in range(len(iarray[0])):
- idname = carray[4][i].strip()
- linename = nettoyeName(linename)
-
-# TODO ______
-# Attention : ceci peut exlure des lignes qui auraient leur place ici et qui s apelleraient BRquelquechose
-# faire le test avant le remplacement dans la chaine et utilser continue
- if NoBreakersandSwitches:
- if 'Br' not in idname and 'Sw' not in idname:
- LineDico[linename] = {}
- LineDico[linename]['FROMNAME'] = carray[0][i].strip()
- LineDico[linename]['TONAME'] = carray[1][i].strip()
- LineDico[linename]['ID'] = carray[4][i]
- LineDico[linename]['FROMEXNAME'] = carray[2][i]
- LineDico[linename]['TOEXNAME'] = carray[3][i]
- LineDico[linename]['FROMNUMBER'] = iarray[0][i]
- LineDico[linename]['TONUMBER'] = iarray[1][i]
-
-
-
- """""""""""""""""""""
- Extract Transfos
- """""""""""""""""""""
-
- if debug :
- print ("Read Transfos")
-# TODO ______
-# se renseigner sur sid owner ...
- sid = -1
- owner = 1
- ties = 1
- flag = 6 # two-winding transfos
- entry = 1 # each branch once, not both directions
-
- string = ['FROMNUMBER','TONUMBER']
- ierr,iarray = psspy.abrnint(sid,owner,ties,flag,entry,string)
- string = ['FROMNAME','TONAME','FROMEXNAME','TOEXNAME','ID']
- ierr,carray = psspy.abrnchar(sid,owner,ties,flag,entry,string)
-
- TfoDico = {} #[Bus name 1, Bus name 2, machine ID, extended bus name 1, extended bus name 2, bus number 1, bus number 2]
-
- for i in range(len(iarray[0])):
- idname = 'Tr' + carray[4][i].strip()
- tfoname = carray[0][i].strip() + "__" + carray[1][i].strip() + "__" + idname
- tfoname = nettoyeName(tfoname)
-
- TfoDico[tfoname] = {}
- TfoDico[tfoname]['FROMNAME'] = carray[0][i].strip()
- TfoDico[tfoname]['TONAME'] = carray[1][i].strip()
- TfoDico[tfoname]['ID'] = carray[4][i]
- TfoDico[tfoname]['FROMEXNAME'] = carray[2][i]
- TfoDico[tfoname]['TOEXNAME'] = carray[3][i]
- TfoDico[tfoname]['FROMNUMBER'] = iarray[0][i]
- TfoDico[tfoname]['TONUMBER'] = iarray[1][i]
- TfoDico[tfoname]['#WIND'] = 2
-
-
- """""""""""""""""""""
- Extract 3 winding Transfos
- """""""""""""""""""""
-
- if debug :
- print ("Read winding Transfos")
-
- sid = -1 # assume a subsystem containing all buses in working case
- owner_3flow = 1 # 1=use bus ownership, 2=use tfo ownership
- ties_3flow = 3 # ignored bc sid is negative. 3 = interior subsystem and subsystem tie 3 winding transformers
- flag = 3 # all 3 winding transfo windings
-
- string = ['wind1number','wind2number','wind3number']
- ierr,iarray = psspy.awndint(sid,owner,ties,flag,entry,string)
- string = ['wind1name','wind2name','wind3name','wind1exname','wind2exname','wind3exname','id']
- ierr,carray = psspy.awndchar(sid,owner,ties,flag,entry,string)
-
- #[Bus name 1, Bus name 2, Bus name 3, machine ID, extended bus name 1, extended bus name 2, extended bus name 3, bus number 1, bus number 2, bus number 3]
-
- for i in range(len(iarray[0])):
- idname = 'Tr' + carray[6][i].strip()
- tfoname = nettoyeName(tfoname)
- tfoname = carray[0][i].strip() + "__" + carray[1][i].strip() + "__" + carray[2][i].strip() + "__" + idname
-
- TfoDico[tfoname] = {}
- TfoDico[tfoname]['FROMNAME'] = carray[0][i].strip()
- TfoDico[tfoname]['TONAME'] = carray[1][i].strip()
- TfoDico[tfoname]['3NAME'] = carray[2][i].strip()
- TfoDico[tfoname]['ID'] = carray[6][i]
- TfoDico[tfoname]['FROMEXNAME'] = carray[3][i]
- TfoDico[tfoname]['TOEXNAME'] = carray[4][i]
- TfoDico[tfoname]['3EXNAME'] = carray[5][i]
- TfoDico[tfoname]['FROMNUMBER'] = iarray[0][i]
- TfoDico[tfoname]['TONUMBER'] = iarray[1][i]
- TfoDico[tfoname]['3NUMBER'] = iarray[2][i]
- TfoDico[tfoname]['#WIND'] = 3
-
-# ___ TODO __ verifier si on peut les enlever pour PSSE ?
- filew = open('temp.txt', 'w')
- filew.write(NetworkFile + '\n')
- filew.write(PSSE_PATH + '\n')
- filew.close()
-
- return MachineDico, LoadDico, LineDico, TfoDico, MotorDico
-
-
-def convert(data):
-# _________________
-# Fonction recursive permettant de relire les data issues de python3
-# Appelee uniquement par PFExtractGeneratorLoadLineandTransfoDico
-# A resorber si le code est compatible python 2 / 3
-
- import collections
- if isinstance(data, basestring):
- return str(data)
- elif isinstance(data, collections.Mapping):
- return dict(map(convert, data.iteritems()))
- elif isinstance(data, collections.Iterable):
- return type(data)(map(convert, data))
- else:
- return data
-
-def PFExtractGeneratorLoadLineandTransfoDico(NetworkFile, PF_PATH, Python3_path):
-#_________________________________________________________________________________
-# PSEN sous PowerFactory. Lecture des donnees de Generateur,Load,Line,Transfo
-# Fonction identique mais lit un reseau PowerFactory et non PSSE
-# ATTENTION --> python3 et non python2 d ou subprocess et ecriture de fichier pour passer/recuperer les donnees
-# A simplifier lorsqu on aura un code compatible 2.7 et 3
-# Lance le code com.py dans un sous process
-
- path1 = os.getcwd()
- filew = open('temp.txt','w')
- filew.write(NetworkFile+'\n')
- filew.write(PF_PATH + '\n')
- filew.write(Python3_path + '\n')
- filew.close()
-
-# ___ TODO __ verifier que python.exe est bien sous Python3_path et sinon
-# afficher un message
- #print('changer le chemin de Python3 executable')
-
- lancer = [Python3_path+'/python.exe', path1+'/com.py']
-
- import subprocess
- proc = subprocess.Popen(lancer)
- proc.wait()
-
-# Reconvertit les donnees crees en python3 pour les retourner a Eficas
- with open('Data_for_interface', 'rb') as fichier:
- mon_depickler = pickle.Unpickler(fichier)
- data_file = mon_depickler.load()
- data=convert(data_file)
-
-# MachineDico = data['MachineDico']
-# LoadDico = data['LoadDico']
-# LineDico = data['LineDico']
-# TfoDico = data['TransfoDico']
-# MotorDico = data['MotorDico']
-# os.remove('Data_for_interface')
- LoadDico = data['LoadDico']
-
-
-# return MachineDico, LoadDico, LineDico, TfoDico, MotorDico
- return LoadDico
-
-if __name__ == "__main__":
- pass
-
- # Tester convert
- # Faire 2 methodes testPFExtractGeneratorLoadLineandTransfoDico et testExtractGeneratorLoadLineandTransfoDico
- # Appelle les methodes PFExtractGeneratorLoadLineandTransfoDico et ExtractGeneratorLoadLineandTransfoDico avec un mini reseau connu
- # on verifie que MachineDico, LoadDico, LineDico, TfoDico, MotorDico contiennent bien ce qu on attendait
- # les 2 fichiers contenant les reseaux seront dans la base git
ierr = psspy.add_details_to_opf_log(1)
-ierr = psspy.produce_opf_log_file(1,r'C:\Users\j15773\Documents\GTDosier\PSEN\Versions\PSEN_V14 - ec dispatch\Example\Results\LOG.log')
\ No newline at end of file
+ierr = psspy.produce_opf_log_file(1,r'C:\Users\j15773\Documents\GTDosier\PSEN\Versions\PSEN_V14 - ec dispatch\Example\Results\LOG.log')
+
+print('OutLog')
\ No newline at end of file
InitializeDispatchGentoP0 = False
# Debug = False
Debug = True
+
+
if __name__ == '__main__':
start_total = time.clock();
start = time.clock(); #++++++++++++++++++
-
+ print('PFWrapper')
if Debug:
cmd_Path=os.getcwd()+r'\usrCmdPF.py' #lancement depuis pssewrapper.py
#cmd_Path=os.getcwd()+'\PSEN\usrCmd.py' #lancement depuis qteficas_psen.py
-MachineDico = {'Bastia_Bastia_syn_Gr_HVDC_SACOI_50MW': {'PMIN': -50.0, 'EXNAME': 'Bastia_Bastia_90.0KV', 'NAME': 'HVDC_SACOI_50MW', 'NUMBER': 151, 'QMAX': 48.0, 'Q': 4.0, 'P': 50.0, 'QMIN': -48.0, 'ID': 'HVDC_SACOI_50MW', 'PMAX': 50.0}, 'Caldanicci_Caldanicci_genstat_Gr_Caldanicci_PV': {'PMIN': 0.0, 'EXNAME': 'Caldanicci_Caldanicci_90.0KV', 'NAME': 'Caldanicci_PV', 'NUMBER': 153, 'QMAX': 0.0, 'Q': 0.0, 'P': 3.0, 'QMIN': 0.0, 'ID': 'Caldanicci_PV', 'PMAX': 10.0}, 'Ocana_Ocana_syn_Gr_PONT_VANNA': {'PMIN': 0.0, 'EXNAME': 'Ocana_Ocana_90.0KV', 'NAME': 'PONT_VANNA', 'NUMBER': 165, 'QMAX': 0.0, 'Q': 4.988999843597412, 'P': 8.0, 'QMIN': 0.0, 'ID': 'PONT_VANNA', 'PMAX': 8.0}, 'IleRousse_IleRousse_genstat_Gr_IleRousse_PV': {'PMIN': 0.0, 'EXNAME': 'IleRousse_IleRousse_90.0KV', 'NAME': 'IleRousse_PV', 'NUMBER': 161, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'IleRousse_PV', 'PMAX': 5.0}, 'Cervione_Cervione_genstat_Gr_CERVIONE_BT_PV': {'PMIN': 0.0, 'EXNAME': 'Cervione_Cervione_90.0KV', 'NAME': 'CERVIONE_BT_PV', 'NUMBER': 156, 'QMAX': 0.0, 'Q': 0.0, 'P': 0.6000000238418579, 'QMIN': 0.0, 'ID': 'CERVIONE_BT_PV', 'PMAX': 2.0}, 'Vazzio_Vazzio_syn_Gr_Vazzio_TAC': {'PMIN': 0.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'Vazzio_TAC', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 0.0, 'QMIN': -10.24000072479248, 'ID': 'Vazzio_TAC', 'PMAX': 20.0}, 'Sovenzia_Sovenzia_syn_Gr_SOVENZ_G': {'PMIN': 0.0, 'EXNAME': 'Sovenzia_Sovenzia_90.0KV', 'NAME': 'SOVENZ_G', 'NUMBER': 175, 'QMAX': 0.0, 'Q': 4.163000106811523, 'P': 15.0, 'QMIN': 0.0, 'ID': 'SOVENZ_G', 'PMAX': 15.0}, 'Lucciana_Lucciana_syn_Gr_LUCCIANA_HTB': {'PMIN': 10.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'LUCCIANA_HTB', 'NUMBER': 163, 'QMAX': 0.0, 'Q': 0.0, 'P': 0.0, 'QMIN': 0.0, 'ID': 'LUCCIANA_HTB', 'PMAX': 50.0}, 'Lucciana_Lucciana_syn_Gr_CASA1': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA1', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA1', 'PMAX': 17.100000381469727}, 'Calvi_Calvi_genstat_Gr_Calvi_EOL': {'PMIN': 0.0, 'EXNAME': 'Calvi_Calvi_90.0KV', 'NAME': 'Calvi_EOL', 'NUMBER': 154, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Calvi_EOL', 'PMAX': 5.0}, 'Corsica_Corsica_syn_Gr_CORSICA_G': {'PMIN': 0.0, 'EXNAME': 'Corsica_Corsica_90.0KV', 'NAME': 'CORSICA_G', 'NUMBER': 157, 'QMAX': 0.0, 'Q': 3.0360000133514404, 'P': 8.0, 'QMIN': 0.0, 'ID': 'CORSICA_G', 'PMAX': 13.0}, 'Lucciana_Lucciana_syn_Gr_CASA2': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA2', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA2', 'PMAX': 17.100000381469727}, 'Ocana_Ocana_syn_Gr_OCA_G3': {'PMIN': 0.0, 'EXNAME': 'Ocana_Ocana_90.0KV', 'NAME': 'OCA_G3', 'NUMBER': 165, 'QMAX': 0.0, 'Q': 2.7890000343322754, 'P': 4.0, 'QMIN': 0.0, 'ID': 'OCA_G3', 'PMAX': 4.0}, 'Ocana_Ocana_syn_Gr_OCA_G2': {'PMIN': 0.0, 'EXNAME': 'Ocana_Ocana_90.0KV', 'NAME': 'OCA_G2', 'NUMBER': 165, 'QMAX': 0.0, 'Q': 2.7890000343322754, 'P': 5.25, 'QMIN': 0.0, 'ID': 'OCA_G2', 'PMAX': 5.25}, 'Ocana_Ocana_syn_Gr_OCA_G1': {'PMIN': 0.0, 'EXNAME': 'Ocana_Ocana_90.0KV', 'NAME': 'OCA_G1', 'NUMBER': 165, 'QMAX': 0.0, 'Q': 2.7909998893737793, 'P': 2.0, 'QMIN': 0.0, 'ID': 'OCA_G1', 'PMAX': 8.100000381469727}, 'Vazzio_Vazzio_syn_Gr_VAZ_G1': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G1', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.622999906539917, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G1', 'PMAX': 17.100000381469727}, 'SainteLucie_SainteLucie_genstat_Gr_SaintLucie_PV': {'PMIN': 0.0, 'EXNAME': 'SainteLucie_SainteLucie_90.0KV', 'NAME': 'SaintLucie_PV', 'NUMBER': 171, 'QMAX': 0.0, 'Q': 0.0, 'P': 3.0, 'QMIN': 0.0, 'ID': 'SaintLucie_PV', 'PMAX': 10.0}, 'Lucciana_Lucciana_syn_Gr_LUCCIANA_HTB_2': {'PMIN': 10.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'LUCCIANA_HTB_2', 'NUMBER': 163, 'QMAX': 0.0, 'Q': 0.0, 'P': 0.0, 'QMIN': 0.0, 'ID': 'LUCCIANA_HTB_2', 'PMAX': 50.0}, 'Loretto_Loretto_genstat_Gr_Loretto_PV': {'PMIN': 0.0, 'EXNAME': 'Loretto_Loretto_90.0KV', 'NAME': 'Loretto_PV', 'NUMBER': 162, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Loretto_PV', 'PMAX': 5.0}, 'Vazzio_Vazzio_syn_Gr_VAZ_G5': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G5', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.622999906539917, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G5', 'PMAX': 17.100000381469727}, 'Vazzio_Vazzio_syn_Gr_VAZ_G4': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G4', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.622999906539917, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G4', 'PMAX': 17.100000381469727}, 'Vazzio_Vazzio_syn_Gr_VAZ_G6': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G6', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.622999906539917, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G6', 'PMAX': 17.100000381469727}, 'Lucciana_Lucciana_syn_Gr_CASA7': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA7', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA7', 'PMAX': 17.100000381469727}, 'Lucciana_Lucciana_syn_Gr_CASA6': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA6', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA6', 'PMAX': 17.100000381469727}, 'Lucciana_Lucciana_syn_Gr_CASA5': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA5', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA5', 'PMAX': 17.100000381469727}, 'Lucciana_Lucciana_syn_Gr_CASA4': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA4', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA4', 'PMAX': 17.100000381469727}, 'Lucciana_Lucciana_syn_Gr_CASA3': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA3', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA3', 'PMAX': 17.100000381469727}, 'Castirla_Castirla_syn_Gr_CASTI_G1': {'PMIN': 0.0, 'EXNAME': 'Castirla_Castirla_90.0KV', 'NAME': 'CASTI_G1', 'NUMBER': 155, 'QMAX': 0.0, 'Q': 5.25, 'P': 5.0, 'QMIN': 0.0, 'ID': 'CASTI_G1', 'PMAX': 14.5}, 'Castirla_Castirla_syn_Gr_CASTI_G2': {'PMIN': 0.0, 'EXNAME': 'Castirla_Castirla_90.0KV', 'NAME': 'CASTI_G2', 'NUMBER': 155, 'QMAX': 0.0, 'Q': 5.25, 'P': 5.0, 'QMIN': 0.0, 'ID': 'CASTI_G2', 'PMAX': 14.5}, 'Bonifacio_Bonifacio_genstat_Gr_Bonifaccio_PV': {'PMIN': 0.0, 'EXNAME': 'Bonifacio_Bonifacio_90.0KV', 'NAME': 'Bonifaccio_PV', 'NUMBER': 152, 'QMAX': 0.0, 'Q': 0.0, 'P': 3.0, 'QMIN': 0.0, 'ID': 'Bonifaccio_PV', 'PMAX': 10.0}, 'Propriano_Propriano_syn_Gr_RIZZANESE1': {'PMIN': 0.0, 'EXNAME': 'Propriano_Propriano_90.0KV', 'NAME': 'RIZZANESE1', 'NUMBER': 169, 'QMAX': 0.0, 'Q': 2.811000108718872, 'P': 10.0, 'QMIN': 0.0, 'ID': 'RIZZANESE1', 'PMAX': 27.5}, 'Sisco_Sisco_genstat_Gr_Sisco_1_EOL': {'PMIN': 0.0, 'EXNAME': 'Sisco_Sisco_90.0KV', 'NAME': 'Sisco_1_EOL', 'NUMBER': 174, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.9500000476837158, 'QMIN': 0.0, 'ID': 'Sisco_1_EOL', 'PMAX': 6.5}, 'Taglio_Taglio_genstat_Gr_Taglio_PV': {'PMIN': 0.0, 'EXNAME': 'Taglio_Taglio_90.0KV', 'NAME': 'Taglio_PV', 'NUMBER': 476, 'QMAX': 0.0, 'Q': 0.0, 'P': 3.0, 'QMIN': 0.0, 'ID': 'Taglio_PV', 'PMAX': 10.0}, 'Propriano_Propriano_syn_Gr_RIZZANESE2': {'PMIN': 0.0, 'EXNAME': 'Propriano_Propriano_90.0KV', 'NAME': 'RIZZANESE2', 'NUMBER': 169, 'QMAX': 0.0, 'Q': 2.811000108718872, 'P': 10.0, 'QMIN': 0.0, 'ID': 'RIZZANESE2', 'PMAX': 27.5}, 'Sampolo_Sampolo_syn_Gr_SAMPO_G2': {'PMIN': 0.0, 'EXNAME': 'Sampolo_Sampolo_90.0KV', 'NAME': 'SAMPO_G2', 'NUMBER': 173, 'QMAX': 0.0, 'Q': 8.279000282287598, 'P': 10.0, 'QMIN': 0.0, 'ID': 'SAMPO_G2', 'PMAX': 21.5}, 'Bonifacio_Bonifacio_syn_Gr_HVAC_SARCO_100MW': {'PMIN': -50.0, 'EXNAME': 'Bonifacio_Bonifacio_90.0KV', 'NAME': 'HVAC_SARCO_100MW', 'NUMBER': 152, 'QMAX': 48.0, 'Q': 4.0, 'P': 50.0, 'QMIN': -48.0, 'ID': 'HVAC_SARCO_100MW', 'PMAX': 50.0}, 'Lucciana_Lucciana_syn_Gr_LUCCIANA_BT': {'PMIN': 5.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'LUCCIANA_BT', 'NUMBER': 163, 'QMAX': 0.0, 'Q': 0.5260000228881836, 'P': 12.0, 'QMIN': 0.0, 'ID': 'LUCCIANA_BT', 'PMAX': 12.0}, 'Sampolo_Sampolo_syn_Gr_SAMPO_G1': {'PMIN': 0.0, 'EXNAME': 'Sampolo_Sampolo_90.0KV', 'NAME': 'SAMPO_G1', 'NUMBER': 173, 'QMAX': 0.0, 'Q': 8.279000282287598, 'P': 10.0, 'QMIN': 0.0, 'ID': 'SAMPO_G1', 'PMAX': 21.5}, 'Vazzio_Vazzio_syn_Gr_VAZ_G3': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G3', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.622999906539917, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G3', 'PMAX': 17.100000381469727}, 'Propriano_Propriano_syn_Gr_PROPRIA_BT': {'PMIN': 0.0, 'EXNAME': 'Propriano_Propriano_90.0KV', 'NAME': 'PROPRIA_BT', 'NUMBER': 169, 'QMAX': 0.0, 'Q': 0.6240000128746033, 'P': 1.899999976158142, 'QMIN': 0.0, 'ID': 'PROPRIA_BT', 'PMAX': 1.899999976158142}, 'Corte_Corte_genstat_Gr_Corte_PV': {'PMIN': 0.0, 'EXNAME': 'Corte_Corte_90.0KV', 'NAME': 'Corte_PV', 'NUMBER': 158, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Corte_PV', 'PMAX': 10.0}, 'Oletta_Oletta_genstat_Gr_Oletta_PV': {'PMIN': 0.0, 'EXNAME': 'Oletta_Oletta_90.0KV', 'NAME': 'Oletta_PV', 'NUMBER': 166, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Oletta_PV', 'PMAX': 5.0}, 'Morosaglia_Morosaglia_genstat_Gr_Morosoglia_PV': {'PMIN': 0.0, 'EXNAME': 'Morosaglia_Morosaglia_90.0KV', 'NAME': 'Morosoglia_PV', 'NUMBER': 164, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Morosoglia_PV', 'PMAX': 5.0}, 'Tolla_Tolla_syn_Gr_TOLLA_G1': {'PMIN': 0.0, 'EXNAME': 'Tolla_Tolla_90.0KV', 'NAME': 'TOLLA_G1', 'NUMBER': 477, 'QMAX': 7.0, 'Q': 2.180000066757202, 'P': 4.5, 'QMIN': -7.0, 'ID': 'TOLLA_G1', 'PMAX': 4.5}, 'Tolla_Tolla_syn_Gr_TOLLA_G2': {'PMIN': 0.0, 'EXNAME': 'Tolla_Tolla_90.0KV', 'NAME': 'TOLLA_G2', 'NUMBER': 477, 'QMAX': 10.0, 'Q': 2.180000066757202, 'P': 4.5, 'QMIN': -10.0, 'ID': 'TOLLA_G2', 'PMAX': 4.5}, 'Tolla_Tolla_syn_Gr_TOLLA_G3': {'PMIN': 0.0, 'EXNAME': 'Tolla_Tolla_90.0KV', 'NAME': 'TOLLA_G3', 'NUMBER': 477, 'QMAX': 0.0, 'Q': 3.7799999713897705, 'P': 7.0, 'QMIN': 0.0, 'ID': 'TOLLA_G3', 'PMAX': 7.0}, 'Vazzio_Vazzio_syn_Gr_VAZ_G11': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G11', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 0.0, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G11', 'PMAX': 17.100000381469727}, 'Vazzio_Vazzio_syn_Gr_VAZ_G10': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G10', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 0.0, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G10', 'PMAX': 17.100000381469727}, 'Vazzio_Vazzio_syn_Gr_VAZ_G12': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G12', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 0.0, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G12', 'PMAX': 17.100000381469727}, 'Sisco_Sisco_genstat_Gr_Sisco_2_EOL': {'PMIN': 0.0, 'EXNAME': 'Sisco_Sisco_90.0KV', 'NAME': 'Sisco_2_EOL', 'NUMBER': 174, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.9500000476837158, 'QMIN': 0.0, 'ID': 'Sisco_2_EOL', 'PMAX': 6.5}, 'Furiani_Furiani_genstat_Gr_Furiani_PV': {'PMIN': 0.0, 'EXNAME': 'Furiani_Furiani_90.0KV', 'NAME': 'Furiani_PV', 'NUMBER': 159, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Furiani_PV', 'PMAX': 5.0}, 'Lucciana_Lucciana_genstat_Gr_Lucciana_PV': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'Lucciana_PV', 'NUMBER': 163, 'QMAX': 0.0, 'Q': 0.0, 'P': 0.6000000238418579, 'QMIN': 0.0, 'ID': 'Lucciana_PV', 'PMAX': 2.0}, 'Propriano_Propriano_genstat_Gr_Propriano_PV': {'PMIN': 0.0, 'EXNAME': 'Propriano_Propriano_90.0KV', 'NAME': 'Propriano_PV', 'NUMBER': 169, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Propriano_PV', 'PMAX': 5.0}, 'Vazzio_Vazzio_syn_Gr_VAZ_G2': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G2', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.622999906539917, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G2', 'PMAX': 17.100000381469727}, 'Sisco_Sisco_genstat_Gr_Sisco_PV': {'PMIN': 0.0, 'EXNAME': 'Sisco_Sisco_90.0KV', 'NAME': 'Sisco_PV', 'NUMBER': 174, 'QMAX': 0.0, 'Q': 0.0, 'P': 3.0, 'QMIN': 0.0, 'ID': 'Sisco_PV', 'PMAX': 10.0}, 'Calvi_Calvi_genstat_Gr_Calvi_PV': {'PMIN': 0.0, 'EXNAME': 'Calvi_Calvi_90.0KV', 'NAME': 'Calvi_PV', 'NUMBER': 154, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Calvi_PV', 'PMAX': 5.0}, 'Ghisonaccia_Ghisonaccia_genstat_Gr_Gisonaccia_PV': {'PMIN': 0.0, 'EXNAME': 'Ghisonaccia_Ghisonaccia_90.0KV', 'NAME': 'Gisonaccia_PV', 'NUMBER': 160, 'QMAX': 0.0, 'Q': 0.0, 'P': 3.0, 'QMIN': 0.0, 'ID': 'Gisonaccia_PV', 'PMAX': 10.0}}
-LoadDico = {'IleRousse_IleRousse_Lo1': {'EXNAME': 'IleRousse_IleRousse_90.0KV', 'NAME': 'Load 7', 'NUMBER': 161, 'Q': 6.5, 'P': 26.0, 'ID': 1}, 'Calvi_Calvi_Lo1': {'EXNAME': 'Calvi_Calvi_90.0KV', 'NAME': 'Load 11', 'NUMBER': 154, 'Q': 5.0, 'P': 20.0, 'ID': 1}, 'Caldanicci_Caldanicci_Lo1': {'EXNAME': 'Caldanicci_Caldanicci_90.0KV', 'NAME': 'Load 4', 'NUMBER': 153, 'Q': 9.25, 'P': 37.0, 'ID': 1}, 'Corte_Corte_Lo1': {'EXNAME': 'Corte_Corte_90.0KV', 'NAME': 'Load 5', 'NUMBER': 158, 'Q': 4.949999809265137, 'P': 19.799999237060547, 'ID': 1}, 'Bastia_Bastia_Lo1': {'EXNAME': 'Bastia_Bastia_90.0KV', 'NAME': 'Load 2', 'NUMBER': 151, 'Q': 11.800000190734863, 'P': 47.20000076293945, 'ID': 1}, 'Sisco_Sisco_Lo1': {'EXNAME': 'Sisco_Sisco_90.0KV', 'NAME': 'Load 20', 'NUMBER': 174, 'Q': 2.5, 'P': 10.0, 'ID': 1}, 'Propriano_Propriano_Lo1': {'EXNAME': 'Propriano_Propriano_90.0KV', 'NAME': 'Load 17', 'NUMBER': 169, 'Q': 4.849999904632568, 'P': 19.399999618530273, 'ID': 1}, 'Ghisonaccia_Ghisonaccia_Lo1': {'EXNAME': 'Ghisonaccia_Ghisonaccia_90.0KV', 'NAME': 'Load 6', 'NUMBER': 160, 'Q': 7.900000095367432, 'P': 31.799999237060547, 'ID': 1}, 'Aspretto_Aspretto_Lo2': {'EXNAME': 'Aspretto_Aspretto_90.0KV', 'NAME': 'LOAD_for_cong', 'NUMBER': 150, 'Q': 0.0, 'P': 20.0, 'ID': 2}, 'Aspretto_Aspretto_Lo1': {'EXNAME': 'Aspretto_Aspretto_90.0KV', 'NAME': 'Load 1', 'NUMBER': 150, 'Q': 11.850000381469727, 'P': 47.400001525878906, 'ID': 1}, 'PorteVecchio_PorteVecchio_Lo1': {'EXNAME': 'PorteVecchio_PorteVecchio_90.0KV', 'NAME': 'Load 16', 'NUMBER': 168, 'Q': 10.0, 'P': 40.0, 'ID': 1}, 'Sagone_Sagone_Lo1': {'EXNAME': 'Sagone_Sagone_90.0KV', 'NAME': 'Load 18', 'NUMBER': 170, 'Q': 4.400000095367432, 'P': 17.0, 'ID': 1}, 'Pietrosella_Pietrosella_Lo1': {'EXNAME': 'Pietrosella_Pietrosella_90.0KV', 'NAME': 'Load 15', 'NUMBER': 167, 'Q': 2.799999952316284, 'P': 11.199999809265137, 'ID': 1}, 'Vazzio_Vazzio_Lo1': {'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'BATTERY_Load', 'NUMBER': 478, 'Q': 0.0, 'P': 20.0, 'ID': 1}, 'SainteMarieSicche_SainteMarieSicche_Lo1': {'EXNAME': 'SainteMarieSicche_SainteMarieSicche_90.0KV', 'NAME': 'Load 19', 'NUMBER': 172, 'Q': 1.649999976158142, 'P': 6.599999904632568, 'ID': 1}, 'Ocana_Ocana_Lo1': {'EXNAME': 'Ocana_Ocana_90.0KV', 'NAME': 'Load 13', 'NUMBER': 165, 'Q': 2.6500000953674316, 'P': 10.600000381469727, 'ID': 1}, 'Morosaglia_Morosaglia_Lo1': {'EXNAME': 'Morosaglia_Morosaglia_90.0KV', 'NAME': 'Load 12', 'NUMBER': 164, 'Q': 1.600000023841858, 'P': 6.400000095367432, 'ID': 1}, 'Lucciana_Lucciana_Lo2': {'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'Load 9', 'NUMBER': 163, 'Q': 7.28000020980835, 'P': 29.100000381469727, 'ID': 2}, 'Lucciana_Lucciana_Lo1': {'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'Load 10', 'NUMBER': 163, 'Q': 0.0, 'P': 0.0, 'ID': 1}, 'Loretto_Loretto_Lo1': {'EXNAME': 'Loretto_Loretto_90.0KV', 'NAME': 'Load 8', 'NUMBER': 162, 'Q': 10.0, 'P': 41.0, 'ID': 1}, 'Oletta_Oletta_Lo1': {'EXNAME': 'Oletta_Oletta_90.0KV', 'NAME': 'Load 14', 'NUMBER': 166, 'Q': 2.200000047683716, 'P': 8.899999618530273, 'ID': 1}, 'Bonifacio_Bonifacio_Lo1': {'EXNAME': 'Bonifacio_Bonifacio_90.0KV', 'NAME': 'Load 3', 'NUMBER': 152, 'Q': 4.0, 'P': 16.0, 'ID': 1}}
-LineDico = {'Taglio_Taglio_Cervione_Cervione_CERVIONE_TAGLIO_Li': {'TONAME': 'Cervione_Cervione', 'FROMNUMBER': 476, 'FROMEXNAME': 'Taglio_Taglio_90.0', 'FROMNAME': 'Taglio_Taglio', 'TOEXNAME': 'Cervione_Cervione_90.0', 'TONUMBER': 156, 'ID': 'CERVIONE_TAGLIO'}, 'Lucciana_Lucciana_Taglio_Taglio_CASAMOZZA_TAGLIO_Li': {'TONAME': 'Taglio_Taglio', 'FROMNUMBER': 163, 'FROMEXNAME': 'Lucciana_Lucciana_90.0', 'FROMNAME': 'Lucciana_Lucciana', 'TOEXNAME': 'Taglio_Taglio_90.0', 'TONUMBER': 476, 'ID': 'CASAMOZZA_TAGLIO'}, 'Calvi_Calvi_IleRousse_IleRousse_CALVI_ILE_ROUSSE_Li': {'TONAME': 'IleRousse_IleRousse', 'FROMNUMBER': 154, 'FROMEXNAME': 'Calvi_Calvi_90.0', 'FROMNAME': 'Calvi_Calvi', 'TOEXNAME': 'IleRousse_IleRousse_90.0', 'TONUMBER': 161, 'ID': 'CALVI_ILE_ROUSSE'}, 'Sampolo_Sampolo_Corte_Corte_CORTE_SAMPOLO_Li': {'TONAME': 'Corte_Corte', 'FROMNUMBER': 173, 'FROMEXNAME': 'Sampolo_Sampolo_90.0', 'FROMNAME': 'Sampolo_Sampolo', 'TOEXNAME': 'Corte_Corte_90.0', 'TONUMBER': 158, 'ID': 'CORTE_SAMPOLO'}, 'Loretto_Loretto_Aspretto_Aspretto_ASPRETTO_LORETTO_Li': {'TONAME': 'Aspretto_Aspretto', 'FROMNUMBER': 162, 'FROMEXNAME': 'Loretto_Loretto_90.0', 'FROMNAME': 'Loretto_Loretto', 'TOEXNAME': 'Aspretto_Aspretto_90.0', 'TONUMBER': 150, 'ID': 'ASPRETTO_LORETTO'}, 'Caldanicci_Caldanicci_Vazzio_Vazzio_CALDANICCIA_VAZZIO_Li': {'TONAME': 'Vazzio_Vazzio', 'FROMNUMBER': 153, 'FROMEXNAME': 'Caldanicci_Caldanicci_90.0', 'FROMNAME': 'Caldanicci_Caldanicci', 'TOEXNAME': 'Vazzio_Vazzio_90.0', 'TONUMBER': 478, 'ID': 'CALDANICCIA_VAZZIO'}, 'PorteVecchio_PorteVecchio_Bonifacio_Bonifacio_BONIFACCIO_PO_VO1_Li': {'TONAME': 'Bonifacio_Bonifacio', 'FROMNUMBER': 168, 'FROMEXNAME': 'PorteVecchio_PorteVecchio_90.0', 'FROMNAME': 'PorteVecchio_PorteVecchio', 'TOEXNAME': 'Bonifacio_Bonifacio_90.0', 'TONUMBER': 152, 'ID': 'BONIFACCIO_PO_VO1'}, 'Ocana_Ocana_SainteMarieSicche_SainteMarieSicche_OCANA_ZSSS6_Li': {'TONAME': 'SainteMarieSicche_SainteMarieSicche', 'FROMNUMBER': 165, 'FROMEXNAME': 'Ocana_Ocana_90.0', 'FROMNAME': 'Ocana_Ocana', 'TOEXNAME': 'SainteMarieSicche_SainteMarieSicche_90.0', 'TONUMBER': 172, 'ID': 'OCANA_ZSSS6'}, 'Tolla_Tolla_Ocana_Ocana_OCANA_TOLLA2_Li': {'TONAME': 'Ocana_Ocana', 'FROMNUMBER': 477, 'FROMEXNAME': 'Tolla_Tolla_90.0', 'FROMNAME': 'Tolla_Tolla', 'TOEXNAME': 'Ocana_Ocana_90.0', 'TONUMBER': 165, 'ID': 'OCANA_TOLLA2'}, 'Corte_Corte_Morosaglia_Morosaglia_CORTE_MOROSAGLIA_Li': {'TONAME': 'Morosaglia_Morosaglia', 'FROMNUMBER': 158, 'FROMEXNAME': 'Corte_Corte_90.0', 'FROMNAME': 'Corte_Corte', 'TOEXNAME': 'Morosaglia_Morosaglia_90.0', 'TONUMBER': 164, 'ID': 'CORTE_MOROSAGLIA'}, 'IleRousse_IleRousse_Castirla_Castirla_CASTIRLA_ILE_ROUSSE_Li': {'TONAME': 'Castirla_Castirla', 'FROMNUMBER': 161, 'FROMEXNAME': 'IleRousse_IleRousse_90.0', 'FROMNAME': 'IleRousse_IleRousse', 'TOEXNAME': 'Castirla_Castirla_90.0', 'TONUMBER': 155, 'ID': 'CASTIRLA_ILE_ROUSSE'}, 'Lucciana_Lucciana_Furiani_Furiani_FURIANI_LUCCIANA1_Li': {'TONAME': 'Furiani_Furiani', 'FROMNUMBER': 163, 'FROMEXNAME': 'Lucciana_Lucciana_90.0', 'FROMNAME': 'Lucciana_Lucciana', 'TOEXNAME': 'Furiani_Furiani_90.0', 'TONUMBER': 159, 'ID': 'FURIANI_LUCCIANA1'}, 'Bonifacio_Bonifacio_PorteVecchio_PorteVecchio_BONIFACCIO_PO_VO2_Li': {'TONAME': 'PorteVecchio_PorteVecchio', 'FROMNUMBER': 152, 'FROMEXNAME': 'Bonifacio_Bonifacio_90.0', 'FROMNAME': 'Bonifacio_Bonifacio', 'TOEXNAME': 'PorteVecchio_PorteVecchio_90.0', 'TONUMBER': 168, 'ID': 'BONIFACCIO_PO_VO2'}, 'Ocana_Ocana_Caldanicci_Caldanicci_CALDANICCIA_OCANA_Li': {'TONAME': 'Caldanicci_Caldanicci', 'FROMNUMBER': 165, 'FROMEXNAME': 'Ocana_Ocana_90.0', 'FROMNAME': 'Ocana_Ocana', 'TOEXNAME': 'Caldanicci_Caldanicci_90.0', 'TONUMBER': 153, 'ID': 'CALDANICCIA_OCANA'}, 'Castirla_Castirla_Corte_Corte_CASTIRLA_CORTE_Li': {'TONAME': 'Corte_Corte', 'FROMNUMBER': 155, 'FROMEXNAME': 'Castirla_Castirla_90.0', 'FROMNAME': 'Castirla_Castirla', 'TOEXNAME': 'Corte_Corte_90.0', 'TONUMBER': 158, 'ID': 'CASTIRLA_CORTE'}, 'Vazzio_Vazzio_Loretto_Loretto_LORETO_VAZZIO_Li': {'TONAME': 'Loretto_Loretto', 'FROMNUMBER': 478, 'FROMEXNAME': 'Vazzio_Vazzio_90.0', 'FROMNAME': 'Vazzio_Vazzio', 'TOEXNAME': 'Loretto_Loretto_90.0', 'TONUMBER': 162, 'ID': 'LORETO_VAZZIO'}, 'Bastia_Bastia_Furiani_Furiani_BASTIA_FURIANI1_Li': {'TONAME': 'Furiani_Furiani', 'FROMNUMBER': 151, 'FROMEXNAME': 'Bastia_Bastia_90.0', 'FROMNAME': 'Bastia_Bastia', 'TOEXNAME': 'Furiani_Furiani_90.0', 'TONUMBER': 159, 'ID': 'BASTIA_FURIANI1'}, 'Sagone_Sagone_Sovenzia_Sovenzia_SAGONE_SOVENZIA_Li': {'TONAME': 'Sovenzia_Sovenzia', 'FROMNUMBER': 170, 'FROMEXNAME': 'Sagone_Sagone_90.0', 'FROMNAME': 'Sagone_Sagone', 'TOEXNAME': 'Sovenzia_Sovenzia_90.0', 'TONUMBER': 175, 'ID': 'SAGONE_SOVENZIA'}, 'Ghisonaccia_Ghisonaccia_SainteLucie_SainteLucie_GHISONACCIA_STE_LUCIE_Li': {'TONAME': 'SainteLucie_SainteLucie', 'FROMNUMBER': 160, 'FROMEXNAME': 'Ghisonaccia_Ghisonaccia_90.0', 'FROMNAME': 'Ghisonaccia_Ghisonaccia', 'TOEXNAME': 'SainteLucie_SainteLucie_90.0', 'TONUMBER': 171, 'ID': 'GHISONACCIA_STE_LUCIE'}, 'Furiani_Furiani_Oletta_Oletta_FURIANI_ZI_OLETTA_Li': {'TONAME': 'Oletta_Oletta', 'FROMNUMBER': 159, 'FROMEXNAME': 'Furiani_Furiani_90.0', 'FROMNAME': 'Furiani_Furiani', 'TOEXNAME': 'Oletta_Oletta_90.0', 'TONUMBER': 166, 'ID': 'FURIANI_ZI_OLETTA'}, 'Vazzio_Vazzio_Ocana_Ocana_OCANA_VAZZIO_Li': {'TONAME': 'Ocana_Ocana', 'FROMNUMBER': 478, 'FROMEXNAME': 'Vazzio_Vazzio_90.0', 'FROMNAME': 'Vazzio_Vazzio', 'TOEXNAME': 'Ocana_Ocana_90.0', 'TONUMBER': 165, 'ID': 'OCANA_VAZZIO'}, 'Ocana_Ocana_Corte_Corte_CORTE_OCANA_Li': {'TONAME': 'Corte_Corte', 'FROMNUMBER': 165, 'FROMEXNAME': 'Ocana_Ocana_90.0', 'FROMNAME': 'Ocana_Ocana', 'TOEXNAME': 'Corte_Corte_90.0', 'TONUMBER': 158, 'ID': 'CORTE_OCANA'}, 'IleRousse_IleRousse_Oletta_Oletta_ILE_ROUSSE_ZI_OLETTA_Li': {'TONAME': 'Oletta_Oletta', 'FROMNUMBER': 161, 'FROMEXNAME': 'IleRousse_IleRousse_90.0', 'FROMNAME': 'IleRousse_IleRousse', 'TOEXNAME': 'Oletta_Oletta_90.0', 'TONUMBER': 166, 'ID': 'ILE_ROUSSE_ZI_OLETTA'}, 'Corsica_Corsica_Sovenzia_Sovenzia_CORSCIA_SOVENZIA_Li': {'TONAME': 'Sovenzia_Sovenzia', 'FROMNUMBER': 157, 'FROMEXNAME': 'Corsica_Corsica_90.0', 'FROMNAME': 'Corsica_Corsica', 'TOEXNAME': 'Sovenzia_Sovenzia_90.0', 'TONUMBER': 175, 'ID': 'CORSCIA_SOVENZIA'}, 'Bastia_Bastia_Furiani_Furiani_BASTIA_FURIANI2_Li': {'TONAME': 'Furiani_Furiani', 'FROMNUMBER': 151, 'FROMEXNAME': 'Bastia_Bastia_90.0', 'FROMNAME': 'Bastia_Bastia', 'TOEXNAME': 'Furiani_Furiani_90.0', 'TONUMBER': 159, 'ID': 'BASTIA_FURIANI2'}, 'Furiani_Furiani_Sisco_Sisco_FURIANI_SISCO_Li': {'TONAME': 'Sisco_Sisco', 'FROMNUMBER': 159, 'FROMEXNAME': 'Furiani_Furiani_90.0', 'FROMNAME': 'Furiani_Furiani', 'TOEXNAME': 'Sisco_Sisco_90.0', 'TONUMBER': 174, 'ID': 'FURIANI_SISCO'}, 'Ghisonaccia_Ghisonaccia_Sampolo_Sampolo_GHISONACCIA_SAMPOLO_Li': {'TONAME': 'Sampolo_Sampolo', 'FROMNUMBER': 160, 'FROMEXNAME': 'Ghisonaccia_Ghisonaccia_90.0', 'FROMNAME': 'Ghisonaccia_Ghisonaccia', 'TOEXNAME': 'Sampolo_Sampolo_90.0', 'TONUMBER': 173, 'ID': 'GHISONACCIA_SAMPOLO'}, 'Lucciana_Lucciana_Furiani_Furiani_FURIANI_LUCCIANA2_Li': {'TONAME': 'Furiani_Furiani', 'FROMNUMBER': 163, 'FROMEXNAME': 'Lucciana_Lucciana_90.0', 'FROMNAME': 'Lucciana_Lucciana', 'TOEXNAME': 'Furiani_Furiani_90.0', 'TONUMBER': 159, 'ID': 'FURIANI_LUCCIANA2'}, 'Cervione_Cervione_Ghisonaccia_Ghisonaccia_CERVIONE_GHISONACCIA_Li': {'TONAME': 'Ghisonaccia_Ghisonaccia', 'FROMNUMBER': 156, 'FROMEXNAME': 'Cervione_Cervione_90.0', 'FROMNAME': 'Cervione_Cervione', 'TOEXNAME': 'Ghisonaccia_Ghisonaccia_90.0', 'TONUMBER': 160, 'ID': 'CERVIONE_GHISONACCIA'}, 'Propriano_Propriano_SainteMarieSicche_SainteMarieSicche_PROPRIANO_ZSSS6_Li': {'TONAME': 'SainteMarieSicche_SainteMarieSicche', 'FROMNUMBER': 169, 'FROMEXNAME': 'Propriano_Propriano_90.0', 'FROMNAME': 'Propriano_Propriano', 'TOEXNAME': 'SainteMarieSicche_SainteMarieSicche_90.0', 'TONUMBER': 172, 'ID': 'PROPRIANO_ZSSS6'}, 'Pietrosella_Pietrosella_Ocana_Ocana_OCANA_PIETROSELLA_Li': {'TONAME': 'Ocana_Ocana', 'FROMNUMBER': 167, 'FROMEXNAME': 'Pietrosella_Pietrosella_90.0', 'FROMNAME': 'Pietrosella_Pietrosella', 'TOEXNAME': 'Ocana_Ocana_90.0', 'TONUMBER': 165, 'ID': 'OCANA_PIETROSELLA'}, 'PorteVecchio_PorteVecchio_Propriano_Propriano_PRORIANO_PO_VO_Li': {'TONAME': 'Propriano_Propriano', 'FROMNUMBER': 168, 'FROMEXNAME': 'PorteVecchio_PorteVecchio_90.0', 'FROMNAME': 'PorteVecchio_PorteVecchio', 'TOEXNAME': 'Propriano_Propriano_90.0', 'TONUMBER': 169, 'ID': 'PRORIANO_PO_VO'}, 'SainteLucie_SainteLucie_PorteVecchio_PorteVecchio_PO_VO_STE_LUCIE_Li': {'TONAME': 'PorteVecchio_PorteVecchio', 'FROMNUMBER': 171, 'FROMEXNAME': 'SainteLucie_SainteLucie_90.0', 'FROMNAME': 'SainteLucie_SainteLucie', 'TOEXNAME': 'PorteVecchio_PorteVecchio_90.0', 'TONUMBER': 168, 'ID': 'PO_VO_STE_LUCIE'}, 'Aspretto_Aspretto_Vazzio_Vazzio_ASPRETTO_VAZZIO_Li': {'TONAME': 'Vazzio_Vazzio', 'FROMNUMBER': 150, 'FROMEXNAME': 'Aspretto_Aspretto_90.0', 'FROMNAME': 'Aspretto_Aspretto', 'TOEXNAME': 'Vazzio_Vazzio_90.0', 'TONUMBER': 478, 'ID': 'ASPRETTO_VAZZIO'}, 'Sagone_Sagone_Loretto_Loretto_LORETO_SAGONE_Li': {'TONAME': 'Loretto_Loretto', 'FROMNUMBER': 170, 'FROMEXNAME': 'Sagone_Sagone_90.0', 'FROMNAME': 'Sagone_Sagone', 'TOEXNAME': 'Loretto_Loretto_90.0', 'TONUMBER': 162, 'ID': 'LORETO_SAGONE'}, 'Lucciana_Lucciana_Morosaglia_Morosaglia_CASAMOZZA_MOROSAGLIA_Li': {'TONAME': 'Morosaglia_Morosaglia', 'FROMNUMBER': 163, 'FROMEXNAME': 'Lucciana_Lucciana_90.0', 'FROMNAME': 'Lucciana_Lucciana', 'TOEXNAME': 'Morosaglia_Morosaglia_90.0', 'TONUMBER': 164, 'ID': 'CASAMOZZA_MOROSAGLIA'}, 'Tolla_Tolla_Ocana_Ocana_OCANA_TOLLA1_Li': {'TONAME': 'Ocana_Ocana', 'FROMNUMBER': 477, 'FROMEXNAME': 'Tolla_Tolla_90.0', 'FROMNAME': 'Tolla_Tolla', 'TOEXNAME': 'Ocana_Ocana_90.0', 'TONUMBER': 165, 'ID': 'OCANA_TOLLA1'}, 'Propriano_Propriano_Pietrosella_Pietrosella_PIETROSELLA_PROPRIANO_Li': {'TONAME': 'Pietrosella_Pietrosella', 'FROMNUMBER': 169, 'FROMEXNAME': 'Propriano_Propriano_90.0', 'FROMNAME': 'Propriano_Propriano', 'TOEXNAME': 'Pietrosella_Pietrosella_90.0', 'TONUMBER': 167, 'ID': 'PIETROSELLA_PROPRIANO'}, 'Castirla_Castirla_Corsica_Corsica_CASTIRLA_CORSICA_Li': {'TONAME': 'Corsica_Corsica', 'FROMNUMBER': 155, 'FROMEXNAME': 'Castirla_Castirla_90.0', 'FROMNAME': 'Castirla_Castirla', 'TOEXNAME': 'Corsica_Corsica_90.0', 'TONUMBER': 157, 'ID': 'CASTIRLA_CORSICA'}}
-TransfoDico = {}
+MachineDico = {'Champagne_G1_Ugen_genstat_Gr_HighDam_Champagne_G1': {'Q': 0.0, 'EXNAME': 'Champagne_G1_Ugen_66.0KV', 'NAME': 'HighDam_Champagne_G1', 'NUMBER': 26, 'QMAX': 10.200000762939453, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -7.309999942779541, 'ID': 'HighDam_Champagne_G1', 'PMAX': 13.600000381469727}, 'StLouis_Ugen_9_syn_Gr_SLPS_G9': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_9_66.0KV', 'NAME': 'SLPS_G9', 'NUMBER': 105, 'QMAX': 6.578999996185303, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -6.578999996185303, 'ID': 'SLPS_G9', 'PMAX': 13.770000457763672}, 'Sarako_22kV_genstat_Gr_PV_Sarako': {'Q': 0.0, 'EXNAME': 'Sarako_22kV_66.0KV', 'NAME': 'PV_Sarako', 'NUMBER': 91, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Sarako', 'PMAX': 15.0}, 'Ebene_22kV_1_genstat_Gr_PV_Ebene_1': {'Q': 0.0, 'EXNAME': 'Ebene_22kV_1_66.0KV', 'NAME': 'PV_Ebene_1', 'NUMBER': 33, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Ebene_1', 'PMAX': 0.5}, 'FVPS_22kV_3_genstat_Gr_PV_FVPS_3': {'Q': 0.0, 'EXNAME': 'FVPS_22kV_3_66.0KV', 'NAME': 'PV_FVPS_3', 'NUMBER': 44, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_FVPS_3', 'PMAX': 0.5}, 'Henrietta_22kV_2_genstat_Gr_PV_Henrietta_2': {'Q': 0.0, 'EXNAME': 'Henrietta_22kV_2_66.0KV', 'NAME': 'PV_Henrietta_2', 'NUMBER': 63, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Henrietta_2', 'PMAX': 0.5}, 'Terminal_1__syn_Gr_FVPS_G5': {'Q': 0.0, 'EXNAME': 'Terminal_1__66.0KV', 'NAME': 'FVPS_G5', 'NUMBER': 108, 'QMAX': 9.894586563110352, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -8.088730812072754, 'ID': 'FVPS_G5', 'PMAX': 15.979999542236328}, 'CaseNoyale_22kV_1_genstat_Gr_PV_CaseNoyale_1': {'Q': 0.0, 'EXNAME': 'CaseNoyale_22kV_1_66.0KV', 'NAME': 'PV_CaseNoyale_1', 'NUMBER': 19, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_CaseNoyale_1', 'PMAX': 0.5}, 'Sottise_22kV_2_genstat_Gr_PV_MonChoisy': {'Q': 0.0, 'EXNAME': 'Sottise_22kV_2_66.0KV', 'NAME': 'PV_MonChoisy', 'NUMBER': 94, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_MonChoisy', 'PMAX': 2.0}, 'Sottise_22kV_1_genstat_Gr_PV_Sottise_1': {'Q': 0.0, 'EXNAME': 'Sottise_22kV_1_66.0KV', 'NAME': 'PV_Sottise_1', 'NUMBER': 93, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Sottise_1', 'PMAX': 0.5}, 'LaFerme_G1_Ugen_genstat_Gr_RoR_LaFerme': {'Q': 0.0, 'EXNAME': 'LaFerme_G1_Ugen_66.0KV', 'NAME': 'RoR_LaFerme', 'NUMBER': 75, 'QMAX': 0.9000000357627869, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.6449999809265137, 'ID': 'RoR_LaFerme', 'PMAX': 1.2000000476837158}, 'Amaury_22kV_2_genstat_Gr_PV_Amaury_2': {'Q': 0.0, 'EXNAME': 'Amaury_22kV_2_66.0KV', 'NAME': 'PV_Amaury_2', 'NUMBER': 1, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Amaury_2', 'PMAX': 0.5}, 'FVPS_22kV_1_genstat_Gr_PV_FVPS_1': {'Q': 0.0, 'EXNAME': 'FVPS_22kV_1_66.0KV', 'NAME': 'PV_FVPS_1', 'NUMBER': 42, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_FVPS_1', 'PMAX': 0.5}, 'StLouis_Ugen_11_syn_Gr_SLPS_G11': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_11_66.0KV', 'NAME': 'SLPS_G11', 'NUMBER': 100, 'QMAX': 12.898200035095215, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -9.2437105178833, 'ID': 'SLPS_G11', 'PMAX': 17.197599411010742}, 'Bellevue_G2_Ugen_syn_Gr_IPP_Bellevue_G2': {'Q': 0.0, 'EXNAME': 'Bellevue_G2_Ugen_66.0KV', 'NAME': 'IPP_Bellevue_G2', 'NUMBER': 12, 'QMAX': 26.700000762939453, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -20.91499900817871, 'ID': 'IPP_Bellevue_G2', 'PMAX': 31.0}, 'Fuel_22kV_2_genstat_Gr_PV_Fuel_2': {'Q': 0.0, 'EXNAME': 'Fuel_22kV_2_66.0KV', 'NAME': 'PV_Fuel_2', 'NUMBER': 57, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Fuel_2', 'PMAX': 0.5}, 'TourKoening_22kV_2_genstat_Gr_PV_TourKoening_2': {'Q': 0.0, 'EXNAME': 'TourKoening_22kV_2_66.0KV', 'NAME': 'PV_TourKoening_2', 'NUMBER': 116, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_TourKoening_2', 'PMAX': 0.5}, 'Fuel_G2_Ugen_syn_Gr_IPP_Fuel_G2': {'Q': 0.0, 'EXNAME': 'Fuel_G2_Ugen_66.0KV', 'NAME': 'IPP_Fuel_G2', 'NUMBER': 60, 'QMAX': 14.100000381469727, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -11.045000076293945, 'ID': 'IPP_Fuel_G2', 'PMAX': 13.5}, 'FGPS_Ugen3_syn_Gr_FGPS_G3': {'Q': 0.0, 'EXNAME': 'FGPS_Ugen3_66.0KV', 'NAME': 'FGPS_G3', 'NUMBER': 39, 'QMAX': 22.374000549316406, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -16.780500411987305, 'ID': 'FGPS_G3', 'PMAX': 21.0}, 'LeVal_G2_Ugen_genstat_Gr_RoR_LeVal_G2': {'Q': 0.0, 'EXNAME': 'LeVal_G2_Ugen_66.0KV', 'NAME': 'RoR_LeVal_G2', 'NUMBER': 78, 'QMAX': 1.5, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -1.0750000476837158, 'ID': 'RoR_LeVal_G2', 'PMAX': 2.0}, 'NIPS_G3_Ugen_syn_Gr_NIPS_G3': {'Q': 0.0, 'EXNAME': 'NIPS_G3_Ugen_66.0KV', 'NAME': 'NIPS_G3', 'NUMBER': 87, 'QMAX': 28.260000228881836, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -20.253000259399414, 'ID': 'NIPS_G3', 'PMAX': 37.68000030517578}, 'FGPS_Ugen2_syn_Gr_FGPS_G2': {'Q': 0.0, 'EXNAME': 'FGPS_Ugen2_66.0KV', 'NAME': 'FGPS_G2', 'NUMBER': 38, 'QMAX': 17.56800079345703, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -14.640000343322754, 'ID': 'FGPS_G2', 'PMAX': 15.399999618530273}, 'FGPS_Ugen1_syn_Gr_FGPS_G1': {'Q': 0.0, 'EXNAME': 'FGPS_Ugen1_66.0KV', 'NAME': 'FGPS_G1', 'NUMBER': 37, 'QMAX': 17.56800079345703, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -14.640000343322754, 'ID': 'FGPS_G1', 'PMAX': 15.399999618530273}, 'UnionVale_22kV_1_genstat_Gr_PV_UnionVale_1': {'Q': 0.0, 'EXNAME': 'UnionVale_22kV_1_66.0KV', 'NAME': 'PV_UnionVale_1', 'NUMBER': 118, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_UnionVale_1', 'PMAX': 0.5}, 'FortGeorge_22kV_1_genstat_Gr_PV_FortGeorge_1': {'Q': 0.0, 'EXNAME': 'FortGeorge_22kV_1_66.0KV', 'NAME': 'PV_FortGeorge_1', 'NUMBER': 53, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_FortGeorge_1', 'PMAX': 0.5}, 'Wooton_22kV_1_genstat_Gr_PV_Esperance': {'Q': 0.0, 'EXNAME': 'Wooton_22kV_1_66.0KV', 'NAME': 'PV_Esperance', 'NUMBER': 121, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Esperance', 'PMAX': 2.0}, 'StLouis_22kV_1_genstat_Gr_PV_StLouis_1': {'Q': 0.0, 'EXNAME': 'StLouis_22kV_1_66.0KV', 'NAME': 'PV_StLouis_1', 'NUMBER': 96, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_StLouis_1', 'PMAX': 0.5}, 'Cecile_G1_Ugen_genstat_Gr_RoR_Cecile': {'Q': 0.0, 'EXNAME': 'Cecile_G1_Ugen_66.0KV', 'NAME': 'RoR_Cecile', 'NUMBER': 23, 'QMAX': 0.75, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.5375000238418579, 'ID': 'RoR_Cecile', 'PMAX': 1.0}, 'Combo_22kV_1_genstat_Gr_PV_Combo_1': {'Q': 0.0, 'EXNAME': 'Combo_22kV_1_66.0KV', 'NAME': 'PV_Combo_1', 'NUMBER': 28, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Combo_1', 'PMAX': 0.5}, 'CTDS_G1_Ugen_syn_Gr_IPP_CTDS_G1': {'Q': 0.0, 'EXNAME': 'CTDS_G1_Ugen_66.0KV', 'NAME': 'IPP_CTDS_G1', 'NUMBER': 14, 'QMAX': 29.439998626708984, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -21.6200008392334, 'ID': 'IPP_CTDS_G1', 'PMAX': 30.0}, 'Terminal_7__syn_Gr_FVPS_G12_MAN': {'Q': 0.0, 'EXNAME': 'Terminal_7__66.0KV', 'NAME': 'FVPS_G12_MAN', 'NUMBER': 114, 'QMAX': 7.390200614929199, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -5.2963104248046875, 'ID': 'FVPS_G12_MAN', 'PMAX': 8.0}, 'StLouis_Ugen_8_syn_Gr_SLPS_G8': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_8_66.0KV', 'NAME': 'SLPS_G8', 'NUMBER': 104, 'QMAX': 6.578999996185303, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -6.578999996185303, 'ID': 'SLPS_G8', 'PMAX': 13.770000457763672}, 'Bellevue_22kV_1_genstat_Gr_PV_Bellevue_1': {'Q': 0.0, 'EXNAME': 'Bellevue_22kV_1_66.0KV', 'NAME': 'PV_Bellevue_1', 'NUMBER': 8, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Bellevue_1', 'PMAX': 0.5}, 'Combo_22kV_2_genstat_Gr_PV_Combo_2': {'Q': 0.0, 'EXNAME': 'Combo_22kV_2_66.0KV', 'NAME': 'PV_Combo_2', 'NUMBER': 29, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Combo_2', 'PMAX': 0.5}, 'Ebene_22kV_3_genstat_Gr_PV_Ebene_3': {'Q': 0.0, 'EXNAME': 'Ebene_22kV_3_66.0KV', 'NAME': 'PV_Ebene_3', 'NUMBER': 35, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Ebene_3', 'PMAX': 0.5}, 'FGPS_Ugen4_syn_Gr_FGPS_G4': {'Q': 0.0, 'EXNAME': 'FGPS_Ugen4_66.0KV', 'NAME': 'FGPS_G4', 'NUMBER': 40, 'QMAX': 22.44000244140625, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -18.700000762939453, 'ID': 'FGPS_G4', 'PMAX': 21.0}, 'Jin_Fei_22kV_2_genstat_Gr_PV_Jin_Fei_1': {'Q': 0.0, 'EXNAME': 'Jin_Fei_22kV_2_66.0KV', 'NAME': 'PV_Jin_Fei_1', 'NUMBER': 70, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Jin_Fei_1', 'PMAX': 0.5}, 'NIPS_G2_Ugen_syn_Gr_NIPS_G2': {'Q': 0.0, 'EXNAME': 'NIPS_G2_Ugen_66.0KV', 'NAME': 'NIPS_G2', 'NUMBER': 86, 'QMAX': 17.025001525878906, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -12.201250076293945, 'ID': 'NIPS_G2', 'PMAX': 22.700000762939453}, 'Nicolay_22kV_2_genstat_Gr_PV_Nicolay_2': {'Q': 0.0, 'EXNAME': 'Nicolay_22kV_2_66.0KV', 'NAME': 'PV_Nicolay_2', 'NUMBER': 89, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Nicolay_2', 'PMAX': 0.5}, 'Wooton_22kV_1_genstat_Gr_PV_Wooton_2': {'Q': 0.0, 'EXNAME': 'Wooton_22kV_1_66.0KV', 'NAME': 'PV_Wooton_2', 'NUMBER': 121, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Wooton_2', 'PMAX': 0.5}, 'Jin_Fei_22kV_1_genstat_Gr_PV_Jin_Fei_2': {'Q': 0.0, 'EXNAME': 'Jin_Fei_22kV_1_66.0KV', 'NAME': 'PV_Jin_Fei_2', 'NUMBER': 69, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Jin_Fei_2', 'PMAX': 0.5}, 'Fuel_G1_Ugen_syn_Gr_IPP_Fuel_G1': {'Q': 0.0, 'EXNAME': 'Fuel_G1_Ugen_66.0KV', 'NAME': 'IPP_Fuel_G1', 'NUMBER': 59, 'QMAX': 16.275001525878906, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -12.748749732971191, 'ID': 'IPP_Fuel_G1', 'PMAX': 13.5}, 'LeVal_G1_Ugen_genstat_Gr_RoR_LeVal_G1': {'Q': 0.0, 'EXNAME': 'LeVal_G1_Ugen_66.0KV', 'NAME': 'RoR_LeVal_G1', 'NUMBER': 77, 'QMAX': 1.5, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -1.0750000476837158, 'ID': 'RoR_LeVal_G1', 'PMAX': 2.0}, 'StLouis_22kV_2_genstat_Gr_PV_StLouis_2': {'Q': 0.0, 'EXNAME': 'StLouis_22kV_2_66.0KV', 'NAME': 'PV_StLouis_2', 'NUMBER': 97, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_StLouis_2', 'PMAX': 0.5}, 'TourKoening_22kV_1_genstat_Gr_PV_TourKoening_1': {'Q': 0.0, 'EXNAME': 'TourKoening_22kV_1_66.0KV', 'NAME': 'PV_TourKoening_1', 'NUMBER': 115, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_TourKoening_1', 'PMAX': 0.5}, 'StLouis_Ugen_10_syn_Gr_SLPS_G10': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_10_66.0KV', 'NAME': 'SLPS_G10', 'NUMBER': 99, 'QMAX': 12.898200035095215, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -9.2437105178833, 'ID': 'SLPS_G10', 'PMAX': 17.197599411010742}, 'LaChaumiere_22kV_2_genstat_Gr_PV_LaChaumiere_2': {'Q': 0.0, 'EXNAME': 'LaChaumiere_22kV_2_66.0KV', 'NAME': 'PV_LaChaumiere_2', 'NUMBER': 73, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_LaChaumiere_2', 'PMAX': 0.5}, 'FGPS_Ugen5_syn_Gr_FGPS_G5': {'Q': 0.0, 'EXNAME': 'FGPS_Ugen5_66.0KV', 'NAME': 'FGPS_G5', 'NUMBER': 41, 'QMAX': 22.44000244140625, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -18.700000762939453, 'ID': 'FGPS_G5', 'PMAX': 21.0}, 'Bellevue_22kV_2_genstat_Gr_PV_Bellevue_2': {'Q': 0.0, 'EXNAME': 'Bellevue_22kV_2_66.0KV', 'NAME': 'PV_Bellevue_2', 'NUMBER': 9, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Bellevue_2', 'PMAX': 0.5}, 'Nicolay_22kV_1_genstat_Gr_PV_Nicolay_1': {'Q': 0.0, 'EXNAME': 'Nicolay_22kV_1_66.0KV', 'NAME': 'PV_Nicolay_1', 'NUMBER': 88, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Nicolay_1', 'PMAX': 0.5}, 'Wooton_22kV_2_genstat_Gr_PV_Wooton_1': {'Q': 0.0, 'EXNAME': 'Wooton_22kV_2_66.0KV', 'NAME': 'PV_Wooton_1', 'NUMBER': 122, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Wooton_1', 'PMAX': 0.5}, 'Sottise_22kV_2_genstat_Gr_PV_Sottise_2': {'Q': 0.0, 'EXNAME': 'Sottise_22kV_2_66.0KV', 'NAME': 'PV_Sottise_2', 'NUMBER': 94, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Sottise_2', 'PMAX': 0.5}, 'StLouis_Ugen_13_syn_Gr_SLPS_G13': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_13_66.0KV', 'NAME': 'SLPS_G13', 'NUMBER': 102, 'QMAX': 12.898200035095215, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -9.2437105178833, 'ID': 'SLPS_G13', 'PMAX': 17.197599411010742}, 'Ferney_G2_Ugen_genstat_Gr_HighDam_Ferney_G2': {'Q': 0.0, 'EXNAME': 'Ferney_G2_Ugen_66.0KV', 'NAME': 'HighDam_Ferney_G2', 'NUMBER': 52, 'QMAX': 3.2875001430511475, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -2.6875, 'ID': 'HighDam_Ferney_G2', 'PMAX': 5.3125}, 'Ferney_G1_Ugen_genstat_Gr_HighDam_Ferney_G1': {'Q': 0.0, 'EXNAME': 'Ferney_G1_Ugen_66.0KV', 'NAME': 'HighDam_Ferney_G1', 'NUMBER': 51, 'QMAX': 3.2875001430511475, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -2.6875, 'ID': 'HighDam_Ferney_G1', 'PMAX': 5.3125}, 'Champagne_G2_Ugen_genstat_Gr_HighDam_Champagne_G2': {'Q': 0.0, 'EXNAME': 'Champagne_G2_Ugen_66.0KV', 'NAME': 'HighDam_Champagne_G2', 'NUMBER': 27, 'QMAX': 10.200000762939453, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -7.309999942779541, 'ID': 'HighDam_Champagne_G2', 'PMAX': 13.600000381469727}, 'PlaineDesRochesPowerStation_22kV_genstat_Gr_EOL_PlaindesRoches': {'Q': 0.0, 'EXNAME': 'PlaineDesRochesPowerStation_22kV_66.0KV', 'NAME': 'EOL_PlaindesRoches', 'NUMBER': 90, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'EOL_PlaindesRoches', 'PMAX': 9.399999618530273}, 'FVPS_22kV_2_genstat_Gr_PV_FVPS_2': {'Q': 0.0, 'EXNAME': 'FVPS_22kV_2_66.0KV', 'NAME': 'PV_FVPS_2', 'NUMBER': 43, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_FVPS_2', 'PMAX': 0.5}, 'Terminal_6__syn_Gr_FVPS_G6': {'Q': 0.0, 'EXNAME': 'Terminal_6__66.0KV', 'NAME': 'FVPS_G6', 'NUMBER': 113, 'QMAX': 9.894586563110352, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -8.088730812072754, 'ID': 'FVPS_G6', 'PMAX': 15.989350318908691}, 'Ebene_22kV_2_genstat_Gr_PV_Ebene_2': {'Q': 0.0, 'EXNAME': 'Ebene_22kV_2_66.0KV', 'NAME': 'PV_Ebene_2', 'NUMBER': 34, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Ebene_2', 'PMAX': 0.5}, 'LaChaumiere_22kV_1_genstat_Gr_PV_LaChaumiere_1': {'Q': 0.0, 'EXNAME': 'LaChaumiere_22kV_1_66.0KV', 'NAME': 'PV_LaChaumiere_1', 'NUMBER': 72, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_LaChaumiere_1', 'PMAX': 0.5}, 'Amaury_22kV_2_genstat_Gr_PV_PetiteRetraite': {'Q': 0.0, 'EXNAME': 'Amaury_22kV_2_66.0KV', 'NAME': 'PV_PetiteRetraite', 'NUMBER': 1, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_PetiteRetraite', 'PMAX': 2.0}, 'Magenta_G1_Ugen_genstat_Gr_RoR_Magenta': {'Q': 0.0, 'EXNAME': 'Magenta_G1_Ugen_66.0KV', 'NAME': 'RoR_Magenta', 'NUMBER': 79, 'QMAX': 0.6000000238418579, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.4300000071525574, 'ID': 'RoR_Magenta', 'PMAX': 0.800000011920929}, 'Terminal_2__syn_Gr_FVPS_G1': {'Q': 0.0, 'EXNAME': 'Terminal_2__66.0KV', 'NAME': 'FVPS_G1', 'NUMBER': 109, 'QMAX': 9.460636138916016, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -7.733980178833008, 'ID': 'FVPS_G1', 'PMAX': 15.288100242614746}, 'StLouis_Ugen_7_syn_Gr_SLPS_G7': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_7_66.0KV', 'NAME': 'SLPS_G7', 'NUMBER': 103, 'QMAX': 6.578999996185303, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -6.578999996185303, 'ID': 'SLPS_G7', 'PMAX': 13.770000457763672}, 'Beauchamp_G1_Ugen_syn_Gr_IPP_Beauchamp_G1': {'Q': 0.0, 'EXNAME': 'Beauchamp_G1_Ugen_66.0KV', 'NAME': 'IPP_Beauchamp_G1', 'NUMBER': 7, 'QMAX': 18.479999542236328, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -13.243999481201172, 'ID': 'IPP_Beauchamp_G1', 'PMAX': 22.0}, 'Terminal_3__syn_Gr_FVPS_G3': {'Q': 0.0, 'EXNAME': 'Terminal_3__66.0KV', 'NAME': 'FVPS_G3', 'NUMBER': 110, 'QMAX': 9.894586563110352, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -8.088730812072754, 'ID': 'FVPS_G3', 'PMAX': 15.989350318908691}, 'Tamarind_G1_Ugen_genstat_Gr_RoR_Tamarind': {'Q': 0.0, 'EXNAME': 'Tamarind_G1_Ugen_66.0KV', 'NAME': 'RoR_Tamarind', 'NUMBER': 106, 'QMAX': 3.2160003185272217, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -2.304800033569336, 'ID': 'RoR_Tamarind', 'PMAX': 4.288000106811523}, 'Terminal_4__syn_Gr_FVPS_G4': {'Q': 0.0, 'EXNAME': 'Terminal_4__66.0KV', 'NAME': 'FVPS_G4', 'NUMBER': 111, 'QMAX': 9.894586563110352, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -8.088730812072754, 'ID': 'FVPS_G4', 'PMAX': 15.989350318908691}, 'Amaury_22kV_1_genstat_Gr_PV_Amaury_1': {'Q': 0.0, 'EXNAME': 'Amaury_22kV_1_66.0KV', 'NAME': 'PV_Amaury_1', 'NUMBER': 0, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Amaury_1', 'PMAX': 0.5}, 'UnionVale_22kV_2_genstat_Gr_PV_UnionVale_2': {'Q': 0.0, 'EXNAME': 'UnionVale_22kV_2_66.0KV', 'NAME': 'PV_UnionVale_2', 'NUMBER': 119, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_UnionVale_2', 'PMAX': 0.5}, 'FortGeorge_22kV_2_genstat_Gr_PV_FortGeorge_2': {'Q': 0.0, 'EXNAME': 'FortGeorge_22kV_2_66.0KV', 'NAME': 'PV_FortGeorge_2', 'NUMBER': 54, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_FortGeorge_2', 'PMAX': 0.5}, 'Terminal_5__syn_Gr_FVPS_G2': {'Q': 0.0, 'EXNAME': 'Terminal_5__66.0KV', 'NAME': 'FVPS_G2', 'NUMBER': 112, 'QMAX': 9.460636138916016, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -7.733980178833008, 'ID': 'FVPS_G2', 'PMAX': 15.288100242614746}, 'Henrietta_22kV_1_genstat_Gr_PV_Henrietta_1': {'Q': 0.0, 'EXNAME': 'Henrietta_22kV_1_66.0KV', 'NAME': 'PV_Henrietta_1', 'NUMBER': 62, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Henrietta_1', 'PMAX': 0.5}, 'StLouis_Ugen_12_syn_Gr_SLPS_G12': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_12_66.0KV', 'NAME': 'SLPS_G12', 'NUMBER': 101, 'QMAX': 12.898200035095215, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -9.2437105178833, 'ID': 'SLPS_G12', 'PMAX': 17.197599411010742}, 'Curepipe_22kV_genstat_Gr_EOL_PlaineSophie': {'Q': 0.0, 'EXNAME': 'Curepipe_22kV_66.0KV', 'NAME': 'EOL_PlaineSophie', 'NUMBER': 31, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'EOL_PlaineSophie', 'PMAX': 30.0}, 'Medine_G2_Ugen_syn_Gr_IPP_Medine_G2': {'Q': 0.0, 'EXNAME': 'Medine_G2_Ugen_66.0KV', 'NAME': 'IPP_Medine_G2', 'NUMBER': 83, 'QMAX': 9.15000057220459, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -6.557499885559082, 'ID': 'IPP_Medine_G2', 'PMAX': 11.0}, 'Fuel_22kV_1_genstat_Gr_PV_Fuel_1': {'Q': 0.0, 'EXNAME': 'Fuel_22kV_1_66.0KV', 'NAME': 'PV_Fuel_1', 'NUMBER': 56, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Fuel_1', 'PMAX': 0.5}, 'CTSAV_G1_Ugen_syn_Gr_IPP_CTSAV_G1': {'Q': 0.0, 'EXNAME': 'CTSAV_G1_Ugen_66.0KV', 'NAME': 'IPP_CTSAV_G1', 'NUMBER': 16, 'QMAX': 39.60000228881836, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -25.80000114440918, 'ID': 'IPP_CTSAV_G1', 'PMAX': 37.0}, 'Terminal_syn_Gr_FVPS_G11_MAN': {'Q': 0.0, 'EXNAME': 'Terminal_66.0KV', 'NAME': 'FVPS_G11_MAN', 'NUMBER': 107, 'QMAX': 7.390200614929199, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -5.2963104248046875, 'ID': 'FVPS_G11_MAN', 'PMAX': 8.0}, 'CTSAV_G2_Ugen_syn_Gr_IPP_CTSAV_G2': {'Q': 0.0, 'EXNAME': 'CTSAV_G2_Ugen_66.0KV', 'NAME': 'IPP_CTSAV_G2', 'NUMBER': 18, 'QMAX': 39.60000228881836, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -25.80000114440918, 'ID': 'IPP_CTSAV_G2', 'PMAX': 37.0}, 'Ferney_22kV_genstat_Gr_PV_Ferney_1': {'Q': 0.0, 'EXNAME': 'Ferney_22kV_66.0KV', 'NAME': 'PV_Ferney_1', 'NUMBER': 50, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Ferney_1', 'PMAX': 0.5}, 'Anahita_22kV_1_genstat_Gr_PV_Anahita_1': {'Q': 0.0, 'EXNAME': 'Anahita_22kV_1_66.0KV', 'NAME': 'PV_Anahita_1', 'NUMBER': 3, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Anahita_1', 'PMAX': 0.5}, 'Medine_G1_Ugen_syn_Gr_IPP_Medine_G1': {'Q': 0.0, 'EXNAME': 'Medine_G1_Ugen_66.0KV', 'NAME': 'IPP_Medine_G1', 'NUMBER': 82, 'QMAX': 12.5, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -12.5, 'ID': 'IPP_Medine_G1', 'PMAX': 10.0}, 'CaseNoyale_22kV_2_genstat_Gr_PV_CaseNoyale_2': {'Q': 0.0, 'EXNAME': 'CaseNoyale_22kV_2_66.0KV', 'NAME': 'PV_CaseNoyale_2', 'NUMBER': 20, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_CaseNoyale_2', 'PMAX': 0.5}, 'NIPS_G1_Ugen_syn_Gr_NIPS_G1': {'Q': 0.0, 'EXNAME': 'NIPS_G1_Ugen_66.0KV', 'NAME': 'NIPS_G1', 'NUMBER': 85, 'QMAX': 16.356000900268555, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -11.721799850463867, 'ID': 'NIPS_G1', 'PMAX': 21.808000564575195}, 'Anahita_22kV_2_genstat_Gr_PV_Anahita_2': {'Q': 0.0, 'EXNAME': 'Anahita_22kV_2_66.0KV', 'NAME': 'PV_Anahita_2', 'NUMBER': 4, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Anahita_2', 'PMAX': 0.5}, 'Bellevue_G1_Ugen_syn_Gr_IPP_Bellevue_G1': {'Q': 0.0, 'EXNAME': 'Bellevue_G1_Ugen_66.0KV', 'NAME': 'IPP_Bellevue_G1', 'NUMBER': 11, 'QMAX': 26.700000762939453, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -20.91499900817871, 'ID': 'IPP_Bellevue_G1', 'PMAX': 31.0}}
+LoadDico = {'Combo_22kV_2_Lo1': {'EXNAME': 'Combo_22kV_2_22.0KV', 'NAME': 'Combo_Load_2', 'NUMBER': 29, 'Q': 2.3155798440790565, 'P': 7.045000076293945, 'ID': 1}, 'CaseNoyale_22kV_2_Lo1': {'EXNAME': 'CaseNoyale_22kV_2_22.0KV', 'NAME': 'CaseNoyale_Load_2', 'NUMBER': 20, 'Q': 2.3155798440790565, 'P': 7.045000076293945, 'ID': 1}, 'Amaury_22kV_1_Lo1': {'EXNAME': 'Amaury_22kV_1_22.0KV', 'NAME': 'Amaury_Load_1', 'NUMBER': 0, 'Q': 2.4815653761717926, 'P': 7.550000190734863, 'ID': 1}, 'FVPS_22kV_1_Lo1': {'EXNAME': 'FVPS_22kV_1_22.0KV', 'NAME': 'FortVictoria_Load_1', 'NUMBER': 42, 'Q': 4.999285895721721, 'P': 15.210000038146973, 'ID': 1}, 'Nicolay_22kV_1_Lo1': {'EXNAME': 'Nicolay_22kV_1_22.0KV', 'NAME': 'Nicolay_Load_1', 'NUMBER': 88, 'Q': 4.830013446924353, 'P': 14.694999694824219, 'ID': 1}, 'FVPS_22kV_2_Lo1': {'EXNAME': 'FVPS_22kV_2_22.0KV', 'NAME': 'FortVictoria_Load_2', 'NUMBER': 43, 'Q': 4.999285895721721, 'P': 15.210000038146973, 'ID': 1}, 'Anahita_22kV_1_Lo1': {'EXNAME': 'Anahita_22kV_1_22.0KV', 'NAME': 'Anahita_Load_1', 'NUMBER': 3, 'Q': 1.7370967871121035, 'P': 5.284999847412109, 'ID': 1}, 'Henrietta_22kV_2_Lo1': {'EXNAME': 'Henrietta_22kV_2_22.0KV', 'NAME': 'Henrietta_Load_2', 'NUMBER': 63, 'Q': 3.972147934844134, 'P': 12.085000038146973, 'ID': 1}, 'StLouis_22kV_2_Lo1': {'EXNAME': 'StLouis_22kV_2_22.0KV', 'NAME': 'StLouis_Load_2', 'NUMBER': 97, 'Q': 4.432305615934249, 'P': 13.484999656677246, 'ID': 1}, 'Nicolay_22kV_2_Lo1': {'EXNAME': 'Nicolay_22kV_2_22.0KV', 'NAME': 'Nicolay_Load_2', 'NUMBER': 89, 'Q': 4.830013446924353, 'P': 14.694999694824219, 'ID': 1}, 'LaChaumiere_22kV_1_Lo1': {'EXNAME': 'LaChaumiere_22kV_1_22.0KV', 'NAME': 'LaChaumiere_Load_1', 'NUMBER': 72, 'Q': 5.355908208276737, 'P': 16.295000076293945, 'ID': 1}, 'Sottise_22kV_1_Lo1': {'EXNAME': 'Sottise_22kV_1_22.0KV', 'NAME': 'Sottise_Load_1', 'NUMBER': 93, 'Q': 4.217017587102438, 'P': 12.829999923706055, 'ID': 1}, 'Fuel_22kV_2_Lo1': {'EXNAME': 'Fuel_22kV_2_22.0KV', 'NAME': 'Fuel_Load_2', 'NUMBER': 57, 'Q': 3.6845493057984093, 'P': 11.210000038146973, 'ID': 1}, 'StLouis_22kV_1_Lo1': {'EXNAME': 'StLouis_22kV_1_22.0KV', 'NAME': 'StLouis_Load_1', 'NUMBER': 96, 'Q': 4.432305615934249, 'P': 13.484999656677246, 'ID': 1}, 'Jin_Fei_22kV_2_Lo1': {'EXNAME': 'Jin_Fei_22kV_2_22.0KV', 'NAME': 'Jin_Fei_Load_2', 'NUMBER': 70, 'Q': 2.0838575451816834, 'P': 6.340000152587891, 'ID': 1}, 'UnionVale_22kV_1_Lo1': {'EXNAME': 'UnionVale_22kV_1_22.0KV', 'NAME': 'UnionVale_Load_1', 'NUMBER': 118, 'Q': 3.83081365112094, 'P': 11.654999732971191, 'ID': 1}, 'Bellevue_22kV_1_Lo1': {'EXNAME': 'Bellevue_22kV_1_22.0KV', 'NAME': 'Bellevue_Load_1', 'NUMBER': 8, 'Q': 4.631159688158113, 'P': 14.09000015258789, 'ID': 1}, 'FVPS_22kV_3_Lo1': {'EXNAME': 'FVPS_22kV_3_22.0KV', 'NAME': 'FortVictoria_Load_3', 'NUMBER': 44, 'Q': 4.999285895721721, 'P': 15.210000038146973, 'ID': 1}, 'FortGeorge_22kV_1_Lo1': {'EXNAME': 'FortGeorge_22kV_1_22.0KV', 'NAME': 'FortGeorge_Load_1', 'NUMBER': 53, 'Q': 4.41587165932631, 'P': 13.4350004196167, 'ID': 1}, 'Wooton_22kV_2_Lo1': {'EXNAME': 'Wooton_22kV_2_22.0KV', 'NAME': 'Wooton_Load_2', 'NUMBER': 122, 'Q': 6.701869566521236, 'P': 20.389999389648438, 'ID': 1}, 'Ebene_22kV_2_Lo1': {'EXNAME': 'Ebene_22kV_2_22.0KV', 'NAME': 'Ebene_Load_2', 'NUMBER': 34, 'Q': 6.284437131607226, 'P': 19.1200008392334, 'ID': 1}, 'Amaury_22kV_2_Lo1': {'EXNAME': 'Amaury_22kV_2_22.0KV', 'NAME': 'Amaury_Load_2', 'NUMBER': 1, 'Q': 2.4815653761717926, 'P': 7.550000190734863, 'ID': 1}, 'LaChaumiere_22kV_2_Lo1': {'EXNAME': 'LaChaumiere_22kV_2_22.0KV', 'NAME': 'LaChaumiere_Load_2', 'NUMBER': 73, 'Q': 5.355908208276737, 'P': 16.295000076293945, 'ID': 1}, 'Sottise_22kV_2_Lo1': {'EXNAME': 'Sottise_22kV_2_22.0KV', 'NAME': 'Sottise_Load_2', 'NUMBER': 94, 'Q': 4.217017587102438, 'P': 12.829999923706055, 'ID': 1}, 'Fuel_22kV_1_Lo1': {'EXNAME': 'Fuel_22kV_1_22.0KV', 'NAME': 'Fuel_Load_1', 'NUMBER': 56, 'Q': 3.6845493057984093, 'P': 11.210000038146973, 'ID': 1}, 'TourKoening_22kV_2_Lo1': {'EXNAME': 'TourKoening_22kV_2_22.0KV', 'NAME': 'TourKoening_Load_2', 'NUMBER': 116, 'Q': 2.976233140523389, 'P': 9.055000305175781, 'ID': 1}, 'Henrietta_22kV_1_Lo1': {'EXNAME': 'Henrietta_22kV_1_22.0KV', 'NAME': 'Henrietta_Load_1', 'NUMBER': 62, 'Q': 3.972147934844134, 'P': 12.085000038146973, 'ID': 1}, 'Anahita_22kV_2_Lo1': {'EXNAME': 'Anahita_22kV_2_22.0KV', 'NAME': 'Anahita_Load_2', 'NUMBER': 4, 'Q': 1.7370967871121035, 'P': 5.284999847412109, 'ID': 1}, 'TourKoening_22kV_1_Lo1': {'EXNAME': 'TourKoening_22kV_1_22.0KV', 'NAME': 'TourKoening_Load_1', 'NUMBER': 115, 'Q': 2.976233140523389, 'P': 9.055000305175781, 'ID': 1}, 'UnionVale_22kV_2_Lo1': {'EXNAME': 'UnionVale_22kV_2_22.0KV', 'NAME': 'UnionVale_Load_2', 'NUMBER': 119, 'Q': 3.83081365112094, 'P': 11.654999732971191, 'ID': 1}, 'Bellevue_22kV_2_Lo1': {'EXNAME': 'Bellevue_22kV_2_22.0KV', 'NAME': 'Bellevue_Load_2', 'NUMBER': 9, 'Q': 4.631159688158113, 'P': 14.09000015258789, 'ID': 1}, 'Ebene_22kV_3_Lo1': {'EXNAME': 'Ebene_22kV_3_22.0KV', 'NAME': 'Ebene_Load_3', 'NUMBER': 35, 'Q': 6.284437131607226, 'P': 19.1200008392334, 'ID': 1}, 'Jin_Fei_22kV_1_Lo1': {'EXNAME': 'Jin_Fei_22kV_1_22.0KV', 'NAME': 'Jin_Fei_Load_1', 'NUMBER': 69, 'Q': 2.0838575451816834, 'P': 6.340000152587891, 'ID': 1}, 'FortGeorge_22kV_2_Lo1': {'EXNAME': 'FortGeorge_22kV_2_22.0KV', 'NAME': 'FortGeorge_Load_2', 'NUMBER': 54, 'Q': 4.41587165932631, 'P': 13.4350004196167, 'ID': 1}, 'Ferney_22kV_Lo1': {'EXNAME': 'Ferney_22kV_22.0KV', 'NAME': 'Ferney_Load_1', 'NUMBER': 50, 'Q': 1.4462093496179527, 'P': 4.400000095367432, 'ID': 1}, 'Ebene_22kV_1_Lo1': {'EXNAME': 'Ebene_22kV_1_22.0KV', 'NAME': 'Ebene_Load_1', 'NUMBER': 33, 'Q': 6.284437131607226, 'P': 19.1200008392334, 'ID': 1}, 'CaseNoyale_22kV_1_Lo1': {'EXNAME': 'CaseNoyale_22kV_1_22.0KV', 'NAME': 'CaseNoyale_Load_1', 'NUMBER': 19, 'Q': 2.3155798440790565, 'P': 7.045000076293945, 'ID': 1}, 'Combo_22kV_1_Lo1': {'EXNAME': 'Combo_22kV_1_22.0KV', 'NAME': 'Combo_Load_1', 'NUMBER': 28, 'Q': 2.3155798440790565, 'P': 7.045000076293945, 'ID': 1}, 'Wooton_22kV_1_Lo1': {'EXNAME': 'Wooton_22kV_1_22.0KV', 'NAME': 'Wooton_Load_1', 'NUMBER': 121, 'Q': 6.701869566521236, 'P': 20.389999389648438, 'ID': 1}}
+LineDico = {'Medine_22kV_2_Henrietta_22kV_1_22kV_Henrietta_Medine_22kV_Li': {'TONAME': 'Henrietta_22kV_1', 'FROMNUMBER': 81, 'FROMEXNAME': 'Medine_22kV_2_22.0', 'FROMNAME': 'Medine_22kV_2', 'TOEXNAME': 'Henrietta_22kV_1_22.0', 'TONUMBER': 62, 'ID': '22kV_Henrietta_Medine_22kV'}, 'Terminal_1__FVPS_Ugen_1_Line11kV_1__Li': {'TONAME': 'FVPS_Ugen_1', 'FROMNUMBER': 108, 'FROMEXNAME': 'Terminal_1__11.0', 'FROMNAME': 'Terminal_1_', 'TOEXNAME': 'FVPS_Ugen_1_11.0', 'TONUMBER': 46, 'ID': 'Line11kV(1)'}, 'Ferney_22kV_Champagne_22kV_22kV_Champagne_Ferney_Li': {'TONAME': 'Champagne_22kV', 'FROMNUMBER': 50, 'FROMEXNAME': 'Ferney_22kV_22.0', 'FROMNAME': 'Ferney_22kV', 'TOEXNAME': 'Champagne_22kV_22.0', 'TONUMBER': 24, 'ID': '22kV_Champagne_Ferney'}, 'Dumas_66kV_Bellevue_66kV_66kV_Dumas_Bellevue_Li': {'TONAME': 'Bellevue_66kV', 'FROMNUMBER': 32, 'FROMEXNAME': 'Dumas_66kV_66.0', 'FROMNAME': 'Dumas_66kV', 'TOEXNAME': 'Bellevue_66kV_66.0', 'TONUMBER': 10, 'ID': '66kV_Dumas_Bellevue'}, 'LeVal_22kV_Wooton_22kV_2_22kV_Wooton_LeVal_Li': {'TONAME': 'Wooton_22kV_2', 'FROMNUMBER': 76, 'FROMEXNAME': 'LeVal_22kV_22.0', 'FROMNAME': 'LeVal_22kV', 'TOEXNAME': 'Wooton_22kV_2_22.0', 'TONUMBER': 122, 'ID': '22kV_Wooton_LeVal'}, 'CaseNoyale_66kV_Henrietta_66kV_66kV_Henrietta_CaseNoyale_Li': {'TONAME': 'Henrietta_66kV', 'FROMNUMBER': 21, 'FROMEXNAME': 'CaseNoyale_66kV_66.0', 'FROMNAME': 'CaseNoyale_66kV', 'TOEXNAME': 'Henrietta_66kV_66.0', 'TONUMBER': 64, 'ID': '66kV_Henrietta_CaseNoyale'}, 'StLouis_66kV_Dumas_66kV_66kV_Dumas_StLouis_2_Li': {'TONAME': 'Dumas_66kV', 'FROMNUMBER': 98, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'Dumas_66kV_66.0', 'TONUMBER': 32, 'ID': '66kV_Dumas_StLouis_2'}, 'Terminal_6__FVPS_Ugen_4_Line11kV_6__Li': {'TONAME': 'FVPS_Ugen_4', 'FROMNUMBER': 113, 'FROMEXNAME': 'Terminal_6__11.0', 'FROMNAME': 'Terminal_6_', 'TOEXNAME': 'FVPS_Ugen_4_11.0', 'TONUMBER': 49, 'ID': 'Line11kV(6)'}, 'Amaury_66kV_Bellevue_66kV_66kV_Amaury_Bellevue_1_Li': {'TONAME': 'Bellevue_66kV', 'FROMNUMBER': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'TOEXNAME': 'Bellevue_66kV_66.0', 'TONUMBER': 10, 'ID': '66kV_Amaury_Bellevue_1'}, 'Dumas_66kV_FortGeorge_66kV_66kV_FortGeorge_Dumas_1_Li': {'TONAME': 'FortGeorge_66kV', 'FROMNUMBER': 32, 'FROMEXNAME': 'Dumas_66kV_66.0', 'FROMNAME': 'Dumas_66kV', 'TOEXNAME': 'FortGeorge_66kV_66.0', 'TONUMBER': 55, 'ID': '66kV_FortGeorge_Dumas_1'}, 'Amaury_66kV_Fuel_66kV_66kV_Amaury_Fuel_1_Li': {'TONAME': 'Fuel_66kV', 'FROMNUMBER': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'TOEXNAME': 'Fuel_66kV_66.0', 'TONUMBER': 58, 'ID': '66kV_Amaury_Fuel_1'}, 'Champagne_66kV_Wooton_66kV_66kV_Champagne_Wooton_2_Li': {'TONAME': 'Wooton_66kV', 'FROMNUMBER': 25, 'FROMEXNAME': 'Champagne_66kV_66.0', 'FROMNAME': 'Champagne_66kV', 'TOEXNAME': 'Wooton_66kV_66.0', 'TONUMBER': 123, 'ID': '66kV_Champagne_Wooton_2'}, 'Wooton_66kV_Ebene_66kV_66kV_Ebene_Wooton_2_Li': {'TONAME': 'Ebene_66kV', 'FROMNUMBER': 123, 'FROMEXNAME': 'Wooton_66kV_66.0', 'FROMNAME': 'Wooton_66kV', 'TOEXNAME': 'Ebene_66kV_66.0', 'TONUMBER': 36, 'ID': '66kV_Ebene_Wooton_2'}, 'StLouis_66kV_FVPS_66kV_66kV_SL_FVPS_Cable2_Li': {'TONAME': 'FVPS_66kV', 'FROMNUMBER': 98, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'FVPS_66kV_66.0', 'TONUMBER': 45, 'ID': '66kV_SL_FVPS_Cable2'}, 'Terminal_2__FVPS_Ugen_2_Line11kV_2__Li': {'TONAME': 'FVPS_Ugen_2', 'FROMNUMBER': 109, 'FROMEXNAME': 'Terminal_2__11.0', 'FROMNAME': 'Terminal_2_', 'TOEXNAME': 'FVPS_Ugen_2_11.0', 'TONUMBER': 47, 'ID': 'Line11kV(2)'}, 'Ebene_66kV_StLouis_66kV_66kV_StLouis_Ebene_1_Li': {'TONAME': 'StLouis_66kV', 'FROMNUMBER': 36, 'FROMEXNAME': 'Ebene_66kV_66.0', 'FROMNAME': 'Ebene_66kV', 'TOEXNAME': 'StLouis_66kV_66.0', 'TONUMBER': 98, 'ID': '66kV_StLouis_Ebene_1'}, 'StLouis_66kV_Dumas_66kV_66kV_Dumas_StLouis_1_Li': {'TONAME': 'Dumas_66kV', 'FROMNUMBER': 98, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'Dumas_66kV_66.0', 'TONUMBER': 32, 'ID': '66kV_Dumas_StLouis_1'}, 'Inter_NI_DU_1_66kV_NIPS_66kV_66kV_Nicolay_Dumas_1_Li': {'TONAME': 'NIPS_66kV', 'FROMNUMBER': 67, 'FROMEXNAME': 'Inter_NI_DU_1_66kV_66.0', 'FROMNAME': 'Inter_NI_DU_1_66kV', 'TOEXNAME': 'NIPS_66kV_66.0', 'TONUMBER': 84, 'ID': '66kV_Nicolay_Dumas_1'}, 'Dumas_66kV_Jin_Fei_66kV_66kV_Dumas_Jin_Fei_Li': {'TONAME': 'Jin_Fei_66kV', 'FROMNUMBER': 32, 'FROMEXNAME': 'Dumas_66kV_66.0', 'FROMNAME': 'Dumas_66kV', 'TOEXNAME': 'Jin_Fei_66kV_66.0', 'TONUMBER': 71, 'ID': '66kV_Dumas_Jin_Fei'}, 'Inter_NI_DU_2_66kV_NIPS_66kV_66kV_Nicolay_Dumas_2_Li': {'TONAME': 'NIPS_66kV', 'FROMNUMBER': 68, 'FROMEXNAME': 'Inter_NI_DU_2_66kV_66.0', 'FROMNAME': 'Inter_NI_DU_2_66kV', 'TOEXNAME': 'NIPS_66kV_66.0', 'TONUMBER': 84, 'ID': '66kV_Nicolay_Dumas_2'}, 'Dumas_66kV_Amaury_66kV_66kV_Dumas_Amaury_Li': {'TONAME': 'Amaury_66kV', 'FROMNUMBER': 32, 'FROMEXNAME': 'Dumas_66kV_66.0', 'FROMNAME': 'Dumas_66kV', 'TOEXNAME': 'Amaury_66kV_66.0', 'TONUMBER': 2, 'ID': '66kV_Dumas_Amaury'}, 'Amaury_66kV_Bellevue_66kV_66kV_Amaury_Bellevue_2_Li': {'TONAME': 'Bellevue_66kV', 'FROMNUMBER': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'TOEXNAME': 'Bellevue_66kV_66.0', 'TONUMBER': 10, 'ID': '66kV_Amaury_Bellevue_2'}, 'Dumas_66kV_Wooton_66kV_66kV_Dumas_Wooton_Li': {'TONAME': 'Wooton_66kV', 'FROMNUMBER': 32, 'FROMEXNAME': 'Dumas_66kV_66.0', 'FROMNAME': 'Dumas_66kV', 'TOEXNAME': 'Wooton_66kV_66.0', 'TONUMBER': 123, 'ID': '66kV_Dumas_Wooton'}, 'Bellevue_66kV_Sottise_66kV_66kV_Bellevue_Sottise_2_Li': {'TONAME': 'Sottise_66kV', 'FROMNUMBER': 10, 'FROMEXNAME': 'Bellevue_66kV_66.0', 'FROMNAME': 'Bellevue_66kV', 'TOEXNAME': 'Sottise_66kV_66.0', 'TONUMBER': 95, 'ID': '66kV_Bellevue_Sottise_2'}, 'Terminal_FVPS_Ugen_1_Line11kV_Li': {'TONAME': 'FVPS_Ugen_1', 'FROMNUMBER': 107, 'FROMEXNAME': 'Terminal_11.0', 'FROMNAME': 'Terminal', 'TOEXNAME': 'FVPS_Ugen_1_11.0', 'TONUMBER': 46, 'ID': 'Line11kV'}, 'Terminal_5__FVPS_Ugen_3_Line11kV_5__Li': {'TONAME': 'FVPS_Ugen_3', 'FROMNUMBER': 112, 'FROMEXNAME': 'Terminal_5__11.0', 'FROMNAME': 'Terminal_5_', 'TOEXNAME': 'FVPS_Ugen_3_11.0', 'TONUMBER': 48, 'ID': 'Line11kV(5)'}, 'UnionVale_66kV_CTSAV_G1_66kV_66kV_CTSAVG1_UnionVale_Li': {'TONAME': 'CTSAV_G1_66kV', 'FROMNUMBER': 120, 'FROMEXNAME': 'UnionVale_66kV_66.0', 'FROMNAME': 'UnionVale_66kV', 'TOEXNAME': 'CTSAV_G1_66kV_66.0', 'TONUMBER': 15, 'ID': '66kV_CTSAVG1_UnionVale'}, 'Medine_22kV_1_LaChaumiere_22kV_1_22kV_LaChaumiere_Medine_22kV_Li': {'TONAME': 'LaChaumiere_22kV_1', 'FROMNUMBER': 80, 'FROMEXNAME': 'Medine_22kV_1_22.0', 'FROMNAME': 'Medine_22kV_1', 'TOEXNAME': 'LaChaumiere_22kV_1_22.0', 'TONUMBER': 72, 'ID': '22kV_LaChaumiere_Medine_22kV'}, 'Combo_66kV_Inter_CN_CO_66kV_66kV_Combo_CaseNoyale_PartOHL_Li': {'TONAME': 'Inter_CN_CO_66kV', 'FROMNUMBER': 30, 'FROMEXNAME': 'Combo_66kV_66.0', 'FROMNAME': 'Combo_66kV', 'TOEXNAME': 'Inter_CN_CO_66kV_66.0', 'TONUMBER': 66, 'ID': '66kV_Combo_CaseNoyale_PartOHL'}, 'LaChaumiere_66kV_StLouis_66kV_66kV_StLouis_LaChaumiere_Li': {'TONAME': 'StLouis_66kV', 'FROMNUMBER': 74, 'FROMEXNAME': 'LaChaumiere_66kV_66.0', 'FROMNAME': 'LaChaumiere_66kV', 'TOEXNAME': 'StLouis_66kV_66.0', 'TONUMBER': 98, 'ID': '66kV_StLouis_LaChaumiere'}, 'Henrietta_66kV_LaChaumiere_66kV_66kV_LaChaumiere_Henrietta_1_Li': {'TONAME': 'LaChaumiere_66kV', 'FROMNUMBER': 64, 'FROMEXNAME': 'Henrietta_66kV_66.0', 'FROMNAME': 'Henrietta_66kV', 'TOEXNAME': 'LaChaumiere_66kV_66.0', 'TONUMBER': 74, 'ID': '66kV_LaChaumiere_Henrietta_1'}, 'Henrietta_66kV_LaChaumiere_66kV_66kV_LaChaumiere_Henrietta_2_Li': {'TONAME': 'LaChaumiere_66kV', 'FROMNUMBER': 64, 'FROMEXNAME': 'Henrietta_66kV_66.0', 'FROMNAME': 'Henrietta_66kV', 'TOEXNAME': 'LaChaumiere_66kV_66.0', 'TONUMBER': 74, 'ID': '66kV_LaChaumiere_Henrietta_2'}, 'StLouis_66kV_FVPS_66kV_66kV_SL_FVPS_Cable3_Li': {'TONAME': 'FVPS_66kV', 'FROMNUMBER': 98, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'FVPS_66kV_66.0', 'TONUMBER': 45, 'ID': '66kV_SL_FVPS_Cable3'}, 'Cecile_22kV_Combo_22kV_2_22kV_Combo_Cecile_Li': {'TONAME': 'Combo_22kV_2', 'FROMNUMBER': 22, 'FROMEXNAME': 'Cecile_22kV_22.0', 'FROMNAME': 'Cecile_22kV', 'TOEXNAME': 'Combo_22kV_2_22.0', 'TONUMBER': 29, 'ID': '22kV_Combo_Cecile'}, 'CTDS_G1_66kV_Combo_66kV_66kV_CTDS_Combo_Li': {'TONAME': 'Combo_66kV', 'FROMNUMBER': 13, 'FROMEXNAME': 'CTDS_G1_66kV_66.0', 'FROMNAME': 'CTDS_G1_66kV', 'TOEXNAME': 'Combo_66kV_66.0', 'TONUMBER': 30, 'ID': '66kV_CTDS_Combo'}, 'Inter_Anahita_Fuel_66kV_Anahita_66kV_66kV_Anahita_Fuel_OHL_Li': {'TONAME': 'Anahita_66kV', 'FROMNUMBER': 65, 'FROMEXNAME': 'Inter_Anahita_Fuel_66kV_66.0', 'FROMNAME': 'Inter_Anahita_Fuel_66kV', 'TOEXNAME': 'Anahita_66kV_66.0', 'TONUMBER': 5, 'ID': '66kV_Anahita_Fuel_OHL'}, 'Terminal_7__FVPS_Ugen_4_Line11kV_7__Li': {'TONAME': 'FVPS_Ugen_4', 'FROMNUMBER': 114, 'FROMEXNAME': 'Terminal_7__11.0', 'FROMNAME': 'Terminal_7_', 'TOEXNAME': 'FVPS_Ugen_4_11.0', 'TONUMBER': 49, 'ID': 'Line11kV(7)'}, 'Henrietta_66kV_Combo_66kV_66kV_Combo_Henrietta_Li': {'TONAME': 'Combo_66kV', 'FROMNUMBER': 64, 'FROMEXNAME': 'Henrietta_66kV_66.0', 'FROMNAME': 'Henrietta_66kV', 'TOEXNAME': 'Combo_66kV_66.0', 'TONUMBER': 30, 'ID': '66kV_Combo_Henrietta'}, 'Dumas_66kV_FortGeorge_66kV_66kV_FortGeorge_Dumas_2_Li': {'TONAME': 'FortGeorge_66kV', 'FROMNUMBER': 32, 'FROMEXNAME': 'Dumas_66kV_66.0', 'FROMNAME': 'Dumas_66kV', 'TOEXNAME': 'FortGeorge_66kV_66.0', 'TONUMBER': 55, 'ID': '66kV_FortGeorge_Dumas_2'}, 'UnionVale_66kV_Champagne_66kV_66kV_UnionVale_Champagne_Li': {'TONAME': 'Champagne_66kV', 'FROMNUMBER': 120, 'FROMEXNAME': 'UnionVale_66kV_66.0', 'FROMNAME': 'UnionVale_66kV', 'TOEXNAME': 'Champagne_66kV_66.0', 'TONUMBER': 25, 'ID': '66kV_UnionVale_Champagne'}, 'Terminal_3__FVPS_Ugen_2_Line11kV_3__Li': {'TONAME': 'FVPS_Ugen_2', 'FROMNUMBER': 110, 'FROMEXNAME': 'Terminal_3__11.0', 'FROMNAME': 'Terminal_3_', 'TOEXNAME': 'FVPS_Ugen_2_11.0', 'TONUMBER': 47, 'ID': 'Line11kV(3)'}, 'Terminal_4__FVPS_Ugen_3_Line11kV_4__Li': {'TONAME': 'FVPS_Ugen_3', 'FROMNUMBER': 111, 'FROMEXNAME': 'Terminal_4__11.0', 'FROMNAME': 'Terminal_4_', 'TOEXNAME': 'FVPS_Ugen_3_11.0', 'TONUMBER': 48, 'ID': 'Line11kV(4)'}, 'Amaury_66kV_Fuel_66kV_66kV_Amaury_Fuel_2_Li': {'TONAME': 'Fuel_66kV', 'FROMNUMBER': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'TOEXNAME': 'Fuel_66kV_66.0', 'TONUMBER': 58, 'ID': '66kV_Amaury_Fuel_2'}, 'Curepipe_22kV_Henrietta_22kV_1_22kV_PlaineSophie_Henrietta_Li': {'TONAME': 'Henrietta_22kV_1', 'FROMNUMBER': 31, 'FROMEXNAME': 'Curepipe_22kV_22.0', 'FROMNAME': 'Curepipe_22kV', 'TOEXNAME': 'Henrietta_22kV_1_22.0', 'TONUMBER': 62, 'ID': '22kV_PlaineSophie_Henrietta'}, 'Jin_Fei_66kV_Bellevue_66kV_66kV_Bellevue_Jin_Fei_Li': {'TONAME': 'Bellevue_66kV', 'FROMNUMBER': 71, 'FROMEXNAME': 'Jin_Fei_66kV_66.0', 'FROMNAME': 'Jin_Fei_66kV', 'TOEXNAME': 'Bellevue_66kV_66.0', 'TONUMBER': 10, 'ID': '66kV_Bellevue_Jin_Fei'}, 'Ebene_66kV_StLouis_66kV_66kV_StLouis_Ebene_2_Li': {'TONAME': 'StLouis_66kV', 'FROMNUMBER': 36, 'FROMEXNAME': 'Ebene_66kV_66.0', 'FROMNAME': 'Ebene_66kV', 'TOEXNAME': 'StLouis_66kV_66.0', 'TONUMBER': 98, 'ID': '66kV_StLouis_Ebene_2'}, 'Fuel_PowerStation_66kV_Fuel_66kV_66kV_FuelPowerStation_Fuel_Li': {'TONAME': 'Fuel_66kV', 'FROMNUMBER': 61, 'FROMEXNAME': 'Fuel_PowerStation_66kV_66.0', 'FROMNAME': 'Fuel_PowerStation_66kV', 'TOEXNAME': 'Fuel_66kV_66.0', 'TONUMBER': 58, 'ID': '66kV_FuelPowerStation_Fuel'}, 'StLouis_66kV_FVPS_66kV_66kV_SL_FVPS_Cable4_Li': {'TONAME': 'FVPS_66kV', 'FROMNUMBER': 98, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'FVPS_66kV_66.0', 'TONUMBER': 45, 'ID': '66kV_SL_FVPS_Cable4'}, 'Champagne_66kV_Wooton_66kV_66kV_Champagne_Wooton_1_Li': {'TONAME': 'Wooton_66kV', 'FROMNUMBER': 25, 'FROMEXNAME': 'Champagne_66kV_66.0', 'FROMNAME': 'Champagne_66kV', 'TOEXNAME': 'Wooton_66kV_66.0', 'TONUMBER': 123, 'ID': '66kV_Champagne_Wooton_1'}, 'TourKoening_66kV_StLouis_66kV_66kV_StLouis_TourKoening_Li': {'TONAME': 'StLouis_66kV', 'FROMNUMBER': 117, 'FROMEXNAME': 'TourKoening_66kV_66.0', 'FROMNAME': 'TourKoening_66kV', 'TOEXNAME': 'StLouis_66kV_66.0', 'TONUMBER': 98, 'ID': '66kV_StLouis_TourKoening'}, 'StLouis_66kV_FVPS_66kV_66kV_SL_FVPS_Cable1_Li': {'TONAME': 'FVPS_66kV', 'FROMNUMBER': 98, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'FVPS_66kV_66.0', 'TONUMBER': 45, 'ID': '66kV_SL_FVPS_Cable1'}, 'UnionVale_66kV_CTSAV_G2_66kV_66kV_CTSAVG2_UnionVale_Li': {'TONAME': 'CTSAV_G2_66kV', 'FROMNUMBER': 120, 'FROMEXNAME': 'UnionVale_66kV_66.0', 'FROMNAME': 'UnionVale_66kV', 'TOEXNAME': 'CTSAV_G2_66kV_66.0', 'TONUMBER': 17, 'ID': '66kV_CTSAVG2_UnionVale'}, 'TourKoening_66kV_LaChaumiere_66kV_66kV_LaChaumiere_TourKoening_Li': {'TONAME': 'LaChaumiere_66kV', 'FROMNUMBER': 117, 'FROMEXNAME': 'TourKoening_66kV_66.0', 'FROMNAME': 'TourKoening_66kV', 'TOEXNAME': 'LaChaumiere_66kV_66.0', 'TONUMBER': 74, 'ID': '66kV_LaChaumiere_TourKoening'}, 'Wooton_66kV_Ebene_66kV_66kV_Ebene_Wooton_1_Li': {'TONAME': 'Ebene_66kV', 'FROMNUMBER': 123, 'FROMEXNAME': 'Wooton_66kV_66.0', 'FROMNAME': 'Wooton_66kV', 'TOEXNAME': 'Ebene_66kV_66.0', 'TONUMBER': 36, 'ID': '66kV_Ebene_Wooton_1'}, 'Combo_66kV_UnionVale_66kV_66kV_UnionVale_Combo_Li': {'TONAME': 'UnionVale_66kV', 'FROMNUMBER': 30, 'FROMEXNAME': 'Combo_66kV_66.0', 'FROMNAME': 'Combo_66kV', 'TOEXNAME': 'UnionVale_66kV_66.0', 'TONUMBER': 120, 'ID': '66kV_UnionVale_Combo'}, 'BeauchampPowerStation_66kV_Anahita_66kV_66kV_Anahita_Beauchamp_Li': {'TONAME': 'Anahita_66kV', 'FROMNUMBER': 6, 'FROMEXNAME': 'BeauchampPowerStation_66kV_66.0', 'FROMNAME': 'BeauchampPowerStation_66kV', 'TOEXNAME': 'Anahita_66kV_66.0', 'TONUMBER': 5, 'ID': '66kV_Anahita_Beauchamp'}, 'Bellevue_66kV_Sottise_66kV_66kV_Bellevue_Sottise_1_Li': {'TONAME': 'Sottise_66kV', 'FROMNUMBER': 10, 'FROMEXNAME': 'Bellevue_66kV_66.0', 'FROMNAME': 'Bellevue_66kV', 'TOEXNAME': 'Sottise_66kV_66.0', 'TONUMBER': 95, 'ID': '66kV_Bellevue_Sottise_1'}, 'Amaury_22kV_1_PlaineDesRochesPowerStation_22kV_22kV_PlaineDesRochesPowerStation_Li': {'TONAME': 'PlaineDesRochesPowerStation_22kV', 'FROMNUMBER': 0, 'FROMEXNAME': 'Amaury_22kV_1_22.0', 'FROMNAME': 'Amaury_22kV_1', 'TOEXNAME': 'PlaineDesRochesPowerStation_22kV_22.0', 'TONUMBER': 90, 'ID': '22kV_PlaineDesRochesPowerStation'}, 'Amaury_66kV_Wooton_66kV_66kV_Wooton_Amaury_Li': {'TONAME': 'Wooton_66kV', 'FROMNUMBER': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'TOEXNAME': 'Wooton_66kV_66.0', 'TONUMBER': 123, 'ID': '66kV_Wooton_Amaury'}, 'Sarako_66kV_LaChaumiere_66kV_66kV_Sarako_LaChaumiere_Li': {'TONAME': 'LaChaumiere_66kV', 'FROMNUMBER': 92, 'FROMEXNAME': 'Sarako_66kV_66.0', 'FROMNAME': 'Sarako_66kV', 'TOEXNAME': 'LaChaumiere_66kV_66.0', 'TONUMBER': 74, 'ID': '66kV_Sarako_LaChaumiere'}, 'Inter_CN_CO_66kV_CaseNoyale_66kV_66kV_Combo_CaseNoyale_PartUGC_Li': {'TONAME': 'CaseNoyale_66kV', 'FROMNUMBER': 66, 'FROMEXNAME': 'Inter_CN_CO_66kV_66.0', 'FROMNAME': 'Inter_CN_CO_66kV', 'TOEXNAME': 'CaseNoyale_66kV_66.0', 'TONUMBER': 21, 'ID': '66kV_Combo_CaseNoyale_PartUGC'}, 'Champagne_66kV_Fuel_66kV_66kV_Champagne_Fuel_Li': {'TONAME': 'Fuel_66kV', 'FROMNUMBER': 25, 'FROMEXNAME': 'Champagne_66kV_66.0', 'FROMNAME': 'Champagne_66kV', 'TOEXNAME': 'Fuel_66kV_66.0', 'TONUMBER': 58, 'ID': '66kV_Champagne_Fuel'}, 'Inter_Anahita_Fuel_66kV_Fuel_66kV_66kV_Anahita_Fuel_UGC_Li': {'TONAME': 'Fuel_66kV', 'FROMNUMBER': 65, 'FROMEXNAME': 'Inter_Anahita_Fuel_66kV_66.0', 'FROMNAME': 'Inter_Anahita_Fuel_66kV', 'TOEXNAME': 'Fuel_66kV_66.0', 'TONUMBER': 58, 'ID': '66kV_Anahita_Fuel_UGC'}}
+TransfoDico = {'NIPS_66kV_Nicolay_22kV_2_Nicolay_TS2_Tr': {'TONAME': 'Nicolay_22kV_2', 'FROMNUMBER': 84, '#WIND': 2, 'FROMEXNAME': 'NIPS_66kV_66.0', 'FROMNAME': 'NIPS_66kV', 'TOEXNAME': 'Nicolay_22kV_222.0', 'TONUMBER': 89, 'ID': 'Nicolay_TS2'}, 'Anahita_66kV_Anahita_22kV_1_Anahita_TS1_Tr': {'TONAME': 'Anahita_22kV_1', 'FROMNUMBER': 5, '#WIND': 2, 'FROMEXNAME': 'Anahita_66kV_66.0', 'FROMNAME': 'Anahita_66kV', 'TOEXNAME': 'Anahita_22kV_122.0', 'TONUMBER': 3, 'ID': 'Anahita_TS1'}, 'Henrietta_66kV_Henrietta_22kV_1_Henrietta_TS1_Tr': {'TONAME': 'Henrietta_22kV_1', 'FROMNUMBER': 64, '#WIND': 2, 'FROMEXNAME': 'Henrietta_66kV_66.0', 'FROMNAME': 'Henrietta_66kV', 'TOEXNAME': 'Henrietta_22kV_122.0', 'TONUMBER': 62, 'ID': 'Henrietta_TS1'}, 'NIPS_66kV_NIPS_G1_Ugen_NIPS_TP1_Tr': {'TONAME': 'NIPS_G1_Ugen', 'FROMNUMBER': 84, '#WIND': 2, 'FROMEXNAME': 'NIPS_66kV_66.0', 'FROMNAME': 'NIPS_66kV', 'TOEXNAME': 'NIPS_G1_Ugen11.0', 'TONUMBER': 85, 'ID': 'NIPS_TP1'}, 'CTSAV_G1_66kV_CTSAV_G1_Ugen_CTSAV_G1_TP_Tr': {'TONAME': 'CTSAV_G1_Ugen', 'FROMNUMBER': 15, '#WIND': 2, 'FROMEXNAME': 'CTSAV_G1_66kV_66.0', 'FROMNAME': 'CTSAV_G1_66kV', 'TOEXNAME': 'CTSAV_G1_Ugen11.0', 'TONUMBER': 16, 'ID': 'CTSAV_G1_TP'}, 'FortGeorge_66kV_FGPS_Ugen1_FGPS_TP1_Tr': {'TONAME': 'FGPS_Ugen1', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'TOEXNAME': 'FGPS_Ugen111.0', 'TONUMBER': 37, 'ID': 'FGPS_TP1'}, 'StLouis_66kV_StLouis_Ugen_12_StLouisG12_TP_Tr': {'TONAME': 'StLouis_Ugen_12', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'StLouis_Ugen_1211.0', 'TONUMBER': 101, 'ID': 'StLouisG12_TP'}, 'Sottise_66kV_Sottise_22kV_2_Sottise_TS2_Tr': {'TONAME': 'Sottise_22kV_2', 'FROMNUMBER': 95, '#WIND': 2, 'FROMEXNAME': 'Sottise_66kV_66.0', 'FROMNAME': 'Sottise_66kV', 'TOEXNAME': 'Sottise_22kV_222.0', 'TONUMBER': 94, 'ID': 'Sottise_TS2'}, 'Medine_22kV_2_Medine_G2_Ugen_Medine_G2_TP_Tr': {'TONAME': 'Medine_G2_Ugen', 'FROMNUMBER': 81, '#WIND': 2, 'FROMEXNAME': 'Medine_22kV_2_22.0', 'FROMNAME': 'Medine_22kV_2', 'TOEXNAME': 'Medine_G2_Ugen6.599999904632568', 'TONUMBER': 83, 'ID': 'Medine_G2_TP'}, 'Sarako_66kV_Sarako_22kV_Sarako_TP_Tr': {'TONAME': 'Sarako_22kV', 'FROMNUMBER': 92, '#WIND': 2, 'FROMEXNAME': 'Sarako_66kV_66.0', 'FROMNAME': 'Sarako_66kV', 'TOEXNAME': 'Sarako_22kV22.0', 'TONUMBER': 91, 'ID': 'Sarako_TP'}, 'FortGeorge_66kV_FortGeorge_22kV_1_FortGeorge_TS1_Tr': {'TONAME': 'FortGeorge_22kV_1', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'TOEXNAME': 'FortGeorge_22kV_122.0', 'TONUMBER': 53, 'ID': 'FortGeorge_TS1'}, 'LeVal_22kV_LeVal_G1_Ugen_LeVal_TP1_Tr': {'TONAME': 'LeVal_G1_Ugen', 'FROMNUMBER': 76, '#WIND': 2, 'FROMEXNAME': 'LeVal_22kV_22.0', 'FROMNAME': 'LeVal_22kV', 'TOEXNAME': 'LeVal_G1_Ugen6.599999904632568', 'TONUMBER': 77, 'ID': 'LeVal_TP1'}, 'CTDS_G1_66kV_CTDS_G1_Ugen_CTDS_G1_TP_Tr': {'TONAME': 'CTDS_G1_Ugen', 'FROMNUMBER': 13, '#WIND': 2, 'FROMEXNAME': 'CTDS_G1_66kV_66.0', 'FROMNAME': 'CTDS_G1_66kV', 'TOEXNAME': 'CTDS_G1_Ugen11.0', 'TONUMBER': 14, 'ID': 'CTDS_G1_TP'}, 'Henrietta_22kV_1_Tamarind_G1_Ugen_Tamarind_G1_TP_Tr': {'TONAME': 'Tamarind_G1_Ugen', 'FROMNUMBER': 62, '#WIND': 2, 'FROMEXNAME': 'Henrietta_22kV_1_22.0', 'FROMNAME': 'Henrietta_22kV_1', 'TOEXNAME': 'Tamarind_G1_Ugen6.599999904632568', 'TONUMBER': 106, 'ID': 'Tamarind_G1_TP'}, 'Champagne_66kV_Champagne_G1_Ugen_Champagne_G1_TP_Tr': {'TONAME': 'Champagne_G1_Ugen', 'FROMNUMBER': 25, '#WIND': 2, 'FROMEXNAME': 'Champagne_66kV_66.0', 'FROMNAME': 'Champagne_66kV', 'TOEXNAME': 'Champagne_G1_Ugen6.599999904632568', 'TONUMBER': 26, 'ID': 'Champagne_G1_TP'}, 'BeauchampPowerStation_66kV_Beauchamp_G1_Ugen_Beauchamp_G1_TP_Tr': {'TONAME': 'Beauchamp_G1_Ugen', 'FROMNUMBER': 6, '#WIND': 2, 'FROMEXNAME': 'BeauchampPowerStation_66kV_66.0', 'FROMNAME': 'BeauchampPowerStation_66kV', 'TOEXNAME': 'Beauchamp_G1_Ugen15.0', 'TONUMBER': 7, 'ID': 'Beauchamp_G1_TP'}, 'CTSAV_G2_66kV_CTSAV_G2_Ugen_CTSAV_G2_TP_Tr': {'TONAME': 'CTSAV_G2_Ugen', 'FROMNUMBER': 17, '#WIND': 2, 'FROMEXNAME': 'CTSAV_G2_66kV_66.0', 'FROMNAME': 'CTSAV_G2_66kV', 'TOEXNAME': 'CTSAV_G2_Ugen11.0', 'TONUMBER': 18, 'ID': 'CTSAV_G2_TP'}, 'FVPS_22kV_3_FVPS_Ugen_3_FVPS_TS3_Tr': {'TONAME': 'FVPS_Ugen_3', 'FROMNUMBER': 44, '#WIND': 2, 'FROMEXNAME': 'FVPS_22kV_3_22.0', 'FROMNAME': 'FVPS_22kV_3', 'TOEXNAME': 'FVPS_Ugen_311.0', 'TONUMBER': 48, 'ID': 'FVPS_TS3'}, 'StLouis_66kV_StLouis_22kV_1_StLouis_TS1_Tr': {'TONAME': 'StLouis_22kV_1', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'StLouis_22kV_122.0', 'TONUMBER': 96, 'ID': 'StLouis_TS1'}, 'Medine_22kV_1_Medine_G1_Ugen_Medine_G1_TP_Tr': {'TONAME': 'Medine_G1_Ugen', 'FROMNUMBER': 80, '#WIND': 2, 'FROMEXNAME': 'Medine_22kV_1_22.0', 'FROMNAME': 'Medine_22kV_1', 'TOEXNAME': 'Medine_G1_Ugen6.599999904632568', 'TONUMBER': 82, 'ID': 'Medine_G1_TP'}, 'Champagne_66kV_Champagne_22kV_Champagne_TS1_Tr': {'TONAME': 'Champagne_22kV', 'FROMNUMBER': 25, '#WIND': 2, 'FROMEXNAME': 'Champagne_66kV_66.0', 'FROMNAME': 'Champagne_66kV', 'TOEXNAME': 'Champagne_22kV22.0', 'TONUMBER': 24, 'ID': 'Champagne_TS1'}, 'Henrietta_22kV_2_Magenta_G1_Ugen_Magenta_G1_TP_Tr': {'TONAME': 'Magenta_G1_Ugen', 'FROMNUMBER': 63, '#WIND': 2, 'FROMEXNAME': 'Henrietta_22kV_2_22.0', 'FROMNAME': 'Henrietta_22kV_2', 'TOEXNAME': 'Magenta_G1_Ugen6.599999904632568', 'TONUMBER': 79, 'ID': 'Magenta_G1_TP'}, 'CaseNoyale_66kV_CaseNoyale_22kV_1_CaseNoyale_TS1_Tr': {'TONAME': 'CaseNoyale_22kV_1', 'FROMNUMBER': 21, '#WIND': 2, 'FROMEXNAME': 'CaseNoyale_66kV_66.0', 'FROMNAME': 'CaseNoyale_66kV', 'TOEXNAME': 'CaseNoyale_22kV_122.0', 'TONUMBER': 19, 'ID': 'CaseNoyale_TS1'}, 'StLouis_66kV_StLouis_Ugen_10_StLouisG10_TP_Tr': {'TONAME': 'StLouis_Ugen_10', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'StLouis_Ugen_1011.0', 'TONUMBER': 99, 'ID': 'StLouisG10_TP'}, 'Bellevue_66kV_Bellevue_22kV_1_Bellevue_TS1_Tr': {'TONAME': 'Bellevue_22kV_1', 'FROMNUMBER': 10, '#WIND': 2, 'FROMEXNAME': 'Bellevue_66kV_66.0', 'FROMNAME': 'Bellevue_66kV', 'TOEXNAME': 'Bellevue_22kV_122.0', 'TONUMBER': 8, 'ID': 'Bellevue_TS1'}, 'Amaury_66kV_Amaury_22kV_1_Amaury_TS1_Tr': {'TONAME': 'Amaury_22kV_1', 'FROMNUMBER': 2, '#WIND': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'TOEXNAME': 'Amaury_22kV_122.0', 'TONUMBER': 0, 'ID': 'Amaury_TS1'}, 'Fuel_66kV_Fuel_22kV_2_Fuel_TS2_Tr': {'TONAME': 'Fuel_22kV_2', 'FROMNUMBER': 58, '#WIND': 2, 'FROMEXNAME': 'Fuel_66kV_66.0', 'FROMNAME': 'Fuel_66kV', 'TOEXNAME': 'Fuel_22kV_222.0', 'TONUMBER': 57, 'ID': 'Fuel_TS2'}, 'FVPS_66kV_FVPS_Ugen_3_FVPS_TP_4_Tr': {'TONAME': 'FVPS_Ugen_3', 'FROMNUMBER': 45, '#WIND': 2, 'FROMEXNAME': 'FVPS_66kV_66.0', 'FROMNAME': 'FVPS_66kV', 'TOEXNAME': 'FVPS_Ugen_311.0', 'TONUMBER': 48, 'ID': 'FVPS_TP_4'}, 'Cecile_22kV_Cecile_G1_Ugen_Cecile_G2_TP2_Tr': {'TONAME': 'Cecile_G1_Ugen', 'FROMNUMBER': 22, '#WIND': 2, 'FROMEXNAME': 'Cecile_22kV_22.0', 'FROMNAME': 'Cecile_22kV', 'TOEXNAME': 'Cecile_G1_Ugen6.599999904632568', 'TONUMBER': 23, 'ID': 'Cecile_G2_TP2'}, 'StLouis_66kV_StLouis_Ugen_7_StLouisG7_TP_Tr': {'TONAME': 'StLouis_Ugen_7', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'StLouis_Ugen_711.0', 'TONUMBER': 103, 'ID': 'StLouisG7_TP'}, 'UnionVale_66kV_UnionVale_22kV_1_UnionVale_TS1_Tr': {'TONAME': 'UnionVale_22kV_1', 'FROMNUMBER': 120, '#WIND': 2, 'FROMEXNAME': 'UnionVale_66kV_66.0', 'FROMNAME': 'UnionVale_66kV', 'TOEXNAME': 'UnionVale_22kV_122.0', 'TONUMBER': 118, 'ID': 'UnionVale_TS1'}, 'Bellevue_66kV_Bellevue_22kV_2_Bellevue_TS2_Tr': {'TONAME': 'Bellevue_22kV_2', 'FROMNUMBER': 10, '#WIND': 2, 'FROMEXNAME': 'Bellevue_66kV_66.0', 'FROMNAME': 'Bellevue_66kV', 'TOEXNAME': 'Bellevue_22kV_222.0', 'TONUMBER': 9, 'ID': 'Bellevue_TS2'}, 'Bellevue_66kV_Bellevue_G2_Ugen_Bellevue_G2_TP_Tr': {'TONAME': 'Bellevue_G2_Ugen', 'FROMNUMBER': 10, '#WIND': 2, 'FROMEXNAME': 'Bellevue_66kV_66.0', 'FROMNAME': 'Bellevue_66kV', 'TOEXNAME': 'Bellevue_G2_Ugen11.0', 'TONUMBER': 12, 'ID': 'Bellevue_G2_TP'}, 'Fuel_PowerStation_66kV_Fuel_G1_Ugen_Fuel_G1_TP_Tr': {'TONAME': 'Fuel_G1_Ugen', 'FROMNUMBER': 61, '#WIND': 2, 'FROMEXNAME': 'Fuel_PowerStation_66kV_66.0', 'FROMNAME': 'Fuel_PowerStation_66kV', 'TOEXNAME': 'Fuel_G1_Ugen6.599999904632568', 'TONUMBER': 59, 'ID': 'Fuel_G1_TP'}, 'StLouis_66kV_StLouis_22kV_2_StLouis_TS2_Tr': {'TONAME': 'StLouis_22kV_2', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'StLouis_22kV_222.0', 'TONUMBER': 97, 'ID': 'StLouis_TS2'}, 'Ebene_66kV_Ebene_22kV_3_Ebene_TS3_Tr': {'TONAME': 'Ebene_22kV_3', 'FROMNUMBER': 36, '#WIND': 2, 'FROMEXNAME': 'Ebene_66kV_66.0', 'FROMNAME': 'Ebene_66kV', 'TOEXNAME': 'Ebene_22kV_322.0', 'TONUMBER': 35, 'ID': 'Ebene_TS3'}, 'StLouis_66kV_StLouis_Ugen_9_StLouisG9_TP_Tr': {'TONAME': 'StLouis_Ugen_9', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'StLouis_Ugen_911.0', 'TONUMBER': 105, 'ID': 'StLouisG9_TP'}, 'LaChaumiere_66kV_LaChaumiere_22kV_2_LaChaumiere_TS2_Tr': {'TONAME': 'LaChaumiere_22kV_2', 'FROMNUMBER': 74, '#WIND': 2, 'FROMEXNAME': 'LaChaumiere_66kV_66.0', 'FROMNAME': 'LaChaumiere_66kV', 'TOEXNAME': 'LaChaumiere_22kV_222.0', 'TONUMBER': 73, 'ID': 'LaChaumiere_TS2'}, 'StLouis_66kV_StLouis_Ugen_8_StLouisG8_TP_Tr': {'TONAME': 'StLouis_Ugen_8', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'StLouis_Ugen_811.0', 'TONUMBER': 104, 'ID': 'StLouisG8_TP'}, 'Ferney_22kV_Ferney_G2_Ugen_Ferney_G2_TP_Tr': {'TONAME': 'Ferney_G2_Ugen', 'FROMNUMBER': 50, '#WIND': 2, 'FROMEXNAME': 'Ferney_22kV_22.0', 'FROMNAME': 'Ferney_22kV', 'TOEXNAME': 'Ferney_G2_Ugen6.599999904632568', 'TONUMBER': 52, 'ID': 'Ferney_G2_TP'}, 'Ebene_66kV_Ebene_22kV_2_Ebene_TS2_Tr': {'TONAME': 'Ebene_22kV_2', 'FROMNUMBER': 36, '#WIND': 2, 'FROMEXNAME': 'Ebene_66kV_66.0', 'FROMNAME': 'Ebene_66kV', 'TOEXNAME': 'Ebene_22kV_222.0', 'TONUMBER': 34, 'ID': 'Ebene_TS2'}, 'Combo_66kV_Combo_22kV_1_Combo_TS1_Tr': {'TONAME': 'Combo_22kV_1', 'FROMNUMBER': 30, '#WIND': 2, 'FROMEXNAME': 'Combo_66kV_66.0', 'FROMNAME': 'Combo_66kV', 'TOEXNAME': 'Combo_22kV_122.0', 'TONUMBER': 28, 'ID': 'Combo_TS1'}, 'FortGeorge_66kV_FGPS_Ugen4_FGPS_TP4_Tr': {'TONAME': 'FGPS_Ugen4', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'TOEXNAME': 'FGPS_Ugen411.0', 'TONUMBER': 40, 'ID': 'FGPS_TP4'}, 'TourKoening_66kV_TourKoening_22kV_2_TourKoening_TS2_Tr': {'TONAME': 'TourKoening_22kV_2', 'FROMNUMBER': 117, '#WIND': 2, 'FROMEXNAME': 'TourKoening_66kV_66.0', 'FROMNAME': 'TourKoening_66kV', 'TOEXNAME': 'TourKoening_22kV_222.0', 'TONUMBER': 116, 'ID': 'TourKoening_TS2'}, 'Ebene_66kV_Ebene_22kV_1_Ebene_TS1_Tr': {'TONAME': 'Ebene_22kV_1', 'FROMNUMBER': 36, '#WIND': 2, 'FROMEXNAME': 'Ebene_66kV_66.0', 'FROMNAME': 'Ebene_66kV', 'TOEXNAME': 'Ebene_22kV_122.0', 'TONUMBER': 33, 'ID': 'Ebene_TS1'}, 'Jin_Fei_66kV_Jin_Fei_22kV_1_Jin_Fei_TS1_Tr': {'TONAME': 'Jin_Fei_22kV_1', 'FROMNUMBER': 71, '#WIND': 2, 'FROMEXNAME': 'Jin_Fei_66kV_66.0', 'FROMNAME': 'Jin_Fei_66kV', 'TOEXNAME': 'Jin_Fei_22kV_122.0', 'TONUMBER': 69, 'ID': 'Jin_Fei_TS1'}, 'StLouis_66kV_StLouis_Ugen_11_StLouisG11_TP_Tr': {'TONAME': 'StLouis_Ugen_11', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'StLouis_Ugen_1111.0', 'TONUMBER': 100, 'ID': 'StLouisG11_TP'}, 'FortGeorge_66kV_FGPS_Ugen3_FGPS_TP3_Tr': {'TONAME': 'FGPS_Ugen3', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'TOEXNAME': 'FGPS_Ugen311.0', 'TONUMBER': 39, 'ID': 'FGPS_TP3'}, 'CaseNoyale_66kV_CaseNoyale_22kV_2_CaseNoyale_TS2_Tr': {'TONAME': 'CaseNoyale_22kV_2', 'FROMNUMBER': 21, '#WIND': 2, 'FROMEXNAME': 'CaseNoyale_66kV_66.0', 'FROMNAME': 'CaseNoyale_66kV', 'TOEXNAME': 'CaseNoyale_22kV_222.0', 'TONUMBER': 20, 'ID': 'CaseNoyale_TS2'}, 'FVPS_22kV_1_FVPS_Ugen_2_FVPS_TS1_Tr': {'TONAME': 'FVPS_Ugen_2', 'FROMNUMBER': 42, '#WIND': 2, 'FROMEXNAME': 'FVPS_22kV_1_22.0', 'FROMNAME': 'FVPS_22kV_1', 'TOEXNAME': 'FVPS_Ugen_211.0', 'TONUMBER': 47, 'ID': 'FVPS_TS1'}, 'Fuel_66kV_Fuel_22kV_1_Fuel_TS1_Tr': {'TONAME': 'Fuel_22kV_1', 'FROMNUMBER': 58, '#WIND': 2, 'FROMEXNAME': 'Fuel_66kV_66.0', 'FROMNAME': 'Fuel_66kV', 'TOEXNAME': 'Fuel_22kV_122.0', 'TONUMBER': 56, 'ID': 'Fuel_TS1'}, 'Anahita_66kV_Anahita_22kV_2_Anahita_TS2_Tr': {'TONAME': 'Anahita_22kV_2', 'FROMNUMBER': 5, '#WIND': 2, 'FROMEXNAME': 'Anahita_66kV_66.0', 'FROMNAME': 'Anahita_66kV', 'TOEXNAME': 'Anahita_22kV_222.0', 'TONUMBER': 4, 'ID': 'Anahita_TS2'}, 'Bellevue_66kV_Bellevue_G1_Ugen_Bellevue_G1_TP_Tr': {'TONAME': 'Bellevue_G1_Ugen', 'FROMNUMBER': 10, '#WIND': 2, 'FROMEXNAME': 'Bellevue_66kV_66.0', 'FROMNAME': 'Bellevue_66kV', 'TOEXNAME': 'Bellevue_G1_Ugen11.0', 'TONUMBER': 11, 'ID': 'Bellevue_G1_TP'}, 'Wooton_66kV_Wooton_22kV_2_Wooton_TS2_Tr': {'TONAME': 'Wooton_22kV_2', 'FROMNUMBER': 123, '#WIND': 2, 'FROMEXNAME': 'Wooton_66kV_66.0', 'FROMNAME': 'Wooton_66kV', 'TOEXNAME': 'Wooton_22kV_222.0', 'TONUMBER': 122, 'ID': 'Wooton_TS2'}, 'Amaury_66kV_Amaury_22kV_2_Amaury_TS2_Tr': {'TONAME': 'Amaury_22kV_2', 'FROMNUMBER': 2, '#WIND': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'TOEXNAME': 'Amaury_22kV_222.0', 'TONUMBER': 1, 'ID': 'Amaury_TS2'}, 'LeVal_22kV_LeVal_G2_Ugen_LeVal_TP2_Tr': {'TONAME': 'LeVal_G2_Ugen', 'FROMNUMBER': 76, '#WIND': 2, 'FROMEXNAME': 'LeVal_22kV_22.0', 'FROMNAME': 'LeVal_22kV', 'TOEXNAME': 'LeVal_G2_Ugen6.599999904632568', 'TONUMBER': 78, 'ID': 'LeVal_TP2'}, 'Jin_Fei_66kV_Jin_Fei_22kV_2_Jin_Fei_TS2_Tr': {'TONAME': 'Jin_Fei_22kV_2', 'FROMNUMBER': 71, '#WIND': 2, 'FROMEXNAME': 'Jin_Fei_66kV_66.0', 'FROMNAME': 'Jin_Fei_66kV', 'TOEXNAME': 'Jin_Fei_22kV_222.0', 'TONUMBER': 70, 'ID': 'Jin_Fei_TS2'}, 'Fuel_PowerStation_66kV_Fuel_G2_Ugen_Fuel_G2_TP_Tr': {'TONAME': 'Fuel_G2_Ugen', 'FROMNUMBER': 61, '#WIND': 2, 'FROMEXNAME': 'Fuel_PowerStation_66kV_66.0', 'FROMNAME': 'Fuel_PowerStation_66kV', 'TOEXNAME': 'Fuel_G2_Ugen6.599999904632568', 'TONUMBER': 60, 'ID': 'Fuel_G2_TP'}, 'TourKoening_66kV_TourKoening_22kV_1_TourKoening_TS1_Tr': {'TONAME': 'TourKoening_22kV_1', 'FROMNUMBER': 117, '#WIND': 2, 'FROMEXNAME': 'TourKoening_66kV_66.0', 'FROMNAME': 'TourKoening_66kV', 'TOEXNAME': 'TourKoening_22kV_122.0', 'TONUMBER': 115, 'ID': 'TourKoening_TS1'}, 'FVPS_66kV_FVPS_Ugen_2_FVPS_TP_1_Tr': {'TONAME': 'FVPS_Ugen_2', 'FROMNUMBER': 45, '#WIND': 2, 'FROMEXNAME': 'FVPS_66kV_66.0', 'FROMNAME': 'FVPS_66kV', 'TOEXNAME': 'FVPS_Ugen_211.0', 'TONUMBER': 47, 'ID': 'FVPS_TP_1'}, 'Sottise_66kV_Sottise_22kV_1_Sottise_TS1_Tr': {'TONAME': 'Sottise_22kV_1', 'FROMNUMBER': 95, '#WIND': 2, 'FROMEXNAME': 'Sottise_66kV_66.0', 'FROMNAME': 'Sottise_66kV', 'TOEXNAME': 'Sottise_22kV_122.0', 'TONUMBER': 93, 'ID': 'Sottise_TS1'}, 'Henrietta_66kV_Henrietta_22kV_2_Henrietta_TS2_Tr': {'TONAME': 'Henrietta_22kV_2', 'FROMNUMBER': 64, '#WIND': 2, 'FROMEXNAME': 'Henrietta_66kV_66.0', 'FROMNAME': 'Henrietta_66kV', 'TOEXNAME': 'Henrietta_22kV_222.0', 'TONUMBER': 63, 'ID': 'Henrietta_TS2'}, 'NIPS_66kV_Nicolay_22kV_1_Nicolay_TS1_Tr': {'TONAME': 'Nicolay_22kV_1', 'FROMNUMBER': 84, '#WIND': 2, 'FROMEXNAME': 'NIPS_66kV_66.0', 'FROMNAME': 'NIPS_66kV', 'TOEXNAME': 'Nicolay_22kV_122.0', 'TONUMBER': 88, 'ID': 'Nicolay_TS1'}, 'NIPS_66kV_NIPS_G2_Ugen_NIPS_TP2_Tr': {'TONAME': 'NIPS_G2_Ugen', 'FROMNUMBER': 84, '#WIND': 2, 'FROMEXNAME': 'NIPS_66kV_66.0', 'FROMNAME': 'NIPS_66kV', 'TOEXNAME': 'NIPS_G2_Ugen11.0', 'TONUMBER': 86, 'ID': 'NIPS_TP2'}, 'Ferney_22kV_Ferney_G1_Ugen_Ferney_G1_TP_Tr': {'TONAME': 'Ferney_G1_Ugen', 'FROMNUMBER': 50, '#WIND': 2, 'FROMEXNAME': 'Ferney_22kV_22.0', 'FROMNAME': 'Ferney_22kV', 'TOEXNAME': 'Ferney_G1_Ugen6.599999904632568', 'TONUMBER': 51, 'ID': 'Ferney_G1_TP'}, 'NIPS_66kV_NIPS_G3_Ugen_NIPS_TP3_Tr': {'TONAME': 'NIPS_G3_Ugen', 'FROMNUMBER': 84, '#WIND': 2, 'FROMEXNAME': 'NIPS_66kV_66.0', 'FROMNAME': 'NIPS_66kV', 'TOEXNAME': 'NIPS_G3_Ugen11.0', 'TONUMBER': 87, 'ID': 'NIPS_TP3'}, 'Combo_66kV_Combo_22kV_2_Combo_TS2_Tr': {'TONAME': 'Combo_22kV_2', 'FROMNUMBER': 30, '#WIND': 2, 'FROMEXNAME': 'Combo_66kV_66.0', 'FROMNAME': 'Combo_66kV', 'TOEXNAME': 'Combo_22kV_222.0', 'TONUMBER': 29, 'ID': 'Combo_TS2'}, 'FortGeorge_66kV_FGPS_Ugen5_FGPS_TP5_Tr': {'TONAME': 'FGPS_Ugen5', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'TOEXNAME': 'FGPS_Ugen511.0', 'TONUMBER': 41, 'ID': 'FGPS_TP5'}, 'FVPS_66kV_FVPS_Ugen_3_FVPS_TP_2_Tr': {'TONAME': 'FVPS_Ugen_3', 'FROMNUMBER': 45, '#WIND': 2, 'FROMEXNAME': 'FVPS_66kV_66.0', 'FROMNAME': 'FVPS_66kV', 'TOEXNAME': 'FVPS_Ugen_311.0', 'TONUMBER': 48, 'ID': 'FVPS_TP_2'}, 'Cecile_22kV_Cecile_G1_Ugen_Cecile_G1_TP1_Tr': {'TONAME': 'Cecile_G1_Ugen', 'FROMNUMBER': 22, '#WIND': 2, 'FROMEXNAME': 'Cecile_22kV_22.0', 'FROMNAME': 'Cecile_22kV', 'TOEXNAME': 'Cecile_G1_Ugen6.599999904632568', 'TONUMBER': 23, 'ID': 'Cecile_G1_TP1'}, 'FortGeorge_66kV_FortGeorge_22kV_1_FortGeorge_TS3_Tr': {'TONAME': 'FortGeorge_22kV_1', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'TOEXNAME': 'FortGeorge_22kV_122.0', 'TONUMBER': 53, 'ID': 'FortGeorge_TS3'}, 'FVPS_66kV_FVPS_Ugen_2_FVPS_TP_3_Tr': {'TONAME': 'FVPS_Ugen_2', 'FROMNUMBER': 45, '#WIND': 2, 'FROMEXNAME': 'FVPS_66kV_66.0', 'FROMNAME': 'FVPS_66kV', 'TOEXNAME': 'FVPS_Ugen_211.0', 'TONUMBER': 47, 'ID': 'FVPS_TP_3'}, 'StLouis_66kV_StLouis_Ugen_13_StLouisG13_TP_Tr': {'TONAME': 'StLouis_Ugen_13', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'TOEXNAME': 'StLouis_Ugen_1311.0', 'TONUMBER': 102, 'ID': 'StLouisG13_TP'}, 'Wooton_66kV_Wooton_22kV_1_Wooton_TS1_Tr': {'TONAME': 'Wooton_22kV_1', 'FROMNUMBER': 123, '#WIND': 2, 'FROMEXNAME': 'Wooton_66kV_66.0', 'FROMNAME': 'Wooton_66kV', 'TOEXNAME': 'Wooton_22kV_122.0', 'TONUMBER': 121, 'ID': 'Wooton_TS1'}, 'FortGeorge_66kV_FGPS_Ugen2_FGPS_TP2_Tr': {'TONAME': 'FGPS_Ugen2', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'TOEXNAME': 'FGPS_Ugen211.0', 'TONUMBER': 38, 'ID': 'FGPS_TP2'}, 'Champagne_66kV_Champagne_G2_Ugen_Champagne_G2_TP_Tr': {'TONAME': 'Champagne_G2_Ugen', 'FROMNUMBER': 25, '#WIND': 2, 'FROMEXNAME': 'Champagne_66kV_66.0', 'FROMNAME': 'Champagne_66kV', 'TOEXNAME': 'Champagne_G2_Ugen6.599999904632568', 'TONUMBER': 27, 'ID': 'Champagne_G2_TP'}, 'LaChaumiere_22kV_2_LaFerme_G1_Ugen_LaFerme_TP_Tr': {'TONAME': 'LaFerme_G1_Ugen', 'FROMNUMBER': 73, '#WIND': 2, 'FROMEXNAME': 'LaChaumiere_22kV_2_22.0', 'FROMNAME': 'LaChaumiere_22kV_2', 'TOEXNAME': 'LaFerme_G1_Ugen6.599999904632568', 'TONUMBER': 75, 'ID': 'LaFerme_TP'}, 'FVPS_22kV_2_FVPS_Ugen_2_FVPS_TS2_Tr': {'TONAME': 'FVPS_Ugen_2', 'FROMNUMBER': 43, '#WIND': 2, 'FROMEXNAME': 'FVPS_22kV_2_22.0', 'FROMNAME': 'FVPS_22kV_2', 'TOEXNAME': 'FVPS_Ugen_211.0', 'TONUMBER': 47, 'ID': 'FVPS_TS2'}, 'LaChaumiere_66kV_LaChaumiere_22kV_1_LaChaumiere_TS1_Tr': {'TONAME': 'LaChaumiere_22kV_1', 'FROMNUMBER': 74, '#WIND': 2, 'FROMEXNAME': 'LaChaumiere_66kV_66.0', 'FROMNAME': 'LaChaumiere_66kV', 'TOEXNAME': 'LaChaumiere_22kV_122.0', 'TONUMBER': 72, 'ID': 'LaChaumiere_TS1'}, 'UnionVale_66kV_UnionVale_22kV_2_UnionVale_TS2_Tr': {'TONAME': 'UnionVale_22kV_2', 'FROMNUMBER': 120, '#WIND': 2, 'FROMEXNAME': 'UnionVale_66kV_66.0', 'FROMNAME': 'UnionVale_66kV', 'TOEXNAME': 'UnionVale_22kV_222.0', 'TONUMBER': 119, 'ID': 'UnionVale_TS2'}, 'FortGeorge_66kV_FortGeorge_22kV_2_FortGeorge_TS2_Tr': {'TONAME': 'FortGeorge_22kV_2', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'TOEXNAME': 'FortGeorge_22kV_222.0', 'TONUMBER': 54, 'ID': 'FortGeorge_TS2'}}
MotorDico = {}
-Dico ={'DISTRIBUTIONCharge': {'Load': ['Aspretto_Aspretto_Lo1', 'Aspretto_Aspretto_Lo2', 'Bastia_Bastia_Lo1', 'Bonifacio_Bonifacio_Lo1', 'Caldanicci_Caldanicci_Lo1', 'Calvi_Calvi_Lo1', 'Corte_Corte_Lo1', 'Ghisonaccia_Ghisonaccia_Lo1', 'IleRousse_IleRousse_Lo1', 'Loretto_Loretto_Lo1', 'Lucciana_Lucciana_Lo1', 'Lucciana_Lucciana_Lo2', 'Morosaglia_Morosaglia_Lo1', 'Ocana_Ocana_Lo1', 'Oletta_Oletta_Lo1', 'Pietrosella_Pietrosella_Lo1', 'PorteVecchio_PorteVecchio_Lo1', 'Propriano_Propriano_Lo1', 'Sagone_Sagone_Lo1', 'SainteMarieSicche_SainteMarieSicche_Lo1', 'Sisco_Sisco_Lo1', 'Vazzio_Vazzio_Lo1'], 'A': 0.9, 'B': 1.0, 'Activated': True, 'Sampling': 'Same sample for all loads', 'ComponentType': 'Load', 'Law': 'Uniform', 'Type': 'Load Level'}, 'PF_PARAMETERS': {'UNIT_COMMITMENT': True, 'LS_Q_CONVERGENCE_CRITERIA': False, 'DECIMAL_SEPARATOR': ',', 'ALGORITHM': 'Optimum Power Flow', 'OBJECTIVE_FUNCTION': 'MINIMISATION_OF_COST', 'NON_COST_OPTIMAL_SOLUTION_ALLOWED': True, 'ITERATION_INTERIOR': 700, 'LOCK_TAPS': True, 'LOAD_SHEDDING_ALLOWED': True}, 'SIMULATION': {'NUMBER_PACKAGE': 1, 'SIZE_PACKAGE': 10}, 'CORRELATION': {'CorrelationMatrix': ["['Charge', 'GEN']", '[1.0, 0.0]', '[0.0, 1.0]']}, 'DIRECTORY': {'Python3_path': 'C:/Python35', 'pfd_file': 'C:/Users/H92579/Documents/Formation_PF/ex_PFD/Modele_Corse_PSEN_peak_good.pfd', 'results_folder': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu', 'PF_path': 'C:/Program Files/DIgSILENT/PowerFactory 2017 SP1/Python/3.5'}, 'DISTRIBUTIONGEN': {'A': 0.8, 'B': 0.85, 'Generator': ['Bonifacio_Bonifacio_genstat_Gr_Bonifaccio_PV', 'Caldanicci_Caldanicci_genstat_Gr_Caldanicci_PV', 'Calvi_Calvi_genstat_Gr_Calvi_PV', 'Cervione_Cervione_genstat_Gr_CERVIONE_BT_PV', 'Corte_Corte_genstat_Gr_Corte_PV', 'Furiani_Furiani_genstat_Gr_Furiani_PV', 'Ghisonaccia_Ghisonaccia_genstat_Gr_Gisonaccia_PV', 'IleRousse_IleRousse_genstat_Gr_IleRousse_PV', 'Loretto_Loretto_genstat_Gr_Loretto_PV', 'Lucciana_Lucciana_genstat_Gr_Lucciana_PV', 'Morosaglia_Morosaglia_genstat_Gr_Morosoglia_PV', 'Oletta_Oletta_genstat_Gr_Oletta_PV', 'Propriano_Propriano_genstat_Gr_Propriano_PV'], 'Activated': True, 'Sampling': 'Same sample for all generators', 'ComponentType': 'Generator', 'Law': 'Uniform', 'Type': 'Generator Power Level'}}
\ No newline at end of file
+Dico ={'DISTRIBUTIONLINE': {'Activated': True, 'Sampling': 'Same sample for all lines', 'ComponentType': 'Line', 'Values': ((0, 0.15), (1, 0.85)), 'Line': ['Amaury_22kV_1_PlaineDesRochesPowerStation_22kV_22kV_PlaineDesRochesPowerStation_Li', 'Amaury_66kV_Bellevue_66kV_66kV_Amaury_Bellevue_1_Li', 'Amaury_66kV_Fuel_66kV_66kV_Amaury_Fuel_1_Li'], 'Law': 'UserDefined', 'Type': 'Line Unavailability'}, 'DISTRIBUTIONTRANSFO': {'Transformer': ['Amaury_66kV_Amaury_22kV_1_Amaury_TS1_Tr', 'Amaury_66kV_Amaury_22kV_2_Amaury_TS2_Tr', 'Anahita_66kV_Anahita_22kV_1_Anahita_TS1_Tr', 'Anahita_66kV_Anahita_22kV_2_Anahita_TS2_Tr'], 'Activated': True, 'Sampling': 'Same sample for all transformers', 'ComponentType': 'Transformer', 'Values': ((0, 0.1), (1, 0.9)), 'Law': 'UserDefined', 'Type': 'Transformer Unavailability'}, 'PF_PARAMETERS': {'UNIT_COMMITMENT': True, 'LS_Q_CONVERGENCE_CRITERIA': False, 'DECIMAL_SEPARATOR': ',', 'ALGORITHM': 'Optimum Power Flow', 'OBJECTIVE_FUNCTION': 'MINIMISATION_OF_COST', 'NON_COST_OPTIMAL_SOLUTION_ALLOWED': True, 'ITERATION_INTERIOR': 700, 'LOCK_TAPS': True, 'LOAD_SHEDDING_ALLOWED': True}, 'SIMULATION': {'NUMBER_PACKAGE': 1, 'SIZE_PACKAGE': 10}, 'CORRELATION': {'CorrelationMatrix': ["['TRANSFO', 'LINE']", '[1.0, 0.8]', '[0.8, 1.0]']}, 'DIRECTORY': {'Python3_path': 'C:/Python35', 'pfd_file': 'C:/Users/H92579/Documents/Formation_PF/ex_PFD/Maurice_2017_CoalSeasonNuit.pfd', 'results_folder': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu', 'PF_path': 'C:\\Program Files\\DIgSILENT\\PowerFactory 2017 SP1\\Python\\3.5'}}
\ No newline at end of file
Debug = True #pour faire des tests
## =============================================================================================
def function_callback(result): #define callback for a probabilistic study
+
+ print('PSSEWrapper > function_callback')
output.extend(result[0])
inputSamp.extend(result[1])
Pmachine.extend(result[2])
## =============================================================================================
def callback_indices(indices): #define callback function for probabilistic study
+
+ print('PSSEWrapper > callback_indices')
Ind1.extend(indices[0])
Ind2.extend(indices[1])
## =============================================================================================
def function_callback_psse(result): #define callback function for time study
- #print(result)
+
+ print('PSSEWrapper > function_callback_psse')
output.extend(result[1])
inputSamp.extend(result[0])#5])
Pmachine.extend(result[2])#6])
def log(filename, text):
+
+ print('PSSEWrapper > log')
f=open(filename, 'a')
f.write(text)
f.close()
## =============================================================================================
def init_PSSEWrapper():
+
+ print('PSSEWrapper > init_PSSEWrapper')
sys.path.append(PSENconfig.Dico['DIRECTORY']['PSSE_path'])
os.environ['PATH'] = PSENconfig.Dico['DIRECTORY']['PSSE_path'] + ";"+ os.environ['PATH']
return cmd_Path
## =============================================================================================
def init_PSSE(Paths):
+
+ print('PSSEWrapper > init_PSSE')
## Inititalisation de PSSE
import psspy
import pssarrays
## =============================================================================================
def read_PSENconfig():
+
+ print('PSSEWrapper > read_PSENconfig')
+
""""
Read the file PSENconfig
PSENconfig contains all the information about the element in the network and the user configuration
## =============================================================================================
#### TEST A FAIRE : creer deux PSENConfig differents : 1 ou matrice de correlation presente et l'autre non pour voir si "Laws" correct
-def read_laws():
+def read_laws():
+
+ print('PSSEWrapper > read_laws')
+
"""
si la loi = pdf_from_file ou time_serie_from_file : on va lire les donnees contenues dans le csv associe
et on met a jour le dictionnaire Laws[shortkey]['FileContents']
## =============================================================================================
def read_or_create_corrmatrix(LawNames, NonActiveIndices, TSindices):
+
+ print('PSSEWrapper > read_or_create_corrmatrix')
+
if PSENconfig.Dico.has_key('CORRELATION'):
#Treat Correlation Matrix - eliminate non-activated laws
CorrMatrix0 = {}
"""
utilise la fonction config_contingency() definie dans support_functions.py
"""
+
+ print('PSSEWrapper > contingency')
+
# Treat Contingency Files enteres as CSVs
LinesList = []
GeneratorsList = []
## ===============================================================================================
def TS(CorrMatrix):
+
+ print('PSSEWrapper > TS')
# Definition des variables pour les series temporelles
# a passer en pandas ?
Ind2=[]
def function_callback(result): #define callback for a probabilistic study
+
+ print('PSSEWrapper > function_callback')
output.extend(result[0])
inputSamp.extend(result[1])
Pmachine.extend(result[2])
def callback_indices(indices): #define callback function for probabilistic study
+
+ print('PSSEWrapper > callback_indices')
Ind1.extend(indices[0])
Ind2.extend(indices[1])
def function_callback_psse(result): #define callback function for time study
- #print(result)
+
+ print('PSSEWrapper > function_callback_psse')
output.extend(result[1])
inputSamp.extend(result[0])#5])
Pmachine.extend(result[2])#6])
#[busnumber, outserv, idplant, 0, 0, 0, 0, 0, busname, 0, 0,plant, pgini, pgini_a]
def saveOPFresults(plants):
+
+ print('comfile > saveOPFresults')
#save OPF results: P, Q of generators, Transfo taps, Switched shunt settings, Load-shedding
upload = app.GetFromStudyCase('ComDbupd') # Sélection commande de mise à jour BDD
nn = int(''.join(ele for ele in case.loc_name if ele.isdigit())) # case number
cas = int(nn)
+print('comfile')
scenario_temporaire = app.GetActiveScenario()
if scenario_temporaire:
_cas.append(line)
filer.close()
+print('correct_comtask')
##############################################################################/
import powerfactory
app = powerfactory.GetApplication()
psspy.progress_output(islct)
def EconomicDispatch(NetworkFile, ecd_file, LossesRatio, TapChange):
-
+ print('ecd > EconomicDispatch')
#Network File
psspy.case(NetworkFile)
psspy.save(NetworkFile)
#read sav
all_inputs_init=read_pfd(app,prj.loc_name,recal=1)
+print('read_pfd_wrapper')
+
# all_inputs_base=read_pfd(Paths['pfd_file'])
all_inputs_base=all_inputs_init
buses_base=[]
# inputSample = []
# x_copy = []
# #############################################################################/
+
+print('run_in_PFfunction')
+
import powerfactory
app = powerfactory.GetApplication()
stop = time.clock(); print(' A0 in run_in_PFfunction.py in ' + str( round(stop - start, 3)) + ' seconds'); start = stop;
# x_copy[ite][i]=x[ite][i]
elif dico['Laws'][law]['TF_Input'] == 'tuples list':
x_copy[ite][i] = applyTF(x[ite][i], dico['Laws'][law]['TF_Values'])
- # else: # ensure values are between 0 and 1
- # Pval = x[ite][i]
- # Pval = min(Pval, 1)
- # Pval = max(Pval, 0)
- # x_copy[ite][i] = Pval
+
###################=======================================
if dico['Laws'][law]['ComponentType'] == 'Load' and ('Unavailability' not in dico['Laws'][law]['Type']):
LoadList = dico['Laws'][law]['Load']
load[6].plini = load[6].plini
ref = load[6].CreateObject('charef', 'plini')
ref.typ_id = chavec_1
-# refP = load[6].GetChildren(1, 'plini.Charef',1)
-# refP[0].outserv = 0
ref = load[6].CreateObject('charef', 'qlini')
ref.typ_id = chavec_1
-# refQ = load[6].GetChildren(1, 'qlini.Charef',1)
-# refQ[0].outserv = 0
+
break
# Motor Load Law: change the values of the different induction motor loads and treat large changes of load to help convergence
- # if dico['Laws'][law]['ComponentType']=='Motor' and ('N_1' not in law) and ('out' not in law.lower()):
+
if dico['Laws'][law]['ComponentType'] == 'Motor' and ('Unavailability' not in dico['Laws'][law]['Type']):
MotorList = dico['Laws'][law]['Motor']
- # if x_copy[ite][i] > 0.75: # On change directement l(es) charge(s)
+
for MotorName in MotorList:
busNum = dico['Motors'][MotorName]['NUMBER']
ID = dico['Motors'][MotorName]['ID']
savfile2 = r'D:\DEWA Solar 2017\2018 DEWA peak_fullGCCIA2.sav'
GenDispatchData, DispTableData, LinCostTables, QuadCostTables, PolyCostTables, GenReserveData, PeriodReserveData,AdjBusShuntData,AdjLoadTables = readOPFdata(ropfile)
+print('runreadOPF')
_i=psspy.getdefaultint()
_f=psspy.getdefaultreal()
#to remve a list from a string "['wind 1', 'wind 2', 'charge']" --> ['wind 1', 'wind 2', 'charge']
def RemoveListfromString(List):
+
+ print('support_functionsPF > RemoveListfromString')
List = List.replace("]","")
List = List.replace("[","")
List = List.replace(")","")
return List
def RemoveTuplesfromString(TList):
+
+ print('support_functionsPF > RemoveTuplesfromString')
TL = RemoveListfromString(TList)
nTL = []
for i in range(len(TL)/2):
def applyTF(x_in, TF):
+ print('support_functionsPF > ')
X = []
P = []
for (x,p) in TF:
'''
-
+ print('support_functionsPF > eol ')
#open and treat wind turbine data in .pow file
f = open(pathWT)
lines = f.readlines()
# ojectif de cette fonction: prendre les parametres du reseau
########################################################
# si recal==1, recalculer loadflow
+
+ print('support_functionsPF > read_pfd')
prj = app.GetActiveProject()
studycase=app.GetActiveStudyCase()
grids=studycase.GetChildren(1,'*.ElmNet',1)[0].contents
# ojectif de cette fonction: prendre les parametres du reseau
########################################################
# si recal==1, recalculer loadflow
+
+ print('support_functionsPF > read_pfd_simple')
prj = app.GetActiveProject()
studycase=app.GetActiveStudyCase()
grids=studycase.GetChildren(1,'*.ElmNet',1)[0].contents
def MyLogger(x,y,z,logCSVfilename,ite):
+
+ print('support_functionsPF > MyLogger')
f=open(logCSVfilename, 'a')
f.write(str(ite)+';')
f.write(";")
# Fonction pour ecrire un fichier de sortie type csv pour chaque type de grandeur de sortie
def MyMultiLogger (x, y, sizeY, z, ite, folder, day, fich, hour):
global ny
+
+ print('support_functionsPF > MyMultiLogger')
y0=0
for fich in range (np.size(sizeY,0)):
multilogfilename=folder+"/N"+day+"/Y"+str(fich)+"simulationDClog_"+hour+".csv"
# Analyses graphiques
def graphical_out (inputSample, outputSampleAll, inputDim, outputDim, montecarlosize) :
+
+ print('support_functionsPF > graphical_out')
print ("\n\n\n Writing graphical analysis files...")
# A Pairwise scatter plot of the inputs
myGraph = Graph()
def config_contingency(LinesList,GroupsList,TransformersList,LoadsList,MotorsList) :
+ print('support_functionsPF > config_contingency')
lines_con=[]
groups_con=[]
loads_con = []
return lines_con, groups_con, transfos_con, loads_con, motors_con, val, prob
def LoadARMA(time_serie_file, time_serie_SS, time_serie_TH) :
+
+ print('support_functionsPF > LoadARMA')
f=open(time_serie_file,"r")
lines=f.readlines()
N=len(lines)
return possibleFuture
def LoadTS(time_serie_file) :
+
+ print('support_functionsPF > LoadTS')
TS=[]
for i in range(len(time_serie_file)) :
if time_serie_file[i] == -1 :
return TS
def KSDist(lines) :
+
+ print('support_functionsPF > KSDist')
print( "Creating Kernel Smoothing distribution ")
N=len(lines)
Xt=[]
def threshold (inputRandomVector, outputVariableOfInterest,pssefun,inputDistribution) :
+
+ print('support_functionsPF > threshold')
# We create a quadraticCumul algorithm
myQuadraticCumul = QuadraticCumul(outputVariableOfInterest)
print ("")
def getUserDefined (values):
+
+ print('support_functionsPF > getUserDefined')
val = []
prob = []
for a in values:
return UserDefined(coll)
def getHistogram (values) :
+
+ print('support_functionsPF > getHistogram')
step = []
prob = []
for a in values:
return myHistogram
def getUserLaw(LawDico):
+
+ print('support_functionsPF > getUserLaw')
time_serie = 0
time_serie_file = ''
time_serie_SS = 0
return law, [time_serie, time_serie_file] #[time_serie, time_serie_file, time_serie_SS, time_serie_TH]
def contingency_automatic (dfxPath, acccPath, rate) :
+
+ print('support_functionsPF > contingency_automatic')
psspy.accc_with_dsp_3( 0.5,[0,0,0,1,1,2,0,0,0,0,0],r"""ALL""",dfxPath,acccPath,"","","")
psspy.accc_single_run_report_4([1,int(rate),int(rate),1,1,0,1,0,0,0,0,0],[0,0,0,0,6000],[ 0.5, 5.0, 100.0,0.0,0.0,0.0, 99999.],acccPath)
return contin_load
def commaToPoint (string) :
+
+ print('support_functionsPF > commaToPoint')
stringReplaced = string.replace(',','.')
return stringReplaced
def PFFunct(dico,x):
+
+ print('support_functionsPF > PFFunct')
# start1 = time.clock();
stop = time.clock(); start = stop;
Output = []
def create_dist(dico):
+
+ print('support_functionsPF > create_dist')
NumLaws = len(dico['Laws']) + int(dico['N_1_fromFile'])
#Create a correlation matrix as copulas
return inputDistribution
def Calculation(dico,nb_fix,cmd_Path):
+
+ print('support_functionsPF > Calculation')
msg = 'run'
output1=[]
inputSamp1=[]
p = subprocess.Popen([dico['Paths']['Python3_path']+'\\python.exe', cmd_Path], stdout=subprocess.PIPE) # launch subprocess
nbsr = NonBlockingStreamReader(p.stdout) # monitor subprocess stdout
-# if debug:
-# chemin=os.path.abspath(os.path.join(os.getcwd(), '../'))
-# else:
chemin=os.getcwd()
dico['cheminPSEN'] = chemin
t += 1
print('Package ' + str(t))
- # LStable=[]
- # FStable=[]
output=[]
inputSample=[]
Pmachine=[]
- # LStable_beforeUC=[]
- # FStable_beforeUC=[]
- # output_beforeUC=[]
- # Pmachine_beforeUC=[]
myMCE = MonteCarloExperiment(inputDistribution,dico['lenpac']) #create new sample
inputSamp = myMCE.generate()
return None
def Convergence(dico,OPF, nb_fix, cmd_Path,z,t):
+
+ print('support_functionsPF > Convergence')
LS=[]
FS=[]
MoyTension=[]
def maFonction6(event):
+
+ print('usrCmd > maFonction6')
quitting()
def quitting():
+
+ print('usrCmd > quitting')
can1.delete(proceeding)
can1.create_text(200,50,font=('Fixedsys',12),text="If you want to quit press button again...")
Button(root,text="Stop Simulation",font=("Fixedsys"),command=really_quitting).grid(row=4,column=1,sticky=N,padx=5)
def really_quitting():
- print 'quitting'
+
+ print('usrCmd > really_quitting')
root.destroy()
# création d'une instance de la classe TK, que l'on affecte à l'objet "root"
def maFonction6(event):
+
+ print('usrCmd > maFonction6')
quitting()
def quitting():
+
+ print('usrCmd > quitting')
can1.delete(proceeding)
can1.create_text(200,50,font=('Fixedsys',12),text="If you want to quit press button again...")
Button(root,text="Stop Simulation",font=("Fixedsys"),command=really_quitting).grid(row=4,column=1,sticky=N,padx=5)
def really_quitting():
- print ('quitting')
+
+ print('usrCmd > really_quitting')
root.destroy()
# création d'une instance de la classe TK, que l'on affecte à l'objet "root"
__repr__=info
__str__=info
-
+print('PSEN_Cata')
#CONTEXT.debug = 1
JdC = JDC_CATA ( code = 'PSEN',
execmodul = None,
__repr__=info
__str__=info
+print('PSEN_Cata_PF')
#CONTEXT.debug = 1
JdC = JDC_CATA ( code = 'PSEN',
print (NetworkFile)
print (PF_PATH)
+ print('com > PFExtractData')
"""
BLOC 33-35
Permet de séparer le chemin du répertoire et le nom du .pfd
def make_config(appli,rep):
+
+ print('configuration_PSEN > make_config')
return CONFIG(appli,rep)
p = subprocess.Popen([Python3_path + '/python.exe', WrapperFilePath])
(out, err) = p.communicate()
-print out
-print err
+print(out)
+print(err)
+print('debugPFWrapper')
+
+
"""
Fonction sd_prod pour la macro INCLUDE
"""
-
+ print('opsPSEN > INCLUDE')
if sav_file==None: return
reevalue=0
listeADeTruire=[]
"""
Fonction op_init pour macro INCLUDE
"""
+ print('opsPSEN > INCLUDE_context')
for k,v in self.g_context.items():
d[k]=v
"""
Fonction sd_prod pour la macro INCLUDE
"""
-
+ print('opsPSEN_PF > INCLUDE')
if pfd_file==None: return
reevalue=0
listeADeTruire=[]
"""
Fonction op_init pour macro INCLUDE
"""
+ print('opsPSEN_PF > INCLUDE_context')
for k,v in self.g_context.items():
d[k]=v
import sys, os
if os.path.dirname(os.path.abspath(__file__)) not in sys.path :
sys.path.insert(0,os.path.dirname(os.path.abspath(__file__)))
+
+print('prefs')
\ No newline at end of file
encoding='iso-8859-1'
docPath=repIni
-
+print('prefs_PSEN')
#
catalogues=(
('PSEN', 'PSEN for PSSE', os.path.join(repIni, 'PSEN_Cata.py'), 'PSEN', 'python'),
version = "1.2"
date = "25/05/2010"
exploit = False
+
+print('properties')
\ No newline at end of file
if __name__=='__main__':
eficas_go.lance_eficas(code=prefs.code)
+
+print('qtEficas_PSEN')
\ No newline at end of file
-Starting time: 0.002446; Monte Carlo Size : 10.000000; Starting time: 0.293662; Monte Carlo Size : 10.000000; Starting time: 0.001656; Monte Carlo Size : 10.000000; Starting time: 0.249637; Monte Carlo Size : 2.000000; Starting time: 0.001503; Monte Carlo Size : 3.000000; Starting time: 0.001179; Monte Carlo Size : 10.000000; Starting time: 0.001271; Monte Carlo Size : 10.000000; Starting time: 0.300779; Monte Carlo Size : 10.000000; Starting time: 0.001302; Monte Carlo Size : 10.000000; Starting time: 0.237096; Monte Carlo Size : 750.000000; Starting time: 0.304474; Monte Carlo Size : 10.000000; Starting time: 0.238076; Monte Carlo Size : 10.000000; Starting time: 0.185095; Monte Carlo Size : 10.000000; Starting time: 0.225074; Monte Carlo Size : 10.000000; Starting time: 0.006847; Monte Carlo Size : 10.000000; Starting time: 0.008662; Monte Carlo Size : 10.000000; Starting time: 0.281258; Monte Carlo Size : 10.000000; Starting time: 0.006176; Monte Carlo Size : 10.000000; Starting time: 0.320835; Monte Carlo Size : 10.000000; Starting time: 0.008815; Monte Carlo Size : 10.000000; Starting time: 0.005938; Monte Carlo Size : 10.000000; Starting time: 0.006103; Monte Carlo Size : 20.000000; Starting time: 0.008669; Monte Carlo Size : 20.000000; Starting time: 0.388910; Monte Carlo Size : 10.000000; Starting time: 0.006206; Monte Carlo Size : 10.000000; Starting time: 0.089172; Monte Carlo Size : 10.000000; Starting time: 0.008701; Monte Carlo Size : 10.000000; Starting time: 0.635387; Monte Carlo Size : 10.000000; Starting time: 0.161781; Monte Carlo Size : 10.000000; Starting time: 0.006213; Monte Carlo Size : 10.000000; Starting time: 0.005910; Monte Carlo Size : 10.000000; Starting time: 0.007659; Monte Carlo Size : 10.000000; Starting time: 0.007824; Monte Carlo Size : 10.000000; Starting time: 0.006322; Monte Carlo Size : 5.000000; Starting time: 0.005984; Monte Carlo Size : 6.000000; Starting time: 0.005932; Monte Carlo Size : 6.000000; Starting time: 0.005939; Monte Carlo Size : 6.000000; Starting time: 0.006617; Monte Carlo Size : 6.000000; Starting time: 0.006071; Monte Carlo Size : 6.000000; Starting time: 0.094942; Monte Carlo Size : 6.000000; Starting time: 0.006779; Monte Carlo Size : 6.000000; Starting time: 0.005969; Monte Carlo Size : 6.000000; Starting time: 0.012818; Monte Carlo Size : 6.000000; Starting time: 0.009155; Monte Carlo Size : 6.000000; Starting time: 0.022845; Monte Carlo Size : 6.000000; Starting time: 0.154829; Monte Carlo Size : 10.000000; Starting time: 0.319019; Monte Carlo Size : 6.000000; Starting time: 0.692187; Monte Carlo Size : 6.000000; Starting time: 0.005742; Monte Carlo Size : 6.000000; Starting time: 0.006014; Monte Carlo Size : 6.000000; Starting time: 0.189341; Monte Carlo Size : 6.000000; Starting time: 0.258081; Monte Carlo Size : 6.000000; Starting time: 0.006084; Monte Carlo Size : 6.000000; Starting time: 0.887862; Monte Carlo Size : 6.000000; Starting time: 0.005848; Monte Carlo Size : 6.000000; Starting time: 0.009089; Monte Carlo Size : 6.000000; Starting time: 0.010174; Monte Carlo Size : 6.000000; Starting time: 0.005965; Monte Carlo Size : 6.000000; Starting time: 0.144982; Monte Carlo Size : 5.000000; Starting time: 0.001871; Monte Carlo Size : 5.000000; Starting time: 0.297407; Monte Carlo Size : 5.000000; Starting time: 0.001171; Monte Carlo Size : 10.000000; Starting time: 0.001427; Monte Carlo Size : 10.000000; Starting time: 0.004446; Monte Carlo Size : 10.000000; Starting time: 0.003990; Monte Carlo Size : 10.000000;
\ No newline at end of file
+Starting time: 0.002446; Monte Carlo Size : 10.000000; Starting time: 0.293662; Monte Carlo Size : 10.000000; Starting time: 0.001656; Monte Carlo Size : 10.000000; Starting time: 0.249637; Monte Carlo Size : 2.000000; Starting time: 0.001503; Monte Carlo Size : 3.000000; Starting time: 0.001179; Monte Carlo Size : 10.000000; Starting time: 0.001271; Monte Carlo Size : 10.000000; Starting time: 0.300779; Monte Carlo Size : 10.000000; Starting time: 0.001302; Monte Carlo Size : 10.000000; Starting time: 0.237096; Monte Carlo Size : 750.000000; Starting time: 0.304474; Monte Carlo Size : 10.000000; Starting time: 0.238076; Monte Carlo Size : 10.000000; Starting time: 0.185095; Monte Carlo Size : 10.000000; Starting time: 0.225074; Monte Carlo Size : 10.000000; Starting time: 0.006847; Monte Carlo Size : 10.000000; Starting time: 0.008662; Monte Carlo Size : 10.000000; Starting time: 0.281258; Monte Carlo Size : 10.000000; Starting time: 0.006176; Monte Carlo Size : 10.000000; Starting time: 0.320835; Monte Carlo Size : 10.000000; Starting time: 0.008815; Monte Carlo Size : 10.000000; Starting time: 0.005938; Monte Carlo Size : 10.000000; Starting time: 0.006103; Monte Carlo Size : 20.000000; Starting time: 0.008669; Monte Carlo Size : 20.000000; Starting time: 0.388910; Monte Carlo Size : 10.000000; Starting time: 0.006206; Monte Carlo Size : 10.000000; Starting time: 0.089172; Monte Carlo Size : 10.000000; Starting time: 0.008701; Monte Carlo Size : 10.000000; Starting time: 0.635387; Monte Carlo Size : 10.000000; Starting time: 0.161781; Monte Carlo Size : 10.000000; Starting time: 0.006213; Monte Carlo Size : 10.000000; Starting time: 0.005910; Monte Carlo Size : 10.000000; Starting time: 0.007659; Monte Carlo Size : 10.000000; Starting time: 0.007824; Monte Carlo Size : 10.000000; Starting time: 0.006322; Monte Carlo Size : 5.000000; Starting time: 0.005984; Monte Carlo Size : 6.000000; Starting time: 0.005932; Monte Carlo Size : 6.000000; Starting time: 0.005939; Monte Carlo Size : 6.000000; Starting time: 0.006617; Monte Carlo Size : 6.000000; Starting time: 0.006071; Monte Carlo Size : 6.000000; Starting time: 0.094942; Monte Carlo Size : 6.000000; Starting time: 0.006779; Monte Carlo Size : 6.000000; Starting time: 0.005969; Monte Carlo Size : 6.000000; Starting time: 0.012818; Monte Carlo Size : 6.000000; Starting time: 0.009155; Monte Carlo Size : 6.000000; Starting time: 0.022845; Monte Carlo Size : 6.000000; Starting time: 0.154829; Monte Carlo Size : 10.000000; Starting time: 0.319019; Monte Carlo Size : 6.000000; Starting time: 0.692187; Monte Carlo Size : 6.000000; Starting time: 0.005742; Monte Carlo Size : 6.000000; Starting time: 0.006014; Monte Carlo Size : 6.000000; Starting time: 0.189341; Monte Carlo Size : 6.000000; Starting time: 0.258081; Monte Carlo Size : 6.000000; Starting time: 0.006084; Monte Carlo Size : 6.000000; Starting time: 0.887862; Monte Carlo Size : 6.000000; Starting time: 0.005848; Monte Carlo Size : 6.000000; Starting time: 0.009089; Monte Carlo Size : 6.000000; Starting time: 0.010174; Monte Carlo Size : 6.000000; Starting time: 0.005965; Monte Carlo Size : 6.000000; Starting time: 0.144982; Monte Carlo Size : 5.000000; Starting time: 0.001871; Monte Carlo Size : 5.000000; Starting time: 0.297407; Monte Carlo Size : 5.000000; Starting time: 0.001171; Monte Carlo Size : 10.000000; Starting time: 0.001427; Monte Carlo Size : 10.000000; Starting time: 0.004446; Monte Carlo Size : 10.000000; Starting time: 0.003990; Monte Carlo Size : 10.000000; Starting time: 0.168754; Monte Carlo Size : 10.000000; Starting time: 0.002662; Monte Carlo Size : 10.000000; Starting time: 0.006057; Monte Carlo Size : 10.000000; Starting time: 0.220507; Monte Carlo Size : 10.000000; Starting time: 0.004955; Monte Carlo Size : 10.000000; Starting time: 0.004405; Monte Carlo Size : 10.000000; Starting time: 0.034908; Monte Carlo Size : 10.000000; Starting time: 0.089922; Monte Carlo Size : 10.000000;
\ No newline at end of file
-C:/Users/H92579/Documents/Formation_PF/ex_PFD/Modele_Corse_PSEN_peak_good.pfd
-C:/Program Files/DIgSILENT/PowerFactory 2017 SP1/Python/3.5
+C:/Users/H92579/Documents/Formation_PF/ex_PFD/Maurice_2017_CoalSeasonNuit.pfd
+C:\Program Files\DIgSILENT\PowerFactory 2017 SP1\Python\3.5
C:/Python35
-C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33\package0_N_20190529_09h33m33
+C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190722_11h42m31\package0_N_20190722_11h42m31
def maFonction6(event):
+
+ print('usrCmdPF > maFonction6' )
quitting()
def quitting():
+
+ print('usrCmdPF > quitting')
can1.delete(proceeding)
can1.create_text(200,50,font=('Fixedsys',12),text="If you want to quit press button again...")
Button(root,text="Stop Simulation",font=("Fixedsys"),command=really_quitting).grid(row=4,column=1,sticky=N,padx=5)
def really_quitting():
- print ('quitting')
+ print('usrCmdPF > really_quitting')
root.destroy()
# création d'une instance de la classe TK, que l'on affecte à l'objet "root"
Button(root,text="Stop Simulation",font=("Fixedsys"),command=quitting).grid(row=4,column=1,sticky=N,padx=5)
root.bind("<q>", maFonction6) # lettre q
root.mainloop()
+
\r
import psspy\r
import redirect\r
-\r
+ \r
+ print('ExtractGeneratorLoadLineandTransfoDico > getNominalKV')\r
psspy.psseinit(100000)\r
redirect.psse2py()\r
psspy.progress_output(6)\r
idname = idname.replace('*','SW')\r
else:\r
idname = 'LI' + idname\r
-## try:\r
-## idname = 'LI' + str(int(idname))\r
-## except:\r
-## idname = 'LI' + idname\r
+\r
linename =carray[0][i].strip() + "__" + carray[1][i].strip() + "__" + idname\r
linename = linename.replace(" ","_")\r
linename = linename.replace("-","_")\r
linename="_" + linename\r
except:\r
pass\r
- #name = carray[0][i] + '-' + carray[1][i]\r
+\r
Options.LinesBaseList[linename] = nom\r
Options.LinesBase.append(nom)\r
Options.LineAreaList[linename] = [ Options.BusAreaList[carray[0][i]] , Options.BusAreaList[carray[1][i]] ]\r
nom1 = Options.BusBaseList[carray[0][i]]\r
nom2 = Options.BusBaseList[carray[1][i]]\r
idname = 'TR' + carray[2][i].strip()\r
-## try:\r
-## idname = 'Tr' + str(int(carray[4][i]))\r
-## except:\r
-## idname = 'Tr' + carray[4][i]\r
+\r
tfoname = carray[0][i].strip() + "__" + carray[1][i].strip() + "__" + idname\r
tfoname = tfoname.replace(" ","_")\r
tfoname = tfoname.replace("-","_")\r
except:\r
pass\r
\r
- #name = carray[0][i] + '-' + carray[1][i]\r
+\r
Options.TransfoBaseList[tfoname] = [nom1, nom2]\r
Options.TransfoBase.append([nom1, nom2])\r
Options.TransfoAreaList[tfoname] = [ Options.BusAreaList[carray[0][i]] , Options.BusAreaList[carray[1][i]] ]\r
#[Bus name 1, Bus name 2, Bus name 3, machine ID, extended bus name 1, extended bus name 2, extended bus name 3, bus number 1, bus number 2, bus number 3]\r
for i in range(len(iarray[0])):\r
idname = '3WNDTR' + carray[6][i].strip()\r
-## try:\r
-## idname = 'Tr' + str(int(carray[4][i]))\r
-## except:\r
-## idname = 'Tr' + carray[4][i]\r
+\r
nom1 = Options.BusBaseList[carray[0][i]]\r
nom2 = Options.BusBaseList[carray[1][i]]\r
nom3 = Options.BusBaseList[carray[2][i]]\r
Options.TransfoBase.append([nom1, nom2, nom3])\r
Options.TransfoAreaList[tfoname] = [ Options.BusAreaList[carray[0][i]] , Options.BusAreaList[carray[1][i]] , Options.BusAreaList[carray[2][i]] ]\r
\r
-## tfoname1 = carray[0][i].strip() + "__" + carray[1][i].strip() + "__" + carray[2][i].strip() + "__Wnd1__" + idname\r
-## tfoname2 = carray[0][i].strip() + "__" + carray[1][i].strip() + "__" + carray[2][i].strip() + "__Wnd2__" + idname\r
-## tfoname3 = carray[0][i].strip() + "__" + carray[1][i].strip() + "__" + carray[2][i].strip() + "__Wnd3__" + idname\r
-## for tfoname in [tfoname1,tfoname2,tfoname3]:\r
-## tfoname = tfoname.replace(" ","_")\r
-## tfoname = tfoname.replace("-","_")\r
-## tfoname = tfoname.replace(".","_")\r
-## tfoname = tfoname.replace("&","and")\r
-## try:\r
-## int(tfoname[0])\r
-## tfoname="_" + tfoname\r
-## except:\r
-## pass\r
-## Options.TransfoBaseList[tfoname] = [nom1, nom2, nom3]\r
-## Options.TransfoBase.append([nom1, nom2, nom3])\r
-\r
TransfosList = []\r
for item in Options.TransfoBase:\r
string = str(item[0]) + ' - ' + str(item[1])\r
\r
\r
def updateConts():\r
+\r
+ print('ExtractGeneratorLoadLineandTransfoDico > updateConts')\r
Options.ContFullList = []\r
tmp = Options.BusBaseList.keys()\r
tmp.sort()\r
for key in tmp:\r
Options.ContFullList.append(key)\r
tmp = Options.TransfoBaseList.keys()\r
-## trs = []\r
-## for tr in tmp:\r
-## if tr.split("__")[-1].startswith("3WNDTR"):\r
-## b = tr.split('__')\r
-## for j,val in enumerate(b):\r
-## if val.startswith("Wnd"):\r
-## del b[j]\r
-## tfo = '__'.join(b)\r
-## trs.append(tfo)\r
+\r
tmp.sort()\r
for key in tmp:\r
Options.ContFullList.append(key)\r
- #print Options.ContFullList\r
+\r
return Options.ContFullList\r
\r
def newContingency(MatList):\r
+ print('ExtractGeneratorLoadLineandTransfoDico > newContingency')\r
Options.CustomContingencies.append(MatList)\r
\r
def checkIfBorder(graph, key, depth, tmplist):\r
- #print "in checkifBorder"\r
- #print "depth ",depth\r
- #print graph\r
+\r
+ print('ExtractGeneratorLoadLineandTransfoDico > checkIfBorder')\r
if key in tmplist:\r
return True\r
if depth == 0:\r
import psspy\r
import redirect\r
\r
+ print('ExtractGeneratorLoadLineandTransfoDico > getTrueLines')\r
psspy.psseinit(100000)\r
redirect.psse2py()\r
psspy.progress_output(6)\r
import psspy\r
import redirect\r
\r
+ print('ExtractGeneratorLoadLineandTransfoDico > ExtractGeneratorLoadLineandTransfoDico')\r
###initialization PSSE\r
psspy.psseinit(100000)\r
_i=psspy.getdefaultint()\r
LoadDico = {} # [Bus name, load ID, extended bus name, bus number]\r
for i in range(len(iarray[0])):\r
idname = "LO" + carray[1][i].strip()\r
-# try: #id is an integer\r
-# idname = "Lo" + str(int(carray[1][i]))\r
-# except: #id is not an integer\r
-# idname = "Lo" + carray[1][i]\r
+\r
loadname = carray[0][i].strip()+ "__" + idname\r
loadname = loadname.replace(" ","_")\r
loadname = loadname.replace("-","_")\r
MachineDico = {} # [Bus name, machine ID, extended bus name, bus number]\r
for i in range(len(iarray[0])):\r
idname = "GR" + carray[1][i].strip()\r
-## try:\r
-## idname = "Gr" + str(int(carray[1][i]))\r
-## except:\r
-## idname = "Gr" + carray[1][i]\r
+\r
machinename = carray[0][i].strip()+ "__" + idname\r
machinename = machinename.replace(" ","_")\r
machinename = machinename.replace("-","_")\r
MotorDico = {} # [Bus name, machine ID, extended bus name, bus number]\r
for i in range(len(iarray[0])):\r
idname = "MO" + carray[1][i].strip()\r
-## try:\r
-## idname = "Gr" + str(int(carray[1][i]))\r
-## except:\r
-## idname = "Gr" + carray[1][i]\r
+\r
motorname = carray[0][i].strip()+ "__" + idname\r
motorname = motorname.replace(" ","_")\r
motorname = motorname.replace("-","_")\r
TfoDico = {} #[linename, Bus name 1, Bus name 2, machine ID, extended bus name 1, extended bus name 2, bus number 1, bus number 2]\r
for i in range(len(iarray[0])):\r
idname = 'TR' + carray[4][i].strip()\r
-## try:\r
-## idname = 'Tr' + str(int(carray[4][i]))\r
-## except:\r
-## idname = 'Tr' + carray[4][i]\r
+\r
tfoname = carray[0][i].strip() + "__" + carray[1][i].strip() + "__" + idname\r
tfoname = tfoname.replace(" ","_")\r
tfoname = tfoname.replace("-","_")\r
#[Bus name 1, Bus name 2, Bus name 3, machine ID, extended bus name 1, extended bus name 2, extended bus name 3, bus number 1, bus number 2, bus number 3]\r
for i in range(len(iarray[0])):\r
idname = '3WNDTR' + carray[6][i].strip()\r
-## try:\r
-## idname = 'Tr' + str(int(carray[4][i]))\r
-## except:\r
-## idname = 'Tr' + carray[4][i]\r
+\r
tfoname = carray[0][i].strip() + "__" + carray[1][i].strip() + "__" + carray[2][i].strip() + "__" + idname\r
tfoname = tfoname.replace(" ","_")\r
tfoname = tfoname.replace("-","_")\r
\r
TfoDico[tfoname] = TR3dico\r
BranchesDico[tfoname] = TR3dico\r
- #print MachineDico, LoadDico, LineDico, TfoDico, MotorDico, BusDico, BranchesDico, BusNominal, BusArea\r
+\r
return MachineDico, LoadDico, LineDico, TfoDico, MotorDico, BusDico, BranchesDico, BusNominal, BusArea\r
\r
if Debug:\r
idx = 0\r
MachineDico, LoadDico, LineDico, TfoDico, MotorDico, BusDico, BranchesDico, BusNominal, BusArea = ExtractGeneratorLoadLineandTransfoDico(it, idx, NetworkFile, PSSE_PATH, PSSPY_PATH)\r
\r
-#updateConts()\r
+\r
+++ /dev/null
-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
\ No newline at end of file
def getNominalkV(NetworkFile):
-
+ print('PFExtractGeneratorLoadLineandTransfoDico > getNominalkV')
with open('Data_for_interface', 'rb') as fichier:#prendre les donnees dans fichier pickle
mon_depickler = pickle.Unpickler(fichier)
data_file = mon_depickler.load()
def convert_keys_to_string(dictionary):
+ # print('PFExtractGeneratorLoadLineandTransfoDico > convert_keys_to_string')
"""Recursively converts dictionary keys to strings."""
if not isinstance(dictionary, dict):
return dictionary
return BusList, LinesList, TransfosList,BusDico
def updateConts():
+ print('PFExtractGeneratorLoadLineandTransfoDico > updateConts')
Options.ContFullList = []
tmp = list(Options.BusBaseList.keys())
tmp.sort()
tmp.sort()
for key in tmp:
Options.ContFullList.append(key)
- #print Options.ContFullList
return Options.ContFullList
def newContingency(MatList):
+ print('PFExtractGeneratorLoadLineandTransfoDico > newContingency')
Options.CustomContingencies.append(MatList)
def checkIfBorder(graph, key, depth, tmplist):
return False
def getTrueLines(NetworkFile):
+ print('PFExtractGeneratorLoadLineandTransfoDico > getTrueLines')
with open('Data_for_interface', 'rb') as fichier:
mon_depickler = pickle.Unpickler(fichier)
data_file = mon_depickler.load()
def convert_keys_to_string(dictionary):
+ # print('PFExtractGeneratorLoadLineandTransfoDico > convert_keys_to_string')
"""Recursively converts dictionary keys to strings."""
if not isinstance(dictionary, dict):
return dictionary
def PFExtractGeneratorLoadLineandTransfoDico(it, idx, NetworkFile, PF_PATH,Python3_path):
-
+ print('PFExtractGeneratorLoadLineandTransfoDico > PFExtractGeneratorLoadLineandTransfoDico')
path1 = os.getcwd()
filew = open('temp.txt', 'w')
filew.write(NetworkFile + '\n')
def convert_keys_to_string(dictionary):
+ # print('PFExtractGeneratorLoadLineandTransfoDico > convert_keys_to_string')
"""Recursively converts dictionary keys to strings."""
if not isinstance(dictionary, dict):
return dictionary
class sd_transfo ( ASSD ) : pass
class sd_moteur ( ASSD ) : pass
#
-
+print('PSEN_Cata_Contingency')
# import types
class Tuple:
def __init__(self,ntuple):
class sd_transfo ( ASSD ) : pass
class sd_moteur ( ASSD ) : pass
#
-
+print('PSEN_Cata_DataProcessing')
# import types
class Tuple:
def __init__(self,ntuple):
class sd_transfo ( ASSD ) : pass
class sd_moteur ( ASSD ) : pass
#
-
+print('PSEN_Cata_DataProcessing_PF')
# import types
class Tuple:
def __init__(self,ntuple):
class sd_transfo ( ASSD ) : pass
class sd_moteur ( ASSD ) : pass
#
-
+print('PSEN_Cata_N1_PF')
# import types
class Tuple:
def __init__(self,ntuple):
def drawChart(storage, excel, sheet):
+
+ print('Chart > drawChart')
# Output values on the sheet
sheet.Cells(1, 1).Value = 'Average'
sheet.Cells(1, 2).Value = 'Min'
markerstyle = 8 # Definit le style des marqueurs (8 = rond)
chart.SeriesCollection(1).Name = 'Average'
- chart.SeriesCollection(1).MarkerStyle = markerstyle # Applique la taille des markers
- chart.SeriesCollection(1).MarkerSize = markersize # Applique le style des marqueurs
+ chart.SeriesCollection(1).MarkerStyle = markerstyle # Applique la taille des markers
+ chart.SeriesCollection(1).MarkerSize = markersize # Applique le style des marqueurs
chart.SeriesCollection(2).Name = 'Min'
- chart.SeriesCollection(2).MarkerStyle = markerstyle # Applique la taille des markers
- chart.SeriesCollection(2).MarkerSize = markersize # Applique le style des marqueurs
+ chart.SeriesCollection(2).MarkerStyle = markerstyle # Applique la taille des markers
+ chart.SeriesCollection(2).MarkerSize = markersize # Applique le style des marqueurs
chart.SeriesCollection(3).Name = 'Max'
- chart.SeriesCollection(3).MarkerStyle = markerstyle # Applique la taille des markers
- chart.SeriesCollection(3).MarkerSize = markersize # Applique le style des marqueurs
-
+ chart.SeriesCollection(3).MarkerStyle = markerstyle # Applique la taille des markers
+ chart.SeriesCollection(3).MarkerSize = markersize # Applique le style des marqueurs
+
if sheet.Name != "Bus":
chart.Name = 'Average ' + sheet.Name + ' load'
chart.Axes(1).AxisTitle.Caption = "Case" # Definit le titre de l'axe des abscisses
chart.Axes(2).HasTitle = True # Cree le champs de titre de l'axe des ordonnees
- chart.Axes(2).AxisTitle.Caption = "Loading (%)" # Definit le titre de l'axe des ordonnees
+ chart.Axes(2).AxisTitle.Caption = "Loading (%)" # Definit le titre de l'axe des ordonnees
else:
chart.Name = 'Average ' + sheet.Name + ' voltage'
chart.Axes(2).AxisTitle.Caption = "Voltage (p.u.)" # Definit le titre de l'axe des ordonnees
def outputChart(wb):
+
+ print('Chart > outputChart')
# Sorting data by mean, to draw readable charts
try:
Options.BusStorage.sort(key = lambda x: x[0], reverse = True)
On distingue 2 cas, l'utilisateur a deja lance une Post Calculation Analysis precedemment ou non
"""
- if len(Dico['N_PROCESSING_OPTIONS'])==3: # L'utilisateur n'a pas selectionne l'option Threshold dans PSEN
+ if len(Dico['N_PROCESSING_OPTIONS'])==3: # L'utilisateur n'a pas selectionne l'option Threshold dans PSEN
- if not os.path.isfile(os.path.join(Options.FolderList[0],'N_Processed.xlsx')): # Premiere simulation de l'utilisateur, il n'y pas de fichier N_Processed deja existant
+ if not os.path.isfile(os.path.join(Options.FolderList[0],'N_Processed.xlsx')): # Premiere simulation de l'utilisateur, il n'y pas de fichier N_Processed deja existant
fileName = Options.FolderList[0] + '/N_Processed.xlsx'
- fileW = open(Options.FolderList[0]+'/iteration.txt', 'w') # On crée un fichier externe qui compte le nombre de Data Processing déjà effectué par l'utilisateur
+ fileW = open(Options.FolderList[0]+'/iteration.txt', 'w') # On crée un fichier externe qui compte le nombre de Data Processing déjà effectué par l'utilisateur
fileW.write(str(1))
fileW.close()
- else: # N-ieme simulation de l'utilisateur, il y a deja un fichier N_Processed existant
+ else: # N-ieme simulation de l'utilisateur, il y a deja un fichier N_Processed existant
- fileR = open (Options.FolderList[0]+'/iteration.txt', 'r') # On lit le fichier iteration.txt crée lors du premier Data Processing
+ fileR = open (Options.FolderList[0]+'/iteration.txt', 'r') # On lit le fichier iteration.txt crée lors du premier Data Processing
compteur = int(fileR.read())
fileR.close()
fileName = Options.FolderList[0] + '/N_Processed_' + str(compteur) + '.xlsx'
- fileW = open(Options.FolderList[0]+'/iteration.txt', 'w') # On incrémente le fichier iteration.txt crée lors du premier Data Processing
+ fileW = open(Options.FolderList[0]+'/iteration.txt', 'w') # On incrémente le fichier iteration.txt crée lors du premier Data Processing
fileW.write(str(compteur + 1))
fileW.close()
- else: # L'utilisateur a selectionne l'option Threshold dans PSEN
+ else: # L'utilisateur a selectionne l'option Threshold dans PSEN
- if not os.path.isfile(os.path.join(Options.FolderList[0],'N_Processed_Threshold.xlsx')): # Premiere simulation de l'utilisateur, il n'y pas de fichier N_Processed deja existant
+ if not os.path.isfile(os.path.join(Options.FolderList[0],'N_Processed_Threshold.xlsx')): # Premiere simulation de l'utilisateur, il n'y pas de fichier N_Processed deja existant
fileName = Options.FolderList[0] + '/N_Processed_Threshold.xlsx'
else:
- fileR = open (Options.FolderList[0]+'/iteration_Threshold.txt', 'r') # N-ieme simulation de l'utilisateur, il y a deja un fichier N_Processed existant
+ fileR = open (Options.FolderList[0]+'/iteration_Threshold.txt', 'r') # N-ieme simulation de l'utilisateur, il y a deja un fichier N_Processed existant
compteur_Threshold = int(fileR.read())
fileR.close()
## processedData : tableau de retour
## name : nom du fichier csv
+ print('Compute > createDoubleArray')
if ' flows ' in name.lower() and ' loadshed ' not in name.lower() and ' voltage ' not in name.lower():
column_start = 4
elif ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
def createDoubleArray(data, processedData, name):
+ print('Compute_save > createDoubleArray')
if ' flows ' in name.lower() and ' loadshed ' not in name.lower() and ' voltage ' not in name.lower():
column_start = 5
elif ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
def init():
global initialized, app, window, mainWidget, layout, tabManager
initialized = True
+
+ print('Display > init')
# initialization of Qt
app = QApplication(sys.argv)
window = QMainWindow()
def addFloatOption(_layout, option, text, default, posX, _type = 'f', maxWidth = 0):
@pyqtSlot()
+ print('Display > addFloatOption')
def changeValue(option, text):
tmp = option[0]
try:
def addBoolOption(_layout, option, text, posX, default = 1, val1 = 'True', val2 = 'False', _type = bool, val3 = None, val4 = None, val5 = None):
# This function extracts the first int or float contained in the string passed as a parameter
+ print('Display > addBoolOption')
def parseCustomString(string, _type):
it = 0
for letter in string:
def updateBusChecked(text, variable, checked):
# Format is either '123.0' for buses and lines or '123.0-50.0' in the case of a transformer
+ print('Display > updateBusChecked')
i = 0
while i < len(text) and ((text[i] >= '0' and text[i] <= '9') or text[i] == '.'):
i += 1
variable.remove(mi)
def updateBusLayout(layout, toDisplay, variable):
+ print('Display > updateBusLayout')
# Remove the previous layout
item = layout.itemAtPosition(0, 0)
layout.removeItem(item)
layout.addWidget(box, 0, 0)
def updateBus(layouts):
+ print('Display > updateBus')
if Options.GetSavsfromFolder[0]:
FileList = os.listdir(Options.FolderList[0])
SavFileList = []
updateBusLayout(layouts[5], toDisplay, Options.AutoN2Transfos)
def updateConts():
+
+ print('Display > updateConts')
Options.ContFullListWidget.clear()
tmp = Options.BusBaseList.keys()
tmp.sort()
Options.ContFullListWidget.addItem(key)
def setVariable(variable, typ, num, value):
+
+ print('Display > setVariable')
tmp = variable[num]
try:
if typ == int:
variable[num] = tmp
def initPathSelection(_layout, text, variable, posX, layouts = []):
+
+ print('Display > initPathSelection')
label = QLabel(text)
label.setMaximumHeight(20)
label.setMinimumHeight(20)
fileSelectButton.clicked.connect(partial(browseFolder, lineEdit, variable, layouts))
def checkVariable(item, checked):
+
+ print('Display > checkVariable')
item[0] = checked
BusLayout = QGridLayout()
def initCaseTab(mainWidget):
global layouts
+
+ print('Display > initCaseTab')
_layout = QGridLayout(mainWidget)
initPathSelection(_layout, 'PSSE BIN folder path:', Options.PSSE_PATH, 1, layouts)
_layout.addWidget(CSVbox, 15, 1)
def initContingencyTab(mainWidget):
+
+ print('Display > initContingencyTab')
_layout = QGridLayout(mainWidget)
addFloatOption(_layout, Options.Vmin, 'Vmin:', 0.90, 0)
addFloatOption(_layout, Options.Vmax, 'Vmax:', 1.10, 1)
addBoolOption(_layout, Options.TripGenerators, 'Trip generators', 8)
def initOutputTab(mainWidget):
+
+ print('Display > initOutputTab')
_layout = QGridLayout(mainWidget)
addBoolOption(_layout, Options.MultipleContingencyReport, 'Output PSSE multiple contingency report to Shell ?', 0, 2)
addBoolOption(_layout, Options.WriteIndivExcels, 'Write an Excel file for the results of each case file ?', 1, 2)
addBoolOption(_layout, Options.WriteFlowDifs, 'Add a tab in Excel results file for the differences between the max flow rate (MVAR)\nand the actual flow rate in lines and transformers', 2, 2)
def initLoadFlowTab(mainWidget):
+
+ print('Display > initLoadFlowTab')
_layout = QGridLayout(mainWidget)
addBoolOption(_layout, Options.AdjTaps, 'Taps adjustment:', 0, 2, '0 - Lock', '1 - Stepping', int, '2 - Direct')
addBoolOption(_layout, Options.AdjDCtaps, 'DC taps adjustment:', 1, 2, '0 - Disable', '1 - Enable', int)
def initNProcessTab(mainWidget):
_layout = QGridLayout(mainWidget)
-
+ print('Display > initNProcessTab')
@pyqtSlot()
def updateBox(id, checked):
Options.OutputNValues[id] = checked
_layout.addWidget(QLabel(''), 5, 0)
def initProcessTab(mainWidget, window):
+
+ print('Display > initProcessTab')
_layout = QGridLayout(mainWidget)
linesList = QListWidget()
lines2List.itemSelectionChanged.connect(partial(onSelectChange, False, namesList, linesList, lines2List))
def initNkTab(mainWidget):
+
+ print('Display > initNkTab')
_layout = QGridLayout(mainWidget)
Options.ContFullListWidget = QListWidget()
Options.ContFullListWidget.setSelectionMode(QAbstractItemView.ExtendedSelection)
_layout.addWidget(RemoveContButton, 1, 1)
def initN1Tab(mainWidget):
+
+ print('Display > initN1Tab')
_layout = QGridLayout(mainWidget)
### Selection from file ###
import Compute
#from Run import *
import pickle
-from UpdateOptions import UpdateProcessorOptions
+from UpdateOptions import UpdateProcessorOptions
#from itertools import izip_longest # Reverse the double array
#from future.moves.itertools import zip_longest
import itertools
import win32com.client as win32
def getXLSinfo(filename):
+
+ print('Processor > getXLSinfo')
wb = xlrd.open_workbook(filename)
sheets = wb.sheet_names()
ret = {}
return ret
def getCSVinfo(csvfilename):
+
+ print('Processor > getCSVinfo')
foldername = os.path.dirname(csvfilename)
sheets =[]
for file in os.listdir(foldername):
return ret
def processXLS(dico):
- print('je suis dans processor')
+ print('Processor > processXLS')
UpdateProcessorOptions(dico)
-
- wb = xlrd.open_workbook(Options.csvFileName)
+ 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')
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'
+ Voltage ==> 'Bus' ; 'Max Voltage' ; 'Min Voltage' ; 'Number of Violations'
+ Flows ==> 'Branch' ; 'Max Violation' ; 'Number of Violations'
"""
- input_excel = pd.ExcelFile(input_path)
-
+ 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):]
+ max_value_sheet = filename + ' Max Value' + name[len(filename):]
+ min_value_sheet = filename + ' Min Value' + name[len(filename):]
+ max_occu_sheet = filename + ' Max Occurence' + name[len(filename):]
+ min_occu_sheet = filename + ' Min Occurence' + name[len(filename):]
- sheet_names_all[name]=[max_sheet, min_sheet, occu_sheet]
+ sheet_names_all[name]=[max_value_sheet, max_occu_sheet, min_value_sheet, min_occu_sheet]
elif 'Flows' in name:
- max_sheet = filename + ' Max' + name[len(filename):]
- occu_sheet = filename + ' Occurence' + name[len(filename):]
+ max_value_sheet = filename + ' Max Value' + name[len(filename):]
+ max_occu_sheet = filename + ' Max Occurence' + name[len(filename):]
- sheet_names_all[name]=[max_sheet, occu_sheet]
+ sheet_names_all[name]=[max_value_sheet, max_occu_sheet]
nomColonne = "'" + 'Component_List_For_'+ str(name) + "'"
nomColonne = nomColonne.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)
"""
for col in df.columns:
if 'Case' in col:
- nb_cases+=1
+ 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
+ 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:
+ if 'Max Value' in sheet:
value_label = 'Max Voltage'
- elif 'Min' in sheet:
+ elif 'Min Value' in sheet:
value_label = 'Min Voltage'
- elif 'Occurence' in sheet:
- value_label = 'Number of Violations'
+ elif 'Max Occurence' in sheet:
+ value_label = 'High Voltages'
+ elif 'Min Occurence' in sheet:
+ value_label = 'Low Voltages'
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:
ite += 1
elif 'Flows' in sheet_keys:
-
compo_label = 'Branch'
ite = 0
"""
On vient recuperer differentes valeurs en fonction de l onglet dans lequel on se trouve (Max/Occurence)
"""
-
- if 'Max' in sheet:
+ if 'Max Value' in sheet:
value_label = 'Max Violation'
- elif 'Occurence' in sheet:
+ elif 'Max 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:
ite += 1
else:
- break
+ print('Il y a une erreur dans le nom des onglets')
-
writer.save()
"""
def processXLS_out(dico):
+
+ print('Processor > processXLS_out')
UpdateProcessorOptions(dico)
indexes = {}
toGather = {}
xlsToOutput(processedData)
def gatherXlsData(wb, sheets, data, totalData):
+
+ print('Processor > gatherXlsData')
for name in sheets:
sheet = wb.sheet_by_name(name)
data[name] = []
data[name][i].append('N/A')
def gatherCsvData(sheets, data, totalData):
+
+ print('Processor > gatherCsvData')
# try: #python 2
for name in sheets:
ACCCresultsfolder = os.path.dirname(Options.csvFileName)
def isData(row):
+
+ print('Processor > isData')
for item in row:
try:
v = float(item)
def xlsToOutput(data):
+
+ print('Processor > xlsToOutput')
ACCCresultsfolder = os.path.dirname(Options.csvFileName)
filename = os.path.join(ACCCresultsfolder,"ACCCresults_processed.xlsx")
workbook = xlsxwriter.Workbook(filename)
def xlsToCsv(indexes, data): #if too much data to be written to xls file, output a csv
+
+ print('Processor > xlsToCsv')
for name in data:
if Options.csvFileName.endswith('.csv'):
ACCCresultsfolder = os.path.dirname(Options.csvFileName)
print( 'Processing over.')
def xlsToCsvPython3(indexes, data): #if too much data to be written to xls file, output a csv
+
+ print('Processor > xlsToCsvPython3')
for name in data:
if Options.csvFileName.endswith('.csv'):
ACCCresultsfolder = os.path.dirname(Options.csvFileName)
def xlsToXls(indexes, data):
- print('xlsToXls')
+ print('Processor > xlsToXls')
palette = []
newWb = xlwt.Workbook(style_compression = 2)
def fill_matrice(dataframe, component_label, component, contingency_label, contingency, value_label, nb_cases):
+ print('Processor > fill_matrice')
import pandas as pd
"""
"""
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':
+ if ('Min' in value_label) or ('Max' in value_label):
for i in range(len(component)):
except:
pass
- else:
+ else :
for i in range(len(component)):
"""
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
"""
pass
return output_excel
+
if __name__ == '__main__':
--- /dev/null
+import xlrd # XLS read
+import xlwt # XLS write
+import csv
+import pdb
+
+import Options
+import Compute
+#from Run import *
+import pickle
+from UpdateOptions import UpdateProcessorOptions
+#from itertools import izip_longest # Reverse the double array
+#from future.moves.itertools import zip_longest
+import itertools
+import os
+import xlsxwriter
+
+import os
+import pandas as pd
+import win32com.client as win32
+
+def getXLSinfo(filename):
+ wb = xlrd.open_workbook(filename)
+ sheets = wb.sheet_names()
+ ret = {}
+ for name in sheets:
+ sheet = wb.sheet_by_name(name)
+ ret[name] = [[],[]]
+ for i in range(0, sheet.nrows):
+ data = str(sheet.cell_value(i, 0))
+ if data not in ret[name][0]:
+ ret[name][0].append(data)
+ data = str(sheet.cell_value(i, 1))
+ if data not in ret[name][1]:
+ ret[name][1].append(data)
+ return ret
+
+def getCSVinfo(csvfilename):
+ foldername = os.path.dirname(csvfilename)
+ sheets =[]
+ for file in os.listdir(foldername):
+ if file.endswith('.csv') and (' Voltage ' in file or ' FlowsDif ' in file or ' Flows ' in file or ' LoadShed ' in file) and 'processed_' not in file.lower():
+ sheets.append(file[0:-4])
+ ret = {}
+ for name in sheets:
+ ACCCresultsfile = os.path.join(foldername, name + '.csv')
+ try: #python 2 compatible
+ h = open(ACCCresultsfile,"rb")
+ crd = csv.reader(h,delimiter=";")
+ ret[name] = [[],[]]
+ for i, row in enumerate(crd):
+ if len(row)>2:
+ data = str(row[0])
+ if data not in ret[name][0]:
+ ret[name][0].append(data)
+ data = str(row[1])
+ if data not in ret[name][1]:
+ ret[name][1].append(data)
+ h.close()
+ except: #python 3 compatible
+ h = open(ACCCresultsfile,"r",newline='')
+ crd = csv.reader(h,delimiter=";")
+ ret[name] = [[],[]]
+ for i, row in enumerate(crd):
+ if len(row)>2:
+ data = str(row[0])
+ if data not in ret[name][0]:
+ ret[name][0].append(data)
+ data = str(row[1])
+ if data not in ret[name][1]:
+ ret[name][1].append(data)
+ h.close()
+ return ret
+
+def processXLS(dico):
+ print('je suis dans processor')
+
+ UpdateProcessorOptions(dico)
+
+ wb = xlrd.open_workbook(Options.csvFileName)
+ """
+ on recupere les feuilles du fichier Excel
+ """
+ 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 de creer 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 = {}
+
+
+ """
+ cette boucle for permet de créer un dictionnaire contenant tous les onglets de notre fichier output
+ """
+ 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):]
+ ## max_occ et min_occ a ajouter
+
+ 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]
+
+ ## ligne et tr a voir comment sont stockees les donnees
+
+ 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, quatre grandeurs vont nous interesser (Max Valeur/Min Valeur/Max Occurence, 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/Max Occurence, 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'
+
+ ## Ajouter max occu et min occu
+
+ 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' ## ajouter transfo ou pas
+ 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 ##mettre un message d'erreur a la place du 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()
+
+
+
+def processXLS_out(dico):
+
+ UpdateProcessorOptions(dico)
+ indexes = {}
+ toGather = {}
+ data = {}
+ totalData = {}
+ # pdb.set_trace()
+
+ 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) :
+ # print(file[0:-4])
+ 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 = {}
+
+ for name in sheets:
+
+ try:
+
+ nomColonne = "'"+'Component_List_For_'+str(name)+"'"
+ nomColonne = nomColonne.replace('_ ',' _')
+
+ nomLigne = "'"+'Contingency_List_For_'+str(name)+"'"
+ nomLigne = nomLigne.replace('_ ',' _')
+
+
+ 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]
+
+ processedData[name] = [[]]
+
+ processedData[name] = Compute.createDoubleArray(totalData[name], processedData[name], name)
+
+ except KeyError:
+ print("error dans ecriture acc results")
+ pass
+
+ xlsToOutput(processedData)
+
+def gatherXlsData(wb, sheets, data, totalData):
+ for name in sheets:
+ sheet = wb.sheet_by_name(name)
+ data[name] = []
+ totalData[name] = []
+
+ for i in range(0, sheet.nrows):
+ totalData[name].append([])
+ data[name].append([])
+ for j in range(0, sheet.ncols):
+ # Store data anyway in totalData
+ if i == 0:
+ totalData[name][i] = [j]
+ try:
+ totalData[name][i].append(float(sheet.cell_value(i, j)))
+ except:
+ totalData[name][i].append(sheet.cell_value(i, j))
+ try:
+ if j == 0:
+ try:
+ if sheet.cell_value(i, 0) in Options.selectedDoubleRow[name] and sheet.cell_value(i, 1) in Options.selectedDoubleCol[name]:
+ pass
+ else:
+ break
+ except:
+ break
+ if i == 0:
+ data[name][i] = [j]
+ data[name][i].append(float(sheet.cell_value(i, j)))
+ except:
+ data[name][i].append('N/A')
+
+def gatherCsvData(sheets, data, totalData):
+ # try: #python 2
+ for name in sheets:
+ ACCCresultsfolder = os.path.dirname(Options.csvFileName)
+ ACCCresultsfile = os.path.join(ACCCresultsfolder,name + '.csv')
+ h = open(ACCCresultsfile,"rb")
+ 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]
+ continue
+ try:
+ totalData[name][i].append(float(row[j]))
+ except:
+ totalData[name][i].append(row[j])
+
+
+
+ h.close()
+
+
+def isData(row):
+ for item in row:
+ try:
+ v = float(item)
+ if v > 0:
+ return True
+ except:
+ try:
+ v = float(item['mean'])
+ if v >= 0: #used to be > 0 but want to keep zero cases!!
+ return True
+ except:
+ pass
+ return False
+
+
+def xlsToOutput(data):
+ ACCCresultsfolder = os.path.dirname(Options.csvFileName)
+ filename = os.path.join(ACCCresultsfolder,"ACCCresults_processed.xlsx")
+ workbook = xlsxwriter.Workbook(filename)
+ worksheet = workbook.add_worksheet()
+ row = 0
+
+ for colonne in data:
+ col=0
+ for cellule in colonne:
+ worksheet.write(col, row, cellule)
+ col = col+1
+ row = row+1
+ workbook.close()
+
+
+def xlsToCsv(indexes, data): #if too much data to be written to xls file, output a csv
+ for name in data:
+ if Options.csvFileName.endswith('.csv'):
+ ACCCresultsfolder = os.path.dirname(Options.csvFileName)
+ newSheet = os.path.join(ACCCresultsfolder,"Processed_" + name +'.csv')
+ totalsSheet = os.path.join(ACCCresultsfolder,"Processed_" + name + '_Total.csv')
+ if 'voltage' in name.lower() and 'loadshed' not in name.lower():
+ zerosSheet = os.path.join(ACCCresultsfolder,"Processed_" + name + '_Zeros.csv')
+ recapSheet = os.path.join(ACCCresultsfolder,"Processed_" + name + '_Recap.csv')
+ elif Options.csvFileName.endswith('.xls') or Options.csvFileName.endswith('.xlsx'):
+ newSheet = Options.csvFileName[:-4] + '_processed_' + name + '.csv'
+ totalsSheet = Options.csvFileName[:-4] + '_processed_' + name + '_Total.csv'
+ if 'voltage' in name.lower() and 'loadshed' not in name.lower():
+ zerosSheet = Options.csvFileName[:-4] + '_processed_' + name + '_Zeros.csv'
+ recapSheet = Options.csvFileName[:-4] + '_processed_' + name + '_Recap.csv'
+ with open(newSheet, 'wb') as csvfile:
+ writer = csv.writer(csvfile, delimiter = ';')
+ flatData = []
+ # Flatten data to remove all dict items
+ for row in data[name]:
+ newRow = []
+ for item in row:
+ if type(item) == dict:
+ try:
+ newRow.append(item['mean'])
+ except:
+ print(item)
+ else:
+ newRow.append(item)
+ flatData.append(newRow)
+ for row in flatData:
+ writer.writerow(row)
+ print('A file has been saved under ' + newSheet + '.')
+
+ with open(totalsSheet, 'wb') as csvfile:
+ writer = csv.writer(csvfile, delimiter = ';')
+ flatData = []
+ # Flatten data to remove all dict items
+ for row in data[name]:
+ newRow = []
+ for item in row:
+ if type(item) == dict:
+ try:
+ newRow.append(item['badcase'])
+ except:
+ print(item)
+ else:
+ newRow.append(item)
+ flatData.append(newRow)
+ for row in flatData:
+ writer.writerow(row)
+ print ('A file has been saved under ' + totalsSheet + '.')
+
+ if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
+ with open(zerosSheet, 'wb') as csvfile:
+ writer = csv.writer(csvfile, delimiter = ';')
+ flatData = []
+ # Flatten data to remove all dict items
+ for row in data[name]:
+ newRow = []
+ for item in row:
+ if type(item) == dict:
+ try:
+ newRow.append(item['zerocase'])
+ except:
+ print (item)
+ else:
+ newRow.append(item)
+ flatData.append(newRow)
+ for row in flatData:
+ writer.writerow(row)
+ print( 'A file has been saved under ' + zerosSheet + '.')
+
+ with open(recapSheet, 'wb') as csvfile:
+ writer = csv.writer(csvfile, delimiter = ';')
+ flatData = []
+ # Flatten data to remove all dict items
+ for row in data[name]:
+ newRow = []
+ for item in row:
+ if type(item) == dict:
+ try:
+ if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
+ newRow.append(str(item['mean']) + ' / ' + str(item['badcase']) + ' / ' + str(item['zerocase']))
+ else:
+ newRow.append(str(item['mean']) + ' / ' + str(item['badcase']) )
+ except:
+ print (item)
+ else:
+ newRow.append(item)
+ flatData.append(newRow)
+ for row in flatData:
+ writer.writerow(row)
+ print( 'A file has been saved under ' + recapSheet + '.')
+
+ print( 'Processing over.')
+
+def xlsToCsvPython3(indexes, data): #if too much data to be written to xls file, output a csv
+ for name in data:
+ if Options.csvFileName.endswith('.csv'):
+ ACCCresultsfolder = os.path.dirname(Options.csvFileName)
+ newSheet = os.path.join(ACCCresultsfolder,"Processed_" + name +'.csv')
+ totalsSheet = os.path.join(ACCCresultsfolder,"Processed_" + name + '_Total.csv')
+ if 'voltage' in name.lower() and 'loadshed' not in name.lower():
+ zerosSheet = os.path.join(ACCCresultsfolder,"Processed_" + name + '_Zeros.csv')
+ recapSheet = os.path.join(ACCCresultsfolder,"Processed_" + name + '_Recap.csv')
+ elif Options.csvFileName.endswith('.xls') or Options.csvFileName.endswith('.xlsx'):
+ newSheet = Options.csvFileName[:-4] + '_processed_' + name + '.csv'
+ totalsSheet = Options.csvFileName[:-4] + '_processed_' + name + '_Total.csv'
+ if 'voltage' in name.lower() and 'loadshed' not in name.lower():
+ zerosSheet = Options.csvFileName[:-4] + '_processed_' + name + '_Zeros.csv'
+ recapSheet = Options.csvFileName[:-4] + '_processed_' + name + '_Recap.csv'
+ with open(newSheet, 'w', newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter = ';')
+ flatData = []
+ # Flatten data to remove all dict items
+ for row in data[name]:
+ newRow = []
+ for item in row:
+ if type(item) == dict:
+ try:
+ newRow.append(item['mean'])
+ except:
+ print(item)
+ else:
+ newRow.append(item)
+ flatData.append(newRow)
+ for row in flatData:
+ writer.writerow(row)
+ print('A file has been saved under ' + newSheet + '.')
+
+ with open(totalsSheet, 'w', newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter = ';')
+ flatData = []
+ # Flatten data to remove all dict items
+ for row in data[name]:
+ #print( row)
+ newRow = []
+ for item in row:
+ if type(item) == dict:
+ try:
+ newRow.append(item['badcase'])
+ except:
+ print( item)
+ else:
+ newRow.append(item)
+ flatData.append(newRow)
+ for row in flatData:
+ writer.writerow(row)
+ print ('A file has been saved under ' + totalsSheet + '.')
+
+ if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
+ with open(zerosSheet, 'w', newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter = ';')
+ flatData = []
+ # Flatten data to remove all dict items
+ for row in data[name]:
+ newRow = []
+ for item in row:
+ if type(item) == dict:
+ try:
+ newRow.append(item['zerocase'])
+ except:
+ print (item)
+ else:
+ newRow.append(item)
+ flatData.append(newRow)
+ for row in flatData:
+ writer.writerow(row)
+ print( 'A file has been saved under ' + zerosSheet + '.')
+
+ with open(recapSheet, 'w', newline='') as csvfile:
+ writer = csv.writer(csvfile, delimiter = ';')
+ flatData = []
+ # Flatten data to remove all dict items
+ for row in data[name]:
+ newRow = []
+ for item in row:
+ if type(item) == dict:
+ try:
+ if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
+ newRow.append(str(item['mean']) + ' / ' + str(item['badcase']) + ' / ' + str(item['zerocase']))
+ else:
+ newRow.append(str(item['mean']) + ' / ' + str(item['badcase']) )
+ except:
+ print (item)
+ else:
+ newRow.append(item)
+ flatData.append(newRow)
+ for row in flatData:
+ writer.writerow(row)
+ print( 'A file has been saved under ' + recapSheet + '.')
+
+ print( 'Processing over.')
+
+def xlsToXls(indexes, data):
+
+ print('xlsToXls')
+
+ palette = []
+ newWb = xlwt.Workbook(style_compression = 2)
+ color = 8
+ for name in data:
+ # print( name)
+ newSheet = newWb.add_sheet(name)
+ totalsSheet = newWb.add_sheet(name + '_Total')
+ if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
+ zerosSheet = newWb.add_sheet(name + '_Zeros')
+ recapSheet = newWb.add_sheet(name + '_Recap')
+ i = 0
+ j = 0
+ for row in data[name]:
+
+ n = 0
+ for item in row:
+
+ try:
+ newSheet.write(i, n, item)
+ totalsSheet.write(i, n, item)
+ if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
+ zerosSheet.write(i, n, item)
+ recapSheet.write(i, n, item)
+ except:
+ # item is not a cell, it's a dict -> display color
+ try:
+ if item['color'] == 0x55FF55:
+ newSheet.write(i, n, item['mean'])
+ totalsSheet.write(i, n, item['badcase'])
+ if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
+ zerosSheet.write(i, n, item['zerocase'])
+ recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']) + ' / ' + str(item['zerocase']) )
+ else:
+ recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']) )
+ else:
+ if item['color'] in palette:
+ style = xlwt.easyxf('pattern: pattern solid, fore_colour custom' + str(item['color']))
+ newSheet.write(i, n, item['mean'], style)
+ totalsSheet.write(i, n, item['badcase'], style)
+ if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
+ zerosSheet.write(i, n, item['zerocase'], style)
+ recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']) + ' / ' + str(item['zerocase']), style)
+ else:
+ recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']), style)
+ else:
+ R = item['color'] / 65536
+ G = item['color'] / 256 - R * 256
+ B = 0x55
+
+ palette.append(item['color'])
+ xlwt.add_palette_colour('custom' + str(item['color']), color)
+ if R>-0.01 and R<256.01 and G>-0.01 and G<256.01 and B>-0.01 and B<256.01:
+ newWb.set_colour_RGB(color, R, G, B)
+ style = xlwt.easyxf('pattern: pattern solid, fore_colour custom' + str(item['color']))
+ newSheet.write(i, n, item['mean'], style)
+ totalsSheet.write(i, n, item['badcase'], style)
+ if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
+ zerosSheet.write(i, n, item['zerocase'], style)
+ recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']) + ' / ' + str(item['zerocase']), style)
+ else:
+ recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']), style)
+ color += 1
+ else:
+ newSheet.write(i, n, item['mean'])
+ totalsSheet.write(i, n, item['badcase'])
+ if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
+ zerosSheet.write(i, n, item['zerocase'])
+ recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']) + ' / ' + str(item['zerocase']) )
+ else:
+ recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']) )
+
+ except Exception as e:
+ print(e)
+ n += 1
+ continue
+ n += 1
+ i += 1
+ if Options.outFileName == '':
+ if Options.ACCcsv:
+ name = os.path.join(os.path.dirname(Options.csvFileName),'ACCCresults_processed.xls')
+ name = name.replace("/","\\")
+ else:
+ name = Options.csvFileName[:-4] + '_processed.xls'
+ name = name.replace("/","\\")
+ else:
+ name = Options.outFileName
+
+ 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 (tenter de remplacer 0 par vide ou None)
+ """
+ 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 composant 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 ecrire 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 composant 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
+ ## occ min et occ max
+
+ """
+ Cette commande permet de venir ecrire 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 dicoN1_process import Dico as dico
+
+ processXLS(dico)
\ No newline at end of file
+++ /dev/null
-import xlrd # XLS read
-import xlwt # XLS write
-import csv
-import pdb
-
-import Options
-import Compute
-#from Run import *
-import pickle
-from UpdateOptions import UpdateProcessorOptions
-#from itertools import izip_longest # Reverse the double array
-#from future.moves.itertools import zip_longest
-import itertools
-import os
-import xlsxwriter
-
-import os
-import pandas as pd
-import win32com.client as win32
-
-def getXLSinfo(filename):
- wb = xlrd.open_workbook(filename)
- sheets = wb.sheet_names()
- ret = {}
- for name in sheets:
- sheet = wb.sheet_by_name(name)
- ret[name] = [[],[]]
- for i in range(0, sheet.nrows):
- data = str(sheet.cell_value(i, 0))
- if data not in ret[name][0]:
- ret[name][0].append(data)
- data = str(sheet.cell_value(i, 1))
- if data not in ret[name][1]:
- ret[name][1].append(data)
- return ret
-
-def getCSVinfo(csvfilename):
- foldername = os.path.dirname(csvfilename)
- sheets =[]
- for file in os.listdir(foldername):
- if file.endswith('.csv') and (' Voltage ' in file or ' FlowsDif ' in file or ' Flows ' in file or ' LoadShed ' in file) and 'processed_' not in file.lower():
- sheets.append(file[0:-4])
- ret = {}
- for name in sheets:
- ACCCresultsfile = os.path.join(foldername, name + '.csv')
- try: #python 2 compatible
- h = open(ACCCresultsfile,"rb")
- crd = csv.reader(h,delimiter=";")
- ret[name] = [[],[]]
- for i, row in enumerate(crd):
- if len(row)>2:
- data = str(row[0])
- if data not in ret[name][0]:
- ret[name][0].append(data)
- data = str(row[1])
- if data not in ret[name][1]:
- ret[name][1].append(data)
- h.close()
- except: #python 3 compatible
- h = open(ACCCresultsfile,"r",newline='')
- crd = csv.reader(h,delimiter=";")
- ret[name] = [[],[]]
- for i, row in enumerate(crd):
- if len(row)>2:
- data = str(row[0])
- if data not in ret[name][0]:
- ret[name][0].append(data)
- data = str(row[1])
- if data not in ret[name][1]:
- ret[name][1].append(data)
- h.close()
- return ret
-
-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 = {}
-
- # for name in sheets:
-
- # try:
-
- # nomColonne = 'Component_List_For_'+str(name)
- # nomColonne = nomColonne.replace('_ ',' _')
-
- # nomLigne = 'Contingency_List_For_'+str(name)
- # nomLigne = nomLigne.replace('_ ',' _')
-
- # 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]
-
- # print('options')
- # print(type(Options.selectedDoubleCol[str(name)]))
-
- # print('apres select')
- # processedData[name] = [[]]
-
- # processedData[name] = Compute.createDoubleArray(totalData[name], processedData[name], name)
-
- # xlsToOutput(processedData[name])
-
-
- # except KeyError:
- # print("error dans ecriture acc results")
- # pass
-
-
-
-def processXLS_out(dico):
-
- UpdateProcessorOptions(dico)
- indexes = {}
- toGather = {}
- data = {}
- totalData = {}
- # pdb.set_trace()
-
- 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) :
- # print(file[0:-4])
- 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 = {}
-
- for name in sheets:
-
- try:
-
- nomColonne = "'"+'Component_List_For_'+str(name)+"'"
- nomColonne = nomColonne.replace('_ ',' _')
-
- nomLigne = "'"+'Contingency_List_For_'+str(name)+"'"
- nomLigne = nomLigne.replace('_ ',' _')
-
-
- 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]
-
- processedData[name] = [[]]
-
- processedData[name] = Compute.createDoubleArray(totalData[name], processedData[name], name)
-
- except KeyError:
- print("error dans ecriture acc results")
- pass
-
- xlsToOutput(processedData)
-
-def gatherXlsData(wb, sheets, data, totalData):
- for name in sheets:
- sheet = wb.sheet_by_name(name)
- data[name] = []
- totalData[name] = []
-
- for i in range(0, sheet.nrows):
- totalData[name].append([])
- data[name].append([])
- for j in range(0, sheet.ncols):
- # Store data anyway in totalData
- if i == 0:
- totalData[name][i] = [j]
- try:
- totalData[name][i].append(float(sheet.cell_value(i, j)))
- except:
- totalData[name][i].append(sheet.cell_value(i, j))
- try:
- if j == 0:
- try:
- if sheet.cell_value(i, 0) in Options.selectedDoubleRow[name] and sheet.cell_value(i, 1) in Options.selectedDoubleCol[name]:
- pass
- else:
- break
- except:
- break
- if i == 0:
- data[name][i] = [j]
- data[name][i].append(float(sheet.cell_value(i, j)))
- except:
- data[name][i].append('N/A')
-
-def gatherCsvData(sheets, data, totalData):
- # try: #python 2
- for name in sheets:
- ACCCresultsfolder = os.path.dirname(Options.csvFileName)
- ACCCresultsfile = os.path.join(ACCCresultsfolder,name + '.csv')
- h = open(ACCCresultsfile,"rb")
- 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]
- continue
- try:
- totalData[name][i].append(float(row[j]))
- except:
- totalData[name][i].append(row[j])
-
-
-
- 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:
- try:
- v = float(item)
- if v > 0:
- return True
- except:
- try:
- v = float(item['mean'])
- if v >= 0: #used to be > 0 but want to keep zero cases!!
- return True
- except:
- pass
- return False
-
-
-def xlsToOutput(data):
- ACCCresultsfolder = os.path.dirname(Options.csvFileName)
- filename = os.path.join(ACCCresultsfolder,"ACCCresults_processed.xlsx")
- workbook = xlsxwriter.Workbook(filename)
- worksheet = workbook.add_worksheet()
- row = 0
-
- for colonne in data:
- col=0
- for cellule in colonne:
- worksheet.write(col, row, cellule)
- col = col+1
- row = row+1
- workbook.close()
-
-
-def xlsToCsv(indexes, data): #if too much data to be written to xls file, output a csv
- for name in data:
- if Options.csvFileName.endswith('.csv'):
- ACCCresultsfolder = os.path.dirname(Options.csvFileName)
- newSheet = os.path.join(ACCCresultsfolder,"Processed_" + name +'.csv')
- totalsSheet = os.path.join(ACCCresultsfolder,"Processed_" + name + '_Total.csv')
- if 'voltage' in name.lower() and 'loadshed' not in name.lower():
- zerosSheet = os.path.join(ACCCresultsfolder,"Processed_" + name + '_Zeros.csv')
- recapSheet = os.path.join(ACCCresultsfolder,"Processed_" + name + '_Recap.csv')
- elif Options.csvFileName.endswith('.xls') or Options.csvFileName.endswith('.xlsx'):
- newSheet = Options.csvFileName[:-4] + '_processed_' + name + '.csv'
- totalsSheet = Options.csvFileName[:-4] + '_processed_' + name + '_Total.csv'
- if 'voltage' in name.lower() and 'loadshed' not in name.lower():
- zerosSheet = Options.csvFileName[:-4] + '_processed_' + name + '_Zeros.csv'
- recapSheet = Options.csvFileName[:-4] + '_processed_' + name + '_Recap.csv'
- with open(newSheet, 'wb') as csvfile:
- writer = csv.writer(csvfile, delimiter = ';')
- flatData = []
- # Flatten data to remove all dict items
- for row in data[name]:
- newRow = []
- for item in row:
- if type(item) == dict:
- try:
- newRow.append(item['mean'])
- except:
- print(item)
- else:
- newRow.append(item)
- flatData.append(newRow)
- for row in flatData:
- writer.writerow(row)
- print('A file has been saved under ' + newSheet + '.')
-
- with open(totalsSheet, 'wb') as csvfile:
- writer = csv.writer(csvfile, delimiter = ';')
- flatData = []
- # Flatten data to remove all dict items
- for row in data[name]:
- newRow = []
- for item in row:
- if type(item) == dict:
- try:
- newRow.append(item['badcase'])
- except:
- print(item)
- else:
- newRow.append(item)
- flatData.append(newRow)
- for row in flatData:
- writer.writerow(row)
- print ('A file has been saved under ' + totalsSheet + '.')
-
- if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
- with open(zerosSheet, 'wb') as csvfile:
- writer = csv.writer(csvfile, delimiter = ';')
- flatData = []
- # Flatten data to remove all dict items
- for row in data[name]:
- newRow = []
- for item in row:
- if type(item) == dict:
- try:
- newRow.append(item['zerocase'])
- except:
- print (item)
- else:
- newRow.append(item)
- flatData.append(newRow)
- for row in flatData:
- writer.writerow(row)
- print( 'A file has been saved under ' + zerosSheet + '.')
-
- with open(recapSheet, 'wb') as csvfile:
- writer = csv.writer(csvfile, delimiter = ';')
- flatData = []
- # Flatten data to remove all dict items
- for row in data[name]:
- newRow = []
- for item in row:
- if type(item) == dict:
- try:
- if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
- newRow.append(str(item['mean']) + ' / ' + str(item['badcase']) + ' / ' + str(item['zerocase']))
- else:
- newRow.append(str(item['mean']) + ' / ' + str(item['badcase']) )
- except:
- print (item)
- else:
- newRow.append(item)
- flatData.append(newRow)
- for row in flatData:
- writer.writerow(row)
- print( 'A file has been saved under ' + recapSheet + '.')
-
- print( 'Processing over.')
-
-def xlsToCsvPython3(indexes, data): #if too much data to be written to xls file, output a csv
- for name in data:
- if Options.csvFileName.endswith('.csv'):
- ACCCresultsfolder = os.path.dirname(Options.csvFileName)
- newSheet = os.path.join(ACCCresultsfolder,"Processed_" + name +'.csv')
- totalsSheet = os.path.join(ACCCresultsfolder,"Processed_" + name + '_Total.csv')
- if 'voltage' in name.lower() and 'loadshed' not in name.lower():
- zerosSheet = os.path.join(ACCCresultsfolder,"Processed_" + name + '_Zeros.csv')
- recapSheet = os.path.join(ACCCresultsfolder,"Processed_" + name + '_Recap.csv')
- elif Options.csvFileName.endswith('.xls') or Options.csvFileName.endswith('.xlsx'):
- newSheet = Options.csvFileName[:-4] + '_processed_' + name + '.csv'
- totalsSheet = Options.csvFileName[:-4] + '_processed_' + name + '_Total.csv'
- if 'voltage' in name.lower() and 'loadshed' not in name.lower():
- zerosSheet = Options.csvFileName[:-4] + '_processed_' + name + '_Zeros.csv'
- recapSheet = Options.csvFileName[:-4] + '_processed_' + name + '_Recap.csv'
- with open(newSheet, 'w', newline='') as csvfile:
- writer = csv.writer(csvfile, delimiter = ';')
- flatData = []
- # Flatten data to remove all dict items
- for row in data[name]:
- newRow = []
- for item in row:
- if type(item) == dict:
- try:
- newRow.append(item['mean'])
- except:
- print(item)
- else:
- newRow.append(item)
- flatData.append(newRow)
- for row in flatData:
- writer.writerow(row)
- print('A file has been saved under ' + newSheet + '.')
-
- with open(totalsSheet, 'w', newline='') as csvfile:
- writer = csv.writer(csvfile, delimiter = ';')
- flatData = []
- # Flatten data to remove all dict items
- for row in data[name]:
- #print( row)
- newRow = []
- for item in row:
- if type(item) == dict:
- try:
- newRow.append(item['badcase'])
- except:
- print( item)
- else:
- newRow.append(item)
- flatData.append(newRow)
- for row in flatData:
- writer.writerow(row)
- print ('A file has been saved under ' + totalsSheet + '.')
-
- if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
- with open(zerosSheet, 'w', newline='') as csvfile:
- writer = csv.writer(csvfile, delimiter = ';')
- flatData = []
- # Flatten data to remove all dict items
- for row in data[name]:
- newRow = []
- for item in row:
- if type(item) == dict:
- try:
- newRow.append(item['zerocase'])
- except:
- print (item)
- else:
- newRow.append(item)
- flatData.append(newRow)
- for row in flatData:
- writer.writerow(row)
- print( 'A file has been saved under ' + zerosSheet + '.')
-
- with open(recapSheet, 'w', newline='') as csvfile:
- writer = csv.writer(csvfile, delimiter = ';')
- flatData = []
- # Flatten data to remove all dict items
- for row in data[name]:
- newRow = []
- for item in row:
- if type(item) == dict:
- try:
- if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
- newRow.append(str(item['mean']) + ' / ' + str(item['badcase']) + ' / ' + str(item['zerocase']))
- else:
- newRow.append(str(item['mean']) + ' / ' + str(item['badcase']) )
- except:
- print (item)
- else:
- newRow.append(item)
- flatData.append(newRow)
- for row in flatData:
- writer.writerow(row)
- print( 'A file has been saved under ' + recapSheet + '.')
-
- print( 'Processing over.')
-
-def xlsToXls(indexes, data):
-
- print('xlsToXls')
-
- palette = []
- newWb = xlwt.Workbook(style_compression = 2)
- color = 8
- for name in data:
- # print( name)
- newSheet = newWb.add_sheet(name)
- totalsSheet = newWb.add_sheet(name + '_Total')
- if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
- zerosSheet = newWb.add_sheet(name + '_Zeros')
- recapSheet = newWb.add_sheet(name + '_Recap')
- i = 0
- j = 0
- for row in data[name]:
-
- n = 0
- for item in row:
-
- try:
- newSheet.write(i, n, item)
- totalsSheet.write(i, n, item)
- if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
- zerosSheet.write(i, n, item)
- recapSheet.write(i, n, item)
- except:
- # item is not a cell, it's a dict -> display color
- try:
- if item['color'] == 0x55FF55:
- newSheet.write(i, n, item['mean'])
- totalsSheet.write(i, n, item['badcase'])
- if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
- zerosSheet.write(i, n, item['zerocase'])
- recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']) + ' / ' + str(item['zerocase']) )
- else:
- recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']) )
- else:
- if item['color'] in palette:
- style = xlwt.easyxf('pattern: pattern solid, fore_colour custom' + str(item['color']))
- newSheet.write(i, n, item['mean'], style)
- totalsSheet.write(i, n, item['badcase'], style)
- if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
- zerosSheet.write(i, n, item['zerocase'], style)
- recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']) + ' / ' + str(item['zerocase']), style)
- else:
- recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']), style)
- else:
- R = item['color'] / 65536
- G = item['color'] / 256 - R * 256
- B = 0x55
-
- palette.append(item['color'])
- xlwt.add_palette_colour('custom' + str(item['color']), color)
- if R>-0.01 and R<256.01 and G>-0.01 and G<256.01 and B>-0.01 and B<256.01:
- newWb.set_colour_RGB(color, R, G, B)
- style = xlwt.easyxf('pattern: pattern solid, fore_colour custom' + str(item['color']))
- newSheet.write(i, n, item['mean'], style)
- totalsSheet.write(i, n, item['badcase'], style)
- if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
- zerosSheet.write(i, n, item['zerocase'], style)
- recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']) + ' / ' + str(item['zerocase']), style)
- else:
- recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']), style)
- color += 1
- else:
- newSheet.write(i, n, item['mean'])
- totalsSheet.write(i, n, item['badcase'])
- if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
- zerosSheet.write(i, n, item['zerocase'])
- recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']) + ' / ' + str(item['zerocase']) )
- else:
- recapSheet.write(i, n, str(item['mean']) + ' / ' + str(item['badcase']) )
-
- except Exception as e:
- print(e)
- n += 1
- continue
- n += 1
- i += 1
- if Options.outFileName == '':
- if Options.ACCcsv:
- name = os.path.join(os.path.dirname(Options.csvFileName),'ACCCresults_processed.xls')
- name = name.replace("/","\\")
- else:
- name = Options.csvFileName[:-4] + '_processed.xls'
- name = name.replace("/","\\")
- else:
- name = Options.outFileName
-
- newWb.save(name)
- print('Processing over. The file has been saved under ' + name + '.')
-
-if __name__ == '__main__':
-
- from dicoN1_process import Dico as dico
-
- processXLS(dico)
\ No newline at end of file
def resetAll():
+
+ print('Run > resetAll')
Options.TotalStorage = []
Options.TotalBusStorage = []
Options.TotalTransfoStorage = []
def join_csv(outputfilepath, filelist):
-
+ print('Run > join_csv')
f=open(outputfilepath,"a")
for k,filepath in enumerate(filelist):
def outputNewCsv():
+
+ print('Run > outputNewCsv')
# Outputs a new .csv file with "cleansed" data (i.e same data than original .csv file, but without unselected branches / buses / etc)
path = os.path.join(Options.FolderList[0], Options.csvCleanedFileName)
path = path.replace("/","\\")
def getCases():
- # print('je suis dans getCases')
+
+ print('Run > getCases')
+
CaseList = []
# More readable options
AvgLineLoad = Options.AvgLineLoad[0]
def writeMultiContReport(accfiles, N_files):
+
+ print('Run > writeMultiContReport')
accfiles = np.array(accfiles)
import sys
import psspy
def run(dico):
+ print('Run > run')
resetAll()
UpdateOptions(dico)
start_time = time.clock()
Options.csvFileName = FlowsCsvPath
sheets = getCSVinfo(Options.csvFileName)
else:
- print("writing Excel file")
+ print("writing Excel file")
Options.csvFileName = outputExcel
sheets = getXLSinfo(Options.csvFileName)
def treatCase(it, case, dico, book, outputExcel, Ops):
+
+ print('Run > treatCase'))
print('Case ' + case)
# Rendering options more readable
AvgLineLoad = Ops['AvgLineLoad'][0]
for fname in FolderContents:
if fname[0:7] == 'package' or fname[0:4] == 'core':
# print(fname)
- packNum = int(fname.split('_')[0][7:])
+ packNum = int(fname.split('_')[0][7:])
# print(packNum)
PackageContents = os.listdir(os.path.join(FolderPath, fname))
for f in PackageContents:
SavFileList = []
for i in range(0, len(table)):
- # print('len(table) ',len(table))
packageN = 0
try:
- N = int(table[i][0])
- # print('N = int(table[i][0]) ',N)
+ N = int(table[i][0])
except:
try:
- N = int(table[i])
- # print('N = int(table[i]) ',N)
+ N = int(table[i])
except:
continue
- # print("debug")
- # print('\n')
- # print(int(NcaseIndex[i]))
- # print(N)
- # print(int(NcaseIndex[i]) >= N)
- # print((np.where(NcaseIndex[i] >= N)))
- # print(int(np.where(NcaseIndex[i][0] >= N)))
+
try:
- # print('NcaseIndex ', NcaseIndex)
- # packageN = int(np.where(NcaseIndex >= N)[0][0])
- packageN = int(N/365) ##CM
- # print('packageN ',packageN)
+ packageN = int(N/365) ##CM
except:
- print('je suis dans except apres packageN')
- # pass
-
- # print('package N is ', packageN)
+ print('je suis dans except apres packageN')
+
+
for fname in FolderContents:
if fname.startswith("package" + str(packageN)) or fname.startswith("core" + str(packageN)):
fname_final = fname
offset = NcaseIndex[packageN-1]
else:
offset = 0
- # caseN = int(N - offset)
- caseN = N%365 ###CM
+ caseN = N%365 ###CM
if caseN == 0:
caseN = 365
cname = 'Case_' + str(caseN)+ '.sav'
- # print(fname_final, " ",cname)
+
SavFileList.append(os.path.join(fname_final, cname))
N_files = len(SavFileList)
outputExcels.append(os.path.join(FolderPath, "N_1_" + case + '_core' + str(l), case + "_ACCCresults.xls"))
else:
- print(" ecriture dans csv")
+ print(" ecriture dans csv")
FlowsCsvPath = os.path.join(FolderPath, "N_1_" + case + '_core' + str(l), case + " core " + str(l) + " Flows 0.csv")
VoltagesCsvPath = os.path.join(FolderPath, "N_1_" + case + '_core' + str(l), case + " core " + str(l) + " Voltage 0.csv")
LoadShedCsvPath = os.path.join(FolderPath, "N_1_" + case + '_core' + str(l), case + " core " + str(l) + " LoadShed 0.csv")
def separateLinesFromTr(Flows, TfoDico, LineDico, Ops):
# Separates Flows into two lists, one of transformers and one of lines
# First, get the branch list
+
+ print('RunACCC > separateLinesFromTr')
branch_list = Flows.keys()
TrList = []
LineList = []
import psspy
import pssarrays
import redirect
+
+
+ print('RunACCC > readACCCresultsgroup')
if WriteIndivExcels:
import pssexcel
if MultipleContingencyReport:
WF.writeMultiContReport(accfilesublist, N_files)
- else: #csv output files
-# import cProfile, pstats, StringIO
-
-# pr = cProfile.Profile()
-# pr.enable()
+ else:
+
print(" writeVoltages ************ ")
print(accfilesublist, i)
print('\n')
WFC.writeFlowsTransfos(book, outputExcel, case, accfilesublist, ContList, TrList, Flows, TfoDico, FlowMax, row_index, Ops.copy())
WFC.writeVoltages(book, case, accfilesublist, ContList, Voltages, BusNominal, Ops.copy())
WFC.writeLoadShed(book, case, accfilesublist, ContList, LoadShed, Ops.copy())
-# pr.disable()
-# s = StringIO.StringIO()
-# sortby = 'cumulative'
-# ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
-# ps.print_stats()
-
- # print(s.getvalue())
+
if MultipleContingencyReport:
WFC.writeMultiContReport(accfilesublist, N_files)
return exitcode
def runACCCfake(SavFileList,GenDico, LoadDico, LineDico, TfoDico, BusDico, BranchesDico, BusNominal, BusArea, FolderPath, core, case, dico):
+
+ print('RunACCC > runACCCfake')
time.sleep(5)
return
-# Uncomment to get multithreading back
-# pool = ThreadPool(1)
-# ret = pool.map(partial(treatSavs, SavFileList, lock, GenDico, LoadDico, LineDico, TfoDico, BusDico, BranchesDico, BusNominal), SavFileList)
+
def runACCC(SavFileList,GenDico, LoadDico, LineDico, TfoDico, BusDico, BranchesDico, BusNominal, BusArea, FolderPath, core, case, Ops):
-# def treatSavs(SavFileList, lock, GenDico, LoadDico, LineDico, TfoDico, BusDico, BranchesDico, BusNominal, savfile):
+
+ print('RunACCC > runACCC')
initPSSE(Ops['PSSE_PATH'][0], Ops['PSSPY_PATH'][0])
import psspy
def extractACCCresults(LineDico, TfoDico, BusNominal, WriteIndivExcels, accfile, Ops):
+ print('RunACCC > extractACCCresults')
initPSSE( Ops['PSSE_PATH'][0], Ops['PSSPY_PATH'][0])
import psspy
SystemMismatchTol = 5
rlst = pssarrays.accc_summary(accfile)
- # print(" after accc_summary")
-# if accfile == 'X:\\Etudes\\DEWA_SOLAR\\DEWA_2018\\tir6\\results\\N_20180626_15h01m34\\N_1_TEST_core0\\package0_Case_263_ACCC.acc':
-# print(rlst)
-# print(rlst.ierr)
-# print(type(rlst))
-# print(dir(rlst))
-# print(stop)
+
if rlst.ierr != 0: ## si rlst.ierr different de zero : calcul de contingences avec erreurs
print(" pas de convergence ", accfile)
def resetAll():
+
+ print('RunPF > resetAll')
Options.TotalStorage = []
Options.TotalBusStorage = []
Options.TotalTransfoStorage = []
Options.LinesStorage = []
def join_csv(outputfilepath, filelist):
+
+ print('RunPF > join_csv')
f=open(outputfilepath,"a")#, newline='')
for k,filepath in enumerate(filelist):
f.close()
-#if not Display.initialized:
+
def read_pfd(app,doc,recal=0):
+
+ print('RunPF > read_pfd')
########################################################
# ojectif de cette fonction: prendre les parametres du reseau
########################################################
swshunt.append(aa)
return buses, lines, transf, plants, loads, shunt, motors, transf3, swshunt
-# Display.init()
+
def read_pfd_simple(app,doc):
+
+ print('RunPF > read_pfd_simple')
########################################################
# ojectif de cette fonction: prendre les parametres du reseau
########################################################
return plants, loads, shunt, swshunt,buses
def outputNewCsv():
+
+ print('RunPF > outputNewCsv')
# Outputs a new .csv file with "cleansed" data (i.e same data than original .csv file, but without unselected branches / buses / etc)
path = os.path.join(Options.FolderList[0], Options.csvCleanedFileName)
with open(path, 'w', newline='') as csvfile:
def separateLinesFromTr(Flows, TfoDico, LineDico):
+
+ print('RunPF > separateLinesFromTr')
# Separates Flows into two lists, one of transformers and one of lines
# First, get the branch list
branch_list = list(Flows.keys())
LineList.append(branch)
except:
LineList.append(branch)
-## elif '3WNDTR' in branch.split('__')[-1]: #was a bypass for 3wnd tfos because not integrated into checkifborder
-## TrList.append(branch)
+
elif 'TR' in branch.split('__')[-1]:
try:
- # Check if the transformer is in the list
- #name = TfoDico[branch]['FROMNAME'] + '-' + TfoDico[branch]['TONAME']
- # if "3WNDTR" in branch.split('__')[-1]:
- # b = branch.split('__')
- # for j,val in enumerate(b):
- # if val.startswith("Wnd"):
- # del b[j]
- # branchTr = '__'.join(b)
- # else: #2 wnd transformer
- # branchTr = branch
if branch not in Options.TrueLines: # Skimming transfos
continue
- # if TrNoGSUorGNDOutput: # Careful: this is not portable, as it removes all "GND", "GSU" and "FMR" transformers systematically
- # TrType = TfoDico[branch]['XFRNAME'].split('_')[-1][0:3]
- # if TrType != 'GND' and TrType != 'GSU' and TrType != 'FMR':
- # TrList.append(branch)
- # else:
TrList.append(branch)
except:
TrList.append(branch)
return TrList, LineList
def getCases():
+
+ print('RunPF > getCases')
CaseList = []
# More readable options
AvgLineLoad = Options.AvgLineLoad[0]
return CaseList
def writeMultiContReport(accfiles, N_files):
+
+ print('RunPF > writeMultiContReport')
accfiles = np.array(accfiles)
import sys
import psspy
def run(dico):
- #print dico
- #print "je suis dans le run"
+
+ print('RunPF > run')
start_time = time.clock()
PF_path=dico['CASE_SELECTION']['PF_path']
def treatCase(it, case, book, outputExcel,app,prj,all_inputs_base,namefolder,Ops):
+
+ print('RunPF > treatCase')
print('Case ' + case)
# Rendering options more readable
N_files = len(SavFileList)
- # Extract network component characteristics
- # Still unsure if this is necessary for each case, as the gens, loads etc should be the same
- # GenDico, LoadDico, LineDico, TfoDico, MotorDico, BusDico, BranchesDico, BusNominal = ExtractGeneratorLoadLineandTransfoDico(it, 0, os.path.join(FolderPath, SavFileList[0]), Ops['PSSE_PATH'][0])
- # GenDico, LoadDico, LineDico, TfoDico, MotorDico, BusDico, BranchesDico = PFExtractGeneratorLoadLineandTransfoDico(
- # it, 0, os.path.join(FolderPath, SavFileList[0]), Ops['PF_PATH'][0])
with open('Data_for_interface', 'rb') as fichier:
mon_depickler = pickle.Unpickler(fichier)
data_file = mon_depickler.load()
key = k
if k not in FlowMax.keys():
FlowMax[k]=str(ret[3][k])
-
-# for k in ret[4].keys():
-# if key == '':
-# key = k
-# if k not in LoadShed.keys():
-# LoadShed[k]={}
-# for cont_key in ret[4][k].keys():
-# #print "LoadShed", k, cont_key, i
-# if cont_key not in LoadShed[k].keys():
-# LoadShed[k][cont_key]=['']*min(flush,len(SavFileList)-int(np.floor(i/flush)*flush))
-# LoadShed[k][cont_key][i%flush] = ret[4][k][cont_key]
+
accfiles.append(ret[5])
def treatPfds(namefolder, GenDico, LoadDico, LineDico, TfoDico, BusDico, BranchesDico, BusNominal, study,app, prj, all_inputs_base, Ops):
+
+ print('RunPF > treatPfds')
Voltages = {}
Flows = {}
FlowMax = {}
JoinCsv = True
#RESULTS FOLDER
-#folder = r'D:\DEWA Solar 2017\2018_run_0001\N_2018_08h07m00_OK_NoSS_001'
-#folder = r'D:\DEWA Solar 2017\2020_run_0001\N_2020_20170522_09h00m07_1pct_noSS120HSYNMBR_132poches_OK_001'
folder = r'D:\DEWA Solar 2017\2020_run_0001\N_2020_20170523_11h11m57_1pct_SS120HSYNMBR_OK_002'
-#folder = r'D:\DEWA Solar 2017\2026_run_0001\N_2026_20170519_09h10m44_NoSS_OK_001'
-#folder = r'D:\DEWA Solar 2017\2030_run_0001\N_20170518_10h39m29_OK_lowVwide_noSSMBR'
+
#INPUTS SPLIT_CSV
input_file = r"simulationDClog_complete_11h11m57.csv"
def split_csv(folder, input_file, N_output_files):
+
+ print('SplitandJoinOutputFile > split_csv')
csvfile = os.path.join(folder, input_file)
g_csvfile = open(csvfile,'rb')
data = csv.reader(g_csvfile, delimiter=';')
def join_csv(folder, filelist, outputfile, copyheader=False):
+
+ print('SplitandJoinOutputFile > join_csv')
outputfilepath = os.path.join(folder, outputfile)
f=open(outputfilepath,"a")
import redirect
import pssexcel
+
+print('TestACCCfile')
###initialization PSSE
print ('initialisation psse')
psspy.psseinit(80000)
import pdb
def printThreshold(wb, name, value, storage, rev = False):
+
+ print('Threshold > printThreshold')
violations = {} # violations[name] = [[seul1 cases], [seuil2 cases], [seuil3 cases]]
#pdb.set_trace()
def processThresholds(wb):
+
+ print('Threshold > processThresholds')
if Options.BranchThreshold != [0, 0, 0]:
printThreshold(wb, 'Branch', Options.BranchThreshold, Options.TotalLinesStorage)
if Options.TransfoThreshold != [0, 0, 0]:
def UpdateProcessorOptions(dico):
+
+ print('UpdateOptions > UpdateProcessorOptions')
for key in dico.keys():
if 'CONTINGENCY_PROCESSING' in key:
curdico = dico[key]
def UpdateOptions(dico):
+ print('UpdateOptions > UpdateOptions')
if 'CASE_SELECTION' in dico:
curdico = dico['CASE_SELECTION']
for key in curdico.keys():
import pdb
def UpdateOptions(dico):
+
+ print('UpdateOptionsPF > UpdateOptions')
Options.SelectedBusBase=[]
Options.BusByNom = [False]
Options.LinesByNom = [False]
def OutputKeptItems(book):
+
+ print('Utils > OutputKeptItems')
+
sheet = book.Worksheets.Add()
sheet.Name = 'Ignored summary'
sheet.Cells(i + 3, 8).Value = ib[i]
def rowNumber(path, percent):
+
+ print('Utils > rowNumber')
+
with open(path, 'rb') as csvfile:
data = csv.reader(csvfile, delimiter=';')
count = 0
def getData(path):
+ print('Utils > getData')
+
cols = []
names = []
BusStorage = []
#try:
if 1:
if cols[i].find('VBus') != -1:
- # print('\n' + "options bus by nom " + '\n')
- # print(Options.BusByNom[0])
- # print('\n' + "Options BusBaseList[names[i]] " + '\n')
- # print(Options.BusBaseList[names[i]])
- # print('\n' + "Options.SelectedBusBase " + '\n')
- # print(Options.SelectedBusBase)
+
if Options.BusByNom[0] and Options.BusBaseList[names[i]] not in Options.SelectedBusBase:
continue
if Options.SortByArea[0] and Options.BusAreaList[names[i]] not in Options.SelectedAreas:
continue
elif Options.SortByArea[0] and not any(x in Options.SelectedAreas for x in Options.TransfoAreaList[tfoname_nownd]):
continue
-## elif Options.RecursiveDepth > 0 and tfoname not in Options.TrueLines: #currently add all 3w transfos b/c Options.TrueLines doesnt have 3w tfos in it
-## continue
- # print(i)
+
tmpAll.append(row[i])
tmpTr.append(float(row[i]))
if it == 1:
return BusMean, TransfoMean, LinesMean
def getHighestValue(storage, numberToGet):
+
+ print('Utils > getHighestValue')
+
tmp = []
table = []
for i in range(len(storage)):
return table
def getLowestValue(storage, numberToGet):
+
+ print('Utils > getLowestValue')
+
tmp = []
table = []
for i in range(len(storage)):
import shutil
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
-#from ExtractGeneratorLoadLineandTransfoDico import *
+
+dictSpecialCharacters = {
+ " " : "_" ,
+ "-" : "_" ,
+ "." : "_" ,
+ ";" : "_" ,
+ "&" : "and",
+ "%" : "pct",
+ "=" : "eq" ,
+ "#" : "_" ,
+ "$" : "_" ,
+ "/" : "_" ,
+ "\\" : "_" ,
+ "@" : "Br" ,
+ "*" : "Sw" ,
+ "'" : "_" ,
+ "(" : "_" ,
+ ")" : "_" ,
+ "é" : "_" ,
+ "è" : "_" ,
+ "à" : "_"
+ }
+
+def cleanName (name) :
+# ---------------------
+# remplace les caracteres speciaux definis dans dictSpecialCharacters
+# de la chaine name passee en argument et retourne une chaine nettoyee
+# prefixe la chaine d un _ si la chaine commence par un chiffre
+
+ newName = name
+ for c in dictSpecialCharacters.keys():
+ newName = newName.replace(c,dictSpecialCharacters[c])
+ if newName[0] in ( '0','1','2','3','4','5','6','7','8','9'):
+ newName = '_' + newName
+ return newName
+
+
+def testCleanName():
+ nom1 = 'a&b-c'
+ if cleanName(nom1) != 'aandb_c':
+ print ('Echec de testCleanName sur remplacement du blanc')
+ exit()
+ nom2 = '2a'
+ if cleanName(nom2) != '_2a':
+ print ('Echec de testCleanName sur prefixe par _ ')
+ exit()
+ print ('succes testCleaname')
+
+
def OutputKeptItems(book):
+ print('UtilsPF > OutputKeptItems')
+
OKI = True
if OKI:
sheet = book.Worksheets.Add()
pass
def rowNumber(path, percent):
+
+ print('UtilsPF > rowNumber')
+
with open(path, 'r') as csvfile:
data = csv.reader(csvfile, delimiter=';')
count = 0
def getData(path,TransfoDico,LineDico,BusDico):
+ print('UtilsPF > getData')
+
cols = []
names = []
BusStorage = []
Bus2 = int(name3.split('-')[1])
tfoname = BusDico[Bus1][2] + '_' + BusDico[Bus2][2] + '_' + str(
idname) + '__' + 'TR'
-
- # idname = cols[i].strip().split(' id')[-1] # separer string par ' id'
- # Bus1 = names[i].split('-')[0].strip()
- # Bus2 = names[i].split('-')[1].strip()
- # # idname = 'TR' + cols[i].strip().split(' ')[-1][2:]
- # # Bus1 = names[i].split(' - ')[0].strip()
- # # Bus2 = names[i].split(' - ')[1].strip()
- # tfoname = Bus1 + '_' + Bus2 + '_' + idname + '_' + 'Tr'
- tfoname = tfoname.replace(" ", "_")
- tfoname = tfoname.replace("-", "_")
- tfoname = tfoname.replace(".", "_")
- tfoname = tfoname.replace("/", "_")
- tfoname = tfoname.replace("&", "and")
+
+ tfoname = cleanName(tfoname)
+
try:
int(tfoname[0])
tfoname = "_" + tfoname
except:
pass
- # tfoname = Bus1 + "__" + Bus2 + "__" + idname
- # tfoname = tfoname.replace(" ","_")
- # tfoname = tfoname.replace("-","_")
- # tfoname = tfoname.replace(".","_")
- # tfoname = tfoname.replace("&","and")
- # try:
- # int(tfoname[0])
- # tfoname="_" + tfoname
- # except:
- # pass
+
if (Options.TransfoByNom[0] and Options.TransfoBaseList[tfoname] not in Options.SelectedTransfoBase):
continue
elif Options.RecursiveDepth > 0 and tfoname not in Options.TrueLines:
Bus3 = int(name3.split('-')[2])
tfoname=BusDico[Bus1][2]+'_'+BusDico[Bus2][2]+'_'+BusDico[Bus3][2]+'_' + str(idname) + '__' + 'TR3'
- # tfoname=names[i]+str(idname)+ '_' + 'Tr3'
- tfoname = tfoname.replace(" ", "_")
- tfoname = tfoname.replace("-", "_")
- tfoname = tfoname.replace(".", "_")
- tfoname = tfoname.replace("/", "_")
- tfoname = tfoname.replace("&", "and")
+
+ tfoname = cleanName(tfoname)
+
try:
int(tfoname[0])
tfoname = "_" + tfoname
if (Options.TransfoByNom[0] and Options.TransfoBaseList[tfoname] not in Options.SelectedTransfoBase):
continue
-## elif Options.RecursiveDepth >0 and tfoname not in Options.TrueLines: #currently add all 3w transfos b/c Options.TrueLines doesnt have 3w tfos in it
-## continue
+
tmpAll.append(row[i])
tmpTr.append(float(row[i]))
if it == 1:
Bus1 = int(name3.split('-')[0])
Bus2 = int(name3.split('-')[1])
linename = BusDico[Bus1][2] + '_' + BusDico[Bus2][2] + '_' + str( idname) + '__' + 'LI'
-
- # idname = cols[i].strip().split(' id')[-1] # separer string par ' id'
- # Bus1 = names[i].split('-')[0].strip()
- # Bus2 = names[i].split('-')[1].strip()
- if '@' in idname:
- idname = idname.replace('@','BR')
- elif '*' in idname:
- idname = idname.replace('*','SW')
- # else:
- # try:
- # idname = 'LI' + str(int(idname))
- # except:
- # idname = 'LI' + idname
- # linename = Bus1 + "_" + Bus2 + "_" + idname+'_Li'
- linename = linename.replace(" ", "_")
- linename = linename.replace("-", "_")
- linename = linename.replace(".", "_")
- linename = linename.replace("/", "_")
- linename = linename.replace("&", "and")
+
+ idname = cleanName(idname)
+
+ linename = cleanName(linename)
try:
int(linename[0])
- # linename="_" + linename
+
linename = "L_" + linename
except:
pass
-
+
if (Options.LinesByNom[0] and Options.LinesBaseList[linename] not in Options.SelectedLinesBase):
continue
elif Options.RecursiveDepth > 0 and linename not in Options.TrueLines:
- continue
+ continue
tmpAll.append(row[i])
tmpLine.append(float(row[i]))
if it == 1:
if it == 1:
Options.NamesStorage.append(names[i])
Options.ColsStorage.append(cols[i])
-# except Exception as e:
-# print (e)
+
def customAppend(fromCont, toCont, meanCont, row):
tmp = []
Options.BusStorage = BusStorage
Options.TransfoStorage = TransfoStorage
Options.LinesStorage = LinesStorage
- #pdb.set_trace()
-
- #delete point version of csvfile
+
if Options.DecimalSeparator[0]==",":
csvfile.close()
os.remove(path)
return BusMean, TransfoMean, LinesMean
def getHighestValue(storage, numberToGet):
+
+ print('UtilsPF > getHighestValue')
+
tmp = []
table = []
for i in range(len(storage)):
return table
def getLowestValue(storage, numberToGet):
+
+ print('UtilsPF > getLowestValue')
+
tmp = []
table = []
for i in range(len(storage)):
pass
tmp.append(storage[i])
return table
+
+
+if __name__ == "__main__":
+ testCleanName()
\ No newline at end of file
import numpy as np
import pdb
-#import Options
-#from dicoN1 import Dico as dico
-#import UpdateOptions as UO
-#import UpdateOptionsPF as UOPF
def writeLoadShed(book, case, SavFileList, ContList, LoadShed, Ops):
+
+ print('WriteFuncs > WriteLoadShed')
+
sheet = False
try:
sheet = book.add_sheet(case + ' LoadShed 0')
if sheet.name == case + ' LoadShed ' + str(sheet_num):
break
for bus in LoadShed.keys():
-# volt = BusNominal[bus]
-# if Ops['BusByNom'][0] and volt not in Ops['SelectedBusBase']:
-# continue
-# if bus in Ops['IsolatedGenList']:
-# continue
+
sheet_num = 0
decr = 0
if Ops['TestBusName'][0]:
def writeVoltages(book, case, SavFileList, ContList, Voltages, BusNominal, Ops):
+
+ print('WriteFuncs > writeVoltages')
+
sheet = False
try:
sheet = book.add_sheet(case + ' Voltage 0')
def writeFlowsLines(book, outputExcel, case, SavFileList, ContList, LineList, Flows, BranchesDico, FlowMax, sheet, Ops):
- #print "Writing contingency violations for lines"
+ print('WriteFuncs > writeFlowsLines')
flow_idx = 0
# getting the right index
while 1:
return row_index
def writeFlowsTransfos(book, outputExcel, case, SavFileList, ContList, TrList, Flows, BranchesDico, FlowMax, row_index, Ops):
- #print "Writing contingency violations for transformers"
+
+ print('WriteFuncs > writeFlowsTransfos')
#row_index = 1
sheet_num = 0
for idx in itertools.count():
def writeLoadShed(book, case, SavFileList, ContList, LoadShed, Ops):
+
+ print('WriteFuncsCsv > writeLoadShed')
LoadShedWriter = book[2]
def writeVoltages(book, case, SavFileList, ContList, Voltages, BusNominal, Ops):
-# import traceback
-# traceback.print_stack()
+ print('WriteFuncsCsv > writeVoltages')
+
VoltagesWriter = book[1]
Vmin = Ops['Vmin'][0]
def writeFlowsLines(book, outputExcel, case, SavFileList, ContList, LineList, Flows, BranchesDico, FlowMax, Ops):
+ print('WriteFuncsCsv > writeFlowsLines')
+
rows = []
row = ["Branch", "Contingency", "Number of Violations", "Max Violation", "Rate (MVA)"]
def writeFlowsTransfos(book, outputExcel, case, SavFileList, ContList, TrList, Flows, BranchesDico, FlowMax, row_index, Ops):
+ print('WriteFuncsCsv > writeFlowsTransfos')
+
FlowsWriter = book[0]
for branch in TrList:
-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
+Dico ={'CONTINGENCY_SELECTION': {'TripLines': True, 'csv_file': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190722_11h42m31/Test.csv', 'SelectionMethod': 'CaseSelectionFromFile', 'case_name': 'transfo', 'TripTransfos': True, 'TripGenerators': True}, 'CASE_SELECTION': {'TransformersList': ['22.0 - 11.0', '22.0 - 6.6', '66.0 - 11.0', '66.0 - 15.0', '66.0 - 22.0', '66.0 - 6.6'], 'PSEN_results_csvfile': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190722_11h42m31/simulationDClog_complete_11h42m31.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': ['11.0', '22.0', '66.0'], 'PSEN_results_folder': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190722_11h42m31', 'OutputNewCsv': False, 'BusesList': ['6.6', '11.0', '15.0', '22.0', '66.0']}, 'CONTINGENCY_OPTIONS': {'ActiveLimits': True, 'Vmin': 0.9, 'FlowLimitTransformers': 10, 'AdjustTaps': False, 'VarLimits': True, 'FlowLimitLines': 50, 'FlatStart': False, 'AdjustShunts': False, 'Vmax': 1.1, '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
+Dico ={'CONTINGENCY_PROCESSING': {'XLS_file': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35/ACCCresults.xls', "'Contingency_List_For_testuno Flows 0'": ['CORTE_MOROSAGLIA', 'FURIANI_SISCO', 'Gisonaccia_PV [Ghisonaccia]', 'LUCCIANA_BT [Lucciana]'], "'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'": ['IleRousse_IleRousse'], "'Contingency_List_For_testuno Voltage 0'": ['CASTIRLA_ILE_ROUSSE', 'PIETROSELLA_PROPRIANO']}, '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
# import traceback
def initPSSE(PSSE_PATH, PSSPY_PATH):
+
+ print('initPSSE > initPSSE')
# PSSE initialization function.
import sys, os
sys.path.append(PSSPY_PATH)
(filepath, filename) = os.path.split(NetworkFile)
sys.path.append(PF_PATH)
os.environ['PATH'] += ';' + os.path.dirname(os.path.dirname(PF_PATH)) + ';'
-
+
+ print('com_base > PFExtractData')
+
# import powerfactory
import powerfactory as pf
app = pf.GetApplication()
TfoDico[tfoname]['3NUMBER'] = bus3_number
TfoDico[tfoname]['#WIND'] = 3
- print ("Read data double OK")
+ print ("Read data OK")
prj.Delete()
return MachineDico, LoadDico, LineDico, TfoDico, MotorDico,buses
filer=open('temp.txt','r')
MachineDico, LoadDico, LineDico, TransfoDico, MotorDico,BusDico = PFExtractData(pfd_file,PF_path)
Data={}
-Data['MachineDico'] = MachineDico
-Data['LoadDico'] = LoadDico
-Data['LineDico'] = LineDico
-Data['TransfoDico'] = TransfoDico
-Data['MotorDico'] = MotorDico
-Data['BusDico'] = BusDico
+Data['MachineDico'] = MachineDico
+Data['LoadDico'] = LoadDico
+Data['LineDico'] = LineDico
+Data['TransfoDico'] = TransfoDico
+Data['MotorDico'] = MotorDico
+Data['BusDico'] = BusDico
import pickle
# print('=========='+str(pickle.HIGHEST_PROTOCOL)+'=========')
with open('Data_for_interface', 'wb') as fichier:
- mon_pickler = pickle.Pickler(fichier,protocol=2)
- mon_pickler.dump(Data)
+ mon_pickler = pickle.Pickler(fichier,protocol=2)
+ mon_pickler.dump(Data)
\r
\r
def make_config(appli,rep):\r
+ print('configuration_PSEN_N1 > make_config')\r
return CONFIG(appli,rep)\r
\r
import subprocess
dico = dicoN1.Dico
+print('debugRun')
+
item=listeparam[0]
dico=item.process_N1()
+ print('mesScripts_PSEN_N1 > EficasProcessXLS')
+
if 'PF_path' in dico['CASE_SELECTION']:
from Processor import processXLS
"""
Fonction sd_prod pour la macro INCLUDE
"""
- ## pour regarder temps passe par python dans les differentes fonctions
- # import cProfile, pstats, StringIO
- # pr = cProfile.Profile()
- # pr.enable()
+ print('opsPSEN_N1 > INCLUDE')
CaseFolder = args['PSEN_results_folder']
Options.RecursiveDepth = args['MaxDepth']
exc_type, exc_obj, exc_tb = sys.exec_info()
print(e)
print(exc_type, exc_tb.tb_lineno)
- #print ""
- #print MachineDico,LoadDico,LineDico,TransfoDico,MotorDico,BusDico,BranchesDico,BusNominal
+
for e in self.jdc.etapes:
if e.nom == 'CASE_SELECTION' :
print(e)
print(exc_type, exc_tb.tb_lineno)
- ## pour regarder temps passe par python dans les differentes fonctions
- # pr.disable()
- # s = StringIO.StringIO()
- # sortby = 'cumulative'
- # ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
- # ps.print_stats()
- # print (s.getvalue())
-
- #self.jdc.ajoutMC(e,'TransfosList',listeTuple)
-
def INCLUDE_context(self,d):
"""
Fonction op_init pour macro INCLUDE
"""
+
+ print('opsPSEN_N1 > INCLUDE_context')
for k,v in self.g_context.items():
d[k]=v
-
-# def PROCESS_context(self,d):
- # pass
def PROCESS_context(self,d):
- print "dans le init du Process"
+
+ print('opsPSEN_N1 > PROCESS_context')
+ print("dans le init du Process")
if self.get_child('XLS_file').valeur == "" or self.get_child('XLS_file').valeur== None : return
#print self.get_child('XLS_file')
self.OngletsSelectionnes= self.get_child('b_TabList').get_child('TabList').valeur
- print "fin de PROCESS_context"
+ print("fin de PROCESS_context")
def PROCESS(self,XLS_file,**args):
-
+
+ print('opsPSEN_N1 > PROCESS')
self.sauve_args=args
- #if (XLS_file == "" or XLS_file == None) or (CSV_folder == "" or CSV_folder == None): return
if (XLS_file == "" or XLS_file == None): return
- #Storage.csvFileName = XLS_file
- # c est la premiere fois
+
print('\n')
print(XLS_file)
if not (hasattr(self,'sheets')) :
from Processor import getXLSinfo, getCSVinfo
- #from Processor_Storage import *
+
print ('getSheets')
- #getSheets()
- #ComponentList, ContingencyList = getComponentandContingencyList(Storage.sheets[0])
- #print ComponentList
- #print ContingencyList
- #Storage.selectedDoubleRow[Storage.sheets[0]]=['PV MATIMBA']
- #Storage.selectedDoubleCol[Storage.sheets[0]]=['MAZENOD_MHDAM_LI1_']
- #self.jdc.appli.changeIntoMC(self,'TabList',Storage.sheets)
- #self.sheets=Storage.sheets
- #self.OngletsValeurs=[]
if not (XLS_file == "" or XLS_file == None):
#XLSinfo = getXLSinfo(XLS_file)
if XLS_file.endswith('.xls') or XLS_file.endswith('.xlsx'):
elif XLS_file.endswith('.csv'):
XLSinfo = getCSVinfo(XLS_file)
-# elif not (CSV_folder == "" or CSV_folder == None):
-# XLSinfo = getCSVinfo(CSV_folder)
+
self.sheets=XLSinfo
- #self.sheets={'a':(('a','b','c'),('f','g','h'))}
- # print(self.sheets)
self.jdc.editor.changeIntoMC(self,'TabList',self.sheets.keys(),('b_TabList',))
-
-## self.jdc.appli.changeIntoMC(self,'TabList',self.sheets.keys())
-##
-## for k in self.sheets.keys():
-## nom='Component_List_For_'+k
-## monInto=self.sheets[k][0]
-## self.jdc.appli.ajoutDefinitionMC('CONTINGENCY_PROCESSING',nom,'TXM',min=0, max='**', into=monInto, homo= 'SansOrdreNiDoublon')
-## nom='Contingency_List_For_'+k
-## monInto=self.sheets[k][1]
-## self.jdc.appli.ajoutDefinitionMC('CONTINGENCY_PROCESSING',nom,'TXM',min=0, max='**', into=monInto, homo= 'SansOrdreNiDoublon')
self.MCAjoutes=[]
self.OngletsSelectionnes=[]
self.MCAjoutes.remove(MCFils)
self.OngletsSelectionnes=nouveauxOngletsSelectionnes
- self.jdc.editor.fenetreCentraleAffichee.reaffiche()
-
- # else :
- ## On a selectionne un onglet
- ## On teste si on a modifie la liste des onglets
-
-
- # TabList= self.get_child('b_TabList').get_child('TabList').valeur
- # nouveauxOngletsSelectionnes = []
- # for tab in TabList:
- # nouveauxOngletsSelectionnes.append(tab.replace(' ','___'))
-
- # if nouveauxOngletsSelectionnes==self.OngletsSelectionnes : return
-
- # if nouveauxOngletsSelectionnes==() or nouveauxOngletsSelectionnes == [] :
- # for MC in self.MCAjoutes : self.jdc.editor.deleteMC(self,MC,('b_TabList',))
- # self.MCAjoutes=[]
- # self.OngletsSelectionnes=[]
-
-
-
- # for Onglet in nouveauxOngletsSelectionnes:
- # if Onglet in self.OngletsSelectionnes : continue
-
- # MCFils='Component_List_For_'+Onglet
- # if MCFils in self.jdc.editor.dicoNouveauxMC.keys() : continue
-
-
- # Onglet2 = Onglet.replace('___',' ')
- # MCFils='Component_List_For_'+Onglet
- # monInto=self.sheets[Onglet2][0]
- # self.jdc.editor.ajoutDefinitionMC('CONTINGENCY_PROCESSING',('b_TabList',),MCFils,'TXM',min=0, max='**', into=monInto, homo= 'SansOrdreNiDoublon')
- # self.jdc.editor.ajoutMC(self,MCFils,[],('b_TabList',))
- # self.MCAjoutes.append(MCFils)
-
- # MCFils='Contingency_List_For_'+Onglet
- # monInto=self.sheets[Onglet2][1]
- # self.jdc.editor.ajoutDefinitionMC('CONTINGENCY_PROCESSING',('b_TabList',),MCFils,'TXM',min=0, max='**', into=monInto, homo= 'SansOrdreNiDoublon')
- # self.jdc.editor.ajoutMC(self,MCFils,[],('b_TabList',))
- # self.MCAjoutes.append(MCFils)
-
-
- # for Onglet in self.OngletsSelectionnes:
- # if Onglet in nouveauxOngletsSelectionnes : continue
-
- # MCFils='Contingency_List_For_'+Onglet
- # self.jdc.editor.deleteMC(self,MCFils,('b_TabList',))
- # self.jdc.editor.deleteDefinitionMC('CONTINGENCY_PROCESSING',('b_TabList',),MCFils)
- # self.MCAjoutes.remove(MCFils)
-
- # MCFils='Component_List_For_'+Onglet
- # self.jdc.editor.deleteMC(self,MCFils,('b_TabList',))
- # self.jdc.editor.deleteDefinitionMC('CONTINGENCY_PROCESSING',('b_TabList',),MCFils)
- # self.MCAjoutes.remove(MCFils)
-
- # self.OngletsSelectionnes=nouveauxOngletsSelectionnes
-
-
-
-## nouveauxOngletsSelectionnes= self.get_child('TabList').getval()
-## if nouveauxOngletsSelectionnes==self.OngletsSelectionnes : return
-## if nouveauxOngletsSelectionnes==() or nouveauxOngletsSelectionnes == [] :
-## for MC in self.MCAjoutes :
-## self.jdc.appli.deleteMC(self,MC)
-## self.MCAjoutes=[]
-## self.OngletsSelectionnes=[]
-## return
-##
-## for Onglet in nouveauxOngletsSelectionnes:
-## if Onglet in self.OngletsSelectionnes : continue
-##
-## MCFils='Contingency_List_For_'+Onglet
-## self.jdc.appli.ajoutMC(self,MCFils,[])
-## self.MCAjoutes.append(MCFils)
-## MCFils='Component_List_For_'+Onglet
-## self.jdc.appli.ajoutMC(self,MCFils,[])
-## self.MCAjoutes.append(MCFils)
-##
-##
-## for Onglet in self.OngletsSelectionnes:
-## if Onglet in nouveauxOngletsSelectionnes : continue
-##
-## MCFils='Contingency_List_For_'+Onglet
-## self.jdc.appli.deleteMC(self,MCFils)
-## self.MCAjoutes.remove(MCFils)
-##
-## MCFils='Component_List_For_'+Onglet
-## self.jdc.appli.deleteMC(self,MCFils)
-## self.MCAjoutes.remove(MCFils)
-##
-## self.OngletsSelectionnes=nouveauxOngletsSelectionnes
-##
-##
+ self.jdc.editor.fenetreCentraleAffichee.reaffiche()
\ No newline at end of file
"""
Fonction sd_prod pour la macro INCLUDE
"""
+ print('opsPSEN_N1_PF > INCLUDE')
CaseFolder = args['PSEN_results_folder']
Options.RecursiveDepth = args['MaxDepth']
if CaseFolder==None:
"""
Fonction op_init pour macro INCLUDE
"""
+ print('opsPSEN_N1_PF > INCLUDE_context')
for k,v in self.g_context.items():
d[k]=v
def PROCESS_context(self,d):
+ print('opsPSEN_N1_PF > PROCESS_context')
pass
def PROCESS(self,XLS_file,**args):
-
+ print('opsPSEN_N1_PF > PROCESS')
self.sauve_args=args
if XLS_file == "" or XLS_file == None: return
- #Storage.csvFileName = XLS_file
- # c est la premiere fois
+
if not (hasattr(self,'sheets')) :
from Processor import getXLSinfo, getCSVinfo
if not (XLS_file == "" or XLS_file == None):
- #XLSinfo = getXLSinfo(XLS_file)
if XLS_file.endswith('.xls') or XLS_file.endswith('.xlsx'):
XLSinfo = getXLSinfo(XLS_file)
elif XLS_file.endswith('.csv'):
def PROCESS_context(self,d):
- print "dans le init du Process"
+ print('opsPSEN_SUITE > PROCESS_context')
+ print("dans le init du Process")
def PROCESS(self,XLS_file,**args):
+ print('opsPSEN_SUITE > PROCESS')
if XLS_file == "" or XLS_file == None: return
if not (hasattr(self,'dico')) :
from Processor import getXLS
import os
def modification_catalogue(self,Fonction,Etape,Genea,NomSIMP,TypeSIMP, PhraseArguments):
+ print('pn > modification_catalogue')
Arguments=eval(PhraseArguments,{})
self.jdc.editor.ajoutDefinitionMC(Etape,Genea,NomSIMP,TypeSIMP,**Arguments)
def modification_catalogue2(self,d):
- #print "je passe par modification_catalogue2 pour ", self.nom
+
+ print('pn > modification_catalogue2')
sauveJDC=self.jdc
self.jdc.editor.deleteEtape(self)
CONTEXT.unset_current_step()
import sys, os
if os.path.dirname(os.path.abspath(__file__)) not in sys.path :
sys.path.insert(0,os.path.dirname(os.path.abspath(__file__)))
+
+print('prefs')
INSTALLDIR=os.path.join(repIni,'..')
sys.path[:0]=[INSTALLDIR]
-
+print('prefs_PSEN_N1')
# lang indique la langue utilisee pour les chaines d'aide : fr ou ang
lang='en' #'fr'
version = "1.2"
date = "25/05/2010"
exploit = False
+
+print('properties')
\ No newline at end of file
-C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190621_07h31m35\package0_N_20190621_07h31m35\BaseCase.pfd
+C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190722_11h42m31\package0_N_20190722_11h42m31\BaseCase.pfd
C:\Program Files\DIgSILENT\PowerFactory 2017 SP1\Python\3.5
C:/Python35