@staticmethod
def _compute_current_dimension(array_shape, selected_items, selected_functions
    ):
    """
        If the user reloads an operation we have to compute the current dimension of the array
        and also the shape of the array based on his selections
        """
    current_dim = len(array_shape)
    for i in range(len(array_shape)):
        if i in selected_items and len(selected_items[i]) > 0:
            array_shape[i] = len(selected_items[i])
            if len(selected_items[i]) == 1:
                current_dim -= 1
        if i in selected_functions and selected_functions[i] != 'none':
            array_shape[i] = 1
            if i not in selected_items or len(selected_items[i]) > 1:
                current_dim -= 1
    return array_shape, current_dim
