diff --git a/lib/ClimaLandSimulations/src/utilities/climaland_output_dataframe.jl b/lib/ClimaLandSimulations/src/utilities/climaland_output_dataframe.jl index 093969e744..69479ef1f8 100644 --- a/lib/ClimaLandSimulations/src/utilities/climaland_output_dataframe.jl +++ b/lib/ClimaLandSimulations/src/utilities/climaland_output_dataframe.jl @@ -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