Skip to content

Commit

Permalink
Merge 803f728 into 4993362
Browse files Browse the repository at this point in the history
  • Loading branch information
alubbock committed Oct 7, 2018
2 parents 4993362 + 803f728 commit 812d6b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pysb/simulator/stochkit.py
Expand Up @@ -97,7 +97,11 @@ def __init__(self, model, tspan=None, initials=None,
param_values=param_values,
verbose=verbose,
**kwargs)
self.cleanup = kwargs.get('cleanup', True)
self.cleanup = kwargs.pop('cleanup', True)
if kwargs:
raise ValueError('Unknown keyword argument(s): {}'.format(
', '.join(kwargs.keys())
))
self._outdir = None
generate_equations(self._model,
cleanup=self.cleanup,
Expand Down
6 changes: 6 additions & 0 deletions pysb/tests/test_simulator_stochkit.py
Expand Up @@ -3,6 +3,7 @@
from pysb.examples import robertson, earm_1_0, expression_observables
import numpy as np
from pysb.core import as_complex_pattern
from nose.tools import raises

_STOCHKIT_SEED = 123

Expand All @@ -11,6 +12,11 @@ def test_stochkit_export():
StochKitExporter(robertson.model).export()


@raises(ValueError)
def test_stochkit_invalid_init_kwarg():
StochKitSimulator(earm_1_0.model, tspan=range(100), spam='eggs')


def test_stochkit_earm():
tspan = np.linspace(0, 1000, 10)
sim = StochKitSimulator(earm_1_0.model, tspan=tspan)
Expand Down

0 comments on commit 812d6b3

Please sign in to comment.