#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2019, by the GROMACS development team, led by
+# Copyright (c) 2019,2021, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
import os
from gmxapi import exceptions
-from gmxapi import _gmxapi
class TprFile(object):
Note:
Currently, TPR files are read-only from the Python interface.
- Example:
-
- >>> import gmxapi as gmx
- >>> filehandle = gmx.TprFile(filename, 'r')
-
"""
if filename is None:
raise exceptions.UsageError("TprFile objects must be associated with a file.")
self._tprFileHandle = None
def __repr__(self):
- return "gmx.fileio.TprFile('{}', '{}')".format(self.filename, self.mode)
+ return "{}('{}', '{}')".format(self.__class__.__name__, self.filename, self.mode)
def __enter__(self):
+ import gmxapi._gmxapi as _gmxapi
self._tprFileHandle = _gmxapi.read_tprfile(self.filename)
return self
Returns:
TBD : possibly a completion condition of some sort and/or handle to the new File
"""
+ import gmxapi._gmxapi as _gmxapi
# TODO: (Data model) Decide how to find output data sources.
if not hasattr(input, 'parameters'):