Becksteinlab / GromacsWrapper

GromacsWrapper wraps system calls to GROMACS tools into thin Python classes (GROMACS 4.6.5 - 2024 supported).

Home Page:https://gromacswrapper.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NDX.write doesn't work

richardjgowers opened this issue · comments

    def write(self, filename=None, ncol=ncol, format=format):
        """Write index file to *filename* (or overwrite the file that the index was read from)"""
        with open(self.filename(filename, ext='ndx'), 'w') as ndx:
            for name in self:
                atomnumbers = self._getarray(name)  # allows overriding
                ndx.write('[ {0!s} ]\n'.format(name))
>               for k in xrange(0, len(atomnumbers), ncol):
E               NameError: name 'xrange' is not defined

Oh Lord... really, I forgot an xrange?

closed in PR #153