diff --git a/Changelog.rst b/Changelog.rst index 5b47696a5..14c827254 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -22,6 +22,9 @@ Version NEXTVERSION * Fix bug that caused `cfdm.write` to fail when a parametric Z dimension coordinate did not have a ``computed_standard_name`` attribute (https://github.com/NCAS-CMS/cfdm/issues/303) +* Fix bug that caused `cfdm.read` to fail to read at all + datasets including variables with badly-encoded UGRID meshes + (https://github.com/NCAS-CMS/cfdm/issues/315) * New class `cfdm.H5netcdfArray` * New class `cfdm.NetCDF4Array` * New dependency: ``h5netcdf>=1.3.0`` diff --git a/cfdm/read_write/netcdf/netcdfread.py b/cfdm/read_write/netcdf/netcdfread.py index e6ab57bf5..f279ad2c0 100644 --- a/cfdm/read_write/netcdf/netcdfread.py +++ b/cfdm/read_write/netcdf/netcdfread.py @@ -10,6 +10,7 @@ from dataclasses import dataclass, field from functools import reduce from math import nan, prod +from pprint import pformat from typing import Any from urllib.parse import urlparse from uuid import uuid4 @@ -3787,9 +3788,10 @@ def _create_field_or_domain( ugrid = False logger.warning( "There was a problem parsing the UGRID mesh " - f"topology variable {mesh.mesh_ncvar!r}: " - f"Ignoring the UGRID mesh for {field_ncvar!r}." + "topology variable. Ignoring the UGRID mesh " + f"for {field_ncvar!r}." ) + logger.debug(f"Mesh dictionary is: {pformat(g['mesh'])}") if ugrid: # The UGRID specification is OK, so get the auxiliary