Пример #1
0
def get_results():
    from pypastry.experiment.results import ResultsRepo
    from git import Repo
    results_repo = ResultsRepo(RESULTS_PATH)
    results = results_repo.get_results(
        Repo('.', search_parent_directories=True))
    return results
Пример #2
0
def run():
    try:
        print_cache_file()
    except FileNotFoundError:
        from pypastry.experiment.results import ResultsRepo
        from git import Repo
        results_repo = ResultsRepo(RESULTS_PATH)
        results = results_repo.get_results(Repo('.'))
        cache_display(results)
        print_cache_file()
Пример #3
0
def run():
    parser = argparse.ArgumentParser(prog='pastry print')
    parser.add_argument('-l', '--limit', type=int, default=None, help='Limit lines to print')

    args = parser.parse_args(sys.argv[2:])
    try:
        print_cache_file(args.limit)
    except FileNotFoundError:
        from pypastry.experiment.results import ResultsRepo
        from git import Repo
        results_repo = ResultsRepo(RESULTS_PATH)
        results = results_repo.get_results(Repo('.'))
        cache_display(results)
        print_cache_file(args.limit)
Пример #4
0
def run():
    parser = argparse.ArgumentParser(prog='pastry run')
    parser.add_argument('-f',
                        '--force',
                        action='store_true',
                        help='Force a re-run of the experiment')
    parser.add_argument('-m',
                        '--message',
                        type=str,
                        required=True,
                        help='Git commit message')
    parser.add_argument('-l', '--limit', type=int, help='Limit lines to print')

    args = parser.parse_args(sys.argv[2:])

    sys.path.append('.')
    import pie
    experiment = pie.get_experiment()

    git_repo = Repo(REPO_PATH)  # type: pypastry.experiment.Experiment
    results_repo = ResultsRepo(
        RESULTS_PATH)  # type: pypastry.experiment.results.ResultsRepo
    runner = ExperimentRunner(git_repo, results_repo, display)  # type:
    # pypastry.experiment.evaluation.ExperimentRunner
    runner.run_experiment(experiment, args.force, args.message, args.limit)
Пример #5
0
def run_experiment(experiment, message, force=False):
    git_repo = Repo(
        REPO_PATH,
        search_parent_directories=True)  # type: pypastry.experiment.Experiment
    results_repo = ResultsRepo(
        RESULTS_PATH)  # type: pypastry.experiment.results.ResultsRepo
    runner = ExperimentRunner(git_repo, results_repo, display)  # type:
    # pypastry.experiment.evaluation.ExperimentRunner
    return runner.run_experiment(experiment, force, message)
Пример #6
0
def run_experiment(experiment, message="", force=False, show_results=True) -> Tuple[List[BaseEstimator], Path]:
    git_repo = Repo(REPO_PATH, search_parent_directories=True)  # type: pypastry.experiment.Experiment
    results_repo = ResultsRepo(RESULTS_PATH)  # type: pypastry.experiment.results.ResultsRepo
    runner = ExperimentRunner(git_repo, results_repo, display)  # type:
    # pypastry.experiment.evaluation.ExperimentRunner
    return runner.run_experiment(
        experiment=experiment,
        message=message,
        force=force,
        show_results=show_results,
    )
Пример #7
0
def get_results():
    results_repo = ResultsRepo(RESULTS_PATH)
    results = results_repo.get_results()
    return results