Unverified Commit 2d4372d7 authored by Marc Schuh's avatar Marc Schuh Committed by GitHub
Browse files

added type checking for Simulation.step() (#4506)

* added type checking for Simulation.step()

* changed how to check if step is an integer number
parent 967d89c8
......@@ -142,8 +142,11 @@ class Simulation(object):
"""
mm.LocalEnergyMinimizer.minimize(self.context, tolerance, maxIterations, reporter)
def step(self, steps):
def step(self, steps: int):
"""Advance the simulation by integrating a specified number of time steps."""
if int(steps) != steps:
raise TypeError(f'Expected an integer for steps, got {type(steps)}')
self._simulate(endStep=self.currentStep+steps)
def runForClockTime(self, time, checkpointFile=None, stateFile=None, checkpointInterval=None):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment