Skip to content

Allow cf.aggregate to retain external cell measures #605

@davidhassell

Description

@davidhassell

External cell cell measures are always deleted during aggregation. The code says:

            # If the measure is an external variable, remove it because
            # the dimensions are not known so there is no way to tell if the
            # aggregation should have changed it. (This is sufficiently
            # sensible behaviour for now, but will be reviewed in future.)

Recent experiences suggest that a different approach is better: keep common external cell measures, and let the checking done by cf.read highlight any problems at a later date.

This allows the the cell measures to be retained when they are still valid, and if they are broken trap that before any harm is done.

>>> import cf
>>> cf.environment(paths=False)
Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.35
HDF5 library: 1.12.2
netcdf library: 4.8.1
udunits2 library: /home/david/miniconda3/lib/libudunits2.so.0
ESMF: 8.2.0
Python: 3.10.8
dask: 2023.1.1
netCDF4: 1.6.2
psutil: 5.9.4
packaging: 23.0
numpy: 1.22.3
scipy: 1.8.1
matplotlib: 3.4.3
cftime: 1.6.2
cfunits: 3.3.5
cfplot: 3.1.31
cfdm: 1.10.0.2
cf: 3.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions