From: Pierre Date: Sat, 20 Oct 2012 13:17:04 +0000 (+0200) Subject: ... X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=commitdiff_plain;h=eb3837fa8ebc881ef1df81980ec576ca0451eb40;ds=sidebyside ... --- diff --git a/INSTALL_WINDOWS b/INSTALL_WINDOWS index a7a915f..e33ddce 100644 --- a/INSTALL_WINDOWS +++ b/INSTALL_WINDOWS @@ -8,10 +8,11 @@ http://www.python.org/ Numpy http://surfnet.dl.sourceforge.net/sourceforge/numpy/ -wxpython +wxpython (2.8) http://surfnet.dl.sourceforge.net/sourceforge/wxpython/ -xlrd +xlrd : +http://pypi.python.org/pypi/xlrd package de R : rgl diff --git a/ProfList.py b/ProfList.py index b89854e..3e6f150 100644 --- a/ProfList.py +++ b/ProfList.py @@ -75,28 +75,45 @@ class ProfListctrlPanel(wx.Panel, listmix.ColumnSorterMixin): | wx.LC_EDIT_LABELS | wx.LC_SORT_ASCENDING ) - line1 = classe[0] + line1 = classe.pop(0) limit = 0 limitsup = 0 i = 0 dictdata = {} - limit = [i for i,b in enumerate(classe[1:]) if b[0] == '*'] - if limit != [] : - limit = limit[0] - 1 - limitsup = [i for i,b in enumerate(classe[1:]) if b[0] == '*****'] - if limitsup == [] : - limitsup = 0 + classen = [line for line in classe if line[0] != '*' and line[0] != '*****'] + if len(classen) == 0 : + lenact = 0 + lensup = 0 + lenet = 0 else : - limitsup = limitsup[0] - classen = [line for line in classe[1:] if line[0] != '*' and line[0] != '*****'] - if limit == [] : - limit = len(classen) - 1 + lenact = [i for i,b in enumerate(classe) if b[0] == '*****'] + if lenact == [] : + lensup = 0 + lenact = [i for i,b in enumerate(classe) if b[0] == '*'] + if lenact == [] : + lenact = len(classen) + lenet = 0 + else : + lenact = 0 + lenet = len(classen) + else : + lenact = lenact[0] + lensup = [i for i,b in enumerate(classe[1:]) if b[0] == '*'] + if lensup != [] : + lensup = lensup[0] - lenact + lenet = len(classen) - lensup + else : + lensup == 0 + lenet = len(classen) + debsup = lenact + + self.lenact = lenact + + debet = lenact + lensup dictdata = dict(zip([i for i in range(0,len(classen))], classen)) - #if not self.Alceste : - # limit = limit + 1 self.list.SetImageList(self.il, wx.IMAGE_LIST_SMALL) - self.PopulateList(dictdata, limit, limitsup, Alceste) + self.PopulateList(dictdata, debet, debsup, Alceste) self.Bind(wx.EVT_SIZE, self.OnSize) self.Bind(wx.EVT_LIST_COL_CLICK, self.OnColClick) @@ -143,28 +160,25 @@ class ProfListctrlPanel(wx.Panel, listmix.ColumnSorterMixin): self.list.SetColumnWidth(7, wx.LIST_AUTOSIZE) # show how to change the colour of a couple items - if limitsup != 0 : - for i in range(limitsup, limit): - item = self.list.GetItem(i) - item.SetTextColour(wx.RED) - self.list.SetItem(item) - else : - limit=limit+1 + for i in range(limitsup, limit): + item = self.list.GetItem(i) + item.SetTextColour(wx.RED) + self.list.SetItem(item) for i in range(limit, len(dictdata)): item = self.list.GetItem(i) item.SetTextColour(wx.BLUE) self.list.SetItem(item) - - if limitsup != 0 : - self.la = [self.getColumnText(i,6) for i in range(0, limitsup-1)] - self.lchi = [float(self.getColumnText(i,4)) for i in range(0, limitsup-1)] - self.lfreq = [int(self.getColumnText(i,1)) for i in range(0, limitsup-1)] + + if self.lenact != 0 : + self.la = [self.getColumnText(i,6) for i in range(0, self.lenact)] + self.lchi = [float(self.getColumnText(i,4)) for i in range(0, self.lenact)] + self.lfreq = [int(self.getColumnText(i,1)) for i in range(0, self.lenact)] else : - self.la = [self.getColumnText(i,6) for i in range(0, limit)] - self.lfreq = [int(self.getColumnText(i,1)) for i in range(0, limit)] - self.lchi = [float(self.getColumnText(i,4)) for i in range(0, limit)] - + self.la = [] + self.lchi = [] + self.lfreq = [] + def do_greyline(self): for row in xrange(self.list.GetItemCount()): if row % 2 : diff --git a/Rscripts/mysvd.R b/Rscripts/mysvd.R index d936196..596e55b 100644 --- a/Rscripts/mysvd.R +++ b/Rscripts/mysvd.R @@ -21,13 +21,24 @@ write.sparse <- function (m, to) { } } } + +write.sparse2 <- function(m, to) { + stopifnot(inherits(m, "dgCMatrix")) + fh <- file(to, open="w") + + wl <- function(...) cat(..., "\n", file=fh) + wl(dim(m), length(m@x)) + +} + +print('FIXME : svdpath hardcoded !!') my.svd <- function(x, nu, nv) { stopifnot(nu==nv) rc <- system(paste("/usr/bin/svd -o /tmp/sout -d", nu, "/tmp/sparse.m")) if (rc != 0) stop("Couldn't run external svd code") d <- scan("/tmp/sout-S", skip=1) -#FIXME : sometimes, libsvdc doesn't find solution with 2 dimensions, but does with 3 +#FIXME : sometimes, svdlibc doesn't find solution with 2 dimensions, but does with 3 if (length(d)==1) { nu <- nu + 1 rc <- system(paste("/usr/bin/svd -o /tmp/sout -d", nu, "/tmp/sparse.m")) diff --git a/Rscripts/simi.R b/Rscripts/simi.R index e738a80..12c0b45 100644 --- a/Rscripts/simi.R +++ b/Rscripts/simi.R @@ -268,6 +268,8 @@ plot.simi <- function(graph.simi, p.type = 'tkplot',filename=NULL, vertex.col = if (p.type == 'rgl') { library('rgl') + #rgl.open() + #par3d(cex=0.8) rglplot(g.toplot,vertex.label= vire.nonascii(v.label), edge.width=we.width/10, vertex.size=0.01, vertex.color=vertex.col, vertex.label.color="black", edge.color = edge.col, layout=lo) los <- layout.norm(lo, -1, 1, -1, 1, -1, 1) rgl.spheres(los, col = vertex.col, radius = vertex.size/100, alpha = alpha) diff --git a/functions.py b/functions.py index b3fff13..bb7e906 100644 --- a/functions.py +++ b/functions.py @@ -21,7 +21,6 @@ import datetime from copy import copy from shutil import copyfile #from dialog import BugDialog -print 'TEST LOGGING funcion' import logging log = logging.getLogger('iramuteq') @@ -70,24 +69,28 @@ class History : def write(self) : sections = self.corpora.keys() + self.analyses.keys() - parametres = [self.corpora[key] for key in self.corpora.keys()] + [self.analyses[key] for key in self.analyses.keys()] + parametres = [self.corpora[key] for key in self.corpora.keys() if key != 'analyses'] + [self.analyses[key] for key in self.analyses.keys()] self.conf.makeoptions(sections, parametres) log.info('write history') def add(self, analyse) : - if 'corpus' in analyse : + tosave = {'uuid' : analyse['uuid'], 'ira': analyse['ira'], 'type' : analyse['type']} + if analyse.get('corpus', False) : + tosave['corpus'] = analyse['corpus'] + tosave['name'] = analyse['name'] acorpus_uuid = analyse['corpus'] if acorpus_uuid in self.corpora : if 'analyses' in self.history[acorpus_uuid] : - self.history[acorpus_uuid]['analyses'].append(analyse) + self.history[acorpus_uuid]['analyses'].append(tosave) else : - self.history[acorpus_uuid]['analyses'] = [analyse] - self.analyses[analyse['uuid']] = analyse + self.history[acorpus_uuid]['analyses'] = [tosave] + self.analyses[analyse['uuid']] = tosave else : - self.analyses[analyse['uuid']] = analyse + self.analyses[analyse['uuid']] = tosave elif 'corpus_name' in analyse : - self.history[analyse['uuid']] = analyse - self.corpora[analyse['uuid']] = analyse + tosave['corpus_name'] = analyse['corpus_name'] + self.history[analyse['uuid']] = tosave + self.corpora[analyse['uuid']] = tosave self.write() def delete(self, uuid, corpus = False) : diff --git a/images/splash.png b/images/splash.png index d739813..37578b8 100644 Binary files a/images/splash.png and b/images/splash.png differ diff --git a/images/splash.svg b/images/splash.svg index e84301a..c61524d 100644 --- a/images/splash.svg +++ b/images/splash.svg @@ -2,6 +2,7 @@ + + + + + + + + + + + + + + + + + + + + + + + style="stop-color:#474b79;stop-opacity:1;" /> + id="stop3801" /> @@ -36,31 +104,28 @@ offset="0" id="stop3838" /> - - + @@ -99,41 +164,41 @@ id="layer1" transform="translate(0,-652.36218)"> Version 0.5 alpha 1 Version 0.6 alpha 1 + id="flowPara3874" />