Skip to content

Commit

Permalink
Merge pull request #1360 from StochSS/develop
Browse files Browse the repository at this point in the history
Release 2.4.11
  • Loading branch information
BryanRumsey authored Aug 23, 2022
2 parents 59b3bf9 + ca7909b commit ea29cde
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 26 deletions.
33 changes: 15 additions & 18 deletions client/model-view/model-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,24 @@ module.exports = View.extend({
this.setReadOnlyMode("model-mode");
this.setReadOnlyMode("system-volume");
}else {
if(this.model.defaultMode === "" && !this.model.is_spatial){
if(this.model.is_spatial) {
this.model.defaultMode = "discrete";
$(this.queryByHook("spatial-discrete")).prop('checked', true);
}else{
if(this.model.is_spatial) {
this.model.defaultMode = "discrete";
$(this.queryByHook("spatial-discrete")).prop('checked', true);
let dataHooks = {
'continuous':'spatial-continuous',
'discrete':'spatial-discrete',
'discrete-concentration':'spatial-discrete-concentration'
};
$(this.queryByHook(dataHooks[this.model.defaultMode])).prop('checked', true);
$(this.queryByHook("model-mode-container")).css("display", "none");
$(this.queryByHook("system-volume-container")).css("display", "none");
}else{
let dataHooks = {'continuous':'all-continuous', 'discrete':'all-discrete', 'dynamic':'advanced'};
$(this.queryByHook("spatial-model-mode-container")).css("display", "none");
if (this.model.defaultMode === ""){
this.getInitialDefaultMode();
}
}else {
if(this.model.is_spatial) {
let dataHooks = {
'continuous':'spatial-continuous',
'discrete':'spatial-discrete',
'discrete-concentration':'spatial-discrete-concentration'
};
$(this.queryByHook(dataHooks[this.model.defaultMode])).prop('checked', true);
$(this.queryByHook("model-mode-container")).css("display", "none");
$(this.queryByHook("system-volume-container")).css("display", "none");
}else{
let dataHooks = {'continuous':'all-continuous', 'discrete':'all-discrete', 'dynamic':'advanced'};
$(this.queryByHook(dataHooks[this.model.defaultMode])).prop('checked', true);
$(this.queryByHook("spatial-model-mode-container")).css("display", "none");
}
}
this.model.reactions.on("change", (reactions) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"metadata": {},
"outputs": [],
"source": [
"model = VilarOscillator1()"
"model = create_vilar_oscillator()"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion stochss/handlers/util/ensemble_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __update_timespan(self):
end = self.settings['timespanSettings']['endSim']
step_size = self.settings['timespanSettings']['timeStep']
self.g_model.timespan(
TimeSpan(numpy.arange(0, end + step_size, step_size))
TimeSpan.arange(step_size, t=end + step_size)
)


Expand Down
2 changes: 1 addition & 1 deletion stochss/handlers/util/parameter_sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def configure(self):
end = self.settings['timespanSettings']['endSim']
step_size = self.settings['timespanSettings']['timeStep']
self.g_model.timespan(
TimeSpan(numpy(0, end + step_size, step_size))
TimeSpan.arange(step_size, t=end + step_size)
)
kwargs = {"model":self.g_model, "settings":run_settings}
parameters = []
Expand Down
2 changes: 1 addition & 1 deletion stochss/handlers/util/stochss_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def __convert_model_settings(self):
try:
end = self.model['modelSettings']['endSim']
step_size = self.model['modelSettings']['timeStep']
return TimeSpan(numpy.arange(0, end + step_size, step_size))
return TimeSpan.arange(step_size, t=end + step_size)
except KeyError as err:
message = "Model settings are not properly formatted or "
message += f"are referenced incorrectly: {str(err)}"
Expand Down
6 changes: 5 additions & 1 deletion stochss/handlers/util/stochss_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ def __create_configuration_cell(self):
else:
commented = False
start = f"{pad}# " if commented else pad
config.append(f"{start}solver = {self.settings['solver']}(model=model)")
if self.nb_type in (self.MODEL_EXPLORATION, self.MODEL_INFERENCE):
del_dir = ", delete_directory=False"
else:
del_dir = ""
config.append(f"{start}solver = {self.settings['solver']}(model=model{del_dir})")
config.append(pad + "kwargs = {")
if self.s_model['is_spatial']:
settings = self.__get_spatialpy_run_setting()
Expand Down
6 changes: 3 additions & 3 deletions stochss/handlers/util/stochss_spatial_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from escapism import escape
from spatialpy import Model, Species, Parameter, Reaction, Domain, DomainError, BoundaryCondition, \
PlaceInitialCondition, UniformInitialCondition, ScatterInitialCondition, \
Geometry, ModelError
Geometry, ModelError, TimeSpan

from .stochss_base import StochSSBase
from .stochss_errors import StochSSFileNotFoundError, FileNotJSONFormatError, DomainFormatError, \
Expand Down Expand Up @@ -235,8 +235,8 @@ def __convert_model_settings(self, model):
end = self.model['modelSettings']['endSim']
output_freq = self.model['modelSettings']['timeStep']
step_size = self.model['modelSettings']['timestepSize']
tspan = numpy.arange(0, end + step_size, output_freq)
model.timespan(tspan, timestep_size=step_size)
tspan = TimeSpan.arange(output_freq, t=end + step_size, timestep_size=step_size)
model.timespan(tspan)
except KeyError as err:
message = "Spatial model settings are not properly formatted or "
message += f"are referenced incorrectly: {str(err)}"
Expand Down

0 comments on commit ea29cde

Please sign in to comment.