fix bug where floating point data was formatted as integer since the second column was assumed to be the type
This commit is contained in:
@ -657,11 +657,14 @@ class dump:
|
|||||||
|
|
||||||
atoms = snap.atoms
|
atoms = snap.atoms
|
||||||
nvalues = len(atoms[0])
|
nvalues = len(atoms[0])
|
||||||
|
keys = dict()
|
||||||
|
for pair in self.names.items():
|
||||||
|
keys[pair[1]] = pair[0]
|
||||||
for i in range(snap.natoms):
|
for i in range(snap.natoms):
|
||||||
if not snap.aselect[i]: continue
|
if not snap.aselect[i]: continue
|
||||||
line = ""
|
line = ""
|
||||||
for j in range(nvalues):
|
for j in range(nvalues):
|
||||||
if (j < 2):
|
if keys[j] == 'id' or keys[j] == 'type' or keys[j] == 'mol':
|
||||||
line += str(int(atoms[i][j])) + " "
|
line += str(int(atoms[i][j])) + " "
|
||||||
else:
|
else:
|
||||||
line += str(atoms[i][j]) + " "
|
line += str(atoms[i][j]) + " "
|
||||||
|
|||||||
Reference in New Issue
Block a user