[docs]defcheck_cf_version(self,ds):cf_version="CF-1.8"try:conventions=ds.attrs["Conventions"]exceptAttributeError:returnCheckResult(error=f"No 'attrs' attribute on {ds}, is it an xarray.Dataset?")exceptKeyError:returnCheckResult(error="Global attribute 'Conventions' is required")# We need to check that the correct cf conventions version is in the# "Conventions" attribute, since there can be more than one whitespace# seperated convention, we also need to check the split apart version# for exactly the value we expectifcf_versioninconventionsandcf_versioninconventions.split():returnCheckResult()returnCheckResult(error="{cf_version} not in {conventions}")