Skip to content

Commit

Permalink
Merge pull request #755 from davidhassell/aggregate-transpose
Browse files Browse the repository at this point in the history
Fix bug in `cf.aggregate` that sometimes put a null transpose operation into the Dask grpah when one was not needed
  • Loading branch information
davidhassell authored Apr 4, 2024
2 parents 7827ba4 + e0a1da5 commit b2d4439
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ version NEXT
* Fix bug in `cf.read` when reading UM files that caused LBPROC value
131072 (Mean over an ensemble of parallel runs) to be ignored
(https://github.com/NCAS-CMS/cf-python/issues/737)
* Fix bug in `cf.aggregate` that sometimes put a null transpose
operation into the Dask grpah when one was not needed
(https://github.com/NCAS-CMS/cf-python/issues/754)

----

Expand Down
2 changes: 1 addition & 1 deletion cf/aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4817,7 +4817,7 @@ def _aggregate_2_fields(

# Ensure that the axis orders are the same in both fields
transpose_axes1 = [dim0_name_map[axis0] for axis0 in data_axes0]
if transpose_axes1 != data_axes1:
if transpose_axes1 != list(data_axes1):
parent1.transpose(transpose_axes1, inplace=True)

construct_type = parent0.construct_type
Expand Down

0 comments on commit b2d4439

Please sign in to comment.