From 15d6c754ac2c56c8a59d8256b2a48d3177cc02ba Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Tue, 19 Nov 2024 16:50:48 +0530 Subject: [PATCH] fix: use `split = false` in `de.jit` --- diffeqpy/de.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/diffeqpy/de.py b/diffeqpy/de.py index dd7242a..9870b06 100644 --- a/diffeqpy/de.py +++ b/diffeqpy/de.py @@ -2,6 +2,11 @@ from . import load_julia_packages de, _, _ = load_julia_packages("DifferentialEquations", "ModelingToolkit", "PythonCall") from juliacall import Main -de.jit = Main.seval("jit(x) = typeof(x).name.wrapper(ModelingToolkit.complete(ModelingToolkit.modelingtoolkitize(x)), x.u0, x.tspan, x.p)") # kinda hackey -de.jit32 = Main.seval("jit(x) = typeof(x).name.wrapper(ModelingToolkit.complete(ModelingToolkit.modelingtoolkitize(x)), Float32.(x.u0), Float32.(x.tspan), Float32.(x.p))") # kinda hackey +de.jit = Main.seval("jit(x) = typeof(x).name.wrapper(ModelingToolkit.complete(ModelingToolkit.modelingtoolkitize(x); split = false), [], x.tspan)") # kinda hackey +de.jit32 = Main.seval(""" + function jit(x) + prob = typeof(x).name.wrapper(ModelingToolkit.complete(ModelingToolkit.modelingtoolkitize(x); split = false), [], Float32.(x.tspan)) + remake(prob; u0 = Float32.(prob.u0), p = Float32.(prob.p)) + end + """) # kinda hackey sys.modules[__name__] = de # mutate myself