Commit f5cbd31e authored by Jason Swails's avatar Jason Swails
Browse files

Small fixes:

    - Adjust CharmmPsfFile parser to accept multiple blank lines before the
      NATOM record (I saw 1 PSF file like this... not sure how common it really
      is)
    - Removed the shebang line from element.py and removed execute permissions--
      it should never be executed directly (evidenced by the fact that the
      original shebang line was wrong and would never work, anyway).
    - Fix a test to determine if a Bond is part of an Angle in the PSF data
      structures.
parent 0ccc5c9e
...@@ -158,10 +158,13 @@ class CharmmPsfFile(object): ...@@ -158,10 +158,13 @@ class CharmmPsfFile(object):
title = list() title = list()
for i in range(ntitle): for i in range(ntitle):
title.append(psf.readline().rstrip()) title.append(psf.readline().rstrip())
# Skip the blank line # Skip all blank lines. Most of the time there is only 1, but I've seen
psf.readline() # a file that has 2
line = psf.readline().strip()
while not line:
line = psf.readline().strip()
# Next is the number of atoms # Next is the number of atoms
natom = conv(psf.readline().strip(), int, 'natom') natom = conv(line, int, 'natom')
# Parse all of the atoms # Parse all of the atoms
residue_list = ResidueList() residue_list = ResidueList()
atom_list = AtomList() atom_list = AtomList()
......
#!/bin/env python
""" """
element.py: Used for managing elements. element.py: Used for managing elements.
......
...@@ -12,7 +12,7 @@ Copyright (c) 2014 the Authors ...@@ -12,7 +12,7 @@ Copyright (c) 2014 the Authors
Author: Jason M. Swails Author: Jason M. Swails
Contributors: Contributors:
Date: April 18, 2014 Date: July 3, 2014
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"), copy of this software and associated documentation files (the "Software"),
...@@ -501,7 +501,7 @@ class Angle(object): ...@@ -501,7 +501,7 @@ class Angle(object):
""" See if a bond or an atom is in this angle """ """ See if a bond or an atom is in this angle """
if isinstance(thing, Bond): if isinstance(thing, Bond):
return self.atom2 in thing and (self.atom1 in thing or return self.atom2 in thing and (self.atom1 in thing or
self.atom2 in thing) self.atom3 in thing)
# Otherwise assume it's an atom # Otherwise assume it's an atom
return self.atom1 is thing or self.atom2 is thing or self.atom3 is thing return self.atom1 is thing or self.atom2 is thing or self.atom3 is thing
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment