From c59c148d89511819d5f27a9e6398a6cecc10770e Mon Sep 17 00:00:00 2001 From: Josh Day Date: Thu, 7 Sep 2023 10:30:53 -0400 Subject: [PATCH] Update tests for AMR changes (#111) --- Manifest.toml | 274 ++++++++++-------- Project.toml | 2 +- examples/SIRModelConfiguartion.json | 12 +- .../BIOMD0000000955_askenet.json | 12 +- .../SIRModelConfiguartion.json | 12 +- examples/sir_calibrate/sir.json | 14 +- src/SimulationService.jl | 24 +- src/operations.jl | 18 +- test/runtests.jl | 90 +++--- 9 files changed, 260 insertions(+), 198 deletions(-) diff --git a/Manifest.toml b/Manifest.toml index edc6d84..e37c3f5 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -1,13 +1,13 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.9.2" +julia_version = "1.9.3" manifest_format = "2.0" project_hash = "bd347c15f83c58674523c40f607d2cf3b61ea5b8" [[deps.ADTypes]] -git-tree-sha1 = "f5c25e8a5b29b5e941b7408bc8cc79fea4d9ef9a" +git-tree-sha1 = "a4c8e0f8c09d4aa708289c1a5fc23e2d1970017a" uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" -version = "0.1.6" +version = "0.2.1" [[deps.AMQPClient]] deps = ["Logging", "MbedTLS", "Sockets"] @@ -23,9 +23,9 @@ version = "0.1.3+0" [[deps.AbstractAlgebra]] deps = ["GroupsCore", "InteractiveUtils", "LinearAlgebra", "MacroTools", "Preferences", "Random", "RandomExtensions", "SparseArrays", "Test"] -git-tree-sha1 = "0eb58a9abe767f5813194a2610b5295c2d22ce9d" +git-tree-sha1 = "41b45260ad00b666558c16f7cd9db0e8af408ea1" uuid = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" -version = "0.31.0" +version = "0.31.1" [[deps.AbstractFFTs]] deps = ["LinearAlgebra"] @@ -173,10 +173,14 @@ uuid = "30b0a656-2188-435a-8636-2ec0e6a096e2" version = "0.1.29" [[deps.ArrayLayouts]] -deps = ["FillArrays", "LinearAlgebra", "SparseArrays"] -git-tree-sha1 = "6189f7819e6345bcc097331c7db571f2f211364f" +deps = ["FillArrays", "LinearAlgebra"] +git-tree-sha1 = "dcda7e0ac618210eabf43751d5cafde100dd539b" uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" -version = "1.1.1" +version = "1.3.0" +weakdeps = ["SparseArrays"] + + [deps.ArrayLayouts.extensions] + ArrayLayoutsSparseArraysExt = "SparseArrays" [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" @@ -201,9 +205,9 @@ version = "0.4.7" [[deps.BandedMatrices]] deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra", "PrecompileTools"] -git-tree-sha1 = "6e9b384d5e21452bc81cae3552c74f430e320985" +git-tree-sha1 = "0b816941273b5b162be122a6c94d706e3b3125ca" uuid = "aae01518-5342-5314-be14-df237901396f" -version = "0.17.35" +version = "0.17.38" weakdeps = ["SparseArrays"] [deps.BandedMatrices.extensions] @@ -272,10 +276,10 @@ uuid = "a134a8b2-14d6-55f6-9291-3336d3ab0209" version = "0.6.2" [[deps.BoundaryValueDiffEq]] -deps = ["BandedMatrices", "DiffEqBase", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "NLsolve", "Reexport", "SciMLBase", "SparseArrays"] -git-tree-sha1 = "ed8e837bfb3d1e3157022c9636ec1c722b637318" +deps = ["ArrayInterface", "BandedMatrices", "DiffEqBase", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "NonlinearSolve", "Reexport", "SciMLBase", "Setfield", "SparseArrays", "TruncatedStacktraces", "UnPack"] +git-tree-sha1 = "f7392ce20e6dafa8fee406142b1764de7d7cd911" uuid = "764a87c0-6b3e-53db-9096-fe964310641d" -version = "2.11.0" +version = "4.0.1" [[deps.Bzip2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -336,10 +340,10 @@ uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9" version = "0.5.1" [[deps.ChainRules]] -deps = ["Adapt", "ChainRulesCore", "Compat", "Distributed", "GPUArraysCore", "IrrationalConstants", "LinearAlgebra", "Random", "RealDot", "SparseArrays", "Statistics", "StructArrays"] -git-tree-sha1 = "f98ae934cd677d51d2941088849f0bf2f59e6f6e" +deps = ["Adapt", "ChainRulesCore", "Compat", "Distributed", "GPUArraysCore", "IrrationalConstants", "LinearAlgebra", "Random", "RealDot", "SparseArrays", "SparseInverseSubset", "Statistics", "StructArrays", "SuiteSparse"] +git-tree-sha1 = "dbeca245b0680f5393b4e6c40dcead7230ab0b3b" uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2" -version = "1.53.0" +version = "1.54.0" [[deps.ChainRulesCore]] deps = ["Compat", "LinearAlgebra", "SparseArrays"] @@ -579,9 +583,9 @@ version = "0.4.0" [[deps.DiffEqBase]] deps = ["ArrayInterface", "ChainRulesCore", "DataStructures", "DocStringExtensions", "EnumX", "FastBroadcast", "ForwardDiff", "FunctionWrappers", "FunctionWrappersWrappers", "LinearAlgebra", "Logging", "Markdown", "MuladdMacro", "Parameters", "PreallocationTools", "Printf", "RecursiveArrayTools", "Reexport", "Requires", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Static", "StaticArraysCore", "Statistics", "Tricks", "TruncatedStacktraces", "ZygoteRules"] -git-tree-sha1 = "ed586656058844e48660c6d6fdb384e83afc50db" +git-tree-sha1 = "df8638dbfa03d1b336c410e23a9dfbf89cb53937" uuid = "2b5f629d-d688-5b77-993f-72d75c75574e" -version = "6.128.0" +version = "6.128.2" [deps.DiffEqBase.extensions] DiffEqBaseDistributionsExt = "Distributions" @@ -607,9 +611,9 @@ version = "6.128.0" [[deps.DiffEqCallbacks]] deps = ["DataStructures", "DiffEqBase", "ForwardDiff", "LinearAlgebra", "Markdown", "NLsolve", "Parameters", "RecipesBase", "RecursiveArrayTools", "SciMLBase", "StaticArraysCore"] -git-tree-sha1 = "303ab70e4524843653e55e16a3dc7b75e677a3dd" +git-tree-sha1 = "9c7d3a84264d935f6981504388b202a770113faa" uuid = "459566f4-90b8-5000-8ac3-15dfb0a30def" -version = "2.27.0" +version = "2.29.1" weakdeps = ["OrdinaryDiffEq", "Sundials"] [[deps.DiffEqNoiseProcess]] @@ -638,9 +642,9 @@ version = "1.15.1" [[deps.DifferentialEquations]] deps = ["BoundaryValueDiffEq", "DelayDiffEq", "DiffEqBase", "DiffEqCallbacks", "DiffEqNoiseProcess", "JumpProcesses", "LinearAlgebra", "LinearSolve", "NonlinearSolve", "OrdinaryDiffEq", "Random", "RecursiveArrayTools", "Reexport", "SciMLBase", "SteadyStateDiffEq", "StochasticDiffEq", "Sundials"] -git-tree-sha1 = "1cfe0178410e1bb4b14058c537d0f347eb9d95dc" +git-tree-sha1 = "c3d11164d1b08c379bc3c6abae45fcd7250e8e35" uuid = "0c46a032-eb83-5123-abaf-570d42b7fbaa" -version = "7.8.0" +version = "7.9.1" [[deps.Distances]] deps = ["LinearAlgebra", "Statistics", "StatsAPI"] @@ -834,10 +838,15 @@ version = "0.9.20" uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" [[deps.FillArrays]] -deps = ["LinearAlgebra", "Random", "SparseArrays", "Statistics"] -git-tree-sha1 = "f372472e8672b1d993e93dada09e23139b509f9e" +deps = ["LinearAlgebra", "Random"] +git-tree-sha1 = "a20eaa3ad64254c61eeb5f230d9306e937405434" uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" -version = "1.5.0" +version = "1.6.1" +weakdeps = ["SparseArrays", "Statistics"] + + [deps.FillArrays.extensions] + FillArraysSparseArraysExt = "SparseArrays" + FillArraysStatisticsExt = "Statistics" [[deps.FiniteDiff]] deps = ["ArrayInterface", "LinearAlgebra", "Requires", "Setfield", "SparseArrays"] @@ -924,9 +933,9 @@ version = "3.3.8+0" [[deps.GPUArrays]] deps = ["Adapt", "GPUArraysCore", "LLVM", "LinearAlgebra", "Printf", "Random", "Reexport", "Serialization", "Statistics"] -git-tree-sha1 = "2e57b4a4f9cc15e85a24d603256fe08e527f48d1" +git-tree-sha1 = "8ad8f375ae365aa1eb2f42e2565a40b55a4b69a8" uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7" -version = "8.8.1" +version = "9.0.0" [[deps.GPUArraysCore]] deps = ["Adapt"] @@ -1092,9 +1101,9 @@ version = "0.1.2" [[deps.Integrals]] deps = ["CommonSolve", "HCubature", "LinearAlgebra", "MonteCarloIntegration", "QuadGK", "Reexport", "Requires", "SciMLBase"] -git-tree-sha1 = "f8f24a73621e9063f696ffeaa83f7a725ab5ae23" +git-tree-sha1 = "44dd71130586e1776fde9041bd81f2e0db15db10" uuid = "de52edbc-65ea-441a-8357-d3a637375a31" -version = "3.8.0" +version = "3.9.0" [deps.Integrals.extensions] IntegralsFastGaussQuadratureExt = "FastGaussQuadrature" @@ -1184,10 +1193,10 @@ uuid = "1019f520-868f-41f5-a6de-eb00f4b6a39c" version = "0.1.5" [[deps.JLLWrappers]] -deps = ["Preferences"] -git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1" +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.4.1" +version = "1.5.0" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] @@ -1221,15 +1230,19 @@ version = "2.1.91+0" [[deps.JuliaFormatter]] deps = ["CSTParser", "CommonMark", "DataStructures", "Glob", "Pkg", "PrecompileTools", "Tokenize"] -git-tree-sha1 = "60567b51bd9e1e19ae2fd8a54dcd6bc5994727f0" +git-tree-sha1 = "680fb31c8b8e2cf482f48e55d8fa01ccc4469e04" uuid = "98e50ef6-434e-11e9-1051-2b60c6c9e899" -version = "1.0.34" +version = "1.0.35" [[deps.JumpProcesses]] deps = ["ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "FunctionWrappers", "Graphs", "LinearAlgebra", "Markdown", "PoissonRandom", "Random", "RandomNumbers", "RecursiveArrayTools", "Reexport", "SciMLBase", "StaticArrays", "TreeViews", "UnPack"] -git-tree-sha1 = "add0bfe9091a0148a358dc8c52d5ac60806da76c" +git-tree-sha1 = "61068b4df1e434c26ff8b876fbaf2be3e3e44d27" uuid = "ccbc3e58-028d-4f4c-8cd5-9ae44345cda5" -version = "9.7.2" +version = "9.7.3" +weakdeps = ["FastBroadcast"] + + [deps.JumpProcesses.extensions] + JumpProcessFastBroadcastExt = "FastBroadcast" [[deps.KLU]] deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse_jll"] @@ -1257,9 +1270,9 @@ version = "0.6.7" [[deps.Krylov]] deps = ["LinearAlgebra", "Printf", "SparseArrays"] -git-tree-sha1 = "fbda7c58464204d92f3b158578fb0b3d4224cea5" +git-tree-sha1 = "17e462054b42dcdda73e9a9ba0c67754170c88ae" uuid = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7" -version = "0.9.3" +version = "0.9.4" [[deps.LAME_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -1275,15 +1288,15 @@ version = "3.0.0+1" [[deps.LLVM]] deps = ["CEnum", "LLVMExtra_jll", "Libdl", "Printf", "Unicode"] -git-tree-sha1 = "8695a49bfe05a2dc0feeefd06b4ca6361a018729" +git-tree-sha1 = "a9d2ce1d5007b1e8f6c5b89c5a31ff8bd146db5c" uuid = "929cbde3-209d-540e-8aea-75f648917ca0" -version = "6.1.0" +version = "6.2.1" [[deps.LLVMExtra_jll]] deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"] -git-tree-sha1 = "c35203c1e1002747da220ffc3c0762ce7754b08c" +git-tree-sha1 = "7ca6850ae880cc99b59b88517545f91a52020afa" uuid = "dad2f222-ce93-54a1-a47d-0025e8a3acab" -version = "0.0.23+0" +version = "0.0.25+0" [[deps.LLVMOpenMP_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -1413,10 +1426,10 @@ uuid = "7add5ba3-2f88-524e-9cd5-f83b8a55f7b8" version = "1.42.0+0" [[deps.Libiconv_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "c7cb1f5d892775ba13767a87c7ada0b980ea0a71" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "f9557a255370125b405568f9767d6d195822a175" uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" -version = "1.16.1+2" +version = "1.17.0+0" [[deps.Libmount_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] @@ -1454,9 +1467,9 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [[deps.LinearSolve]] deps = ["ArrayInterface", "DocStringExtensions", "EnumX", "FastLapackInterface", "GPUArraysCore", "InteractiveUtils", "KLU", "Krylov", "Libdl", "LinearAlgebra", "PrecompileTools", "Preferences", "RecursiveFactorization", "Reexport", "Requires", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Sparspak", "SuiteSparse", "UnPack"] -git-tree-sha1 = "f746a5b9522815bf098049f9cbfbfcae53f29450" +git-tree-sha1 = "69cbd612e6e67ba2f8121bc8725bc9d04d803599" uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" -version = "2.5.0" +version = "2.5.1" [deps.LinearSolve.extensions] LinearSolveCUDAExt = "CUDA" @@ -1464,6 +1477,7 @@ version = "2.5.0" LinearSolveIterativeSolversExt = "IterativeSolvers" LinearSolveKrylovKitExt = "KrylovKit" LinearSolveMKLExt = "MKL_jll" + LinearSolveMetalExt = "Metal" LinearSolvePardisoExt = "Pardiso" [deps.LinearSolve.weakdeps] @@ -1472,6 +1486,7 @@ version = "2.5.0" IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153" KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" MKL_jll = "856f044c-d86e-5d09-b602-aeab76dc8ba7" + Metal = "dde4c033-4e86-420c-a63e-0dd931031962" Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2" [[deps.LogDensityProblems]] @@ -1482,12 +1497,11 @@ version = "2.1.1" [[deps.LogDensityProblemsAD]] deps = ["DocStringExtensions", "LogDensityProblems", "Requires", "SimpleUnPack"] -git-tree-sha1 = "7841ebecc60703fa978cbe9623e1a37dcaf96b75" +git-tree-sha1 = "a0512ad65f849536b5a52e59b05c59c25cdad943" uuid = "996a588d-648d-4e1f-a8f0-a84b347e47b1" -version = "1.6.1" +version = "1.5.0" [deps.LogDensityProblemsAD.extensions] - LogDensityProblemsADADTypesExt = "ADTypes" LogDensityProblemsADEnzymeExt = "Enzyme" LogDensityProblemsADFiniteDifferencesExt = "FiniteDifferences" LogDensityProblemsADForwardDiffBenchmarkToolsExt = ["BenchmarkTools", "ForwardDiff"] @@ -1497,7 +1511,6 @@ version = "1.6.1" LogDensityProblemsADZygoteExt = "Zygote" [deps.LogDensityProblemsAD.weakdeps] - ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000" @@ -1508,9 +1521,9 @@ version = "1.6.1" [[deps.LogExpFunctions]] deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "c3ce8e7420b3a6e071e0fe4745f5d4300e37b13f" +git-tree-sha1 = "7d6dd4e9212aebaeed356de34ccf262a3cd415aa" uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.24" +version = "0.3.26" weakdeps = ["ChainRulesCore", "ChangesOfVariables", "InverseFunctions"] [deps.LogExpFunctions.extensions] @@ -1523,9 +1536,9 @@ uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" [[deps.LoggingExtras]] deps = ["Dates", "Logging"] -git-tree-sha1 = "cedb76b37bc5a6c702ade66be44f831fa23c681e" +git-tree-sha1 = "0d097476b6c381ab7906460ef1ef1638fbce1d91" uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" -version = "1.0.0" +version = "1.0.2" [[deps.LoopVectorization]] deps = ["ArrayInterface", "ArrayInterfaceCore", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"] @@ -1569,9 +1582,9 @@ version = "2023.2.0+0" [[deps.MLJModelInterface]] deps = ["Random", "ScientificTypesBase", "StatisticalTraits"] -git-tree-sha1 = "c8b7e632d6754a5e36c0d94a4b466a5ba3a30128" +git-tree-sha1 = "03ae109be87f460fe3c96b8a0dbbf9c7bf840bd5" uuid = "e80e1ace-859a-464e-9ed9-23947d8ae3ea" -version = "1.8.0" +version = "1.9.2" [[deps.MLStyle]] git-tree-sha1 = "bc38dff0548128765760c79eb7388a4b37fae2c8" @@ -1586,9 +1599,9 @@ version = "5.4.1+0" [[deps.MacroTools]] deps = ["Markdown", "Random"] -git-tree-sha1 = "42324d08725e200c23d4dfb549e0d5d89dede2d2" +git-tree-sha1 = "9ee1618cbf5240e6d4e0371d6f24065083f60c48" uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" -version = "0.5.10" +version = "0.5.11" [[deps.ManualMemory]] git-tree-sha1 = "bcaef4fc7a0cfe2cba636d84cda54b5e4e4ca3cd" @@ -1612,9 +1625,9 @@ version = "0.1.15" [[deps.MathOptInterface]] deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test", "Unicode"] -git-tree-sha1 = "5c5cd501ae1d76d3ccd7c7e6b4325a15dde7f31c" +git-tree-sha1 = "f4e059d60f10ffa61f897c10f7fbdb8eed895e95" uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" -version = "1.18.0" +version = "1.19.0" [[deps.MathProgBase]] deps = ["LinearAlgebra", "SparseArrays"] @@ -1660,10 +1673,10 @@ uuid = "78c3b35d-d492-501b-9361-3d52fe80e533" version = "0.7.7" [[deps.ModelingToolkit]] -deps = ["AbstractTrees", "ArrayInterface", "Combinatorics", "Compat", "ConstructionBase", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "DiffRules", "Distributed", "Distributions", "DocStringExtensions", "DomainSets", "ForwardDiff", "FunctionWrappersWrappers", "Graphs", "IfElse", "InteractiveUtils", "JuliaFormatter", "JumpProcesses", "LabelledArrays", "Latexify", "Libdl", "LinearAlgebra", "MLStyle", "MacroTools", "NaNMath", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLBase", "Serialization", "Setfield", "SimpleNonlinearSolve", "SparseArrays", "SpecialFunctions", "StaticArrays", "SymbolicIndexingInterface", "SymbolicUtils", "Symbolics", "URIs", "UnPack", "Unitful"] -git-tree-sha1 = "98800b44bf5b502197372b5c67aee4047962f8fa" +deps = ["AbstractTrees", "ArrayInterface", "Combinatorics", "Compat", "ConstructionBase", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "DiffRules", "Distributed", "Distributions", "DocStringExtensions", "DomainSets", "ForwardDiff", "FunctionWrappersWrappers", "Graphs", "IfElse", "InteractiveUtils", "JuliaFormatter", "JumpProcesses", "LabelledArrays", "Latexify", "Libdl", "LinearAlgebra", "MLStyle", "MacroTools", "NaNMath", "OrdinaryDiffEq", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLBase", "Serialization", "Setfield", "SimpleNonlinearSolve", "SparseArrays", "SpecialFunctions", "StaticArrays", "SymbolicIndexingInterface", "SymbolicUtils", "Symbolics", "URIs", "UnPack", "Unitful"] +git-tree-sha1 = "5be2fccc426a102c63d51c02fe414911ed539e24" uuid = "961ee093-0014-501f-94e3-6117800e7a78" -version = "8.64.0" +version = "8.67.0" [deps.ModelingToolkit.extensions] MTKDeepDiffsExt = "DeepDiffs" @@ -1694,9 +1707,9 @@ version = "0.5.1" [[deps.MutableArithmetics]] deps = ["LinearAlgebra", "SparseArrays", "Test"] -git-tree-sha1 = "964cb1a7069723727025ae295408747a0b36a854" +git-tree-sha1 = "5879579adbd9bc3017fe63c766371aace1a1d641" uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" -version = "1.3.0" +version = "1.3.1" [[deps.MvNormalCDF]] deps = ["Distributions", "FillArrays", "LinearAlgebra", "Primes", "Random", "StatsBase"] @@ -1735,9 +1748,9 @@ version = "4.5.1" [[deps.NNlib]] deps = ["Adapt", "Atomix", "ChainRulesCore", "GPUArraysCore", "KernelAbstractions", "LinearAlgebra", "Pkg", "Random", "Requires", "Statistics"] -git-tree-sha1 = "3d42748c725c3f088bcda47fa2aca89e74d59d22" +git-tree-sha1 = "3b29fafcdfa66d6673306cf116a2dc243933e2c5" uuid = "872c559c-99b0-510c-b3b7-b6c96a88d5cd" -version = "0.9.4" +version = "0.9.5" [deps.NNlib.extensions] NNlibAMDGPUExt = "AMDGPU" @@ -1772,9 +1785,9 @@ version = "1.2.0" [[deps.NonlinearSolve]] deps = ["ArrayInterface", "DiffEqBase", "EnumX", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "LinearSolve", "PrecompileTools", "RecursiveArrayTools", "Reexport", "SciMLBase", "SimpleNonlinearSolve", "SparseArrays", "SparseDiffTools", "StaticArraysCore", "UnPack"] -git-tree-sha1 = "23dabe80f8ebec9a68b0db4cd02f2d2cdbc4f653" +git-tree-sha1 = "ee53089df81a6bdf3c06c17cf674e90931b10a73" uuid = "8913a72c-1f9b-4ce2-8d82-65094dcecaec" -version = "1.9.0" +version = "1.10.0" [[deps.OffsetArrays]] deps = ["Adapt"] @@ -1790,9 +1803,9 @@ version = "1.3.5+1" [[deps.OpenAPI]] deps = ["Base64", "Dates", "Downloads", "HTTP", "JSON", "LibCURL", "MIMEs", "MbedTLS", "TimeZones", "URIs"] -git-tree-sha1 = "0102557f8939333cc5b0b0e578cb8b931ebe9845" +git-tree-sha1 = "5fb4a1e8ccce18523eacaceee21bd62fc23aac06" uuid = "d5e62ea6-ddf3-4d43-8e4c-ad5e6c8bfd7d" -version = "0.1.15" +version = "0.1.17" [[deps.OpenBLAS32_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] @@ -1830,9 +1843,9 @@ version = "0.5.5+0" [[deps.Optim]] deps = ["Compat", "FillArrays", "ForwardDiff", "LineSearches", "LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "PositiveFactorizations", "Printf", "SparseArrays", "StatsBase"] -git-tree-sha1 = "e3a6546c1577bfd701771b477b794a52949e7594" +git-tree-sha1 = "963b004d15216f8129f6c0f7d187efa136570be0" uuid = "429524aa-4258-5aef-a3af-852621145aeb" -version = "1.7.6" +version = "1.7.7" [[deps.Optimisers]] deps = ["ChainRulesCore", "Functors", "LinearAlgebra", "Random", "Statistics"] @@ -1841,17 +1854,19 @@ uuid = "3bd65402-5787-11e9-1adc-39752487f4e2" version = "0.2.15" [[deps.Optimization]] -deps = ["ADTypes", "ArrayInterface", "ConsoleProgressMonitor", "DocStringExtensions", "LinearAlgebra", "Logging", "LoggingExtras", "Pkg", "Printf", "ProgressLogging", "Reexport", "Requires", "SciMLBase", "SparseArrays", "TerminalLoggers"] -git-tree-sha1 = "80005bc7d96d4d00e56b8a58c5240a35bd638d4a" +deps = ["ADTypes", "ArrayInterface", "ConsoleProgressMonitor", "DocStringExtensions", "LinearAlgebra", "Logging", "LoggingExtras", "Pkg", "Printf", "ProgressLogging", "Reexport", "Requires", "SciMLBase", "SparseArrays", "Symbolics", "TerminalLoggers"] +git-tree-sha1 = "8aea10e024a6ac845bf71818480ab8ac813d9caa" uuid = "7f7a1694-90dd-40f0-9382-eb1efda571ba" -version = "3.15.2" +version = "3.16.1" [deps.Optimization.extensions] OptimizationEnzymeExt = "Enzyme" - OptimizationFinitediffExt = "FiniteDiff" - OptimizationForwarddiffExt = "ForwardDiff" + OptimizationFiniteDiffExt = "FiniteDiff" + OptimizationForwardDiffExt = "ForwardDiff" OptimizationMTKExt = "ModelingToolkit" - OptimizationReversediffExt = "ReverseDiff" + OptimizationReverseDiffExt = "ReverseDiff" + OptimizationSparseFiniteDiffExt = ["SparseDiffTools", "FiniteDiff"] + OptimizationSparseForwardDiffExt = ["SparseDiffTools", "ForwardDiff"] OptimizationTrackerExt = "Tracker" OptimizationZygoteExt = "Zygote" @@ -1861,6 +1876,7 @@ version = "3.15.2" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78" ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804" Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" @@ -1872,9 +1888,9 @@ version = "0.1.5" [[deps.OptimizationMOI]] deps = ["Ipopt_jll", "MathOptInterface", "ModelingToolkit", "Optimization", "Reexport", "SparseArrays", "Symbolics"] -git-tree-sha1 = "32c99127e8caf6b50856d676b56a9382bd5650c6" +git-tree-sha1 = "0e6f35532f6b433818760ec9db5eaf623b8cba52" uuid = "fd9f6733-72f4-499f-8506-86b2bdd0dea1" -version = "0.1.14" +version = "0.1.15" [[deps.OptimizationNLopt]] deps = ["NLopt", "Optimization", "Reexport"] @@ -1895,9 +1911,9 @@ version = "1.6.2" [[deps.OrdinaryDiffEq]] deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "ExponentialUtilities", "FastBroadcast", "FastClosures", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "IfElse", "InteractiveUtils", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "LoopVectorization", "MacroTools", "MuladdMacro", "NLsolve", "NonlinearSolve", "Polyester", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLNLSolve", "SciMLOperators", "SimpleNonlinearSolve", "SimpleUnPack", "SparseArrays", "SparseDiffTools", "StaticArrayInterface", "StaticArrays", "TruncatedStacktraces"] -git-tree-sha1 = "47c560dcb059570bdbd9f887a6b8958190e498a4" +git-tree-sha1 = "ba3ed480f991b846cf9a8118d3370d9752e7166d" uuid = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" -version = "6.53.4" +version = "6.55.0" [[deps.Oxygen]] deps = ["Dates", "HTTP", "JSON3", "MIMEs", "Sockets"] @@ -1970,9 +1986,9 @@ version = "1.3.5" [[deps.Plots]] deps = ["Base64", "Contour", "Dates", "Downloads", "FFMPEG", "FixedPointNumbers", "GR", "JLFzf", "JSON", "LaTeXStrings", "Latexify", "LinearAlgebra", "Measures", "NaNMath", "Pkg", "PlotThemes", "PlotUtils", "PrecompileTools", "Preferences", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "RelocatableFolders", "Requires", "Scratch", "Showoff", "SparseArrays", "Statistics", "StatsBase", "UUIDs", "UnicodeFun", "UnitfulLatexify", "Unzip"] -git-tree-sha1 = "9f8675a55b37a70aa23177ec110f6e3f4dd68466" +git-tree-sha1 = "ccee59c6e48e6f2edf8a5b64dc817b6729f99eb5" uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" -version = "1.38.17" +version = "1.39.0" [deps.Plots.extensions] FileIOExt = "FileIO" @@ -2048,9 +2064,9 @@ version = "0.4.12" [[deps.PrecompileTools]] deps = ["Preferences"] -git-tree-sha1 = "9673d39decc5feece56ef3940e5dafba15ba0f81" +git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f" uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" -version = "1.1.2" +version = "1.2.0" [[deps.Preferences]] deps = ["TOML"] @@ -2086,9 +2102,9 @@ version = "0.1.4" [[deps.ProgressMeter]] deps = ["Distributed", "Printf"] -git-tree-sha1 = "d7a7aef8f8f2d537104f170139553b14dfe39fe9" +git-tree-sha1 = "ae36206463b2395804f2787ffe172f44452b538d" uuid = "92933f4c-e287-5a05-a399-4b506db050ca" -version = "1.7.2" +version = "1.8.0" [[deps.Qt6Base_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Libglvnd_jll", "OpenSSL_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "xkbcommon_jll"] @@ -2232,9 +2248,9 @@ version = "0.4.0+0" [[deps.Roots]] deps = ["ChainRulesCore", "CommonSolve", "Printf", "Setfield"] -git-tree-sha1 = "de432823e8aab4dd1a985be4be768f95acf152d4" +git-tree-sha1 = "ff42754a57bb0d6dcfe302fd0d4272853190421f" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "2.0.17" +version = "2.0.19" [deps.Roots.extensions] RootsForwardDiffExt = "ForwardDiff" @@ -2279,10 +2295,14 @@ uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" version = "0.6.39" [[deps.SciMLBase]] -deps = ["ADTypes", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables", "TruncatedStacktraces"] -git-tree-sha1 = "04370090604cd399db5bebddb636d80ab9d338e9" +deps = ["ADTypes", "ArrayInterface", "ChainRulesCore", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables", "TruncatedStacktraces", "ZygoteRules"] +git-tree-sha1 = "450de8c64c4f201bd56f74aa0c7cf6d66666aaee" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" -version = "1.94.0" +version = "1.96.0" +weakdeps = ["Zygote"] + + [deps.SciMLBase.extensions] + ZygoteExt = "Zygote" [[deps.SciMLExpectations]] deps = ["DiffEqBase", "Distributions", "Integrals", "KernelDensity", "LinearAlgebra", "Parameters", "Random", "RecursiveArrayTools", "Reexport", "StaticArrays", "Statistics", "Zygote"] @@ -2395,15 +2415,27 @@ deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [[deps.SparseDiffTools]] -deps = ["ADTypes", "Adapt", "ArrayInterface", "Compat", "DataStructures", "FiniteDiff", "ForwardDiff", "Graphs", "LinearAlgebra", "Reexport", "Requires", "SciMLOperators", "Setfield", "SparseArrays", "StaticArrayInterface", "StaticArrays", "Tricks", "VertexSafeGraphs"] -git-tree-sha1 = "4c1a57bcbc0b795fbfdc2009e70f9c2fd2815bfe" +deps = ["ADTypes", "Adapt", "ArrayInterface", "Compat", "DataStructures", "FiniteDiff", "ForwardDiff", "Graphs", "LinearAlgebra", "PackageExtensionCompat", "Reexport", "SciMLOperators", "Setfield", "SparseArrays", "StaticArrayInterface", "StaticArrays", "Tricks", "UnPack", "VertexSafeGraphs"] +git-tree-sha1 = "b3eb6747277d9919f5527ad9053f6d2fb1166516" uuid = "47a9eef4-7e08-11e9-0b38-333d64bd3804" -version = "2.4.1" -weakdeps = ["Zygote"] +version = "2.5.1" [deps.SparseDiffTools.extensions] + SparseDiffToolsEnzymeExt = "Enzyme" + SparseDiffToolsSymbolicsExt = "Symbolics" SparseDiffToolsZygoteExt = "Zygote" + [deps.SparseDiffTools.weakdeps] + Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" + Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" + Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" + +[[deps.SparseInverseSubset]] +deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"] +git-tree-sha1 = "91402087fd5d13b2d97e3ef29bbdf9d7859e678a" +uuid = "dc90abb0-5640-4711-901d-7e5b23a2fada" +version = "0.1.1" + [[deps.Sparspak]] deps = ["Libdl", "LinearAlgebra", "Logging", "OffsetArrays", "Printf", "SparseArrays", "Test"] git-tree-sha1 = "342cf4b449c299d8d1ceaf00b7a49f4fbc7940e7" @@ -2417,9 +2449,9 @@ version = "0.1.5" [[deps.SpecialFunctions]] deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] -git-tree-sha1 = "7beb031cf8145577fbccacd94b8a8f4ce78428d3" +git-tree-sha1 = "e2cfc4012a19088254b3950b85c3c1d8882d864d" uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.3.0" +version = "2.3.1" weakdeps = ["ChainRulesCore"] [deps.SpecialFunctions.extensions] @@ -2438,10 +2470,10 @@ uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" version = "0.8.8" [[deps.StaticArrayInterface]] -deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "Requires", "SnoopPrecompile", "SparseArrays", "Static", "SuiteSparse"] -git-tree-sha1 = "33040351d2403b84afce74dae2e22d3f5b18edcb" +deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"] +git-tree-sha1 = "03fec6800a986d191f64f5c0996b59ed526eda25" uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" -version = "1.4.0" +version = "1.4.1" weakdeps = ["OffsetArrays", "StaticArrays"] [deps.StaticArrayInterface.extensions] @@ -2573,9 +2605,9 @@ version = "0.2.2" [[deps.SymbolicUtils]] deps = ["AbstractTrees", "Bijections", "ChainRulesCore", "Combinatorics", "ConstructionBase", "DataStructures", "DocStringExtensions", "DynamicPolynomials", "IfElse", "LabelledArrays", "LinearAlgebra", "MultivariatePolynomials", "NaNMath", "Setfield", "SparseArrays", "SpecialFunctions", "StaticArrays", "TimerOutputs", "Unityper"] -git-tree-sha1 = "9704a1d0ecbbf5d65700418dcf1bb4c680c790bb" +git-tree-sha1 = "dbb5d0cb3aa5207e887ab12e4549c5313d0f4f02" uuid = "d1185830-fcd6-423d-90d6-eec64667417b" -version = "1.2.0" +version = "1.3.0" [[deps.Symbolics]] deps = ["ArrayInterface", "ConstructionBase", "DataStructures", "DiffRules", "Distributions", "DocStringExtensions", "DomainSets", "Groebner", "IfElse", "LaTeXStrings", "LambertW", "Latexify", "Libdl", "LinearAlgebra", "MacroTools", "Markdown", "NaNMath", "RecipesBase", "Reexport", "Requires", "RuntimeGeneratedFunctions", "SciMLBase", "Setfield", "SparseArrays", "SpecialFunctions", "StaticArrays", "SymbolicUtils", "TreeViews"] @@ -2594,6 +2626,12 @@ deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" version = "1.0.3" +[[deps.TZJData]] +deps = ["Artifacts"] +git-tree-sha1 = "d39314cdbaf5b90a047db33858626f8d1cc973e1" +uuid = "dc5dba14-91b3-4cab-a142-028a31da12f7" +version = "1.0.0+2023c" + [[deps.TableTraits]] deps = ["IteratorInterfaceExtensions"] git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" @@ -2658,10 +2696,14 @@ uuid = "ac1d9e8a-700a-412c-b207-f0111f4b6c0d" version = "0.1.11" [[deps.TimeZones]] -deps = ["Dates", "Downloads", "InlineStrings", "LazyArtifacts", "Mocking", "Printf", "RecipesBase", "Scratch", "Unicode"] -git-tree-sha1 = "5b347464bdac31eccfdbe1504d9484c31645cafc" +deps = ["Artifacts", "Dates", "Downloads", "InlineStrings", "LazyArtifacts", "Mocking", "Printf", "Scratch", "TZJData", "Unicode", "p7zip_jll"] +git-tree-sha1 = "89e64d61ef3cd9e80f7fc12b7d13db2d75a23c03" uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53" -version = "1.11.0" +version = "1.13.0" +weakdeps = ["RecipesBase"] + + [deps.TimeZones.extensions] + TimeZonesRecipesBaseExt = "RecipesBase" [[deps.TimerOutputs]] deps = ["ExprTools", "Printf"] @@ -2779,9 +2821,9 @@ version = "0.4.1" [[deps.Unitful]] deps = ["Dates", "LinearAlgebra", "Random"] -git-tree-sha1 = "64eb17acef1d9734cf09967539818f38093d9b35" +git-tree-sha1 = "a72d22c7e13fe2de562feda8645aa134712a87ee" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.16.2" +version = "1.17.0" weakdeps = ["ConstructionBase", "InverseFunctions"] [deps.Unitful.extensions] @@ -2858,10 +2900,10 @@ uuid = "76eceee3-57b5-4d4a-8e66-0e911cebbf60" version = "1.6.1" [[deps.XML2_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"] -git-tree-sha1 = "93c41695bc1c08c46c5899f4fe06d6ead504bb73" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] +git-tree-sha1 = "04a51d15436a572301b5abbb9d099713327e9fc4" uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" -version = "2.10.3+0" +version = "2.10.4+0" [[deps.XSLT_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Libgpg_error_jll", "Libiconv_jll", "Pkg", "XML2_jll", "Zlib_jll"] @@ -3020,9 +3062,9 @@ version = "1.5.5+0" [[deps.Zygote]] deps = ["AbstractFFTs", "ChainRules", "ChainRulesCore", "DiffRules", "Distributed", "FillArrays", "ForwardDiff", "GPUArrays", "GPUArraysCore", "IRTools", "InteractiveUtils", "LinearAlgebra", "LogExpFunctions", "MacroTools", "NaNMath", "PrecompileTools", "Random", "Requires", "SparseArrays", "SpecialFunctions", "Statistics", "ZygoteRules"] -git-tree-sha1 = "e2fe78907130b521619bc88408c859a472c4172b" +git-tree-sha1 = "b97c927497c1de55a78dc9030f6068be5d83ef80" uuid = "e88e6eb3-aa80-5325-afca-941959d7151f" -version = "0.6.63" +version = "0.6.64" weakdeps = ["Colors", "Distances", "Tracker"] [deps.Zygote.extensions] diff --git a/Project.toml b/Project.toml index 0c35949..b67f25e 100644 --- a/Project.toml +++ b/Project.toml @@ -33,6 +33,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6" [compat] +julia = "1.9" AMQPClient = "0.5" CSV = "0.10" DataFrames = "1.6" @@ -47,7 +48,6 @@ Oxygen = "1.1" SciMLBase = "1.93" SwaggerMarkdown = "0.2" YAML = "0.4" -julia = "1.9" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/examples/SIRModelConfiguartion.json b/examples/SIRModelConfiguartion.json index f37f678..218b6a5 100644 --- a/examples/SIRModelConfiguartion.json +++ b/examples/SIRModelConfiguartion.json @@ -1,9 +1,11 @@ { "id": "55ca595f-940d-458c-9c73-7c315a10b559", - "name": "Default config", - "description": "Default config", - "timestamp": "2023-07-13T20:18:12", - "model_id": "0984a5a9-6438-4041-aa11-2f9ea8fc9d4a", + "header": { + "name": "Default config", + "description": "Default config", + "timestamp": "2023-07-13T20:18:12", + "model_id": "0984a5a9-6438-4041-aa11-2f9ea8fc9d4a" + }, "configuration": { "id": "0984a5a9-6438-4041-aa11-2f9ea8fc9d4a", "name": "SIRs", @@ -639,4 +641,4 @@ "calibrated": false, "calibration": null, "calibration_score": null -} \ No newline at end of file +} diff --git a/examples/calibrate_example1/BIOMD0000000955_askenet.json b/examples/calibrate_example1/BIOMD0000000955_askenet.json index afa448f..3899f12 100644 --- a/examples/calibrate_example1/BIOMD0000000955_askenet.json +++ b/examples/calibrate_example1/BIOMD0000000955_askenet.json @@ -1,9 +1,11 @@ { - "name": "Giordano2020 - SIDARTHE model of COVID-19 spread in Italy", - "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", - "schema_name": "petrinet", - "description": "Giordano2020 - SIDARTHE model of COVID-19 spread in Italy", - "model_version": "0.1", + "header": { + "name": "Giordano2020 - SIDARTHE model of COVID-19 spread in Italy", + "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json", + "schema_name": "petrinet", + "description": "Giordano2020 - SIDARTHE model of COVID-19 spread in Italy", + "model_version": "0.1" + }, "properties": {}, "model": { "states": [ diff --git a/examples/calibrate_example2/SIRModelConfiguartion.json b/examples/calibrate_example2/SIRModelConfiguartion.json index f37f678..218b6a5 100644 --- a/examples/calibrate_example2/SIRModelConfiguartion.json +++ b/examples/calibrate_example2/SIRModelConfiguartion.json @@ -1,9 +1,11 @@ { "id": "55ca595f-940d-458c-9c73-7c315a10b559", - "name": "Default config", - "description": "Default config", - "timestamp": "2023-07-13T20:18:12", - "model_id": "0984a5a9-6438-4041-aa11-2f9ea8fc9d4a", + "header": { + "name": "Default config", + "description": "Default config", + "timestamp": "2023-07-13T20:18:12", + "model_id": "0984a5a9-6438-4041-aa11-2f9ea8fc9d4a" + }, "configuration": { "id": "0984a5a9-6438-4041-aa11-2f9ea8fc9d4a", "name": "SIRs", @@ -639,4 +641,4 @@ "calibrated": false, "calibration": null, "calibration_score": null -} \ No newline at end of file +} diff --git a/examples/sir_calibrate/sir.json b/examples/sir_calibrate/sir.json index d916c78..e37eb38 100644 --- a/examples/sir_calibrate/sir.json +++ b/examples/sir_calibrate/sir.json @@ -1,9 +1,11 @@ { - "id": "5bcf7464-5dce-4af5-b8b3-747328f1525e", - "timestamp": "2023-07-10 18:41:39", - "name": "SIRs", - "description": "SIR model", - "username": null, + "id": "5bcf7464-5dce-4af5-b8b3-747328f1525e", + "header": { + "timestamp": "2023-07-10 18:41:39", + "name": "SIRs", + "description": "SIR model", + "username": null + }, "model": { "states": [ { @@ -636,4 +638,4 @@ ] }, "schema": "https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/petrinet_v0.5/petrinet/petrinet_schema.json" -} \ No newline at end of file +} diff --git a/src/SimulationService.jl b/src/SimulationService.jl index 9f5beb8..9771b8d 100644 --- a/src/SimulationService.jl +++ b/src/SimulationService.jl @@ -15,7 +15,7 @@ import HTTP import InteractiveUtils: subtypes import JobSchedulers import JSON3 -import JSONSchema +import JSONSchema import LinearAlgebra: norm import MathML import ModelingToolkit: @parameters, substitute, Differential, Num, @variables, ODESystem, ODEProblem, ODESolution, structural_simplify, states, observed @@ -40,6 +40,7 @@ const simulation_schema = Ref{JSON3.Object}() const petrinet_schema = Ref{JSON3.Object}() const petrinet_JSONSchema_object = Ref{JSONSchema.Schema}() const server_url = Ref{String}() +const mock_tds = Ref{Dict{String, Dict{String, JSON3.Object}}}() # e.g. "model" => "model_id" => model #-----# Environmental Variables: # Server configuration @@ -64,6 +65,7 @@ function __init__() simulation_schema[] = get_json("https://raw.githubusercontent.com/DARPA-ASKEM/simulation-api-spec/main/schemas/simulation.json") petrinet_schema[] = get_json("https://raw.githubusercontent.com/DARPA-ASKEM/Model-Representations/main/petrinet/petrinet_schema.json") petrinet_JSONSchema_object[] = JSONSchema.Schema(petrinet_schema[]) + HOST[] = get(ENV, "SIMSERVICE_HOST", "0.0.0.0") PORT[] = parse(Int, get(ENV, "SIMSERVICE_PORT", "8080")) ENABLE_TDS[] = get(ENV, "SIMSERVICE_ENABLE_TDS", "true") == "true" # @@ -80,8 +82,9 @@ function __init__() (; MECHANISM = "AMQPLAIN", LOGIN=RABBITMQ_LOGIN, PASSWORD=RABBITMQ_PASSWORD) ) conn = AMQPClient.connection(; virtualhost="/", host="localhost", port=RABBITMQ_PORT, auth_params) - @info typeof(AMQPClient.channel(conn, AMQPClient.UNUSED_CHANNEL, true)) + rabbitmq_channel[] = AMQPClient.channel(conn, AMQPClient.UNUSED_CHANNEL, true) + AMQPClient.queue_declare(rabbitmq_channel[], "sciml-queue") end v = Pkg.Types.read_project("Project.toml").version @@ -131,6 +134,19 @@ get_json(url::String) = JSON3.read(HTTP.get(url, json_header).body) timestamp() = Dates.format(now(), "yyyy-mm-ddTHH:MM:SS") +# Run some code with a running server +function with_server(f::Function; wait=1) + try + start!() + sleep(wait) + url = SimulationService.server_url[] + f(url) + catch ex + rethrow(ex) + finally + stop!() + end +end #-----------------------------------------------------------------------------# job endpoints get_job(id::String) = JobSchedulers.job_query(jobhash(id)) @@ -223,7 +239,7 @@ function OperationRequest(req::HTTP.Request, route::String) # Checks if the JSON model is valid against the petrinet schema # If not valid, produces a warning saying why if !isnothing(o.model) - valid_against_schema = JSONSchema.validate(petrinet_JSONSchema_object[],o.model) + valid_against_schema = JSONSchema.validate(petrinet_JSONSchema_object[],o.model) if !isnothing(valid_against_schema) @warn "Object not valid against schema: $(valid_against_schema)" end @@ -231,7 +247,7 @@ function OperationRequest(req::HTTP.Request, route::String) if !isnothing(o.models) for model in o.models - valid_against_schema = JSONSchema.validate(petrinet_JSONSchema_object[],model) + valid_against_schema = JSONSchema.validate(petrinet_JSONSchema_object[],model) if !isnothing(valid_against_schema) @warn "Object not valid against schema: $(valid_against_schema)" end diff --git a/src/operations.jl b/src/operations.jl index 2447d4c..7b24107 100644 --- a/src/operations.jl +++ b/src/operations.jl @@ -53,7 +53,9 @@ function amr_get(amr::JSON3.Object, ::Type{ODESystem}) push!(eqs, ofunc ~ expr) end - sys = structural_simplify(ODESystem(eqs, t, allfuncs, paramvars; defaults = [statefuncs .=> initial_vals; sym_defs], name=Symbol(amr.name))) + defaults = [statefuncs .=> initial_vals; sym_defs] + name = Symbol(amr.header.name) + sys = structural_simplify(ODESystem(eqs, t, allfuncs, paramvars; defaults, name)) @info "amr_get(amr, ODESystem) --> $sys" sys @@ -154,10 +156,10 @@ function Simulate(o::OperationRequest) Simulate(sys, o.timespan) end -function solve(op::Simulate; kw...) +function solve(op::Simulate; callback) # joshday: What does providing `u0 = []` do? Don't we know what u0 is from AMR? prob = ODEProblem(op.sys, [], op.timespan) - sol = solve(prob; progress = true, progress_steps = 1, saveat=1, kw...) + sol = solve(prob; progress = true, progress_steps = 1, saveat=1, callback) @info "Timesteps returned are: $(sol.t)" dataframe_with_observables(sol) end @@ -207,7 +209,7 @@ function solve(o::Calibrate; callback) probs = [EasyModelAnalysis.remake(prob, p = Pair.(first.(p_posterior), getindex.(pvalues,i))) for i in 1:length(p_posterior[1][2])] enprob = EasyModelAnalysis.EnsembleProblem(probs) - ensol = solve(enprob, saveat = 1) + ensol = solve(enprob; saveat = 1, callback) outs = map(1:length(probs)) do i mats = stack(ensol[i][statenames])' headers = string.("ensemble",i,"_", statenames) @@ -231,7 +233,7 @@ function solve(o::Calibrate; callback) end newprob = EasyModelAnalysis.DifferentialEquations.remake(prob, p=fit) - sol = EasyModelAnalysis.DifferentialEquations.solve(newprob; saveat = 1) + sol = EasyModelAnalysis.DifferentialEquations.solve(newprob; saveat = 1, callback) dfsim = DataFrame(hcat(sol.t,stack(sol[statenames])'), :auto) rename!(dfsim, ["timestamp";string.(statenames)]) @@ -273,7 +275,7 @@ function solve(o::Ensemble{Simulate}; callback) systems = [sim.sys for sim in o.operations] probs = ODEProblem.(systems, Ref([]), Ref(o.operations[1].timespan)) enprob = EMA.EnsembleProblem(probs) - sol = solve(enprob; saveat = 1); + sol = solve(enprob; saveat = 1, callback); weights = [0.2, 0.5, 0.3] data = [x => vec(sum(stack(o.weights .* sol[:,x]), dims = 2)) for x in error("What goes here?")] end @@ -293,7 +295,7 @@ function solve(o::Ensemble{Calibrate}; callback) # forecast_probs = [EMA.remake(enprobs.prob[i]; tspan = (t_train[1],t_forecast[end])) for i in 1:length(enprobs.prob)] # fit_enprob = EMA.EnsembleProblem(forecast_probs) - # sol = solve(fit_enprob; saveat = o.t_forecast); + # sol = solve(fit_enprob; saveat = o.t_forecast, callback); # soldata = DataFrame([sol.t; Matrix(sol[names])']) @@ -328,7 +330,7 @@ end # forecast_probs = [EMA.remake(enprobs.prob[i]; tspan = (t_train[1],t_forecast[end])) for i in 1:length(enprobs.prob)] # fit_enprob = EMA.EnsembleProblem(forecast_probs) -# sol = solve(fit_enprob; saveat = o.t_forecast); +# sol = solve(fit_enprob; saveat = o.t_forecast, callback); # soldata = DataFrame([sol.t; Matrix(sol[names])']) diff --git a/test/runtests.jl b/test/runtests.jl index c7fd4ef..8958d3d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -124,7 +124,7 @@ end obj = SimulationService.get_json(json_url) sys = SimulationService.amr_get(obj, ODESystem) op = Simulate(sys, (0.0, 99.0)) - df = solve(op) + df = solve(op; callback = nothing) @test df isa DataFrame @test extrema(df.timestamp) == (0.0, 99.0) end @@ -141,9 +141,9 @@ end ode_method = nothing o = SimulationService.Calibrate(sys, (0.0, 89.0), priors, data, num_chains, num_iterations, calibrate_method, ode_method) - dfsim, dfparam = SimulationService.solve(o; callback = nothing) + dfsim, dfparam = solve(o; callback = nothing) - statenames = [states(o.sys);getproperty.(observed(o.sys), :lhs)] + statenames = [states(o.sys); getproperty.(observed(o.sys), :lhs)] @test names(dfsim) == vcat("timestamp",reduce(vcat,[string.("ensemble",i,"_", statenames) for i in 1:size(dfsim,2)÷length(statenames)])) @test names(dfparam) == string.(parameters(sys)) @@ -214,58 +214,52 @@ end #-----------------------------------------------------------------------------# test routes @testset "Server Routes" begin - start!() - - url = SimulationService.server_url[] - - sleep(3) # Give server a chance to start - - @testset "/" begin - res = HTTP.get(url) - @test res.status == 200 - @test JSON3.read(res.body).status == "ok" - end + SimulationService.with_server() do url + @testset "/" begin + res = HTTP.get(url) + @test res.status == 200 + @test JSON3.read(res.body).status == "ok" + end - @testset "/docs" begin - res = HTTP.get("$url/docs") - @test res.status == 200 - end + @testset "/docs" begin + res = HTTP.get("$url/docs") + @test res.status == 200 + end - # Check the status of a job until it finishes - function test_until_done(id::String, every=2) - t = now() - while true - st = get_json("$url/status/$id").status - @info "status from job $(repr(id)) - ($(round(now() - t, Dates.Second))): $st" - st in ["queued", "running", "complete"] && @test true - st in ["failed", "error"] && (@test false; break) - st == "complete" && break - sleep(every) + # Check the status of a job until it finishes + function test_until_done(id::String, every=2) + t = now() + while true + st = get_json("$url/status/$id").status + @info "status from job $(repr(id)) - ($(round(now() - t, Dates.Second))): $st" + st in ["queued", "running", "complete"] && @test true + st in ["failed", "error"] && (@test false; break) + st == "complete" && break + sleep(every) + end end - end - @testset "/simulate" begin - for body in simulate_payloads - res = HTTP.post("$url/simulate", ["Content-Type" => "application/json"]; body) - @test res.status == 201 - id = JSON3.read(res.body).simulation_id - test_until_done(id) - @test SimulationService.last_operation[].result isa DataFrame + @testset "/simulate" begin + for body in simulate_payloads + res = HTTP.post("$url/simulate", ["Content-Type" => "application/json"]; body) + @test res.status == 201 + id = JSON3.read(res.body).simulation_id + test_until_done(id) + @test SimulationService.last_operation[].result isa DataFrame + end end - end - @testset "/calibrate" begin - for body in calibrate_payloads - res = HTTP.post("$url/calibrate", ["Content-Type" => "application/json"]; body) - @test res.status == 201 - id = JSON3.read(res.body).simulation_id - test_until_done(id, 5) + @testset "/calibrate" begin + for body in calibrate_payloads + res = HTTP.post("$url/calibrate", ["Content-Type" => "application/json"]; body) + @test res.status == 201 + id = JSON3.read(res.body).simulation_id + test_until_done(id, 5) + end end - end - @testset "/ensemble" begin - @test true # TODO + @testset "/ensemble" begin + @test true # TODO + end end - - stop!() end