예제 #1
0
    def test_runcommand(self):
        module = "hello"
        execution_path = "./example"
        experiment_name = "my_experiment"
        worker_name = "my_worker"

        with tempfile.TemporaryDirectory() as tempdir:
            rootdir = Path(tempdir)

            executor = Executor(
                rootdir=rootdir,
                module=module,
                execution_path=execution_path,
            )

            experiment_id = executor.init(experiment_name)
            runinfo = executor.run(experiment_id, worker_name)

            args = self.parser.parse_args([
                "rename",
                "-r",
                runinfo.uuid,
                "-n",
                "new name",
                "-s",
                tempdir,
            ])

            args.func(args)

            runinfo_ = executor._store.load_run(runinfo.uuid)

            assert runinfo_.name == "new name"
예제 #2
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)
예제 #3
0
    def test_runcommand(self):
        module = "hello"
        execution_path = "./example"
        experiment_name = "my_experiment"
        worker_name = "my_worker"

        with tempfile.TemporaryDirectory() as tempdir:
            rootdir = Path(tempdir)

            executor = Executor(
                rootdir=rootdir,
                module=module,
                execution_path=execution_path,
            )
            experiment_id = executor.init(experiment_name)

            args = self.parser.parse_args([
                "run",
                "-s",
                tempdir,
                "-m",
                module,
                "-e",
                str(experiment_id),
                "-w",
                worker_name,
                "--exec-path",
                execution_path,
            ])

            args.func(args)
예제 #4
0
    def test_runcommand(self):
        module = "hello"
        execution_path = "./example"
        experiment_name = "my_experiment"
        worker_name = "my_worker"

        with tempfile.TemporaryDirectory() as tempdir:
            rootdir = Path(tempdir)

            executor = Executor(
                rootdir=rootdir,
                module=module,
                execution_path=execution_path,
            )

            experiment_id = executor.init(experiment_name)
            runinfo = executor.run(experiment_id, worker_name)

            run_path = rootdir / str(
                experiment_id) / worker_name / runinfo.uuid
            assert run_path.exists()

            args = self.parser.parse_args([
                "delete",
                "-r",
                runinfo.uuid,
                "-s",
                tempdir,
                "-f",
            ])

            args.func(args)

            assert not run_path.exists()
예제 #5
0
    def test_run():
        with tempfile.TemporaryDirectory() as tempdir:
            rootdir = Path(tempdir)

            executor = Executor(
                rootdir=rootdir,
                module="hello",
                execution_path="./examples",
            )

            experiment_id = executor.init("my_experiment")
            runinfo = executor.run(experiment_id, "my_worker")
예제 #6
0
파일: init.py 프로젝트: altescy/logexp
    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}")