@classmethod
def depsize(cls, v):
    """Checks that DEPEND has same shape as that dim

        Compares the size of variables specified in the variable
        attributes for `DEPEND
        <https://spdf.gsfc.nasa.gov/istp_guide/vattributes.html#DEPEND_0>`_
        and compares to the size of the corresponding dimension in
        this variable.

        Parameters
        ----------
        v : :class:`~spacepy.pycdf.Var`
            Variable to check

        Returns
        -------
        list of str
            Description of each validation failure.

        """
    rv = int(v.rv())
    errs = []
    if v.shape == (0,):
        if 'DEPEND_1' in v.attrs or 'DEPEND_2' in v.attrs:
            errs.append(
                'Do not expect DEPEND_1 or DEPEND_2 in 1 dimensional variable.'
                )
    for i in range(rv, len(v.shape)):
        depidx = i + 1 - rv
        target = v.shape[i]
        if not 'DEPEND_{}'.format(depidx) in v.attrs:
            continue
        d = v.attrs['DEPEND_{}'.format(depidx)]
        if d in v.cdf_file:
            dv = v.cdf_file[d]
        else:
            continue
        if dv.rv() != ('DEPEND_0' in dv.attrs):
            errs.append('DEPEND_{} {} is RV but has no DEPEND_0.'.format(
                depidx, d))
            continue
        if 'DEPEND_2' in dv.attrs:
            errs.append('Do not expect three layers of dependency.')
            continue
        elif 'DEPEND_1' in dv.attrs:
            dd = dv.attrs['DEPEND_1']
            if dd in v.cdf_file:
                ddv = v.cdf_file[dd]
            else:
                continue
            actual = list(dv.shape)
            for ii in actual:
                if ii in ddv.shape:
                    actual.remove(ii)
            if 'DEPEND_0' in dv.attrs:
                dd = dv.attrs['DEPEND_0']
                if dd[:5] != 'Epoch':
                    errs.append('Expect DEPEND_0 to be Epoch.')
                    continue
                if dd in v.cdf_file:
                    ddv = v.cdf_file[dd]
                else:
                    continue
                for ii in actual:
                    if ii in ddv.shape:
                        actual.remove(ii)
            if len(actual) != 1:
                errs.append(
                    'More complicated double dependency than taken into account.'
                    )
                continue
            else:
                actual = actual[0]
        else:
            actual = dv.shape[int(dv.rv())]
        if target != actual:
            errs.append('Dim {} sized {} but DEPEND_{} {} sized {}.'.format
                (i, target, depidx, d, actual))
    return errs
