Skip to content

config_schema

config_schema ¤

Classes:

Name Description
PingPongConfig

panther.plugins.services.iut.minip.ping_pong.config_schema.PingPongConfig dataclass ¤

PingPongConfig(name: str = 'ping-pong', type: ImplementationType = iut, shadow_compatible: bool = True, gperf_compatible: bool = False, version: PingPongVersion = 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/') -> PingPongVersion

Load version configurations dynamically from YAML files.

Source code in panther/plugins/services/iut/minip/ping_pong/config_schema.py
32
33
34
35
36
37
38
39
40
41
42
43
@staticmethod
def load_versions_from_files(version_configs_dir: str =f"{Path(os.path.dirname(__file__))}/version_configs/") -> PingPongVersion:
    """Load version configurations dynamically from YAML files."""
    logging.debug(f"Loading PingPong 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 PingPong version config: {raw_version_config}")
            version_config = OmegaConf.to_object(OmegaConf.merge(PingPongVersion, raw_version_config))
            logging.debug(f"Loaded Picoquic version {version_config}")
            return version_config