Beispiel #1
0
def test_Config_multi_output_levels(levels):
    levels_set = list(set(levels))
    str_levels = ",".join(str(s) for s in levels_set)
    parser = argparse.ArgumentParser()
    Config.register_parser(parser)
    args = parser.parse_args(["--multi-output", "--levels", str_levels])
    config = Config.from_args(args)
    assert config.target.levels == levels_set
Beispiel #2
0
def test_Config_register_parser(args, loss_cls):
    parser = argparse.ArgumentParser()
    Config.register_parser(parser)
    args = parser.parse_args(args)
    config = Config.from_args(args)
    assert isinstance(config, Config)
    assert isinstance(config.target, loss_cls)

    if args.relative_humidity:
        assert config.relative_humidity
    else:
        assert not config.relative_humidity
Beispiel #3
0
def get_parser() -> argparse.ArgumentParser:
    parser = argparse.ArgumentParser()
    Config.register_parser(parser)
    return parser