SciTools/iris — pull request #492 by niallrobinson (2013-05-03 12:07:54+00:00)
Title: Warn coord present

Currently iris will raise an error if you try and add a new coord categorisation that has the same name as a coordinate already present on the cube. I find myself littering my analysis code with the following type of thing:

try:
iris.coord_categorisation.add_month(cube, 'time')
except ValueError as e:
cube.remove_coord('month')
iris.coord_categorisation.add_month(cube, 'time')
warnings.warn("Overwrote coord: %s" % str(e))

I've changed the code so that, instead of raising an error, it just overwrites the coordinate and raises a warning.