Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

HOTFIX: Pause Resume #641

Closed
wants to merge 2 commits into from
Closed
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: 2 additions & 0 deletions gillespy2/solvers/cpp/c_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ def _update_resume_data(self, resume: Results, simulation_data: "list[dict[str,
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.
if entry_name != "time":
entry_data = entry_data[:-1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some testing with pause/resume models, and it showed that there was consistently a duplicate entry from the end time of the initial run to the "next step" of the resume run. This fix shaves the last data point off so that things line up, but I have proposed an alternate fix in #643 which eliminates the duplicate entries.

new_data = numpy.concatenate((resume[entry_name], entry_data), axis=None)
simulation_data[-1][entry_name] = new_data

Expand Down