Skip to content

Commit

Permalink
Merge pull request #168 from isaacsas/fix_tests
Browse files Browse the repository at this point in the history
fix tests
  • Loading branch information
isaacsas authored Oct 15, 2024
2 parents 68137ff + edd1601 commit e78e84b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
/docs/build/
/test/logs/
*Manifest.toml

# vscode stuff
.vscode
.vscode/*

LocalPreferences.toml
10 changes: 5 additions & 5 deletions test/systems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rs = ReactionSystem(MODEL1)
Catalyst.Reaction[Catalyst.Reaction(k1, nothing, [s1], nothing, [1.0])])
@test isequal(Catalyst.get_iv(rs), IV)
@test isequal(Catalyst.get_species(rs), [s1])
@test isequal(Catalyst.get_ps(rs), [k1, c1])
@test issetequal(Catalyst.get_ps(rs), [k1, c1])
@named rs = ReactionSystem(MODEL1)
isequal(nameof(rs), :rs)

Expand All @@ -60,7 +60,7 @@ rs = ReactionSystem(readSBML(sbmlfile))
[1.0])])
@test isequal(Catalyst.get_iv(rs), IV)
@test isequal(Catalyst.get_species(rs), [s1, s1s2, s2])
@test isequal(Catalyst.get_ps(rs), [k1, c1])
@test issetequal(Catalyst.get_ps(rs), [k1, c1])
@named rs = ReactionSystem(MODEL1)
isequal(nameof(rs), :rs)

Expand All @@ -72,7 +72,7 @@ rs = ReactionSystem(MODEL2) # Contains reversible reaction
nothing, [1])])
@test isequal(Catalyst.get_iv(rs), IV)
@test isequal(Catalyst.get_species(rs), [s1])
@test isequal(Catalyst.get_ps(rs), [k1, c1])
@test issetequal(Catalyst.get_ps(rs), [k1, c1])

@test convert(ModelingToolkit.ODESystem, rs) isa ODESystem
@test structural_simplify(convert(ModelingToolkit.ODESystem, rs)) isa ODESystem
Expand All @@ -83,7 +83,7 @@ trueeqs = Equation[default_time_deriv()(s1) ~ k1]
@test isequal(Catalyst.get_eqs(odesys), trueeqs)
@test isequal(Catalyst.get_iv(odesys), IV)
@test isequal(Catalyst.get_unknowns(odesys), [s1])
@test isequal(Catalyst.get_ps(odesys), [k1, c1])
@test issetequal(Catalyst.get_ps(odesys), [k1, c1])
u0 = [s1 => 1.0]
par = [k1 => 1.0, c1 => 2.0]
@test isequal(ModelingToolkit.defaults(odesys), ModelingToolkit._merge(u0, par)) # PL: @Anand: for some reason this does not work with `Catalyst.get_default()`
Expand All @@ -99,7 +99,7 @@ trueeqs = Equation[default_time_deriv()(s1) ~ -((k1 * s1 * s2) / c1),
@test isequal(Catalyst.get_eqs(odesys), trueeqs)
@test isequal(Catalyst.get_iv(odesys), IV)
@test isequal(Catalyst.get_unknowns(odesys), [s1, s1s2, s2])
@test isequal(Catalyst.get_ps(odesys), [k1, c1])
@test issetequal(Catalyst.get_ps(odesys), [k1, c1])
u0 = [s1 => 2 * 1.0, s2 => 2 * 1.0, s1s2 => 2 * 1.0]
par = [k1 => 1.0, c1 => 2.0]
@test isequal(ModelingToolkit.defaults(odesys), ModelingToolkit._merge(u0, par))
Expand Down

0 comments on commit e78e84b

Please sign in to comment.