mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-11-04 05:03:53 +01:00
Use the new extractMath function of bdd0982b92
for doubleColumn and doubleTBE handler
This commit is contained in:
parent
3f52913a19
commit
6ca8c57086
@ -1,7 +1,7 @@
|
||||
from ..formatHandlerBase import formatHandlerBase
|
||||
from ..formatName import formatName
|
||||
from ...data import dataFileBase,DataType,method,excitationValue,datafileSelector,AbsDataFile,getSubtablesRange,state
|
||||
from ...LaTeX import newCommand
|
||||
from ...LaTeX import newCommand,extractMath
|
||||
import re
|
||||
from TexSoup import TexSoup
|
||||
import numpy as np
|
||||
@ -19,13 +19,9 @@ class doubleColumnHandler(formatHandlerBase):
|
||||
for rangeTrans in subtablestrans:
|
||||
mytrans=moltable[rangeTrans,:]
|
||||
mytransdesc=mytrans[0:2,1]
|
||||
|
||||
for i in range(2):
|
||||
try:
|
||||
mathsoup=TexSoup(mytransdesc[i])
|
||||
except:
|
||||
print(f"Error when parsing latex state: {str(mytransdesc[i])}")
|
||||
exit(-1)
|
||||
newCommand.runAll(mathsoup,self.commands)
|
||||
mathsoup=extractMath(mytransdesc[i],Soup=True,commands=self.commands)
|
||||
mytransdesc[i]=str(mathsoup)
|
||||
for colindex in range(3,np.size(table,1)):
|
||||
col=mytrans[:,colindex]
|
||||
|
@ -2,7 +2,7 @@ from ..formatHandlerBase import formatHandlerBase
|
||||
from ..formatName import formatName
|
||||
from ...data import dataFileBase,DataType,method,excitationValue,datafileSelector,getSubtablesRange,AbsDataFile,state
|
||||
from ...utils import getValFromCell, checkFloat
|
||||
from ...LaTeX import newCommand
|
||||
from ...LaTeX import newCommand,extractMath
|
||||
from TexSoup import TexSoup
|
||||
import re
|
||||
@formatName("doubleTBE")
|
||||
@ -15,12 +15,7 @@ class doubleTBEHandler(formatHandlerBase):
|
||||
data.molecule=str(table[rangeMol[0],0])
|
||||
data.method=method("TBE","CBS")
|
||||
for mytrans in table[rangeMol]:
|
||||
try:
|
||||
mathsoup=TexSoup(mytrans[1])
|
||||
except:
|
||||
print(f"Error when parsing latex state: {str(mytransdesc[i])}")
|
||||
exit(-1)
|
||||
newCommand.runAll(mathsoup,self.commands)
|
||||
mathsoup=extractMath(mytrans[1],Soup=True,commands=self.commands)
|
||||
mytransdesc=str(mathsoup)
|
||||
infin=mytransdesc.split(r"\rightarrow")
|
||||
for i,item in enumerate(infin):
|
||||
|
Loading…
Reference in New Issue
Block a user