In the split-apply-combine, reductions are supported by Reduction. It would be useful to also pass information about the dimension values to the reduction. The syntax might looks like
time_averaged_var =
var |>
ClimaAnalysis.GroupAll("time") |>
ClimaAnalysis.ReduceWithDims(integrate) |>
ClimaAnalysis.combine
and the signature of the reduction could be function integrate(data, dim_name, dims_values; dims) end where data is being reduced over, dim_name is the name of the dimension, dims_values are all the dimension values (in the form of a dictionary mapping dimension name to dimension values), and dims is the index to do the reduction on.
The use case for this is to support operations like finding the argmax/argmin or integrating time series data.
One concern I have is whether it makes sense to pass in more information like the attributes and dimension attributes. Although, there are work around for this by defining a functor for the reduction that store the attributes and dimension attributes in the OutputVars.
In the split-apply-combine, reductions are supported by
Reduction. It would be useful to also pass information about the dimension values to the reduction. The syntax might looks likeand the signature of the reduction could be
function integrate(data, dim_name, dims_values; dims) endwheredatais being reduced over,dim_nameis the name of the dimension,dims_valuesare all the dimension values (in the form of a dictionary mapping dimension name to dimension values), anddimsis the index to do the reduction on.The use case for this is to support operations like finding the argmax/argmin or integrating time series data.
One concern I have is whether it makes sense to pass in more information like the attributes and dimension attributes. Although, there are work around for this by defining a functor for the reduction that store the attributes and dimension attributes in the
OutputVars.