@classmethod
def dimsOf(cls, x):
    """Calculate total dimension-set of the elements in x
        
        This is *extremely* messy, as it has to track nested arrays
        where the arrays could be different sizes on all sorts of 
        levels...
        """
    try:
        dimensions = [len(x)]
    except (TypeError, AttributeError, ValueError) as err:
        return []
    else:
        childDimension = None
        for child in x:
            newDimension = cls.dimsOf(child)
            if childDimension is not None:
                if newDimension != childDimension:
                    raise ValueError(
                        'Non-uniform array encountered: %s versus %s' % (
                        newDimension, childDimension), x)
