diff --git a/tools/lib/data.py b/tools/lib/data.py index c03ba6eb..3d9c38cf 100644 --- a/tools/lib/data.py +++ b/tools/lib/data.py @@ -75,10 +75,14 @@ class dataFileBase(object): def readFromTable(table,format=Format.LINE,default=dataType.ABS ,firstState=state(1,1,"A_1"),commands=[]): def getSubtableIndex(table,firstindex=2,column=0,count=1): subtablesindex=list() - for i in range(firstindex+count,np.size(table,0)): + i=firstindex+count + while i[-+]?\d+\.?\d*)\s*\((?P\d*\.?\d+)\%\)$",strcell) - val,unsafe=getValFromCell(TexSoup(m.group("value"))) - T1=m.group("T1") + methodname=methodnameAT1[:-len(PTString)] else: - m=re.match(r"^[-+]?\d+\.?\d*",strcell) - val,unsafe=getValFromCell(TexSoup(m.group(0))) - T1=None - finst=finsts[index] - if (mymolecule,mymethod) in datacls: - data=datacls[(mymolecule,mymethod)] - else: - data=AbsDataFile() - data.molecule=mymolecule - data.method=mymethod - infin=mytrans.split("\rightarrow") + methodname=str(methodnameAT1) + mymethod=method(methodname,mybasis) + strcell=str(cell) + if strcell!="": + if HasT1: + m=re.match(r"^(?P[-+]?\d+\.?\d*)\s*(?:\((?P\d+\.?\d*)\\\%\))?",strcell) + val,unsafe=getValFromCell(TexSoup(m.group("value"))) + T1=m.group("T1") + else: + m=re.match(r"^[-+]?\d+\.?\d*",strcell) + val,unsafe=getValFromCell(TexSoup(m.group(0))) + T1=None + if (mymolecule,mymethod.name,mymethod.basis) in datacls: + data=datacls[(mymolecule,mymethod.name,mymethod.basis)] + else: + data=AbsDataFile() + data.molecule=mymolecule + data.method=mymethod + datacls[(mymolecule,mymethod.name,mymethod.basis)]=data + infin=mytransdesc[0].split(r"\rightarrow") for i,item in enumerate(infin): - m=re.match(r"^(?P\d)\\[,:;\s]\s*\^(?P\d)(?P\S*)",item) + m=re.match(r"^(?P\d)\\[,:;\s]\s*\^(?P\d)(?P\S*)",item.strip()) infin[i]=state(m.group("number"),m.group("multiplicity"),m.group("sym")) - data.excitations.append(excitationValue(infin[0],infin[1],val,type=mytrans[1],isUnsafe=unsafe,T1=T1)) - for value in datacls.values(): - datalist.append(value) + data.excitations.append(excitationValue(infin[0],infin[1],val,type=mytransdesc[1],isUnsafe=unsafe,T1=T1)) + for value in datacls.values(): + datalist.append(value) + return datalist elif format==Format.TBE: subtablesindex=getSubtableIndex(table) for first, last in subtablesindex: