Skip to content

Commit

Permalink
outputs with layers
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisRenchon committed Mar 15, 2024
1 parent da72c5b commit 280219a
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,15 @@ function make_output_df(sv, inputs; N_days = 60, N_spinup_days = 30)
((1:1:20), :soil, :θ_l),
(1, :soil, :turbulent_fluxes, :vapor_flux),
)

output_vectors = [getoutput(sv, args...) for args in output_list]

# WIP WIP

depth = reduce(vcat, [
output_vectors = [getoutput(sv, args...) for args in output_list]
column_names = reduce(vcat, [
if isa(t[1], Integer) # Check for integers
[t[1]] # Wrap number in a single-element list
Symbol(t[end]) # Wrap number in a single-element list
else
collect(t[1]) # Keep range or other non-number elements as-is
[Symbol(string(symbol, "_", i)) for (symbol, i) in zip([t[end] for _ in 1:20], collect(t[1]))]
end
for t in output_list
])



# Extract the last symbol from each tuple for column names
column_names = [Symbol(names[end], "_", depth) for names in output_list, depth in output_list[1]]
# Create a dictionary with simplified column names and corresponding vectors
data_dict = Dict(zip(column_names, output_vectors))
# Create a DataFrame from the dictionary
Expand Down

0 comments on commit 280219a

Please sign in to comment.