From 491a453517a5e7494ab307938f119307d86ff5e1 Mon Sep 17 00:00:00 2001 From: seanebum Date: Mon, 6 Jan 2020 10:43:47 -0500 Subject: [PATCH 1/3] also fixed timespan numpy issue for cython solver --- gillespy2/solvers/cython/cython_ssa_solver.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gillespy2/solvers/cython/cython_ssa_solver.pyx b/gillespy2/solvers/cython/cython_ssa_solver.pyx index 87ee72eaf..f33a070e9 100644 --- a/gillespy2/solvers/cython/cython_ssa_solver.pyx +++ b/gillespy2/solvers/cython/cython_ssa_solver.pyx @@ -165,7 +165,7 @@ class CythonSSASolver(GillesPySolver): seed = -1 cdef int seed_arg = seed #set timespan for simulation(s) - timeline = np.linspace(0,t, (t//increment+1)) + timeline = np.linspace(0,t, (t / int(round(increment+1)))) #allocate memory for trajectories cdef np.ndarray[np.float64_t, ndim=3] trajectories = np.zeros((number_of_trajectories, timeline.size, number_species + 1)) trajectories[:,:,0] = timeline From 57400a3f992ccd6afc0e446d86a154d1106e2d63 Mon Sep 17 00:00:00 2001 From: seanebum Date: Mon, 6 Jan 2020 11:00:54 -0500 Subject: [PATCH 2/3] fixed error in update to cython solver --- gillespy2/solvers/cython/cython_ssa_solver.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gillespy2/solvers/cython/cython_ssa_solver.pyx b/gillespy2/solvers/cython/cython_ssa_solver.pyx index f33a070e9..1db1742d0 100644 --- a/gillespy2/solvers/cython/cython_ssa_solver.pyx +++ b/gillespy2/solvers/cython/cython_ssa_solver.pyx @@ -165,7 +165,7 @@ class CythonSSASolver(GillesPySolver): seed = -1 cdef int seed_arg = seed #set timespan for simulation(s) - timeline = np.linspace(0,t, (t / int(round(increment+1)))) + timeline = np.linspace(0,t, int(round(t / increment+1))) #allocate memory for trajectories cdef np.ndarray[np.float64_t, ndim=3] trajectories = np.zeros((number_of_trajectories, timeline.size, number_species + 1)) trajectories[:,:,0] = timeline From 61c7f86802693d4cde8982a00da309bdd3bc3ebc Mon Sep 17 00:00:00 2001 From: seanebum Date: Mon, 6 Jan 2020 11:33:29 -0500 Subject: [PATCH 3/3] fixed error setting timeline in cython ssa solver --- gillespy2/solvers/cython/cython_ssa_solver.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gillespy2/solvers/cython/cython_ssa_solver.pyx b/gillespy2/solvers/cython/cython_ssa_solver.pyx index 1db1742d0..f880c00bf 100644 --- a/gillespy2/solvers/cython/cython_ssa_solver.pyx +++ b/gillespy2/solvers/cython/cython_ssa_solver.pyx @@ -165,7 +165,7 @@ class CythonSSASolver(GillesPySolver): seed = -1 cdef int seed_arg = seed #set timespan for simulation(s) - timeline = np.linspace(0,t, int(round(t / increment+1))) + timeline = np.linspace(0,t, int(round(t /increment+1))) #allocate memory for trajectories cdef np.ndarray[np.float64_t, ndim=3] trajectories = np.zeros((number_of_trajectories, timeline.size, number_species + 1)) trajectories[:,:,0] = timeline