'Checks that the input is a Quantity with the necessary units (or the
special value ``0``).
Parameters
value : object
Input value to be converted.
Returns
out, converted : correctly-typed object, boolean
Tuple consisting of the correctly-typed object and a boolean which
indicates if conversion was actually performed.
Raises
ValueError
If the input is not valid for this attribute.'

def convert_input(self, value):

    if (np.all((value == 0)) and (self.unit is not None)):
        return (u.Quantity(np.zeros(self.shape), self.unit), True)
    else:
        if (not hasattr(value, u'unit')):
            raise TypeError(u'Tried    to    set    a    QuantityAttribute    with    something    that    does    not    have    a    unit.')
        oldvalue = value
        value = u.Quantity(oldvalue, self.unit, copy=False)
        if ((self.shape is not None) and (value.shape != self.shape)):
            raise ValueError(u'The    provided    value    has    shape    "{0}",    but    should    have    shape    "{1}"'.format(value.shape, self.shape))
        converted = (oldvalue is not value)
        return (value, converted)
