83afa41b90bf670e905ff44f013665242c350f51,pyemma/_base/estimator.py,,estimate_param_scan,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,193

Before Change



        from .parallel import _init_pool
        pool = _init_pool(n_jobs)
        assert pool
        // the ctx manager will close and remove the processes, so we have to start new ones every time...
        with pool:
            res = pool(task_iter)
    // if n_jobs=1 don"t invoke the pool, but directly dispatch the iterator

After Change



        from pathos.multiprocessing import Pool as Parallel
        pool = Parallel(processes=n_jobs)
        args = list(task_iter)
        if progress_reporter is not None:
            progress_reporter._progress_register(len(estimators), stage=0, description="estimating %s" % str(estimator.__class__.__name__))
            from pyemma._base.model import SampledModel
            for a in args:
                if isinstance(a[0], SampledModel):
                    a[0].show_progress = False

        def callback(_):
            progress_reporter._progress_update(1, stage=0)

        with pool:
            res_async = [pool.apply_async(_estimate_param_scan_worker, a, callback=callback) for a in args]
            res = [x.get() for x in res_async]

    // if n_jobs=1 don"t invoke the pool, but directly dispatch the iterator
    else:
        res = []
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: markovmodel/PyEMMA
Commit Name: 83afa41b90bf670e905ff44f013665242c350f51
Time: 2017-08-28
Author: m.scherer@fu-berlin.de
File Name: pyemma/_base/estimator.py
Class Name:
Method Name: estimate_param_scan


Project Name: tensorflow/magenta
Commit Name: d657fbe414191d55b5e2b77baf3709d7caef3393
Time: 2016-11-09
Author: curtis@thefjord.org
File Name: magenta/models/rl_tuner/rl_tuner_test.py
Class Name: RLTunerTest
Method Name: testTraining


Project Name: nipy/dipy
Commit Name: ac61e469228f464858fdd83ed02ed243a0a8306e
Time: 2020-10-29
Author: skab12@gmail.com
File Name: dipy/core/tests/test_gradients.py
Class Name:
Method Name: test_GradientTable