Skip to content

Commit

Permalink
fix blank lines error in XYZ file
Browse files Browse the repository at this point in the history
  • Loading branch information
abelcarreras committed Dec 11, 2020
1 parent 11d3d14 commit 21b086f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cosymlib/file_io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,21 @@ def get_geometry_from_file_xyz(file_name, read_multiple=False):
positions=input_molecule[1],
name=name))
input_molecule = [[], []]
name = line.split()[0]
try:
name = line.split()[0]
except IndexError:
if read_multiple:
return geometries
else:
return geometries[0]

molecule = Geometry(symbols=input_molecule[0],
positions=input_molecule[1],
name=name)
if read_multiple:
geometries.append(molecule)
else:
return molecule
return geometries[0]

return geometries

Expand Down

0 comments on commit 21b086f

Please sign in to comment.