diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 997b5426..ed747b4c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,7 +13,7 @@ jobs: matrix: group: - Core - - ModelingToolkitExt + - ModelingToolkitSIExt version: - '1' - '1.6' diff --git a/Project.toml b/Project.toml index 9c061245..005a89cc 100644 --- a/Project.toml +++ b/Project.toml @@ -26,7 +26,7 @@ SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b" Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" [extensions] -ModelingToolkitExt = ["ModelingToolkit", "SymbolicUtils", "Symbolics"] +ModelingToolkitSIExt = ["ModelingToolkit", "SymbolicUtils", "Symbolics"] [compat] AbstractAlgebra = "0.34.5, 0.35" diff --git a/docs/src/tutorials/creating_ode.md b/docs/src/tutorials/creating_ode.md index 915a742a..a09b069c 100644 --- a/docs/src/tutorials/creating_ode.md +++ b/docs/src/tutorials/creating_ode.md @@ -54,7 +54,7 @@ assess_identifiability(ode) ## Defining using `ModelingToolkit` -`StructuralIdentifiability` has an extension `ModelingToolkitExt` which allows to use `ODESystem` from `ModelingToolkit` to describe +`StructuralIdentifiability` has an extension `ModelingToolkitSIExt` which allows to use `ODESystem` from `ModelingToolkit` to describe a model. The extension is loaded automatically once `ModelingToolkit` is loaded via `using ModelingToolkit`. In this case, one should encode the equations for the states as `ODESystem` and specify the outputs separately. In order to do this, we first introduce all functions and scalars: diff --git a/docs/src/tutorials/discrete_time.md b/docs/src/tutorials/discrete_time.md index c8f0571f..4138c47b 100644 --- a/docs/src/tutorials/discrete_time.md +++ b/docs/src/tutorials/discrete_time.md @@ -87,7 +87,7 @@ assess_local_identifiability(dds; funcs_to_check = [β * S]) As other main functions in the package, `assess_local_identifiability` accepts an optional parameter `loglevel` (default: `Logging.Info`) to adjust the verbosity of logging. -If one loads `ModelingToolkit` (and thus the `ModelingToolkitExt` extension), one can use `DiscreteSystem` from `ModelingToolkit` to +If one loads `ModelingToolkit` (and thus the `ModelingToolkitSIExt` extension), one can use `DiscreteSystem` from `ModelingToolkit` to describe the input model (now in terms of difference!): ```@example discrete_mtk diff --git a/ext/ModelingToolkitExt.jl b/ext/ModelingToolkitSIExt.jl similarity index 99% rename from ext/ModelingToolkitExt.jl rename to ext/ModelingToolkitSIExt.jl index 33447508..65af94c9 100644 --- a/ext/ModelingToolkitExt.jl +++ b/ext/ModelingToolkitSIExt.jl @@ -1,4 +1,4 @@ -module ModelingToolkitExt +module ModelingToolkitSIExt using DataStructures using Logging @@ -15,9 +15,6 @@ else using ..ModelingToolkit end -export mtk_to_si -export assess_local_identifiability, assess_identifiability, find_identifiable_functions - # ------------------------------------------------------------------------------ function eval_at_nemo(e::Num, vals::Dict) @@ -96,7 +93,7 @@ Output: - `conversion` dictionary from the symbols in the input MTK model to the variable involved in the produced `ODE` object """ -function mtk_to_si( +function StructuralIdentifiability.mtk_to_si( de::ModelingToolkit.AbstractTimeDependentSystem, measured_quantities::Array{ModelingToolkit.Equation}, ) @@ -106,7 +103,7 @@ function mtk_to_si( ) end -function mtk_to_si( +function StructuralIdentifiability.mtk_to_si( de::ModelingToolkit.AbstractTimeDependentSystem, measured_quantities::Array{<:Symbolics.Num}, ) @@ -116,7 +113,7 @@ function mtk_to_si( ) end -function mtk_to_si( +function StructuralIdentifiability.mtk_to_si( de::ModelingToolkit.AbstractTimeDependentSystem, measured_quantities::Array{<:SymbolicUtils.BasicSymbolic}, ) diff --git a/src/StructuralIdentifiability.jl b/src/StructuralIdentifiability.jl index f5a8cb8e..66713cca 100644 --- a/src/StructuralIdentifiability.jl +++ b/src/StructuralIdentifiability.jl @@ -172,4 +172,10 @@ end using PrecompileTools include("precompile.jl") +### Extensions ### + +# ModelingToolkit extension. +function mtk_to_si end +export mtk_to_si + end diff --git a/test/extensions/modelingtoolkit.jl b/test/extensions/modelingtoolkit.jl index 7753e565..c85883a6 100644 --- a/test/extensions/modelingtoolkit.jl +++ b/test/extensions/modelingtoolkit.jl @@ -1,4 +1,4 @@ -if GROUP == "All" || GROUP == "ModelingToolkitExt" +if GROUP == "All" || GROUP == "ModelingToolkitSIExt" @testset "Check identifiability of `ODESystem` object" begin using ModelingToolkit using ModelingToolkit: parameters @@ -656,4 +656,8 @@ if GROUP == "All" || GROUP == "ModelingToolkitExt" ) == c[:res] end end + + @testset "Exporting ModelingToolkit Model to SI Model" begin + + end end diff --git a/test/runtests.jl b/test/runtests.jl index 1c75f517..e5ed9fe7 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -68,7 +68,7 @@ using StructuralIdentifiability: const GROUP = get(ENV, "GROUP", "All") @static if VERSION >= v"1.10.0" - if GROUP == "All" || GROUP == "ModelingToolkitExt" + if GROUP == "All" || GROUP == "ModelingToolkitSIExt" using Pkg Pkg.add("ModelingToolkit") Pkg.add("Symbolics") @@ -123,7 +123,7 @@ function get_test_files(group) if group == "All" || (group == "Core" && dir != "./extensions") || ( - group == "ModelingToolkitExt" && + group == "ModelingToolkitSIExt" && dir == "./extensions" && VERSION >= v"1.10.0" )