Skip to content

Commit 6449e6f

Browse files
committed
Fix minor bugs: nsteps is not an argument to the ModelList anymore, and verbose to the ModelList method of dep
1 parent 14f4533 commit 6449e6f

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/component_models/ModelList.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,17 @@ function Base.copy(m::T) where {T<:ModelList}
328328
ModelList(
329329
m.models,
330330
deepcopy(m.status),
331-
deepcopy(m.type_promotion)
331+
deepcopy(m.type_promotion),
332+
deepcopy(m.dependency_graph)
332333
)
333334
end
334335

335336
function Base.copy(m::T, status) where {T<:ModelList}
336337
ModelList(
337338
m.models,
338339
status,
339-
deepcopy(m.type_promotion)
340+
deepcopy(m.type_promotion),
341+
deepcopy(m.dependency_graph)
340342
)
341343
end
342344

@@ -468,7 +470,7 @@ function convert_vars!(mapped_vars::Dict{String,Dict{Symbol,Any}}, type_promotio
468470
end
469471

470472
function Base.show(io::IO, ::MIME"text/plain", t::ModelList)
471-
print(io, dep(t, verbose=false))
473+
print(io, dep(t))
472474
print(io, status(t))
473475
end
474476

src/processes/model_initialisation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ function init_variables(model::T; verbose::Bool=true) where {T<:AbstractModel}
245245
end
246246

247247
function init_variables(m::ModelList; verbose::Bool=true)
248-
init_variables(dep(m; verbose=verbose))
248+
init_variables(dep(m))
249249
end
250250

251251
function init_variables(m::DependencyGraph)

test/test-ModelList.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
leaf = ModelList(
1919
process1=Process1Model(1.0),
2020
process2=Process2Model(),
21-
nsteps=3
2221
)
2322

2423
@test length(status(leaf)) == 5
@@ -81,7 +80,6 @@ end;
8180
process1=Process1Model(1.0),
8281
process2=Process2Model(),
8382
status=(var1=15.0,),
84-
nsteps=3
8583
)
8684

8785
@test length(status(leaf)) == 5
@@ -123,8 +121,7 @@ end;
123121
inits = init_variables(leaf)
124122
sorted_vars = sort([keys(inits.process3)...])
125123

126-
@test [getfield(inits.process3, i) for i in sorted_vars] ==
127-
fill(-Inf, 3)
124+
@test [getfield(inits.process3, i) for i in sorted_vars] == fill(-Inf, 3)
128125
end;
129126

130127
@testset "Copy a ModelList" begin

0 commit comments

Comments
 (0)