10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-11-04 05:03:53 +01:00

Merge branch 'master' into QUEST5

This commit is contained in:
Mickaël Véril 2020-08-03 17:25:02 +02:00
commit e99a42ec67
4 changed files with 10 additions and 19 deletions

View File

@ -24,7 +24,7 @@ class columnHandler(formatHandlerBase):
if dt in datacls: if dt in datacls:
data=datacls[dt] data=datacls[dt]
else: else:
cl=datafileSelector[dt] cl=datafileSelector(dt)
data=cl() data=cl()
data.molecule=mymolecule data.molecule=mymolecule
data.method=mymethod data.method=mymethod

View File

@ -1,7 +1,7 @@
from ..formatHandlerBase import formatHandlerBase from ..formatHandlerBase import formatHandlerBase
from ..formatName import formatName from ..formatName import formatName
from ...data import dataFileBase,DataType,method,excitationValue,datafileSelector,AbsDataFile,getSubtablesRange,state from ...data import dataFileBase,DataType,method,excitationValue,datafileSelector,AbsDataFile,getSubtablesRange,state
from ...LaTeX import newCommand from ...LaTeX import newCommand,extractMath
import re import re
from TexSoup import TexSoup from TexSoup import TexSoup
import numpy as np import numpy as np
@ -19,13 +19,9 @@ class doubleColumnHandler(formatHandlerBase):
for rangeTrans in subtablestrans: for rangeTrans in subtablestrans:
mytrans=moltable[rangeTrans,:] mytrans=moltable[rangeTrans,:]
mytransdesc=mytrans[0:2,1] mytransdesc=mytrans[0:2,1]
for i in range(2): for i in range(2):
try: mathsoup=extractMath(mytransdesc[i],Soup=True,commands=self.commands)
mathsoup=TexSoup(mytransdesc[i])
except:
print(f"Error when parsing latex state: {str(mytransdesc[i])}")
exit(-1)
newCommand.runAll(mathsoup,self.commands)
mytransdesc[i]=str(mathsoup) mytransdesc[i]=str(mathsoup)
for colindex in range(3,np.size(table,1)): for colindex in range(3,np.size(table,1)):
col=mytrans[:,colindex] col=mytrans[:,colindex]

View File

@ -2,7 +2,7 @@ from ..formatHandlerBase import formatHandlerBase
from ..formatName import formatName from ..formatName import formatName
from ...data import dataFileBase,DataType,method,excitationValue,datafileSelector,getSubtablesRange,AbsDataFile,state from ...data import dataFileBase,DataType,method,excitationValue,datafileSelector,getSubtablesRange,AbsDataFile,state
from ...utils import getValFromCell, checkFloat from ...utils import getValFromCell, checkFloat
from ...LaTeX import newCommand from ...LaTeX import newCommand,extractMath
from TexSoup import TexSoup from TexSoup import TexSoup
import re import re
@formatName("doubleTBE") @formatName("doubleTBE")
@ -12,15 +12,10 @@ class doubleTBEHandler(formatHandlerBase):
subtablesMol=getSubtablesRange(table) subtablesMol=getSubtablesRange(table)
for rangeMol in subtablesMol: for rangeMol in subtablesMol:
data=AbsDataFile() data=AbsDataFile()
data.molecule=str(table[rangeMol,0]) data.molecule=str(table[rangeMol[0],0])
data.method=method("TBE","CBS") data.method=method("TBE","CBS")
for mytrans in table[rangeMol]: for mytrans in table[rangeMol]:
try: mathsoup=extractMath(mytrans[1],Soup=True,commands=self.commands)
mathsoup=TexSoup(mytrans[1])
except:
print(f"Error when parsing latex state: {str(mytransdesc[i])}")
exit(-1)
newCommand.runAll(mathsoup,self.commands)
mytransdesc=str(mathsoup) mytransdesc=str(mathsoup)
infin=mytransdesc.split(r"\rightarrow") infin=mytransdesc.split(r"\rightarrow")
for i,item in enumerate(infin): for i,item in enumerate(infin):

View File

@ -33,7 +33,7 @@ class exoticColumnHandler(formatHandlerBase):
methodname=str(methtex) methodname=str(methtex)
mymethod=method(methodname,basis) mymethod=method(methodname,basis)
methkey=json.dumps(mymethod.__dict__) methkey=json.dumps(mymethod.__dict__)
finsts=dataFileBase.convertState(table[myrange,1],initialState,default=self.TexOps.default,commands=self.commands) finsts=dataFileBase.convertState(table[myrange,1],initialState,default=self.TexOps.defaultType,commands=self.commands)
for index,cell in enumerate(col[myrange]): for index,cell in enumerate(col[myrange]):
if str(cell)!="": if str(cell)!="":
val,unsafe=getValFromCell(cell) val,unsafe=getValFromCell(cell)
@ -57,7 +57,7 @@ class exoticColumnHandler(formatHandlerBase):
#data.excitations.append(excitationValue(initialState,finst[0],val,type=finst[2])) #data.excitations.append(excitationValue(initialState,finst[0],val,type=finst[2]))
for dt,methdic in valDic.items(): for dt,methdic in valDic.items():
for methstring,exdic in methdic.items(): for methstring,exdic in methdic.items():
data=datafileSelector[dt]() data=datafileSelector(dt)()
data.molecule=mymolecule data.molecule=mymolecule
methdic=json.loads(methstring) methdic=json.loads(methstring)
data.method=method(methdic["name"],methdic["basis"]) data.method=method(methdic["name"],methdic["basis"])