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
8dfdd485
Unverified
Commit
8dfdd485
authored
Nov 13, 2019
by
peastman
Committed by
GitHub
Nov 13, 2019
Browse files
Merge pull request #2469 from peastman/steps
runForClockTime() updates currentStep correctly
parents
6024e7c0
e275bd08
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
wrappers/python/simtk/openmm/app/simulation.py
wrappers/python/simtk/openmm/app/simulation.py
+2
-1
wrappers/python/tests/TestSimulation.py
wrappers/python/tests/TestSimulation.py
+6
-0
No files found.
wrappers/python/simtk/openmm/app/simulation.py
View file @
8dfdd485
...
...
@@ -196,10 +196,11 @@ class Simulation(object):
while
stepsToGo
>
10
:
self
.
integrator
.
step
(
10
)
# Only take 10 steps at a time, to give Python more chances to respond to a control-c.
stepsToGo
-=
10
self
.
currentStep
+=
10
if
endTime
is
not
None
and
datetime
.
now
()
>=
endTime
:
return
self
.
integrator
.
step
(
stepsToGo
)
self
.
currentStep
+=
nextSteps
self
.
currentStep
+=
stepsToGo
if
anyReport
:
# One or more reporters are ready to generate reports. Organize them into three
# groups: ones that want wrapped positions, ones that want unwrapped positions,
...
...
wrappers/python/tests/TestSimulation.py
View file @
8dfdd485
...
...
@@ -146,6 +146,12 @@ class TestSimulation(unittest.TestCase):
self
.
assertTrue
(
endTime
>=
startTime
+
timedelta
(
seconds
=
5
))
self
.
assertTrue
(
endTime
<
startTime
+
timedelta
(
seconds
=
10
))
# Check that the time and step count are consistent.
time
=
simulation
.
context
.
getState
().
getTime
().
value_in_unit
(
picoseconds
)
expectedTime
=
simulation
.
currentStep
*
integrator
.
getStepSize
().
value_in_unit
(
picoseconds
)
self
.
assertAlmostEqual
(
expectedTime
,
time
)
# Load the checkpoint and state and make sure they are both correct.
...
...
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