Skip to content

Include helpful error if non-identical meshes have prevented concatenation or merging #5683

@trexfeathers

Description

@trexfeathers

✨ Feature Request

As discovered in #5576, calling concatenate_cube() on cubes where the MeshCoords appear identical, but are derived from non-identical Meshes, produces this un-informative error:

ConcatenateError: failed to concatenate into a single cube.
  An unexpected problem prevented concatenation.

This is unlike other concatenation errors that hint at the potential blockers (e.g. different coordinates). We should add an informative error about differences in the cubes' Meshes.

I'm unaware if merging has similar problems, but this should also be looked into.

Motivation

Concatenation and merging are both a common use of Iris, and rather difficult to get right. Various errors attempt to help the user understand problems; without these errors the problem becomes almost impossible to debug and users are forced to as developers for help. If we can provide more information about impossible concatenation/merging then we should.

Additional context

I believe this stems from the fact that users are led to expect differences in coordinate values and metadata to be the problem, but MeshCoord equality ALSO checks Mesh equality. The concatenate code is unaware of this so it becomes an 'invisible' concern.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions