Skip to content

Commit 57d4503

Browse files
committed
Update tests to reflect new hard_dependencies(mapping) output
1 parent 02237b5 commit 57d4503

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/dependencies/dependencies.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ dep(;models...)
6868
```
6969
"""
7070
function dep(nsteps=1; verbose::Bool=true, vars...)
71-
hard_dep = first(hard_dependencies((; vars...), verbose=verbose))
71+
hard_dep = hard_dependencies((; vars...), verbose=verbose)
7272
deps = soft_dependencies(hard_dep, nsteps)
7373

7474
# Return the dependency graph

test/test-mtg-multiscale-cyclic-dep.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ out_vars = Dict(
4747

4848
@test_throws "Cyclic dependency detected in the graph. Cycle:" dep(mapping_cyclic)
4949

50-
soft_dep_graphs_roots = PlantSimEngine.hard_dependencies(mapping_cyclic)
51-
dep_graph = PlantSimEngine.soft_dependencies_multiscale(soft_dep_graphs_roots, mapping_cyclic)
50+
soft_dep_graphs_roots, hard_dep_dict = PlantSimEngine.hard_dependencies(mapping_cyclic)
51+
dep_graph = PlantSimEngine.soft_dependencies_multiscale(soft_dep_graphs_roots, mapping_cyclic, hard_dep_dict)
5252
iscyclic, cycle_vec = PlantSimEngine.is_graph_cyclic(dep_graph; warn=false)
5353

5454
@test iscyclic
@@ -95,9 +95,9 @@ end
9595

9696
@test_nowarn dep(mapping_nocyclic)
9797

98-
soft_dep_graphs_roots = PlantSimEngine.hard_dependencies(mapping_nocyclic)
98+
soft_dep_graphs_roots, hard_dep_dict = PlantSimEngine.hard_dependencies(mapping_nocyclic)
9999
# soft_dep_graphs_roots.roots["Leaf"].inputs
100-
dep_graph = PlantSimEngine.soft_dependencies_multiscale(soft_dep_graphs_roots, mapping_nocyclic)
100+
dep_graph = PlantSimEngine.soft_dependencies_multiscale(soft_dep_graphs_roots, mapping_nocyclic, hard_dep_dict)
101101
iscyclic, cycle_vec = PlantSimEngine.is_graph_cyclic(dep_graph; warn=false)
102102

103103
@test !iscyclic

test/test-mtg-multiscale.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ end
168168
type_promotion = nothing
169169
nsteps = 2
170170
dependency_graph = dep(mapping_1)
171-
organs_statuses, others = PlantSimEngine.init_statuses(mtg_init, mapping_1, PlantSimEngine.hard_dependencies(mapping_1; verbose=false); type_promotion=type_promotion)
171+
organs_statuses, others = PlantSimEngine.init_statuses(mtg_init, mapping_1, first(PlantSimEngine.hard_dependencies(mapping_1; verbose=false)); type_promotion=type_promotion)
172172

173173
@test collect(keys(organs_statuses)) == ["Soil", "Internode", "Plant", "Leaf"]
174174
@test collect(keys(organs_statuses["Soil"][1])) == [:node, :soil_water_content]

0 commit comments

Comments
 (0)