Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Set minimum number of presim points #18

Merged
merged 4 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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