Skip to content

Commit cf74260

Browse files
authored
Merge pull request #10 from JuBiotech/sunode-fixes
Fix import route of `sunode`'s `as_aesara` wrapper
2 parents 204d21a + 2cef953 commit cf74260

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

murefi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
)
1212
from .ode import BaseODEModel
1313

14-
__version__ = "5.1.0"
14+
__version__ = "5.1.1"

murefi/datastructures.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,12 @@ def make_template(tmin: float, tmax: float, independent_keys: list, rids: list,
246246

247247
@staticmethod
248248
def make_template_like(
249-
dataset, independent_keys: typing.Iterable[str], *, N: int = 200, tmin: typing.Optional[float] = None
249+
dataset,
250+
independent_keys: typing.Iterable[str],
251+
*,
252+
N: int = 200,
253+
tmin: typing.Optional[float] = None,
254+
tmax: typing.Optional[float] = None,
250255
):
251256
"""Create a dense template Dataset that has the same start and end times as another Dataset.
252257
@@ -255,6 +260,7 @@ def make_template_like(
255260
independent_keys (list): list of independent variable keys to include in the template
256261
N (int): total number of timepoints (default: 200)
257262
tmin (float, optional): override for the start time (when tmin=None, the first timepoint of the template replicate is used)
263+
tmax (float): override for the last timepoint
258264
259265
Returns:
260266
dataset (Dataset): dataset object containing Replicates with dense timeseries of random y data
@@ -263,7 +269,7 @@ def make_template_like(
263269
for rid, rep in dataset.items():
264270
ds[rid] = Replicate.make_template(
265271
tmin=rep.t_any[0] if tmin is None else tmin,
266-
tmax=rep.t_max,
272+
tmax=rep.t_max if tmax is None else tmax,
267273
independent_keys=independent_keys,
268274
rid=rid,
269275
N=N,

murefi/symbolic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
try:
4242
import sunode
43-
import sunode.wrappers.as_theano
43+
from sunode.wrappers import as_aesara
4444

4545
HAS_SUNODE = True
4646
except ModuleNotFoundError:
@@ -154,13 +154,13 @@ def dydt_dict(t, y, params):
154154
y0 = named_with_shapes_dict(y0, independent_keys)
155155
params = named_with_shapes_dict(ode_parameters, parameter_names)
156156
params["extra"] = numpy.zeros(1)
157-
solution, *_ = sunode.wrappers.as_theano.solve_ivp(
157+
solution, *_ = as_aesara.solve_ivp(
158158
y0=y0,
159159
params=params,
160160
rhs=dydt_dict,
161161
tvals=t,
162162
t0=t[0],
163163
derivatives="forward",
164-
solver_kwargs=dict(sens_mode="simultaneous", compute_sens=True),
164+
solver_kwargs=dict(sens_mode="simultaneous"),
165165
)
166166
return solution

0 commit comments

Comments
 (0)