Skip to content

Commit

Permalink
fix: Warning about sort(Dict)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Bernhard committed May 8, 2024
1 parent 27bb702 commit 73fa25b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/func_postprocess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ function intern___get_soil_idx(simulation::DiscretizedSPAC, depths_to_read_out_m
idx_to_read_out[it] = findfirst(curr_depth_mm .<= lower_boundaries)
end
end
all_idxs = sort(Dict((d => i) for (d,i) in zip(depths_to_read_out_mm, idx_to_read_out)))
all_idxs = Dict((d => i) for (d,i) in zip(depths_to_read_out_mm, idx_to_read_out))
if only_valid_idxs
return filter((k, v)::Pair -> v != 0, all_idxs)
else # default
Expand Down
4 changes: 2 additions & 2 deletions test/fct-helpers-for-integration-tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function prepare_θψδ_from_sim_and_reference(;
@assert sim_sol.prob.p.p_soil.NLAYER == length(unique(referenceSolution_layer.nl)) """
Discrtizations of simulated and reference solution are not equal, check arguments.
"""
idx_ref = idx
idx_ref = sort(collect(idx))
ref_θ = unstack(
referenceSolution_layer[:,[:yr, :mo, :da, :doy, :nl, :theta]],
[:yr, :mo, :da, :doy], # ID variable
Expand All @@ -92,7 +92,7 @@ function prepare_θψδ_from_sim_and_reference(;
[:yr, :mo, :da, :doy], # ID variable
:nl, # variable that will be spread out into column names
:psimi,# value that will be filled into the wide table
renamecols=x->Symbol(:nl_, x))[:, [:doy; Symbol.("nl_" .* string.(idx))]]
renamecols=x->Symbol(:nl_, x))[:, [:doy; Symbol.("nl_" .* string.(idx_ref))]]
rename!(ref_ψ, :doy => :time)

ref_δ18O = allowmissing(copy(ref_ψ))
Expand Down

0 comments on commit 73fa25b

Please sign in to comment.