NCAS-CMS / cf-python

A CF-compliant Earth Science data analysis library
http://ncas-cms.github.io/cf-python
MIT License
125 stars 19 forks source link

Failure when creating 'T: mean within days time: minimum over days'' collapse #809

Closed davidhassell closed 1 month ago

davidhassell commented 2 months ago

At v3.16.2, the following fails in the following way, when it shouldn't:

>>> import cf
>>> f = cf.example_field(5)
>>> f.collapse("T: mean within days time: minimum over days", within_days=cf.h(12))
Traceback (most recent call last):
    ...
TypeError: unsupported operand type(s) for %: 'TimeDuration' and 'TimeDuration'

Climatological time collapses "within/over years" seem OK, but here are no units tests for a "within/over days" case!