Why can't map_blocks()
just infer the coordinate values of the output Dataset/DataArray, instead of requiring them in template
?
#9635
Labels
What is your issue?
Hello,
I am not sure whether to treat this as a bug or as a feature request yet. The title says it all, and I've attached a minimum example below. Let's say I want to average some data by blocks, but also average its attached time coordinate:
The error is:
Everything works as expected if I provide the correct time coordinate values in the
template
argument. In fact, the example shown in the function documentation does precisely this, but does not explain why it is necessary.I understand why "template" must specify the length of every output dimension and be chunked properly. However, is there a fundamental reason why coordinate values are treated differently from data variables here? I am wondering if that limitation could be removed in principle, because that would help our actual use case (and we might be able to help with a hypothetical fix).
The text was updated successfully, but these errors were encountered: