Skip to content

Commit 1ca3b3a

Browse files
fix some more iv depwarns and slap a downstream test on
1 parent 4f70d0a commit 1ca3b3a

File tree

3 files changed

+56
-6
lines changed

3 files changed

+56
-6
lines changed

.github/workflows/Downstream.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: IntegrationTest
2+
on:
3+
push:
4+
branches: [master]
5+
tags: [v*]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
name: ${{ matrix.package.repo }}/${{ matrix.package.group }}
11+
runs-on: ${{ matrix.os }}
12+
env:
13+
GROUP: ${{ matrix.package.group }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
julia-version: [1]
18+
os: [ubuntu-latest]
19+
package:
20+
- {user: SciML, repo: Catalyst.jl, group: All}
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: julia-actions/setup-julia@v1
25+
with:
26+
version: ${{ matrix.julia-version }}
27+
arch: x64
28+
- uses: julia-actions/julia-buildpkg@latest
29+
- name: Clone Downstream
30+
uses: actions/checkout@v2
31+
with:
32+
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
33+
path: downstream
34+
- name: Load this and run the downstream tests
35+
shell: julia --color=yes --project=downstream {0}
36+
run: |
37+
using Pkg
38+
try
39+
# force it to use this PR's version of the package
40+
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
41+
Pkg.update()
42+
Pkg.test() # resolver may fail with test time deps
43+
catch err
44+
err isa Pkg.Resolve.ResolverError || rethrow()
45+
# If we can't resolve that means this is incompatible by SemVer and this is fine
46+
# It means we marked this as a breaking change, so we don't need to worry about
47+
# Mistakenly introducing a breaking change, as we have intentionally made one
48+
@info "Not compatible with this release. No problem." exception=err
49+
exit(0) # Exit immediately, as a success
50+
end

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function calculate_tgrad(sys::AbstractODESystem;
66
# have `u(t) * t` we want to have the tgrad to be `u(t)` instead of `u'(t) *
77
# t + u(t)`.
88
rhs = [detime_dvs(eq.rhs) for eq equations(sys)]
9-
iv = sys.iv
9+
iv = get_iv(sys)
1010
xs = states(sys)
1111
rule = Dict(map((x, xt) -> xt=>x, detime_dvs.(xs), xs))
1212
rhs = substitute.(rhs, Ref(rule))
@@ -22,7 +22,7 @@ function calculate_jacobian(sys::AbstractODESystem;
2222
isempty(sys.jac[]) || return sys.jac[] # use cached Jacobian, if possible
2323
rhs = [eq.rhs for eq equations(sys)]
2424

25-
iv = sys.iv
25+
iv = get_iv(sys)
2626
dvs = states(sys)
2727

2828
if sparse
@@ -38,13 +38,13 @@ end
3838
function generate_tgrad(sys::AbstractODESystem, dvs = states(sys), ps = parameters(sys);
3939
simplify=false, kwargs...)
4040
tgrad = calculate_tgrad(sys,simplify=simplify)
41-
return build_function(tgrad, dvs, ps, sys.iv; kwargs...)
41+
return build_function(tgrad, dvs, ps, get_iv(sys); kwargs...)
4242
end
4343

4444
function generate_jacobian(sys::AbstractODESystem, dvs = states(sys), ps = parameters(sys);
4545
simplify=false, sparse = false, kwargs...)
4646
jac = calculate_jacobian(sys;simplify=simplify,sparse=sparse)
47-
return build_function(jac, dvs, ps, sys.iv; kwargs...)
47+
return build_function(jac, dvs, ps, get_iv(sys); kwargs...)
4848
end
4949

5050
function generate_function(sys::AbstractODESystem, dvs = states(sys), ps = parameters(sys); kwargs...)
@@ -244,7 +244,7 @@ function process_DEProblem(constructor, sys::AbstractODESystem,u0map,parammap;
244244
kwargs...)
245245
dvs = states(sys)
246246
ps = parameters(sys)
247-
u0map′ = lower_mapnames(u0map,sys.iv)
247+
u0map′ = lower_mapnames(u0map,get_iv(sys))
248248
u0 = varmap_to_vars(u0map′,dvs; defaults=default_u0(sys))
249249

250250
if !(parammap isa DiffEqBase.NullParameters)

src/systems/reaction/reactionsystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ function Base.convert(::Type{<:SDESystem},rs::ReactionSystem, combinatoric_ratel
441441

442442
SDESystem(eqs,
443443
noiseeqs,
444-
get_iv(iv),
444+
get_iv(rs),
445445
states(rs),
446446
(noise_scaling===nothing) ?
447447
get_ps(rs) :

0 commit comments

Comments
 (0)