Skip to content

Commit

Permalink
Merge pull request #18 from biosimulators/min-presim-points
Browse files Browse the repository at this point in the history
Set minimum number of presim points
  • Loading branch information
luciansmith committed Aug 15, 2023
2 parents 154f6d9 + 7e8cc5f commit 705eeb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion biosimulators_tellurium/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.39'
__version__ = '0.1.40'
5 changes: 3 additions & 2 deletions biosimulators_tellurium/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ def exec_sed_task(task, variables, preprocessed_task=None, log=None, config=None
(sim.output_end_time - sim.output_start_time) * sim.number_of_steps + 1

number_of_presim_points = round(number_of_presim_points) - sim.number_of_steps
number_of_presim_points = max(2, number_of_presim_points)
road_runner.simulate(sim.initial_time, sim.output_start_time, number_of_presim_points)

results = numpy.array(road_runner.simulate(sim.output_start_time, sim.output_end_time, sim.number_of_steps+1).tolist()).transpose()
Expand Down Expand Up @@ -310,10 +311,10 @@ def exec_sed_task(task, variables, preprocessed_task=None, log=None, config=None

def get_all_tasks_from_task(task):
ret = set()
if type(task) == Task:
if isinstance(task, Task):
ret.add(task)
return ret
elif type(task) == RepeatedTask:
elif isinstance(task, RepeatedTask):
for sub_task in task.sub_tasks:
submodels = get_all_tasks_from_task(sub_task.task)
ret.update(submodels)
Expand Down

0 comments on commit 705eeb0

Please sign in to comment.