If I want to iterate over all possible OutputVars that are available in SimDir, I would need to write
vars = []
for short_name in ClimaAnalysis.available_vars(simdir)
for reduction in ClimaAnalysis.available_reductions(simdir; short_name)
for period in ClimaAnalysis.available_periods(simdir; short_name, reduction)
for coord_type in ClimaAnalysis.available_coord_types(
simdir;
short_name,
reduction,
period,
)
push!(vars, get(simdir; short_name, reduction, period, coord_type))
end
end
end
end
which is verbose. Something better than this would be to create a new struct SimDirIterator that implements the iterator interface that Julia expects. This would iterate through all the OutputVars in SimDir. I don't think the order matters here. This can also be done for NCCatalog.
If I want to iterate over all possible
OutputVars that are available inSimDir, I would need to writewhich is verbose. Something better than this would be to create a new struct
SimDirIteratorthat implements the iterator interface that Julia expects. This would iterate through all theOutputVars inSimDir. I don't think the order matters here. This can also be done forNCCatalog.