Skip to content

Commit c48eca0

Browse files
committed
For DSGs, don't aggregate non-feature axes
1 parent 1022a78 commit c48eca0

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

cf/aggregate.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2977,9 +2977,18 @@ def aggregate(
29772977
# ------------------------------------------------------------
29782978
if axes is None:
29792979
# Aggregation will be over as many axes as possible
2980-
aggregating_axes = meta[0].axis_ids
2980+
m0 = meta[0]
2981+
aggregating_axes = m0.axis_ids[:]
2982+
2983+
# For DSG feature types, only consider aggregating the
2984+
# feature dimension(s).
2985+
if m0.featureType:
2986+
for axis in aggregating_axes[:]:
2987+
if not dsg_feature_type_axis(m0, axis):
2988+
aggregating_axes.remove(axis)
2989+
29812990
_create_hash_and_first_values(
2982-
meta, None, False, hfl_cache, rtol, atol
2991+
meta, aggregating_axes, False, hfl_cache, rtol, atol
29832992
)
29842993

29852994
else:

0 commit comments

Comments
 (0)