Skip to content

Parser cli

parse_cli(args) ยค

Internal function for parsing CLI arguments to a valid configuration dictionary.

Source code in aucmedi/automl/parser_cli.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
def parse_cli(args):
    """ Internal function for parsing CLI arguments to a valid configuration
    dictionary.
    """
    # Parse argument namespace to config dict
    config = vars(args)

    # Convert variables
    if config["hub"] == "training":
        # Handle 3D shape - from str to tuple
        config["shape_3D"] = tuple(map(int, config["shape_3D"].split("x")))
        # Handle architecture list
        if "," in config["architecture"]:
            config["architecture"] = config["architecture"].split(",")

    # Return valid configs
    return config