Skip to content

Commit 602f74a

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

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cf/aggregate.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2990,7 +2990,6 @@ def aggregate(
29902990
_create_hash_and_first_values(
29912991
meta, aggregating_axes, False, hfl_cache, rtol, atol
29922992
)
2993-
29942993
else:
29952994
# Specific aggregation axes have been selected
29962995
aggregating_axes = []
@@ -3501,7 +3500,8 @@ def _create_hash_and_first_values(
35013500
35023501
meta: `list` of `_Meta`
35033502
3504-
axes: `None` or `list`
3503+
axes: `list`
3504+
The identities of the possible aggregating axes.
35053505
35063506
donotchecknonaggregatingaxes: `bool`
35073507
@@ -3514,10 +3514,15 @@ def _create_hash_and_first_values(
35143514
# identity.
35153515
canonical_direction = {}
35163516

3517+
aggregating_axes = list(axes)
3518+
35173519
for m in meta:
35183520
field = m.field
35193521
constructs = field.constructs.todict()
35203522

3523+
# Store the aggregating axis identities
3524+
m.aggregating_axes = aggregating_axes
3525+
35213526
m_sort_keys = m.sort_keys
35223527
m_sort_indices = m.sort_indices
35233528

@@ -4140,7 +4145,7 @@ def _group_fields(meta, axis, info=False):
41404145
group is represented by a `list` of `_Meta` objects.
41414146
41424147
"""
4143-
axes = meta[0].axis_ids
4148+
axes = meta[0].aggregating_axes
41444149

41454150
if axes:
41464151
if axis in axes:

0 commit comments

Comments
 (0)