mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-12-25 13:53:48 +01:00
Fix bug in data.py
This commit is contained in:
parent
5fd4ad54c5
commit
cff3119df5
@ -49,18 +49,22 @@ class dataFileBase(object):
|
|||||||
st=str(mathsoup)
|
st=str(mathsoup)
|
||||||
m=re.match(r"^\^(?P<multiplicity>\d)(?P<symm>[^\s\[(]*)\s*(?:\[(?:\\mathrm{)?(?P<special>\w)(?:})\])?\s*\((?P<type>[^\)]*)\)",st)
|
m=re.match(r"^\^(?P<multiplicity>\d)(?P<symm>[^\s\[(]*)\s*(?:\[(?:\\mathrm{)?(?P<special>\w)(?:})\])?\s*\((?P<type>[^\)]*)\)",st)
|
||||||
seq=m.group("multiplicity","symm")
|
seq=m.group("multiplicity","symm")
|
||||||
|
mul=int(m.group("multiplicity"))
|
||||||
|
symm=m.group("symm")
|
||||||
spgrp=m.group("special")
|
spgrp=m.group("special")
|
||||||
if spgrp is not None and spgrp=="F":
|
if spgrp is not None and spgrp=="F":
|
||||||
trsp=dataType.FLUO
|
trsp=dataType.FLUO
|
||||||
else:
|
else:
|
||||||
trsp=default
|
trsp=default
|
||||||
tygrp=m.group("type")
|
tygrp=m.group("type")
|
||||||
tmplst.append((*seq,trsp,tygrp))
|
tmplst.append((mul,symm,trsp,tygrp))
|
||||||
lst=[]
|
lst=[]
|
||||||
for index,item in enumerate(tmplst):
|
for index,item in enumerate(tmplst):
|
||||||
unformfirststate=(str(firstState.multiplicity),firstState.symetry)
|
unformfirststate=(firstState.multiplicity,firstState.symetry)
|
||||||
count=([unformfirststate]+tmplst[:index+1]).count(item)
|
countlst=[unformfirststate]+[(it[0],it[1]) for it in tmplst[:index+1]]
|
||||||
lst.append((state(count,int(item[0]),item[1]),item[2],item[3]))
|
countitem=(item[0],item[1])
|
||||||
|
count=countlst.count(countitem)
|
||||||
|
lst.append((state(count,item[0],item[1]),item[2],item[3]))
|
||||||
return lst
|
return lst
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user