YangLab-um / BiologicalOscillations.jl

A package for researchers working with biological oscillations
https://yanglab-um.github.io/BiologicalOscillations.jl/
MIT License
1 stars 2 forks source link

Correct definition of a symbol array #38

Closed biphy closed 5 months ago

biphy commented 5 months ago

Newer versions of ModelingToolkit.jl (tested with v.8.70.0) distinguish the following two definitions of symbol arrays:

julia> @variables X[1:3]
1-element Vector{Symbolics.Arr{Num, 1}}:
 X[1:3]

julia> X[1]
X[1]

and

julia> @variables X[collect(1:3)]
1-element Vector{Symbolics.Arr{Num, 1}}:
 X[[1, 2, 3]]

julia> X[1]
ERROR: MethodError: no method matching CartesianIndices(::Tuple{Vector{Int64}})

protein_interaction_network and gene_regulatory_network currently use the latter way to define species, which leads to errors while indexing symbols with newer versions of ModelingToolkits.jl. For later releases, the following blocks should be corrected.

# protein_interaction_network.jl
@species (X(t))[collect(1:N)]

# gene_regulatory_network.jl
@species (m(t))[collect(1:N)]
@species (X(t))[collect(1:N)]

This issue might be related to the CI failure.

ftavella commented 5 months ago

NICE! I've been looking at it and had a note to check the same thing you're describing here. This is great and will probably solve the CI issue.