import re


def parse_timestep_str_from_path(path: str) -> str:
    """
    Get the model timestep timestamp from a given path

    Args:
        path: A file or directory path that includes a timestep to extract

    Returns:
        The extrancted timestep string
    """

    extracted_time = re.search(r"(\d\d\d\d\d\d\d\d\.\d\d\d\d\d\d)", path)

    if extracted_time is not None:
        return extracted_time.group(1)
    else:
        raise ValueError(f"No matching time pattern found in path: {path}")