dvc/repo/experiments/executor.py
def reproduce(dvc_dir, cwd=None, **kwargs):
        """Run dvc repro and return the result."""
        from dvc.repo import Repo
        from dvc.repo.experiments import hash_exp

        unchanged = []

        def filter_pipeline(stage):
            if isinstance(stage, PipelineStage):
                unchanged.append(stage)

        if cwd:
            old_cwd = os.getcwd()
            os.chdir(cwd)
        else:
            old_cwd = None
            cwd = os.getcwd()

        try:
            logger.debug("Running repro in '%s'", cwd)
            dvc = Repo(dvc_dir)
            dvc.checkout()
            stages = dvc.reproduce(on_unchanged=filter_pipeline, **kwargs)
        finally:
            if old_cwd is not None:
                os.chdir(old_cwd)

        # ideally we would return stages here like a normal repro() call, but
        # stages is not currently picklable and cannot be returned across
        # multiprocessing calls
        return hash_exp(stages + unchanged)
Run dvc repro and return the result.
Run dvc repro and return the result.
Run dvc repro and return the result .
def reproduce(dvc_dir, cwd=None, **kwargs):
        from dvc.repo import Repo
        from dvc.repo.experiments import hash_exp
        unchanged = []
        def filter_pipeline(stage):
            if isinstance(stage, PipelineStage):
                unchanged.append(stage)
        if cwd:
            old_cwd = os.getcwd()
            os.chdir(cwd)
        else:
            old_cwd = None
            cwd = os.getcwd()
        try:
            logger.debug("Running repro in '%s'", cwd)
            dvc = Repo(dvc_dir)
            dvc.checkout()
            stages = dvc.reproduce(on_unchanged=filter_pipeline, **kwargs)
        finally:
            if old_cwd is not None:
                os.chdir(old_cwd)
        return hash_exp(stages + unchanged)
def reproduce ( dvc_dir , cwd = None , ** kwargs ) : from dvc . repo import Repo from dvc . repo . experiments import hash_exp unchanged = [ ] def filter_pipeline ( stage ) : if isinstance ( stage , PipelineStage ) : unchanged . append ( stage ) if cwd : old_cwd = os . getcwd ( ) os . chdir ( cwd ) else : old_cwd = None cwd = os . getcwd ( ) try : logger . debug ( "Running repro in '%s'" , cwd ) dvc = Repo ( dvc_dir ) dvc . checkout ( ) stages = dvc . reproduce ( on_unchanged = filter_pipeline , ** kwargs ) finally : if old_cwd is not None : os . chdir ( old_cwd ) return hash_exp ( stages + unchanged )
Run dvc repro and return the result.
Run dvc repro and return the result .
"""Run dvc repro and return the result.""" # ideally we would return stages here like a normal repro() call, but # stages is not currently picklable and cannot be returned across # multiprocessing calls
dvc_dir
cwd