Skip to content

Commit

Permalink
Merge pull request #347 from StochSS/253-simulation-error-is-raised-w…
Browse files Browse the repository at this point in the history
…hen-user-provides-a-timeout

Enable simulation timeouts
  • Loading branch information
BryanRumsey authored Mar 1, 2023
2 parents a6776e7 + 2054296 commit 4e7048d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions spatialpy/solvers/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import numpy

from spatialpy.core.spatialpyerror import ModelError, SimulationError, SimulationTimeout
from spatialpy.core.spatialpyerror import ModelError, SimulationError

def _read_from_stdout(stdout ,verbose=True):
try:
Expand Down Expand Up @@ -536,7 +536,6 @@ def run(self, number_of_trajectories=1, seed=None, timeout=None,
:returns: A SpatialPy Result object containing spatial and time series data from simulation.
:rtype: spatialpy.Result.Result | list(spatialpy.Result.Result)
:raises SimulationTimeout: Simulation exceeded timeout.
:raises SimulationError: Simulation execution failed.
"""
from spatialpy.core.result import Result # pylint: disable=import-outside-toplevel
Expand Down Expand Up @@ -587,7 +586,6 @@ def run(self, number_of_trajectories=1, seed=None, timeout=None,
result.timeout = True
# send signal to the process group
os.killpg(process.pid, signal.SIGINT)
raise SimulationTimeout("SpatialPy solver timeout exceded.") from err
except OSError as err:
print(f"Error, execution of solver raised an exception: {err}")
print(f"cmd = {solver_cmd}")
Expand Down

0 comments on commit 4e7048d

Please sign in to comment.