From 6f006e5d27a3c4fb5737ae2ce1c97c0620165386 Mon Sep 17 00:00:00 2001 From: Bryan Rumsey Date: Tue, 9 Nov 2021 10:57:37 -0500 Subject: [PATCH 1/2] Fixed the pause resume results shape mismatch. --- gillespy2/solvers/cpp/c_solver.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gillespy2/solvers/cpp/c_solver.py b/gillespy2/solvers/cpp/c_solver.py index 7966c9035..6adef9be8 100644 --- a/gillespy2/solvers/cpp/c_solver.py +++ b/gillespy2/solvers/cpp/c_solver.py @@ -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:] new_data = numpy.concatenate((resume[entry_name], entry_data), axis=None) simulation_data[-1][entry_name] = new_data From f441731f942246e87908b18295998281cc7c8dc6 Mon Sep 17 00:00:00 2001 From: Bryan Rumsey Date: Tue, 9 Nov 2021 16:47:19 -0500 Subject: [PATCH 2/2] Switched the fix to remove the last element of the new data instead of the first element. --- gillespy2/solvers/cpp/c_solver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gillespy2/solvers/cpp/c_solver.py b/gillespy2/solvers/cpp/c_solver.py index 6adef9be8..a20822cd4 100644 --- a/gillespy2/solvers/cpp/c_solver.py +++ b/gillespy2/solvers/cpp/c_solver.py @@ -332,7 +332,7 @@ def _update_resume_data(self, resume: Results, simulation_data: "list[dict[str, # 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:] + entry_data = entry_data[:-1] new_data = numpy.concatenate((resume[entry_name], entry_data), axis=None) simulation_data[-1][entry_name] = new_data