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
17d440fe
Commit
17d440fe
authored
Oct 18, 2013
by
Jason Swails
Browse files
Add the flush calls back to statedatareporter properly protected by try-except.
parent
7b28f2c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
wrappers/python/simtk/openmm/app/statedatareporter.py
wrappers/python/simtk/openmm/app/statedatareporter.py
+8
-0
No files found.
wrappers/python/simtk/openmm/app/statedatareporter.py
View file @
17d440fe
...
@@ -117,6 +117,10 @@ class StateDataReporter(object):
...
@@ -117,6 +117,10 @@ class StateDataReporter(object):
self
.
_initializeConstants
(
simulation
)
self
.
_initializeConstants
(
simulation
)
headers
=
self
.
_constructHeaders
()
headers
=
self
.
_constructHeaders
()
print
>>
self
.
_out
,
'#"%s"'
%
(
'"'
+
self
.
_separator
+
'"'
).
join
(
headers
)
print
>>
self
.
_out
,
'#"%s"'
%
(
'"'
+
self
.
_separator
+
'"'
).
join
(
headers
)
try
:
self
.
_out
.
flush
()
except
AttributeError
:
pass
self
.
_hasInitialized
=
True
self
.
_hasInitialized
=
True
# Check for errors.
# Check for errors.
...
@@ -127,6 +131,10 @@ class StateDataReporter(object):
...
@@ -127,6 +131,10 @@ class StateDataReporter(object):
# Write the values.
# Write the values.
print
>>
self
.
_out
,
self
.
_separator
.
join
(
str
(
v
)
for
v
in
values
)
print
>>
self
.
_out
,
self
.
_separator
.
join
(
str
(
v
)
for
v
in
values
)
try
:
self
.
_out
.
flush
()
except
AttributeError
:
pass
def
_constructReportValues
(
self
,
simulation
,
state
):
def
_constructReportValues
(
self
,
simulation
,
state
):
"""Query the simulation for the current state of our observables of interest.
"""Query the simulation for the current state of our observables of interest.
...
...
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