Exemple #1
0
    def run(self, args: argparse.Namespace) -> None:
        settings = Settings()
        if args.config_file is not None:
            settings.load(args.config_file)

        module = args.module or settings.logexp_module
        store_path = args.store or settings.logstore_storepath
        exec_path = args.exec_path or settings.logexp_execpath

        if not module:
            raise RuntimeError("module is required")

        executor = Executor(
            rootdir=store_path,
            module=module,
            execution_path=exec_path,
        )
        run_info = executor.run(
            experiment_id=args.experiment,
            worker_name=args.worker,
            params_path=args.params,
            name=args.name,
            note=args.note,
        )

        if run_info.report is not None:
            _print_report(run_info.report)

        _print_summary(run_info)
Exemple #2
0
    def run(self, args: argparse.Namespace) -> None:
        settings = Settings()
        if args.config_file is not None:
            settings.load(args.config_file)

        store_path = args.store or settings.logstore_storepath

        store = LogStore(store_path)
        runinfo = store.load_run(args.run)
        print(json.dumps(runinfo.to_json(), indent=2))
Exemple #3
0
    def run(self, args: argparse.Namespace) -> None:
        settings = Settings()
        if args.config_file is not None:
            settings.load(args.config_file)

        store_path = args.store or settings.logstore_storepath

        store = LogStore(store_path)
        runinfos = store.get_runs(args.experiment, args.worker)
        runinfo_dicts = [x.to_json() for x in runinfos]
        print(json.dumps(runinfo_dicts))
Exemple #4
0
    def run(self, args: argparse.Namespace) -> None:
        settings = Settings()
        if args.config_file is not None:
            settings.load(args.config_file)

        if args.store is None:
            store_path = settings.logstore_storepath
        else:
            store_path = Path(args.store)

        store = LogStore(store_path)
        runinfo = store.load_run(args.run)

        runinfo.name = args.name

        store.save_run(runinfo)
Exemple #5
0
    def run(self, args: argparse.Namespace) -> None:
        settings = Settings()
        if args.config_file is not None:
            settings.load(args.config_file)

        store_path = args.store or settings.logstore_storepath

        store = LogStore(store_path)
        runinfo = store.load_run(args.run)

        if args.force:
            choise = "y"
        else:
            choise = input(f"Do you delete this run: {runinfo.uuid} ? [y/N] ")

        if choise.strip().lower() == "y":
            store.delete_run(runinfo.uuid)
Exemple #6
0
    def run(self, args: argparse.Namespace) -> None:
        settings = Settings()
        if args.config_file is not None:
            settings.load(args.config_file)

        store_path = args.store or settings.logstore_storepath
        module = args.module or settings.logexp_module
        exec_path = args.exec_path or settings.logexp_execpath

        if not module:
            raise RuntimeError("module is required")

        executor = Executor(
            rootdir=store_path,
            module=module,
            execution_path=exec_path,
        )
        experiment_id = executor.init(args.experiment)
        print(f"experiment id: {experiment_id}")
Exemple #7
0
    def run(self, args: argparse.Namespace) -> None:
        settings = Settings()
        if args.config_file is not None:
            settings.load(args.config_file)

        store_path = args.store or settings.logstore_storepath

        store = LogStore(store_path)
        runinfos = store.get_runs(args.experiment, args.worker)

        table = _get_runinfo_table(runinfos, args.max_column_width)

        if args.sort is not None:
            table.sort(args.sort, args.desc)

        if args.columns is not None:
            columns = args.columns.split(",")
            table = table[columns]

        table.print()
Exemple #8
0
    def run(self, args: argparse.Namespace) -> None:
        settings = Settings()
        if args.config_file is not None:
            settings.load(args.config_file)

        if args.store is None:
            store_path = settings.logstore_storepath
        else:
            store_path = Path(args.store)

        store = LogStore(store_path)
        runinfo = store.load_run(args.run)

        note = edit(
            editor=settings.logexp_editor,
            filename="note.txt",
            text=runinfo.note,
        )

        runinfo.note = note

        store.save_run(runinfo)
Exemple #9
0
    def test_settings():
        with tempfile.TemporaryDirectory() as tempdir:
            before_path = os.getcwd()

            path = Path(tempdir)
            os.chdir(path)

            with open(path / "logexp.ini", "w") as f:
                f.write("[logexp]\n" "module = foo")

            settings = Settings()

            assert settings.logexp_module == "foo"

        os.chdir(before_path)
Exemple #10
0
    def run(self, args: argparse.Namespace) -> None:
        settings = Settings()
        if args.config_file is not None:
            settings.load(args.config_file)

        store_path = args.store or settings.logstore_storepath

        store = LogStore(store_path)
        runinfos = [
            x for x in store.get_runs(args.experiment, args.worker)
            if x.status == Status.FAILED or x.status == Status.INTERRUPTED
        ]

        if args.force:
            choise = "y"
        else:
            print("Following runs will be removed:")
            for runinfo in runinfos:
                print(f"  {runinfo.uuid}")
            choise = input("Are you sure you want to continue? [y/N] ")

        if choise.strip().lower() == "y":
            for runinfo in runinfos:
                store.delete_run(runinfo.uuid)