These should be integers not strings (`%d` not `%s`). In general it might be better to use the newer `format()` method, as used in many other parts of the code base. Also `Cube`s have an `ndim` property, so perhaps:

    msg = 'Cube must be {:d}-dimensional. Got {:d} dimensions.'
    raise ValueError(msg.format(ndims+1, cube.ndim))