10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-25 05:43:46 +01:00

Add support for unsafe data in Line format

This commit is contained in:
Mickaël Véril 2019-12-17 12:49:02 +01:00
parent 0cef9b8935
commit 464923c04b

View File

@ -1,6 +1,7 @@
from collections import OrderedDict from collections import OrderedDict
from TexSoup import TexSoup from TexSoup import TexSoup
from .LaTeX import newCommand from .LaTeX import newCommand
from TexSoup import TexNode
from enum import IntEnum,auto,unique,IntFlag from enum import IntEnum,auto,unique,IntFlag
from .Format import Format from .Format import Format
import re import re
@ -77,7 +78,11 @@ class dataFileBase(object):
datacls=dict() datacls=dict()
for index,cell in enumerate(col[3:]): for index,cell in enumerate(col[3:]):
if str(cell)!="": if str(cell)!="":
unsafe=False
val= list(cell.contents)[0] val= list(cell.contents)[0]
if type(val) is TexNode and val.name=='emph':
unsafe=True
val=val.string
val=float(str(val)) val=float(str(val))
finst=finsts[index] finst=finsts[index]
dt=finst[1] dt=finst[1]
@ -89,7 +94,7 @@ class dataFileBase(object):
datacls[dt]=data datacls[dt]=data
data.molecule=mymolecule data.molecule=mymolecule
data.method=mymethod data.method=mymethod
data.excitations.append(excitationValue(firstState,finst[0],val,type=finst[2],isUnsafe=False)) data.excitations.append(excitationValue(firstState,finst[0],val,type=finst[2],isUnsafe=unsafe))
datalist.append(data) datalist.append(data)
return datalist return datalist
elif format==Format.COLUMN: elif format==Format.COLUMN: