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
90dfedb8
Commit
90dfedb8
authored
May 28, 2014
by
Jason Swails
Browse files
Remove a context manager to improve compatibility with older versions of scipy.
parent
efc196e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
wrappers/python/simtk/openmm/app/internal/amber_file_parser.py
...ers/python/simtk/openmm/app/internal/amber_file_parser.py
+4
-1
No files found.
wrappers/python/simtk/openmm/app/internal/amber_file_parser.py
View file @
90dfedb8
...
...
@@ -1179,7 +1179,8 @@ class AmberNetcdfRestart(object):
# open. This is unnecessary in scipy v.0.12 and lower because NetCDFFile
# accidentally leaks the file handle, but that was 'fixed' in 0.13. This
# fix taken from MDTraj
with
NetCDFFile
(
filename
,
'r'
)
as
ncfile
:
ncfile
=
NetCDFFile
(
filename
,
'r'
)
try
:
self
.
natom
=
ncfile
.
dimensions
[
'atom'
]
self
.
coordinates
=
np
.
array
(
ncfile
.
variables
[
'coordinates'
][:])
if
'velocities'
in
ncfile
.
variables
:
...
...
@@ -1195,6 +1196,8 @@ class AmberNetcdfRestart(object):
)
if
'time'
in
ncfile
.
variables
:
self
.
time
=
ncfile
.
variables
[
'time'
].
getValue
()
finally
:
ncfile
.
close
()
# They are already numpy -- convert to list if we don't want numpy
if
not
asNumpy
:
...
...
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