from pathlib import Path


def _get_save_dir(data_dir: Path, name: str, ext: str) -> Path:
    """A helper function which generates the path where the masks and DataFrames
    are saved to.

    Args:
        data_dir (Path): The directory to save the binary masks and DataFrames.
        name (str): The field of the DataClass to be saved.
        ext (str): The file extension, either `csv` or `tiff`.

    Returns:
        Path: Returns the path where the file is saved to.
    """
    return Path(data_dir, name + f".{ext}")