from pathlib import Path
from typing import Set


def get_unit_types(unit_directory: Path) -> Set[str]:
    """Returns the unit types found in a directory"""

    unit_filenames = unit_directory.glob("*")
    unit_types = set([Path(filename).stem.split("_")[0] for filename in unit_filenames])
    return unit_types