コード例 #1
0
def find_first_job(pred, packagelist, settings, molecule, job_name, **kwargs):
    joblist = [
        package(settings,
                molecule,
                job_name=package.pkg_name + "_" + job_name,
                **kwargs) for package in packagelist
    ]
    return find_first(pred, joblist)
コード例 #2
0
def test_find_first():
    global counter

    wfs = [counted_sqr(x) for x in range(10)]
    w = find_first(is_sixteen, wfs)
    result = run_single(w)
    assert result == 16
    assert counter == 5

    wfs = [counted_sqr(x) for x in range(10)]
    w = find_first(is_sixteen, wfs)
    result = run_process(w, n_processes=1, registry=base)
    assert result == 16

    wfs = [display_sqr(x) for x in range(10)]
    w = find_first(is_sixteen, wfs)
    with NCDisplay() as display:
        result = run_logging(w, n_threads=2, display=display)
    assert result == 16
コード例 #3
0
ファイル: test_conditionals.py プロジェクト: NLeSC/noodles
def test_find_first():
    global counter

    wfs = [counted_sqr(x) for x in range(10)]
    w = find_first(is_sixteen, wfs)
    result = run_single(w)
    assert result == 16
    assert counter == 5

    wfs = [counted_sqr(x) for x in range(10)]
    w = find_first(is_sixteen, wfs)
    result = run_process(w, n_processes=1, registry=base)
    assert result == 16

    wfs = [display_sqr(x) for x in range(10)]
    w = find_first(is_sixteen, wfs)
    with NCDisplay() as display:
        result = run_logging(w, n_threads=2, display=display)
    assert result == 16
コード例 #4
0
ファイル: operations.py プロジェクト: SCM-NV/qmflows
def find_first_job(pred: Predicate, packagelist: Iterable[Package],
                   settings: Settings, molecule: Molecule, job_name: str,
                   **kwargs: Any) -> Optional[Result]:
    """Return the first job to finish."""
    joblist = [
        package(settings,
                molecule,
                job_name=f"{package.pkg_name}_{job_name}",
                **kwargs) for package in packagelist
    ]
    return find_first(pred, joblist)
コード例 #5
0
def find_first():
    wfs = [sqr(x) for x in range(10)]
    return noodles.find_first(is_sixteen, wfs)
コード例 #6
0
ファイル: operations.py プロジェクト: SCM-NV/qmworks
def find_first_job(pred, packagelist, settings, molecule, job_name, **kwargs):
    joblist = [package(
        settings, molecule, job_name=package.pkg_name + "_" + job_name, **kwargs)
        for package in packagelist]
    return find_first(pred, joblist)