From cff3119df54a0c515ba193729319ee9360541dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Mon, 17 Feb 2020 15:18:08 +0100 Subject: [PATCH] Fix bug in data.py --- tools/lib/data.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/lib/data.py b/tools/lib/data.py index 89be4cec..278ebec1 100644 --- a/tools/lib/data.py +++ b/tools/lib/data.py @@ -49,18 +49,22 @@ class dataFileBase(object): st=str(mathsoup) m=re.match(r"^\^(?P\d)(?P[^\s\[(]*)\s*(?:\[(?:\\mathrm{)?(?P\w)(?:})\])?\s*\((?P[^\)]*)\)",st) seq=m.group("multiplicity","symm") + mul=int(m.group("multiplicity")) + symm=m.group("symm") spgrp=m.group("special") if spgrp is not None and spgrp=="F": trsp=dataType.FLUO else: trsp=default tygrp=m.group("type") - tmplst.append((*seq,trsp,tygrp)) + tmplst.append((mul,symm,trsp,tygrp)) lst=[] for index,item in enumerate(tmplst): - unformfirststate=(str(firstState.multiplicity),firstState.symetry) - count=([unformfirststate]+tmplst[:index+1]).count(item) - lst.append((state(count,int(item[0]),item[1]),item[2],item[3])) + unformfirststate=(firstState.multiplicity,firstState.symetry) + countlst=[unformfirststate]+[(it[0],it[1]) for it in tmplst[:index+1]] + countitem=(item[0],item[1]) + count=countlst.count(countitem) + lst.append((state(count,item[0],item[1]),item[2],item[3])) return lst @staticmethod