Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions Artifacts.toml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
[[heta_app]]
arch = "x86_64"
git-tree-sha1 = "68d5937a561697b75a437e5ba5b85211dcdb7de0"
git-tree-sha1 = "d53e55032f2d0aebc09fd816076fe0565a860614"
libc = "glibc"
os = "linux"

[[heta_app.download]]
sha256 = "d65b333521f3b6a1ff45d7e85be31920db305ccf5476cf43facb5c280547b3f6"
url = "https://github.com/hetalang/heta-compiler/releases/download/v0.9.8/heta-compiler-linux-x64.tar.gz"
sha256 = "53b74d935349390ecb8e08885b4a0a41112b491e01aa899d2ef882059350c892"
url = "https://github.com/hetalang/heta-compiler/releases/download/v0.10.0/heta-compiler-linux-x64.tar.gz"
[[heta_app]]
arch = "aarch64"
git-tree-sha1 = "36a68eb4b97c6a1359eb020b3ecbcae9edf5b8d4"
git-tree-sha1 = "f5fd8098f0b6f5dcf9e12ea85762308b7b4f16f2"
libc = "glibc"
os = "linux"

[[heta_app.download]]
sha256 = "570d448f3ac400121c62e52a457c5c3913ac8cd7db245993f069a38a5e828ec6"
url = "https://github.com/hetalang/heta-compiler/releases/download/v0.9.8/heta-compiler-linux-arm64.tar.gz"
sha256 = "ac4c7bc4f193b49249304d1c526d2a450363324096a501f8591577db56849c3e"
url = "https://github.com/hetalang/heta-compiler/releases/download/v0.10.0/heta-compiler-linux-arm64.tar.gz"
[[heta_app]]
arch = "x86_64"
git-tree-sha1 = "da83049a6967fbf9d03203eed2e39c34d2abc958"
git-tree-sha1 = "9f0f36d98ae3ad587b1a7eb708f2cf4ba747f4b0"
os = "windows"

[[heta_app.download]]
sha256 = "24a58a6d4b19beb396a102caa0f552e975b4a12152857550e4e8523caa644629"
url = "https://github.com/hetalang/heta-compiler/releases/download/v0.9.8/heta-compiler-windows-x64.tar.gz"
sha256 = "c47e89c1a97a46910a1fa884540e3f84f6080f7d5844aa2a570164a141b2beff"
url = "https://github.com/hetalang/heta-compiler/releases/download/v0.10.0/heta-compiler-windows-x64.tar.gz"
[[heta_app]]
arch = "x86_64"
git-tree-sha1 = "b9d4a095b4b49c117a6c2e8d04401db8cba4276a"
git-tree-sha1 = "f4868fa87fa18c3672b9e744f95b1c404153741e"
os = "macos"

[[heta_app.download]]
sha256 = "8d36ecccaa822e758a3e075eee4068d8733c46d89b24ce98ac10eb62f8b8d4e2"
url = "https://github.com/hetalang/heta-compiler/releases/download/v0.9.8/heta-compiler-macos-x64.tar.gz"
sha256 = "822aa5de6f438ae7f1bf7b64243275e942e396e7cc95e6a2111401224ce2af03"
url = "https://github.com/hetalang/heta-compiler/releases/download/v0.10.0/heta-compiler-macos-x64.tar.gz"
[[heta_app]]
arch = "aarch64"
git-tree-sha1 = "7f648c13f14fb469e9383f6a4c7b06f4ac2f9501"
git-tree-sha1 = "949269e6117de92477167fd00077adc749c78570"
os = "macos"

[[heta_app.download]]
sha256 = "a2fe5313ffcdde63d5e990bb2094b20cb4528aafcf99b7ea932380abbdab9df3"
url = "https://github.com/hetalang/heta-compiler/releases/download/v0.9.8/heta-compiler-macos-arm64.tar.gz"
sha256 = "e611e9afc46c7ad7820386c6f4a2ddb70efbea039a93d7fde582998f81bd30c3"
url = "https://github.com/hetalang/heta-compiler/releases/download/v0.10.0/heta-compiler-macos-arm64.tar.gz"
2 changes: 1 addition & 1 deletion artifacts_scripts/build_artifacts.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ArtifactUtils
using Pkg.Artifacts

const HETA_COMPILER_RELEASE = "v0.9.8"
const HETA_COMPILER_RELEASE = "v0.10.0"

const artifacts_toml = joinpath(@__DIR__, "..", "Artifacts.toml")

Expand Down
2 changes: 1 addition & 1 deletion src/HetaSimulator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module HetaSimulator
import Base: SHA1

# heta-compiler supported version
const HETA_COMPILER_VERSION = "0.9.8"
const HETA_COMPILER_VERSION = "0.10.0"
#const SUPPORTED_VERSIONS = ["0.8.4", "0.8.5", "0.8.6"]

function heta_compiler_load()
Expand Down
3 changes: 2 additions & 1 deletion src/events.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function add_event(evt::TimeEvent, events_save::Tuple{Bool, Bool}=(false,false),
#scn_func(u, t, integrator) = t in tstops

function init_time_event(cb,u,t,integrator)
append!(tstops, evt.condition_func(integrator.sol.prob.p.x[2], integrator.sol.prob.tspan))
ts = evt.condition_func(integrator.sol.prob.p.x[2], integrator.sol.prob.tspan)
append!(tstops, _to_float.(ts)) # fix for Dual numbers
tf = integrator.sol.prob.tspan[2]
[add_tstop!(integrator, tstop) for tstop in tstops if tstop <= tf]
#[add_tstop!(integrator, tstop) for tstop in tstops]
Expand Down
15 changes: 6 additions & 9 deletions src/heta_cli/connect.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,16 @@ Arguments:
function load_jlplatform(
model_jl::AbstractString
)
# include and CAPTURE the returned tuple (models, tasks, version)
args = Base.invokelatest(() -> Base.include(Main, model_jl))

# load model to Main
Base.include(Main, model_jl)

version = Main.__platform__[3]
# version check
version = args[3]
@assert version == HETA_COMPILER_VERSION "The model was build with Heta compiler v$version, which is not supported.\n"*
"This HetaSimulator release includes Heta compiler v$HETA_COMPILER_VERSION. Please re-compile the model with HetaSimulator load_platform()."

# tmp fix to output model without task
# (models, tasks,) = Base.invokelatest(Main.Platform)

platform = Base.invokelatest(Platform, Main.__platform__...)

# build the Platform using the returned tuple
platform = Base.invokelatest(Platform, args...)
return platform
end

Expand Down
2 changes: 1 addition & 1 deletion src/ode_problem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function build_ode_problem( # used in Scenario constructor only
lobs = length(merged_observables)
function saving_func(u,t,integrator)
out = zeros(eltype(u), lobs)
saving!(out,u,t,integrator)
Base.invokelatest(saving!,out,u,t,integrator)
return out
end

Expand Down
8 changes: 8 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,11 @@ function Base.setindex!(A::ArrayPartition, X::AbstractArray, I::AbstractVector{I
end
return A
end

function _to_float(x::Real)
return float(x)
end

function _to_float(x::ForwardDiff.Dual)
return float(x.value)
end
2 changes: 1 addition & 1 deletion test/dummy_jlmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This code was generated by heta-compiler 0.0.1
=#

__platform__ = (function()
(function()

### NO MODEL CODE ###

Expand Down
Loading