def flatten_dims(point, space):
    """Flatten `point` in `space` and convert it to a list.

    Parameters
    ----------
    point: array
        Points to be regrouped.
    space: `orion.algo.space.Space`
        The optimization space.

    Returns
    -------
    list

    """
    flattened = []
    for subpoint, dimension in zip(point, space.values()):
        shape = dimension.shape
        if shape:
            assert len(shape) == 1
            flattened.extend(subpoint)
        else:
            flattened.append(subpoint)
    return flattened
