Skip to content

Commit ceb355e

Browse files
committed
protein routing proceeds without scipy if needed
1 parent 751d696 commit ceb355e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

amx/gromacs/common.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,14 @@ def solvate_protein(structure,top):
485485
#top='solvate-standard',
486486
#---trim waters if the protein_water_gap setting is not False
487487
water_gap = state.q('protein_water_gap')
488-
if water_gap: trim_waters(structure='solvate-dense',gro='solvate',gap=water_gap,boxvecs=boxvecs)
489-
else: copy_file(state.here+'solvate-dense.gro',state.here+'solvate.gro')
488+
if water_gap:
489+
try:
490+
import scipy
491+
trim_waters(structure='solvate-dense',gro='solvate',gap=water_gap,boxvecs=boxvecs)
492+
except:
493+
status('failed to load scipy so continuing without a water_gap',tag='warning')
494+
copy_file('solvate-dense.gro','solvate.gro')
495+
else: copy_file('solvate-dense.gro','solvate.gro')
490496
gmx('make_ndx',structure='solvate',ndx='solvate-water-check',inpipe='q\n',
491497
log='make-ndx-solvate-check')
492498
with open(state.here+'log-make-ndx-solvate-check','r') as fp: lines = fp.readlines()

0 commit comments

Comments
 (0)