Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Parameters
-----------
filename: str, filepath to input (.prmtop)
restart: str, file path to Amber restart file (.rst7)
logger: logging.Logger object, records information
Notes
-----
Reference for parmed.load_Structure *args and **kwargs
https://parmed.github.io/ParmEd/html/structobj/parmed.formats.registry.load_file.html#parmed.formats.registry.load_file
"""
if 'restart' in config['structure'].keys():
rst7 = config['structure']['restart']
config['Logger'].info('Restarting simulation from {}'.format(rst7))
restart = parmed.amber.Rst7(rst7)
config['structure'].pop('restart')
structure = parmed.load_file(**config['structure'])
structure.positions = restart.positions
structure.velocities = restart.velocities
structure.box = restart.box
else:
structure = parmed.load_file(**config['structure'])
config['Structure'] = structure
return config
Parameters
-----------
filename: str, filepath to input (.prmtop)
restart: str, file path to Amber restart file (.rst7)
logger: logging.Logger object, records information
Notes
-----
Reference for parmed.load_Structure *args and **kwargs
https://parmed.github.io/ParmEd/html/structobj/parmed.formats.registry.load_file.html#parmed.formats.registry.load_file
"""
if 'restart' in config['structure'].keys():
rst7 = config['structure']['restart']
config['Logger'].info('Restarting simulation from {}'.format(rst7))
restart = parmed.amber.Rst7(rst7)
config['structure'].pop('restart')
structure = parmed.load_file(**config['structure'])
structure.positions = restart.positions
structure.velocities = restart.velocities
structure.box = restart.box
else:
structure = parmed.load_file(**config['structure'])
config['Structure'] = structure
return config