Skip to content

config_schema

config_schema ¤

Classes:

Name Description
MvfstConfig

panther.plugins.services.iut.quic.mvfst.config_schema.MvfstConfig dataclass ¤

MvfstConfig(name: str = 'mvfst', type: ImplementationType = iut, shadow_compatible: bool = False, gperf_compatible: bool = False, version: MvfstVersion = lambda: load_versions_from_files()())

Bases: ImplementationConfig

Methods:

Name Description
load_versions_from_files

Load version configurations dynamically from YAML files.

load_versions_from_files staticmethod ¤

load_versions_from_files(version_configs_dir: str = f'{Path(dirname(__file__))}/version_configs/') -> MvfstVersion

Load version configurations dynamically from YAML files.

Source code in panther/plugins/services/iut/quic/mvfst/config_schema.py
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@staticmethod
def load_versions_from_files(
    version_configs_dir: str =f"{Path(os.path.dirname(__file__))}/version_configs/",
) -> MvfstVersion:
    """Load version configurations dynamically from YAML files."""
    logging.debug(f"Loading Mvfst versions from {version_configs_dir}")
    for version_file in os.listdir(version_configs_dir):
        if version_file.endswith(".yaml"):
            version_path = os.path.join(version_configs_dir, version_file)
            raw_version_config = OmegaConf.load(version_path)
            logging.debug(
                f"Loaded raw Mvfst version config: {raw_version_config}"
            )
            version_config = OmegaConf.to_object(
                OmegaConf.merge(MvfstVersion, raw_version_config)
            )
            logging.debug(f"Loaded Mvfst version {version_config}")
            return version_config