Skip to content

Commit

Permalink
fix: use split = false in de.jit
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Nov 20, 2024
1 parent 2ccb76d commit b7d7391
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions diffeqpy/de.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b7d7391

Please sign in to comment.