from pathlib import Path
from typing import Dict
from typing import Any
import yaml


def load_specs(specs_file: Path) -> Dict[str, Any]:
    """
    Read the specifications for benchmark scenarios from the given file.

    Returns:
      A dict where keys are scenario names and values are scenario configuration.
    """
    with open(specs_file, "r") as f:
        specs_list = yaml.safe_load(f)

    specs: Dict[str, Any] = {}
    for spec in specs_list:
        name = spec.pop("scenario")
        specs[name] = spec

    return specs