def _extract_memmap_shape(path):
    """Get the shape tuple from a memmap path as saved in the expected format
    [prefix]__[shape element 1]_[shape_element 2]_..._[shape element n].npy

    Args:
        path (pathlib Path): Path to the memmap

    Returns:
        (tuple of ints): The shape of the memmap

    """
    return tuple(int(element) for element in path.stem.split("__")[1].split("_"))