Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
cb293447
"docs-source/vscode:/vscode.git/clone" did not exist on "61ca19f84647e8ff26a6f86666e0700383823d0a"
Unverified
Commit
cb293447
authored
Feb 07, 2022
by
Sander Roet
Committed by
GitHub
Feb 07, 2022
Browse files
resolve scipy 1.8.0 io.netcdf deprecation warning (#3451)
parent
129cece9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
wrappers/python/openmm/app/internal/amber_file_parser.py
wrappers/python/openmm/app/internal/amber_file_parser.py
+8
-3
wrappers/python/tests/TestAmberInpcrdFile.py
wrappers/python/tests/TestAmberInpcrdFile.py
+8
-4
No files found.
wrappers/python/openmm/app/internal/amber_file_parser.py
View file @
cb293447
...
...
@@ -790,7 +790,7 @@ def readAmberSystem(topology, prmtop_filename=None, prmtop_loader=None, shake=No
for
(
iAtom
,
jAtom
,
k
,
rMin
)
in
prmtop
.
getBondsNoH
():
force
.
addBond
(
iAtom
,
jAtom
,
rMin
,
2
*
k
)
system
.
addForce
(
force
)
# Add Urey-Bradley terms.
if
len
(
prmtop
.
getUreyBradleys
())
>
0
:
if
verbose
:
print
(
"Adding Urey-Bradley terms..."
)
...
...
@@ -1434,9 +1434,14 @@ class AmberNetcdfRestart(object):
"""
def
__init__
(
self
,
filename
,
asNumpy
=
False
):
try
:
from
scipy.io
.netcdf
import
NetCDFFile
from
scipy.io
import
NetCDFFile
except
ImportError
:
raise
ImportError
(
'scipy is necessary to parse NetCDF restarts'
)
# scipy < 1.8.0
try
:
from
scipy.io.netcdf
import
NetCDFFile
except
ImportError
:
raise
ImportError
(
'scipy is necessary to parse NetCDF '
'restarts'
)
self
.
filename
=
filename
self
.
velocities
=
self
.
boxVectors
=
self
.
time
=
None
...
...
wrappers/python/tests/TestAmberInpcrdFile.py
View file @
cb293447
...
...
@@ -5,11 +5,15 @@ from openmm import *
from
openmm.unit
import
*
import
openmm.app.element
as
elem
try
:
from
scipy.io
import
n
et
cdf
from
scipy.io
import
N
et
CDFFile
SCIPY_IMPORT_FAILED
=
False
except
:
SCIPY_IMPORT_FAILED
=
True
except
ImportError
:
try
:
# scipy < 1.8.0
from
scipy.io
import
netcdf
SCIPY_IMPORT_FAILED
=
False
except
:
SCIPY_IMPORT_FAILED
=
True
def
compareByElement
(
array1
,
array2
,
cmp
):
for
x
,
y
in
zip
(
array1
,
array2
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment