From ee3d1475a8022adda3d7b5f03f69e83edd45a9d1 Mon Sep 17 00:00:00 2001 From: Alex Lubbock Date: Tue, 28 Mar 2023 22:08:06 +0100 Subject: [PATCH] Fix numpy v1.24 compatibility Numpy v1.24 deprecated ragged arrays unless dtype=object is passed (numpy/numpy#22004). The SimulationResult class needs to support different length entries in tout in the case that these differ across simulations. PySB shouldn't convert these to a numpy array, instead preferring to keep them as a list/iterable. --- pysb/simulator/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysb/simulator/base.py b/pysb/simulator/base.py index 4b22ac95..7d3f5284 100644 --- a/pysb/simulator/base.py +++ b/pysb/simulator/base.py @@ -748,7 +748,7 @@ def __init__(self, simulator, tout, trajectories=None, self.run_kwargs = {} self.squeeze = squeeze - self.tout = np.asarray(tout) + self.tout = tout self._yfull = None self.n_sims_per_parameter_set = simulations_per_param_set self.pysb_version = PYSB_VERSION