Skip to content

Commit

Permalink
Merge pull request #653 from StochSS/develop
Browse files Browse the repository at this point in the history
Release 1.6.6
  • Loading branch information
BryanRumsey authored Dec 2, 2021
2 parents eb1c4a2 + 9420bd1 commit ad52917
Show file tree
Hide file tree
Showing 12 changed files with 1,380 additions and 172 deletions.
662 changes: 662 additions & 0 deletions examples/AdvancedFeatures/CLE_examples_convergence.ipynb

Large diffs are not rendered by default.

66 changes: 35 additions & 31 deletions examples/ExtraModels/GeneticToggleSwitch.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gillespy2/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# =============================================================================


__version__ = '1.6.5'
__version__ = '1.6.6'

__title__ = 'GillesPy2'
__description__ = 'Python interface for Gillespie-style biochemical simulations'
Expand Down
1 change: 1 addition & 0 deletions gillespy2/core/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def set_expression(self, expression):
# strings will be caught below. It is perfectly fine to give a scalar
# value as the expression. This can then be evaluated in an empty
# namespace to the scalar value.
from gillespy2.core import log

log.warning("'Parameter.set_expression' has been deprecated, future versions of GillesPy2 will not support"
" this function. To set expression within a parameter, use Parameter.expression = expression")
Expand Down
3 changes: 1 addition & 2 deletions gillespy2/core/reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,7 @@ def create_mass_action(self):
rname = r.name
# Case 1: 2X -> Y
if self.reactants[r] == 2:
propensity_function = (propensity_function +
"*" + rname + "*(" + rname + "-1)/vol")
propensity_function = "0.5 * {0} * {1} * ({1} - 1) / vol".format(propensity_function, rname)
ode_propensity_function += '*' + rname + '*' + rname
else:
# Case 3: X1, X2 -> Y;
Expand Down
5 changes: 4 additions & 1 deletion gillespy2/sbml/SBMLimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ def __get_parameters(sbml_model, gillespy_model):
for i in range(sbml_model.getNumParameters()):
parameter = sbml_model.getParameter(i)
name = parameter.getId()
value = parameter.getValue()
if parameter.isSetValue():
value = parameter.getValue()
else:
value = 0
init_state[name] = value

# GillesPy2 represents non-constant parameters as species
Expand Down
4 changes: 2 additions & 2 deletions gillespy2/solvers/cpp/c_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,14 @@ def _update_resume_data(self, resume: Results, simulation_data: "list[dict[str,
resume_time = float(resume["time"][-1])
increment = resume_time - float(resume["time"][-2])
# Replace the simulation's timespan to continue where the Results object left off.
simulation_data[-1]["time"] = numpy.arange(start=(resume_time + increment),
simulation_data[-1]["time"] = numpy.arange(start=(resume_time),
stop=(resume_time + time_stopped + increment),
step=increment)

for entry_name, entry_data in simulation_data[-1].items():
# The results of the current simulation is treated as an "extension" of the resume data.
# As such, the new simulation output is formed by joining the two end to end.
new_data = numpy.concatenate((resume[entry_name], entry_data), axis=None)
new_data = numpy.concatenate((resume[entry_name], entry_data[1:]), axis=None)
simulation_data[-1][entry_name] = new_data

return simulation_data
Expand Down
Loading

0 comments on commit ad52917

Please sign in to comment.