Skip to content

load_benchmark

Loads the benchmark DataFrame from a specified CSV file.

Parameters:

Name Type Description Default
path Union[str, Path]

Path to the benchmark CSV file.

required

Returns:

Type Description
DataFrame

pd.DataFrame: Loaded benchmark DataFrame.

Raises:

Type Description
FileNotFoundError

If the specified file does not exist.

Source code in periomod/wrapper/_wrapper.py
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
def load_benchmark(path: Union[str, Path]) -> pd.DataFrame:
    """Loads the benchmark DataFrame from a specified CSV file.

    Args:
        path (Union[str, Path]): Path to the benchmark CSV file.

    Returns:
        pd.DataFrame: Loaded benchmark DataFrame.

    Raises:
        FileNotFoundError: If the specified file does not exist.
    """
    path = Path(path)
    if not path.is_absolute():
        path = Path.cwd() / path

    if not path.exists():
        raise FileNotFoundError(f"The file {path} does not exist.")

    return pd.read_csv(path)