Skip to content

Commit

Permalink
ClimaAnalysis: add SimDir summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbozzolo committed Nov 13, 2023
1 parent dacbce0 commit a012d86
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/ClimaAnalysis/src/SimDir.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@ function available_periods(
return keys(simdir.vars[short_name][reduction]) |> Set
end

function Base.summary(io::IO, simdir::SimDir)
print(io, "Output directory: $(simdir.simulation_path)\n")
print(io, "Variables:")
for short_name in available_vars(simdir)
print(io, "\n- $short_name")
for reduction in available_reductions(simdir; short_name)
print(io, "\n $reduction")
if reduction != "inst"
periods = available_periods(simdir; short_name, reduction)
print(io, " (", join(periods, ", "), ")")
end
end
end
end

"""
get(simdir::SimDir;
short_name,
Expand Down

0 comments on commit a012d86

Please sign in to comment.