mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-12-24 13:23:40 +01:00
Add DOUBLETBE format
This commit is contained in:
parent
5db9a8d640
commit
451ddc0121
@ -228,6 +228,30 @@ class dataFileBase(object):
|
||||
for dat in value:
|
||||
datalist.append(dat)
|
||||
return datalist
|
||||
elif format==Format.DOUBLETBE:
|
||||
datacls=dict()
|
||||
subtablesMol=getSubtableIndex(table)
|
||||
for firstMol, lastMol in subtablesMol:
|
||||
data=AbsDataFile()
|
||||
data.molecule=str(table[firstMol,0])
|
||||
data.method=method("TBE","CBS")
|
||||
for mytrans in table[firstMol:lastMol+1]:
|
||||
try:
|
||||
mathsoup=TexSoup(mytrans[1])
|
||||
except:
|
||||
print(f"Error when parsing latex state: {str(mytransdesc[i])}")
|
||||
exit(-1)
|
||||
newCommand.runAll(mathsoup,commands)
|
||||
mytransdesc=str(mathsoup)
|
||||
infin=mytransdesc.split(r"\rightarrow")
|
||||
for i,item in enumerate(infin):
|
||||
m=re.match(r"^(?P<number>\d)\\[,:;\s]\s*\^(?P<multiplicity>\d)(?P<sym>\S*)",item.strip())
|
||||
infin[i]=state(m.group("number"),m.group("multiplicity"),m.group("sym"))
|
||||
cell=mytrans[6]
|
||||
val,unsafe=getValFromCell(cell)
|
||||
data.excitations.append(excitationValue(infin[0],infin[1],val,isUnsafe=unsafe))
|
||||
datalist.append(data)
|
||||
return datalist
|
||||
|
||||
def getMetadata(self):
|
||||
dic=OrderedDict()
|
||||
|
Loading…
Reference in New Issue
Block a user