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
c9fc6ed8
Commit
c9fc6ed8
authored
May 27, 2015
by
peastman
Browse files
Merge pull request #934 from swails/ncwarn
Eliminate scipy RuntimeWarning when reading NetCDF restart files
parents
77524af3
8908f33b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
wrappers/python/simtk/openmm/app/internal/amber_file_parser.py
...ers/python/simtk/openmm/app/internal/amber_file_parser.py
+2
-0
No files found.
wrappers/python/simtk/openmm/app/internal/amber_file_parser.py
View file @
c9fc6ed8
...
@@ -1363,6 +1363,7 @@ class AmberNetcdfRestart(object):
...
@@ -1363,6 +1363,7 @@ class AmberNetcdfRestart(object):
if
'velocities'
in
ncfile
.
variables
:
if
'velocities'
in
ncfile
.
variables
:
vels
=
ncfile
.
variables
[
'velocities'
]
vels
=
ncfile
.
variables
[
'velocities'
]
self
.
velocities
=
np
.
array
(
vels
[:])
*
vels
.
scale_factor
self
.
velocities
=
np
.
array
(
vels
[:])
*
vels
.
scale_factor
del
vels
# Get rid of reference to variable to avoid warnings
if
(
'cell_lengths'
in
ncfile
.
variables
and
if
(
'cell_lengths'
in
ncfile
.
variables
and
'cell_angles'
in
ncfile
.
variables
):
'cell_angles'
in
ncfile
.
variables
):
self
.
boxVectors
=
np
.
zeros
((
3
,
3
),
np
.
float32
)
self
.
boxVectors
=
np
.
zeros
((
3
,
3
),
np
.
float32
)
...
@@ -1372,6 +1373,7 @@ class AmberNetcdfRestart(object):
...
@@ -1372,6 +1373,7 @@ class AmberNetcdfRestart(object):
units
.
degrees
)
units
.
degrees
)
self
.
boxVectors
=
computePeriodicBoxVectors
(
leng
[
0
],
leng
[
1
],
self
.
boxVectors
=
computePeriodicBoxVectors
(
leng
[
0
],
leng
[
1
],
leng
[
2
],
angl
[
0
],
angl
[
1
],
angl
[
2
])
leng
[
2
],
angl
[
0
],
angl
[
1
],
angl
[
2
])
del
leng
,
angl
# Avoid warnings
if
'time'
in
ncfile
.
variables
:
if
'time'
in
ncfile
.
variables
:
self
.
time
=
ncfile
.
variables
[
'time'
].
getValue
()
self
.
time
=
ncfile
.
variables
[
'time'
].
getValue
()
finally
:
finally
:
...
...
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