Skip to content

Instantly share code, notes, and snippets.

@larsbratholm
Last active January 31, 2020 13:35
Show Gist options
  • Save larsbratholm/97165a2ad5d5d27f1c44ac3fe6f065b0 to your computer and use it in GitHub Desktop.
Save larsbratholm/97165a2ad5d5d27f1c44ac3fe6f065b0 to your computer and use it in GitHub Desktop.
fix xyz reader
tokens = line.split()
try:
atom = tokens[0].upper()
numbers = np.asarray(tokens[1:4], dtype=float)
except:
exit("Reading the .xyz file failed in line {0}. Please check the format.".format(lines_read + 2))
V.append(numbers)
atoms.append(atom)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment