self.dlg = dlg
self.dialok = True
self.parametres = parametres
- self.pathout = PathOut(corpus.parametres['originalpath'], analyse_type = parametres['type'], dirout = corpus.parametres['pathout'])
+ self.val = False
+ if not 'pathout' in self.parametres :
+ self.pathout = PathOut(corpus.parametres['originalpath'], analyse_type = parametres['type'], dirout = corpus.parametres['pathout'])
+ else :
+ self.pathout = PathOut(filename = corpus.parametres['originalpath'], dirout = self.parametres['pathout'], analyse_type = self.parametres['name'])
self.parametres = self.make_config(parametres)
log.info(self.pathout.dirout)
if self.parametres is not None :
self.parametres['uuid'] = str(uuid4())
self.parametres['name'] = os.path.split(self.parametres['pathout'])[1]
self.parametres['type'] = parametres['type']
+ self.parametres['encoding'] = self.ira.syscoding
self.t1 = time()
#if self.corpus.lems is None :
self.corpus.make_lems(lem = self.parametres['lem'])
corpus.parse_active(gramact, gramsup)
- self.doanalyse()
- self.time = time() - self.t1
- minutes, seconds = divmod(self.time, 60)
- hours, minutes = divmod(minutes, 60)
- self.parametres['time'] = '%.0fh %.0fm %.0fs' % (hours, minutes, seconds)
- self.parametres['ira'] = self.pathout['ira']
- DoConf().makeoptions([self.parametres['type']], [self.parametres], self.pathout['ira'])
- self.ira.history.add(self.parametres)
- if dlg :
- dlg.Destroy()
- OpenAnalyse(self.parent, self.parametres['ira'])
- self.ira.tree.AddAnalyse(self.parametres)
- self.val = 5100
+ result_analyse = self.doanalyse()
+ if result_analyse is None :
+ self.time = time() - self.t1
+ minutes, seconds = divmod(self.time, 60)
+ hours, minutes = divmod(minutes, 60)
+ self.parametres['time'] = '%.0fh %.0fm %.0fs' % (hours, minutes, seconds)
+ self.parametres['ira'] = self.pathout['Analyse.ira']
+ DoConf().makeoptions([self.parametres['type']], [self.parametres], self.pathout['Analyse.ira'])
+ self.ira.history.add(self.parametres)
+ if dlg :
+ dlg.Destroy()
+ OpenAnalyse(self.parent, self.parametres['ira'])
+ self.ira.tree.AddAnalyse(self.parametres)
+ self.val = 5100
+ else :
+ self.val = False
+ if dlg :
+ dlg.Destroy()
else :
if dlg :
dlg.Destroy()
def make_config(self, config) :
if config is not None :
- if isinstance(config, basestring) :
- return self.readconfig(config)
+ if not self.dlg :
+ return config
else :
return self.preferences()
def preferences(self) :
return {}
- def doR(self):
- pass
-
def printRscript(self) :
pass
sleep(0.2)
else :
sleep(0.2)
- check_Rresult(self.ira, pid)
+ return check_Rresult(self.ira, pid)
elif self.parametres['classif_mode'] == 2 :
self.corpus.make_and_write_sparse_matrix_from_uci(self.actives, self.pathout['TableUc1'], self.pathout['listeuce1'])
Rscript = self.printRscript()
- self.doR(Rscript)
+ self.doR(Rscript, dlg = self.dlg, message = 'CHD...')
#self.lc = make_ucecl_from_R(self.pathout['uce'])
#self.lc0 = self.lc.pop(0)
self.corpus.make_ucecl_from_R(self.pathout['uce'])
self.clnb = len(self.corpus.lc)
self.parametres['clnb'] = self.clnb
Rscript = self.printRscript2()
- self.doR(Rscript)
+ self.doR(Rscript, dlg = self.dlg, message = 'profils et A.F.C. ...')
self.time = time() - self.t1
minutes, seconds = divmod(self.time, 60)
hours, minutes = divmod(minutes, 60)
return self.pathout['RTxtProfGraph']
def print_graph_files(self) :
- afc_graph_list = [[os.path.basename(self.pathout['AFC2DL_OUT']), u'Variables actives - coordonnées - facteurs 1 / 2'],
- [os.path.basename(self.pathout['AFC2DSL_OUT']), u'variables supplémentaires - coordonnées - facteurs 1 / 2'],
- [os.path.basename(self.pathout['AFC2DEL_OUT']), u'Variables illustratives - Coordonnées - facteur 1 / 2'],
- [os.path.basename(self.pathout['AFC2DCL_OUT']), u'Classes - Coordonnées - facteur 1 / 2'],
- [os.path.basename(self.pathout['AFC2DCoul']), u'Variables actives - Corrélation - facteur 1 / 2'],
- [os.path.basename(self.pathout['AFC2DCoulSup']), u'Variables supplémentaires - Corrélation - facteur 1 / 2'],
- [os.path.basename(self.pathout['AFC2DCoulEt']), u'Variables illustratives - Corrélations - facteur 1 / 2'],
- [os.path.basename(self.pathout['AFC2DCoulCl']), u'Classes - Corrélations - facteurs 1 / 2'],]
+ mess_afc = u"La position des points n'est peut être pas exacte"
+ afc_graph_list = [[os.path.basename(self.pathout['AFC2DL_OUT']), u'Variables actives - coordonnées - 30 points par classes - facteurs 1 / 2 - %s' % mess_afc],
+ [os.path.basename(self.pathout['AFC2DSL_OUT']), u'variables supplémentaires - coordonnées - 30 points par classes - facteurs 1 / 2 - %s' % mess_afc],
+ [os.path.basename(self.pathout['AFC2DEL_OUT']), u'Variables illustratives - Coordonnées - 30 points par classes - facteur 1 / 2 - %s' % mess_afc],
+ [os.path.basename(self.pathout['AFC2DCL_OUT']), u'Classes - Coordonnées - facteur 1 / 2']]
+ #[os.path.basename(self.pathout['AFC2DCoul']), u'Variables actives - Corrélation - facteur 1 / 2'],
+ #[os.path.basename(self.pathout['AFC2DCoulSup']), u'Variables supplémentaires - Corrélation - facteur 1 / 2'],
+ #[os.path.basename(self.pathout['AFC2DCoulEt']), u'Variables illustratives - Corrélations - facteur 1 / 2'],
+ #[os.path.basename(self.pathout['AFC2DCoulCl']), u'Classes - Corrélations - facteurs 1 / 2'],]
chd_graph_list = [[os.path.basename(self.pathout['dendro1']), u'dendrogramme à partir de chd1']]
if self.parametres['classif_mode'] == 0 :
chd_graph_list.append([os.path.basename(self.pathout['dendro2']), u'dendrogramme à partir de chd2'])