Hi,
I'm wondering if there are any plans to increase the amount of information returned by the error messages for concatenate, concatenate_cube, merge and merge_cube?
As a user I feel I spend a disproportionate amount of time trying to understand why cubes are incompatible with each other, often receiving only the slightly frustrating message:
ConcatenateError: failed to concatenate into a single cube.
An unexpected problem prevented concatenation.
Expected only a single cube, found 2.
I have resorted to filling my scripts with functions of the following type to try and find the cause of errors:
def check_cubes_concatenate(F0,F1):
assert F0.dtype==F1.dtype
assert F0.units==F1.units
assert F0.metadata==F1.metadata
assert F0.attributes==F1.attributes
for coord1,coord2 in zip(F0.coords(),F1.coords()):
assert coord1.standard_name==coord2.standard_name
assert coord1.var_name==coord2.var_name
assert coord1.long_name==coord2.long_name
assert coord1.dtype==coord2.dtype
assert coord1.units==coord2.units
assert coord1.attributes==coord2.attributes
assert coord1.has_bounds()==coord2.has_bounds()
if coord1.has_bounds():
assert coord1.bounds.dtype==coord2.bounds.dtype
assert coord1.is_compatible(coord2)
#There should be one and only one concatenatable coordinate
concat_coords=0
for coord1,coord2 in zip(F0.dim_coords,F1.dim_coords):
assert coord1.circular==coord2.circular
overlap=np.isin(coord1.points,coord2.points).any()
same=np.isin(coord1.points,coord2.points).all()
if not (overlap or same):
concat_coords+=1
assert concat_coords==1
return True
I know that many users have this same frustration, and I am wondering whether there is a technical difficulty to improving the quality of the error messages that I am not appreciating? If it is simply an issue of someone getting round to doing it, I would be willing to work on doing so.