mirror of
https://github.com/arcan1s/moldyn.git
synced 2025-06-29 15:15:47 +00:00
fix error
This commit is contained in:
@ -144,11 +144,11 @@ def getData(fileList):
|
|||||||
if (first):
|
if (first):
|
||||||
type = defineType(file)
|
type = defineType(file)
|
||||||
if (type == "rmsd"):
|
if (type == "rmsd"):
|
||||||
rawData[system].append(getRmsdOutput(file, first))
|
rawData[system] = rawData[system] + getRmsdOutput(file, first)
|
||||||
elif (type == "dist"):
|
elif (type == "dist"):
|
||||||
rawData[system] = rawData[system] + getDistanceOutput(file, first)
|
rawData[system] = rawData[system] + getDistanceOutput(file, first)
|
||||||
elif (type == "angl"):
|
elif (type == "angl"):
|
||||||
rawData[system].append(getAngleOutput(file, first))
|
rawData[system] = rawData[system] + getAngleOutput(file, first)
|
||||||
if (first):
|
if (first):
|
||||||
first = False
|
first = False
|
||||||
return rawData
|
return rawData
|
||||||
@ -157,6 +157,13 @@ def getData(fileList):
|
|||||||
def createCsv(directory, label, data, timeStep):
|
def createCsv(directory, label, data, timeStep):
|
||||||
"""function to create *.csv file"""
|
"""function to create *.csv file"""
|
||||||
file = os.path.join(directory, label + ".csv")
|
file = os.path.join(directory, label + ".csv")
|
||||||
|
iter = 0
|
||||||
|
suffix = ""
|
||||||
|
while (os.path.exists(file + suffix)):
|
||||||
|
suffix = ".%i" % (iter)
|
||||||
|
iter = iter + 1
|
||||||
|
if (suffix != ""):
|
||||||
|
os.rename(file, file + suffix)
|
||||||
with open(file, "w") as output:
|
with open(file, "w") as output:
|
||||||
output.write("t\t%s\n" % ('\t'.join(data.keys())))
|
output.write("t\t%s\n" % ('\t'.join(data.keys())))
|
||||||
count = max([len(data[system]) for system in data.keys()])
|
count = max([len(data[system]) for system in data.keys()])
|
||||||
@ -173,6 +180,13 @@ def createCsv(directory, label, data, timeStep):
|
|||||||
def createQti(directory, label, data, timeStep):
|
def createQti(directory, label, data, timeStep):
|
||||||
"""function to create *.qti file"""
|
"""function to create *.qti file"""
|
||||||
file = os.path.join(directory, label + ".qti")
|
file = os.path.join(directory, label + ".qti")
|
||||||
|
iter = 0
|
||||||
|
suffix = ""
|
||||||
|
while (os.path.exists(file + suffix)):
|
||||||
|
suffix = ".%i" % (iter)
|
||||||
|
iter = iter + 1
|
||||||
|
if (suffix != ""):
|
||||||
|
os.rename(file, file + suffix)
|
||||||
with open(file, "w") as output:
|
with open(file, "w") as output:
|
||||||
count = max([len(data[system]) for system in data.keys()])
|
count = max([len(data[system]) for system in data.keys()])
|
||||||
timestamp = datetime.datetime.now().strftime("%d.%m.%y %H:%M")
|
timestamp = datetime.datetime.now().strftime("%d.%m.%y %H:%M")
|
||||||
|
Reference in New Issue
Block a user