def test_default_backend(self): """ipyparallel.register_joblib_backend() registers default backend""" ipp.register_joblib_backend() with mock.patch.object(ipp.Client, "__new__", lambda *a, **kw: self.client): p = Parallel(backend='ipyparallel') assert p._backend._view.client is self.client
def test_default_backend(self): """ipyparallel.register_joblib_backend() registers default backend""" ipp.register_joblib_backend() with mock.patch('ipyparallel.Client', lambda : self.client): p = Parallel(backend='ipyparallel') assert p._backend._view.client is self.client self.client[:].use_pickle()
def test_default_backend(self): """ipyparallel.register_joblib_backend() registers default backend""" ipp.register_joblib_backend() with mock.patch('ipyparallel.Client', lambda : self.client): p = Parallel(backend='ipyparallel') assert p._backend._view.client is self.client # FIXME: add View.use_pickle to undo use_cloudpickle def _restore_default_pickle(): import pickle from ipyparallel.serialize import canning, serialize canning.pickle = serialize.pickle = pickle canning.can_map[canning.FunctionType] = canning.CannedFunction _restore_default_pickle() self.client[:].apply_sync(_restore_default_pickle)
Options: -h --help Show this screen. """ from docopt import docopt import numpy as np import pandas as pd import sqlite3 from joblib import Parallel, delayed from pathlib import Path from tqdm import trange import pycabnn import ipyparallel as ipp ipp.register_joblib_backend() def main(db, nblocks, ntargets): # c = conn.cursor() # c.execute('SELECT MAX(target) FROM connection') # ntargets, = c.fetchone() # print(ntargets) prefix = Path(db).resolve() prefix = str(prefix.parent / prefix.stem) def sqlite3_ffetch(k): with sqlite3.connect(db) as conn: df = pd.read_sql_query( "SELECT * FROM connection WHERE target={}".format(k), conn)