From b0e3b1895b4c889e3b3d536fc458a8ab88a76e08 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Tue, 28 Jun 2016 12:50:12 -0700 Subject: [PATCH] fixed: distance for initial box was not set by default If the distance was not given explicitly as setup.distance, the default distance from equil.DIST was not chosen. Note that the DIST[water] default was set to 1.0 again (instead of 1.2) because for right now we want to be consistent with the SAMPL5 simulations. We might set it to 1.2 later (to reduce problems with cutoffs in the box for small molecules) --- mdpow/equil.py | 7 +++++-- mdpow/run.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mdpow/equil.py b/mdpow/equil.py index 1f2fe7ab..247274b3 100644 --- a/mdpow/equil.py +++ b/mdpow/equil.py @@ -55,8 +55,10 @@ # BOX <-- forcefields.get_solvent_model(id).coordinates +# TODO: change to water distance 1.2 in the future (1.0 for +# compatibility with our SAMPL5 runs) #: minimum distance between solute and box surface (in nm) -DIST = {'water': 1.2, 'octanol': 1.5,'cyclohexane':1.5} +DIST = {'water': 1.0, 'octanol': 1.5, 'cyclohexane': 1.5} class Simulation(Journalled): @@ -186,7 +188,8 @@ def __init__(self, molecule=None, **kwargs): raise ValueError(msg) self.solventmodel = forcefields.get_solvent_model(self.solventmodel_identifier) - distance = kwargs.pop('distance', DIST[solvent]) + distance = kwargs.pop('distance', None) + distance = distance if distance is not None else DIST[solvent] self.solvent = AttributeDict(itp=self.solventmodel.itp, box=self.solventmodel.coordinates, diff --git a/mdpow/run.py b/mdpow/run.py index e674bd9a..679e3f7b 100644 --- a/mdpow/run.py +++ b/mdpow/run.py @@ -203,7 +203,7 @@ def equilibrium_simulation(cfg, solvent, **kwargs): # custom mdp files mdpfiles = get_mdp_files(cfg, Simulation.protocols) try: - distance = cfg.get('setup','distance') + distance = cfg.get('setup', 'distance') except KeyError: distance = None # if no distance is specified, None = default