def main():
    runner = None

    try:
        config = Config.load()

        init_logging(config)

        runner = Runner()
        runner.open(config)
        runner.run()

        return 0

    except KeyboardInterrupt:
        # if runner is not None:
        #     runner.close()
        return 0

    except Exception as ex:
        _logger.exception(ex)
        # no runner.close() to signal abnomal termination!
        return 1

    finally:
        if runner is not None:
            runner.close()
Beispiel #2
0
def test_488():
    p = Runner(88, "eval", verbose=True)
    p.run("connect")
    p.run("count_hole")
    p.run("freq")
    p.run("sort_ascending")
    p.run("trim_background")
Beispiel #3
0
def test_58():
    p = Runner(58, verbose=True)
    p.run("mesh_split")
    p.run("n_cell")
    p.run("keep_max")
    p.run("max_color")
    p.run("paste_color_full")
def test_log():
    with open(os.path.join(os.path.dirname(__file__), "log.txt")) as f:
        flag = False
        for row in f:
            if row[:5] == "train":
                file_kbn = list(row.split())
            elif row[:4] == "eval":
                file_kbn = list(row.split())
            elif row[:6] == "Failed":
                flag = False
            elif row[:6] == "Solved":
                flag = True
            # print(row, file_kbn)
            if flag and row[0] == "[":
                op_list = eval(row.strip())
                p = Runner(int(file_kbn[1]), file_kbn[0], verbose=True)
                for op in op_list:
                    p.run(op)
                ac, wa = p.eval_test(verbose=True)
                if wa == 0 and file_kbn[0] == "eval":
                    # print(file_kbn[1], op_list)
                    pass
                if wa > 0:
                    print(op_list)
                    print(ac, wa)
                assert p.eval_distance() == 0
Beispiel #5
0
def test_578():
    p = Runner(178, "eval", verbose=True)
    p.run("trim_background")
Beispiel #6
0
def test_561():
    p = Runner(161, "eval", verbose=True)
    p.run("trim_background")
Beispiel #7
0
def test_555():
    p = Runner(155, "eval", verbose=True)
    p.run("trim_background")
Beispiel #8
0
def test_440():
    p = Runner(40, "eval", verbose=True)
    p.run("connect")
Beispiel #9
0
def test_134():
    p = Runner(134, verbose=True)
    p.run("divide")
Beispiel #10
0
def test_124():
    p = Runner(124, verbose=True)
    p.run("change_background")
Beispiel #11
0
def test_756():
    p = Runner(356, "eval", verbose=True)
    p.run("color")
Beispiel #12
0
def test_738():
    p = Runner(338, "eval", verbose=True)
    p.run("change_background")
    p.run("connect4")
    p.run("auto_paste_a")
Beispiel #13
0
def test_654():
    p = Runner(254, "eval", verbose=True)
    p.run("connect")
    p.run("auto_keep")
Beispiel #14
0
def test_652():
    p = Runner(252, "eval", verbose=True)
    p.run("color")
    p.run("auto_keep")
    p.run("align")
Beispiel #15
0
def test_607():
    p = Runner(207, "eval", verbose=True)
    p.run("mesh_split")
    p.run("collect_max")
Beispiel #16
0
def test_586():
    p = Runner(186, "eval", verbose=True)
    p.run("trim_background")