from pathlib import Path


def generate_output_filename(filepath: Path, out_unit: str) -> Path:
    """Append the output unit of measurement to the filename of the provided filepath."""
    new_filename = f"{filepath.stem}_{out_unit}{filepath.suffix}"
    return filepath.with_name(new_filename)