Skip to content

Commit

Permalink
Merge branch 'master' into known_ic_generic
Browse files Browse the repository at this point in the history
  • Loading branch information
pogudingleb authored Feb 4, 2024
2 parents b0fc443 + 63158d5 commit f452f75
Show file tree
Hide file tree
Showing 76 changed files with 2,872 additions and 2,218 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
matrix:
group:
- Core
- ModelingToolkitSIExt
version:
- '1'
- '1.6'
Expand All @@ -21,7 +22,7 @@ jobs:
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
- uses: actions/cache@v3
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/Downgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Downgrade
on:
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
push:
branches:
- master
paths-ignore:
- 'docs/**'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['1']
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
- uses: cjdoris/julia-downgrade-compat-action@v1
# if: ${{ matrix.version == '1.6' }}
with:
# skip standard libraries..
skip: Aqua,Compat,Dates,IterTools,LinearAlgebra,Logging,Pkg,Random,Test,TOML
strict: 'false'
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
13 changes: 13 additions & 0 deletions .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Spell Check

on: [pull_request]

jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v3
- name: Check spelling
uses: crate-ci/[email protected]
2 changes: 2 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[default.extend-words]
numer = "numer"
44 changes: 28 additions & 16 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name = "StructuralIdentifiability"
uuid = "220ca800-aa68-49bb-acd8-6037fa93a544"
authors = ["Alexander Demin, Ruiwen Dong, Christian Goodbrake, Heather Harrington, Gleb Pogudin <[email protected]>"]
version = "0.4.15"
version = "0.5.3"

[deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand All @@ -14,45 +13,58 @@ IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a"
ParamPunPam = "3e851597-e36f-45a9-af0a-b7781937992f"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Primes = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"

[weakdeps]
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"

[extensions]
ModelingToolkitSIExt = ["ModelingToolkit", "SymbolicUtils", "Symbolics"]

[compat]
AbstractAlgebra = "0.13, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33"
BenchmarkTools = "1"
AbstractAlgebra = "0.34.5, 0.35"
Aqua = "0.8"
Combinatorics = "1"
CPUSummary = "0.2"
DataStructures = "0.18"
Dates = "1.6, 1.7"
Groebner = "0.4, 0.5"
Groebner = "0.6.3"
IterTools = "1"
LinearAlgebra = "1.6, 1.7"
Logging = "1.6, 1.7"
MacroTools = "0.5"
ModelingToolkit = "7, 8"
Nemo = "0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37"
ParamPunPam = "0.2"
PrecompileTools = "1"
ModelingToolkit = "8.75"
Nemo = "0.38.3, 0.39"
ParamPunPam = "0.3.1"
Pkg = "1.6, 1.7"
PrecompileTools = "1.2"
Primes = "0.5"
Random = "1.6, 1.7"
SpecialFunctions = "1, 2"
SymbolicUtils = "1"
Symbolics = "5"
SpecialFunctions = "2"
SymbolicUtils = "1.4, 1.5"
Symbolics = "5.16"
Test = "1.6, 1.7"
TestSetExtensions = "2"
TimerOutputs = "0.5"
julia = "1.6, 1.7"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
CPUSummary = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestSetExtensions = "98d24dd4-01ad-11ea-1b02-c9a08f80db04"

[targets]
test = ["CPUSummary", "Test", "TestSetExtensions"]
test = ["Aqua", "CPUSummary", "Pkg", "SpecialFunctions", "Test", "TestSetExtensions"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ In this example:
- `y(t)` is the **output variable** which is assumed to be observed in the experiments and, thus, known;
- `a01, a21, a12, b` are unknown scalar **parameters**.

Note that there may be mulitple inputs and outputs.
Note that there may be multiple inputs and outputs.

### Assessing identifiability

Expand Down
2 changes: 1 addition & 1 deletion benchmarking/IdentifiableFunctions/experiments.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ end
#! format: off

new_rff = StructuralIdentifiability.RationalFunctionField(funcs1)
cfs = StructuralIdentifiability.beautifuly_generators(new_rff)
cfs = StructuralIdentifiability.beautiful_generators(new_rff)
gb_rff = StructuralIdentifiability.RationalFunctionField(cfs)

K = GF(2^31 - 1)
Expand Down
2 changes: 1 addition & 1 deletion benchmarking/IdentifiableFunctions/homogenization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Bilirubin2_io = @ODEmodel(
funcs = find_identifiable_functions(Bilirubin2_io, with_states = true, strategy = (:gb,))

rff = StructuralIdentifiability.RationalFunctionField(funcs)
cfs = StructuralIdentifiability.beautifuly_generators(rff)
cfs = StructuralIdentifiability.beautiful_generators(rff)
rff = StructuralIdentifiability.RationalFunctionField(cfs)

K = GF(2^31 - 1)
Expand Down
22 changes: 11 additions & 11 deletions benchmarking/IdentifiableFunctions/param.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function check_constructive_field_membership(generators::AbstractVector, to_be_r
$(join(map(x -> string(x[1]) * " -> " * string(x[2]), zip(fracs_gen, tag_strings)), "\t\n"))
"""
var_strings = vcat(sat_string, map(string, gens(ring)), tag_strings)
ring_tag, xs_tag = PolynomialRing(K, var_strings, ordering = Nemo.ordering(ring))
ring_tag, xs_tag = polynomial_ring(K, var_strings, ordering = Nemo.ordering(ring))
orig_vars = xs_tag[2:(nvars(ring) + 1)]
tag_vars = xs_tag[(nvars(ring) + 2):end]
sat_var = xs_tag[1]
Expand Down Expand Up @@ -121,12 +121,12 @@ rem_tags, tag_to_gen = check_constructive_field_membership(fracs_generators, to_
#=
┌ Info:
│ rem_tags =
│ 3-element Vector{AbstractAlgebra.Generic.Frac{fmpq_mpoly}}:
│ 3-element Vector{AbstractAlgebra.Generic.Frac{QQMPolyRingElem}}:
│ T1^2
│ -5*T1 + T2
│ T2//T1^10
│ tag_to_gen =
│ Dict{fmpq_mpoly, AbstractAlgebra.Generic.Frac{fmpq_mpoly}} with 2 entries:
│ Dict{QQMPolyRingElem, AbstractAlgebra.Generic.Frac{QQMPolyRingElem}} with 2 entries:
│ T1 => a^2
└ T2 => (a + b)//b
=#
Expand Down Expand Up @@ -205,10 +205,10 @@ new_vector_field, new_outputs, new_vars =
│ Dict{Any, Any} with 1 entry:
│ T1 => 2*T1 + T2
│ new_outputs =
│ Dict{fmpq_mpoly, AbstractAlgebra.Generic.Frac{fmpq_mpoly}} with 1 entry:
│ Dict{QQMPolyRingElem, AbstractAlgebra.Generic.Frac{QQMPolyRingElem}} with 1 entry:
│ y => T1
│ new_vars =
│ Dict{fmpq_mpoly, AbstractAlgebra.Generic.Frac{fmpq_mpoly}} with 2 entries:
│ Dict{QQMPolyRingElem, AbstractAlgebra.Generic.Frac{QQMPolyRingElem}} with 2 entries:
│ T2 => a + b
└ T1 => x2 + x1
=#
Expand All @@ -230,7 +230,7 @@ id_funcs = StructuralIdentifiability.find_identifiable_functions(
#=
┌ Info:
│ id_funcs =
│ 2-element Vector{AbstractAlgebra.Generic.Frac{fmpq_mpoly}}:
│ 2-element Vector{AbstractAlgebra.Generic.Frac{QQMPolyRingElem}}:
│ x2*x1
└ a + b
=#
Expand All @@ -246,10 +246,10 @@ new_vector_field, new_outputs, new_vars = reparametrize_with_respect_to(ode, new
│ Dict{Any, Any} with 1 entry:
│ T1 => T1*T2
│ new_outputs =
│ Dict{fmpq_mpoly, AbstractAlgebra.Generic.Frac{fmpq_mpoly}} with 1 entry:
│ Dict{QQMPolyRingElem, AbstractAlgebra.Generic.Frac{QQMPolyRingElem}} with 1 entry:
│ y => T1
│ new_vars =
│ Dict{fmpq_mpoly, AbstractAlgebra.Generic.Frac{fmpq_mpoly}} with 2 entries:
│ Dict{QQMPolyRingElem, AbstractAlgebra.Generic.Frac{QQMPolyRingElem}} with 2 entries:
│ T2 => a + b
└ T1 => x2*x1
=#
Expand All @@ -271,7 +271,7 @@ id_funcs = StructuralIdentifiability.find_identifiable_functions(
#=
┌ Info:
│ id_funcs =
│ 5-element Vector{AbstractAlgebra.Generic.Frac{fmpq_mpoly}}:
│ 5-element Vector{AbstractAlgebra.Generic.Frac{QQMPolyRingElem}}:
│ x2*x1
│ a*b
│ x2 + x1
Expand All @@ -292,10 +292,10 @@ new_vector_field, new_iutputs, new_vars = reparametrize_with_respect_to(ode, new
│ T2 => T2*T4
│ T3 => -1//2*T1*T4^2 + 2*T1*T5 + 1//2*T3*T4
│ new_outputs =
│ Dict{fmpq_mpoly, AbstractAlgebra.Generic.Frac{fmpq_mpoly}} with 1 entry:
│ Dict{QQMPolyRingElem, AbstractAlgebra.Generic.Frac{QQMPolyRingElem}} with 1 entry:
│ y => T1
│ new_vars =
│ Dict{fmpq_mpoly, AbstractAlgebra.Generic.Frac{fmpq_mpoly}} with 5 entries:
│ Dict{QQMPolyRingElem, AbstractAlgebra.Generic.Frac{QQMPolyRingElem}} with 5 entries:
│ T1 => x2 + x1
│ T2 => x2*x1
│ T3 => a*x2 - a*x1 - b*x2 + b*x1
Expand Down
4 changes: 2 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544"
[compat]
BenchmarkTools = "1.3"
Documenter = "0.27, 1"
ModelingToolkit = "8.34"
StructuralIdentifiability = "0.4"
ModelingToolkit = "8.74"
StructuralIdentifiability = "0.5"
1 change: 1 addition & 0 deletions docs/pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pages = [
"tutorials/identifiability.md",
"tutorials/identifiable_functions.md",
"tutorials/discrete_time.md",
"tutorials/reparametrization.md",
],
"Basics" => Any["input/input.md", "identifiability/identifiability.md"],
"Library" => Any[
Expand Down
4 changes: 2 additions & 2 deletions docs/src/assets/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544"
[compat]
BenchmarkTools = "1.3"
Documenter = "0.27, 1"
ModelingToolkit = "8.34"
StructuralIdentifiability = "0.4"
ModelingToolkit = "8.74"
StructuralIdentifiability = "0.5"
8 changes: 7 additions & 1 deletion docs/src/input/input.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Parsing input ODE system
# Parsing input system

```@docs
@ODEmodel(ex::Expr...)
Expand All @@ -11,3 +11,9 @@ set_parameter_values
```@docs
linear_compartment_model
```

## Discrete-time systems

```@docs
@DDSmodel
```
6 changes: 4 additions & 2 deletions docs/src/tutorials/creating_ode.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ which involves

- a vector $\mathbf{x}(t)$ of the state variables of the system,

- a vector $\mathbf{u}(t)$ of extermal inputs,
- a vector $\mathbf{u}(t)$ of external inputs,
- a vector $\mathbf{p}$ of scalar parameters,
- a vector $\mathbf{y}(t)$ of outputs (i.e., observations),
- and vectors of rational functions $\mathbf{f}$ and $\mathbf{g}$ (for discussion of the non-rational case, see this [issue](https://github.com/SciML/StructuralIdentifiability.jl/issues/144)).
Expand Down Expand Up @@ -54,7 +54,9 @@ assess_identifiability(ode)

## Defining using `ModelingToolkit`

Alternatively, one can use `ModelingToolkit`: encode the equations for the states as `ODESystem` and specify the outputs separately.
`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:

```@example 2; continued = true
Expand Down
Loading

0 comments on commit f452f75

Please sign in to comment.