From 47ba65c7eee6e426dfd39d8a92fb61d102571c43 Mon Sep 17 00:00:00 2001 From: Bryan Rumsey Date: Thu, 24 Jun 2021 16:26:04 -0400 Subject: [PATCH] Fixed timestepSize key error in notebook gen. Fixed event delay as str erro in notebook gen. --- stochss/handlers/util/stochss_notebook.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stochss/handlers/util/stochss_notebook.py b/stochss/handlers/util/stochss_notebook.py index 41840f149e..fae8ece046 100644 --- a/stochss/handlers/util/stochss_notebook.py +++ b/stochss/handlers/util/stochss_notebook.py @@ -137,7 +137,7 @@ def __create_event_strings(self, model, pad): pad=pad) a_names = self.__create_event_assignment_strings(assignments=assignments, event=event, pad=pad) - delay = f"{event['delay']}" if event['delay'] else None + delay = f'"{event["delay"]}"' if event['delay'] else None ev_str = f'{pad}self.add_event(Event(name="{event["name"]}", ' ev_str += f'trigger={t_name}, assignments=[{a_names}], ' ev_str += f'delay={delay}, priority="{event["priority"]}", ' @@ -770,9 +770,9 @@ def __create_stoich_spec_string(self, stoich_species): def __create_tspan_string(self, model, pad): end = self.s_model['modelSettings']['endSim'] output_freq = self.s_model['modelSettings']['timeStep'] - step_size = self.s_model['modelSettings']['timestepSize'] tspan = ["", f"{pad}# Timespan"] if self.s_model['is_spatial']: + step_size = self.s_model['modelSettings']['timestepSize'] ts_str = f'{pad}self.timespan(np.arange(0, {end + step_size}, {output_freq})' ts_str += f", timestep_size={step_size})" else: