From c48eca0226253b2cdeec0a484095934c3d3cf930 Mon Sep 17 00:00:00 2001 From: David Hassell Date: Thu, 29 Feb 2024 23:29:36 +0000 Subject: [PATCH] For DSGs, don't aggregate non-feature axes --- cf/aggregate.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cf/aggregate.py b/cf/aggregate.py index dffdca9f58..6154c14012 100644 --- a/cf/aggregate.py +++ b/cf/aggregate.py @@ -2977,9 +2977,18 @@ def aggregate( # ------------------------------------------------------------ if axes is None: # Aggregation will be over as many axes as possible - aggregating_axes = meta[0].axis_ids + m0 = meta[0] + aggregating_axes = m0.axis_ids[:] + + # For DSG feature types, only consider aggregating the + # feature dimension(s). + if m0.featureType: + for axis in aggregating_axes[:]: + if not dsg_feature_type_axis(m0, axis): + aggregating_axes.remove(axis) + _create_hash_and_first_values( - meta, None, False, hfl_cache, rtol, atol + meta, aggregating_axes, False, hfl_cache, rtol, atol ) else: