Skip to content

Commit

Permalink
For DSGs, don't aggregate non-feature axes
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhassell committed Feb 29, 2024
1 parent 1022a78 commit c48eca0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cf/aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c48eca0

Please sign in to comment.