Skip to content
Snippets Groups Projects
Commit 8e94909c authored by dmt's avatar dmt
Browse files

Clear output of example.ipynb.

parent 3226f26e
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags:
``` python
import conML
```
%% Output
/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/sklearn/utils/deprecation.py:144: FutureWarning: The sklearn.cluster.birch module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.cluster. Anything that cannot be imported from sklearn.cluster is now part of the private API.
warnings.warn(message, FutureWarning)
/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/sklearn/utils/deprecation.py:144: FutureWarning: The sklearn.neighbors.kde module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.neighbors. Anything that cannot be imported from sklearn.neighbors is now part of the private API.
warnings.warn(message, FutureWarning)
%% Cell type:code id: tags:
``` python
settings = conML.get_settings()
settings.HIGHEST_LEVEL = 4
settings.LEARN_BLOCK_MINIMUM = 5000
settings.SIGMA_ZETA_CUTOFF = 0.01
settings.MAX_CATEGORIES = 5
settings.MIN_CATEGORY_SIZE = 0.1
settings.MIN_BUILD_MODELS = 2
settings.MAX_FEATURES = 60
settings.MAX_FILTER_X = 50
settings.MAX_FILTER_Y = 15000
settings.MAX_MODELS_REDUCTION = True
settings.MIN_TEST_ACCURACY = 0.8
settings.RELIABILITY_SAMPLE = 0.3
settings.MIN_RELIABILITY = 0.8
settings.REDUCE_MODEL_REDUNDANCY = False
settings.DECONST_STRATEGY = "integrative"
settings.DECONST_MODE = "minimal"
settings.DECONST_MAX_DISTANCE_T = 1.0
settings.DECONST_FULL_TOLERANCE = 0.1
settings.FORCE_TIME_EXPANSION = False
settings.ALLOW_WEAK_RELIABILITY = True
```
%% Cell type:code id: tags:
``` python
import os
import pandas as pd
PATH = os.path.join(os.path.expanduser("~"), "final_test.csv")
def generate_blocks():
df = pd.read_table(PATH, index_col=False, sep=" ",
names=[i for i in range(1,353)]+["T", "Sigma", "Z"])
df["Z"] = ""
df["Sigma"] = ""
for from_, to in [
(0, 83), (0, 41), (42, 83),
(84, 167), (84, 125), (126, 167),
(168, 249), (168, 208), (209, 249),
(250, 281), (250, 265), (266, 281),
(282, 313), (282, 297), (298, 313),
(314, 345), (314, 329), (330, 345)
]:
for start in range(0, 10000, 10000):
bl = df.iloc[start:start + 10000, from_:to]
bl.columns = [f"0.0.{i}" for i in bl.columns]
bl["T"], bl["Sigma"], bl["Z"] = df["T"], df["Sigma"], df["Z"]
yield bl
```
%% Cell type:code id: tags:
``` python
from sklearn.cluster import KMeans
from sklearn.cluster import AgglomerativeClustering
kmeans = KMeans(precompute_distances=False, algorithm="elkan", random_state=1)
agglo = AgglomerativeClustering()
algorithms = [("Kme", kmeans), ("Agg", agglo)]
constructor = conML.construction("conceptual", algorithms)
```
%% Cell type:code id: tags:
``` python
from sklearn.feature_selection import VarianceThreshold, SelectFromModel
from sklearn.ensemble import ExtraTreesClassifier
variance = VarianceThreshold(2000)
forest = ExtraTreesClassifier(n_estimators=250, random_state=1)
embedded = SelectFromModel(forest)
selector = conML.feature_selection(filter_method=variance, embedded_method=embedded)
```
%% Cell type:code id: tags:
``` python
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import SVC
from sklearn.neighbors import KNeighborsClassifier
from sklearn.naive_bayes import GaussianNB
random_forest = RandomForestClassifier(n_estimators=2)
svc = SVC(gamma="auto", C=1)
neighbor = KNeighborsClassifier(n_neighbors=3)
gaus = GaussianNB()
algos = [("Gau", gaus),("Nei", neighbor)]
reconstructor = conML.reconstruction("conceptual", algos)
```
%% Cell type:code id: tags:
``` python
deconstructor = conML.deconstruction(reconstructor)
```
%% Cell type:code id: tags:
``` python
dbs = []
components = (constructor, selector, reconstructor, deconstructor)
with conML.knowledge_searcher(*components, n_procs=4, stdout=True) as s:
for i, block in enumerate(generate_blocks()):
db, halde = s.search(block)
dbs.append(db)
```
%% Output
==========================================BLOCKPROCESSING===========================================
Rows 10000
Columns 86
=============================================LEARNBLOCK=============================================
State State.IDENTIFIED
Relationship ('Sigma', 'Z')
Process ForkPoolWorker-5:
Process ForkPoolWorker-3:
Process ForkPoolWorker-4:
Traceback (most recent call last):
Traceback (most recent call last):
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py", line 89, in map_onto
return parallel_runner.run(level, block)
Process ForkPoolWorker-2:
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py", line 59, in run
con_info, labeled_lb = next(it)
Traceback (most recent call last):
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/domain/construction/construction.py", line 90, in construct
model.train(learnblock)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/ports/ml_adapter.py", line 245, in train
self.model.fit(data)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/sklearn/cluster/_kmeans.py", line 859, in fit
order=order, copy=self.copy_x)
Traceback (most recent call last):
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py", line 89, in map_onto
return parallel_runner.run(level, block)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py", line 59, in run
con_info, labeled_lb = next(it)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/domain/construction/construction.py", line 90, in construct
model.train(learnblock)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/ports/ml_adapter.py", line 245, in train
self.model.fit(data)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/sklearn/cluster/_kmeans.py", line 859, in fit
order=order, copy=self.copy_x)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py", line 89, in map_onto
return parallel_runner.run(level, block)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/sklearn/utils/validation.py", line 601, in check_array
if copy and np.may_share_memory(array, array_orig):
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py", line 89, in map_onto
return parallel_runner.run(level, block)
File "<__array_function__ internals>", line 6, in may_share_memory
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py", line 59, in run
con_info, labeled_lb = next(it)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/ports/source_adapter.py", line 103, in __getitem__
return self.df.iloc[item][:end]
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/domain/construction/construction.py", line 90, in construct
model.train(learnblock)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/ports/ml_adapter.py", line 245, in train
self.model.fit(data)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/series.py", line 871, in __getitem__
result = self.index.get_value(self, key)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 4404, in get_value
return self._engine.get_value(s, k, tz=getattr(series.dtype, "tz", None))
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py", line 59, in run
con_info, labeled_lb = next(it)
File "pandas/_libs/index.pyx", line 80, in pandas._libs.index.IndexEngine.get_value
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/domain/construction/construction.py", line 90, in construct
model.train(learnblock)
File "pandas/_libs/index.pyx", line 90, in pandas._libs.index.IndexEngine.get_value
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/sklearn/utils/validation.py", line 601, in check_array
if copy and np.may_share_memory(array, array_orig):
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/sklearn/cluster/_kmeans.py", line 859, in fit
order=order, copy=self.copy_x)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/ports/ml_adapter.py", line 245, in train
self.model.fit(data)
File "pandas/_libs/index.pyx", line 116, in pandas._libs.index.IndexEngine.get_loc
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/sklearn/cluster/_kmeans.py", line 859, in fit
order=order, copy=self.copy_x)
KeyboardInterrupt
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/sklearn/utils/validation.py", line 601, in check_array
if copy and np.may_share_memory(array, array_orig):
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/sklearn/utils/validation.py", line 601, in check_array
if copy and np.may_share_memory(array, array_orig):
File "<__array_function__ internals>", line 6, in may_share_memory
File "<__array_function__ internals>", line 6, in may_share_memory
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/ports/source_adapter.py", line 103, in __getitem__
return self.df.iloc[item][:end]
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/ports/source_adapter.py", line 103, in __getitem__
return self.df.iloc[item][:end]
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/indexing.py", line 1768, in __getitem__
return self._getitem_axis(maybe_callable, axis=axis)
File "<__array_function__ internals>", line 6, in may_share_memory
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/indexing.py", line 2140, in _getitem_axis
return self._get_loc(key, axis=axis)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/indexing.py", line 628, in _get_loc
return self.obj._ixs(key, axis=axis)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/ports/source_adapter.py", line 103, in __getitem__
return self.df.iloc[item][:end]
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/series.py", line 910, in __getitem__
return self._get_with(key)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/frame.py", line 2735, in _ixs
new_values = self._data.fast_xs(i)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/indexing.py", line 1768, in __getitem__
return self._getitem_axis(maybe_callable, axis=axis)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/internals/managers.py", line 920, in fast_xs
result[rl] = blk.iget((i, loc))
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/series.py", line 915, in _get_with
return self._slice(key)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/series.py", line 865, in _slice
slobj = self.index._convert_slice_indexer(slobj, kind=kind or "getitem")
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2935, in _convert_slice_indexer
if self.is_integer() or is_index_slice:
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 1671, in is_integer
return self.inferred_type in ["integer"]
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/indexing.py", line 2140, in _getitem_axis
return self._get_loc(key, axis=axis)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/indexing.py", line 628, in _get_loc
return self.obj._ixs(key, axis=axis)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/frame.py", line 2735, in _ixs
new_values = self._data.fast_xs(i)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/internals/managers.py", line 920, in fast_xs
result[rl] = blk.iget((i, loc))
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/internals/blocks.py", line 365, in iget
def iget(self, i):
KeyboardInterrupt
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/pandas/core/internals/blocks.py", line 366, in iget
return self.values[i]
KeyboardInterrupt
KeyboardInterrupt
Process ForkPoolWorker-7:
Traceback (most recent call last):
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/queues.py", line 352, in get
res = self._reader.recv_bytes()
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 110, in worker
task = get()
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/connection.py", line 216, in recv_bytes
buf = self._recv_bytes(maxlength)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/connection.py", line 411, in _recv_bytes
return self._recv(size)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/connection.py", line 386, in _recv
buf.write(chunk)
KeyboardInterrupt
Process ForkPoolWorker-8:
Traceback (most recent call last):
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 110, in worker
task = get()
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/queues.py", line 354, in get
return _ForkingPickler.loads(res)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/sklearn/base.py", line 309, in __setstate__
def __setstate__(self, state):
KeyboardInterrupt
Traceback (most recent call last):
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py", line 182, in search
return self.search_parallel(block)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py", line 220, in search_parallel
reliability_dicts = self.pool.map(map_onto, args)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 268, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 651, in get
self.wait(timeout)
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 648, in wait
self._event.wait(timeout)
File "/home/dmt/Applications/anaconda3/lib/python3.7/threading.py", line 552, in wait
signaled = self._cond.wait(timeout)
File "/home/dmt/Applications/anaconda3/lib/python3.7/threading.py", line 296, in wait
waiter.acquire()
KeyboardInterrupt
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3331, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-8-f1604f8c73ec>", line 5, in <module>
db, halde = s.search(block)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py", line 187, in search
self.pool.join()
File "/home/dmt/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py", line 556, in join
self._worker_handler.join()
File "/home/dmt/Applications/anaconda3/lib/python3.7/threading.py", line 1044, in join
self._wait_for_tstate_lock()
File "/home/dmt/Applications/anaconda3/lib/python3.7/threading.py", line 1060, in _wait_for_tstate_lock
elif lock.acquire(block, timeout):
KeyboardInterrupt
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 2044, in showtraceback
stb = value._render_traceback_()
AttributeError: 'KeyboardInterrupt' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/IPython/core/ultratb.py", line 1148, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/IPython/core/ultratb.py", line 316, in wrapped
return f(*args, **kwargs)
File "/home/dmt/Project/python/test_venv/lib/python3.7/site-packages/IPython/core/ultratb.py", line 350, in _fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "/home/dmt/Applications/anaconda3/lib/python3.7/inspect.py", line 1502, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "/home/dmt/Applications/anaconda3/lib/python3.7/inspect.py", line 1460, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "/home/dmt/Applications/anaconda3/lib/python3.7/inspect.py", line 696, in getsourcefile
if getattr(getmodule(object, filename), '__loader__', None) is not None:
File "/home/dmt/Applications/anaconda3/lib/python3.7/inspect.py", line 742, in getmodule
os.path.realpath(f)] = module.__name__
File "/home/dmt/Applications/anaconda3/lib/python3.7/posixpath.py", line 395, in realpath
path, ok = _joinrealpath(filename[:0], filename, {})
File "/home/dmt/Applications/anaconda3/lib/python3.7/posixpath.py", line 429, in _joinrealpath
if not islink(newpath):
File "/home/dmt/Applications/anaconda3/lib/python3.7/posixpath.py", line 171, in islink
st = os.lstat(path)
KeyboardInterrupt
---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
~/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py in search(self, block)
181 self.pool = multiprocessing.Pool(n_procs, maxtasksperchild=1)
--> 182 return self.search_parallel(block)
183
~/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py in search_parallel(self, block)
219
--> 220 reliability_dicts = self.pool.map(map_onto, args)
221
~/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py in map(self, func, iterable, chunksize)
267 '''
--> 268 return self._map_async(func, iterable, mapstar, chunksize).get()
269
~/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py in get(self, timeout)
650 def get(self, timeout=None):
--> 651 self.wait(timeout)
652 if not self.ready():
~/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py in wait(self, timeout)
647 def wait(self, timeout=None):
--> 648 self._event.wait(timeout)
649
~/Applications/anaconda3/lib/python3.7/threading.py in wait(self, timeout)
551 if not signaled:
--> 552 signaled = self._cond.wait(timeout)
553 return signaled
~/Applications/anaconda3/lib/python3.7/threading.py in wait(self, timeout)
295 if timeout is None:
--> 296 waiter.acquire()
297 gotit = True
KeyboardInterrupt:
During handling of the above exception, another exception occurred:
KeyboardInterrupt Traceback (most recent call last)
~/Project/python/test_venv/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_code(self, code_obj, result, async_)
3330 else:
-> 3331 exec(code_obj, self.user_global_ns, self.user_ns)
3332 finally:
<ipython-input-8-f1604f8c73ec> in <module>
4 for i, block in enumerate(generate_blocks()):
----> 5 db, halde = s.search(block)
6 dbs.append(db)
~/Project/python/test_venv/lib/python3.7/site-packages/cml-0.1.dev0-py3.7.egg/cml/usecases/query.py in search(self, block)
186 self.pool.close()
--> 187 self.pool.join()
188 del self.pool
~/Applications/anaconda3/lib/python3.7/multiprocessing/pool.py in join(self)
555 raise ValueError("In unknown state")
--> 556 self._worker_handler.join()
557 self._task_handler.join()
~/Applications/anaconda3/lib/python3.7/threading.py in join(self, timeout)
1043 if timeout is None:
-> 1044 self._wait_for_tstate_lock()
1045 else:
~/Applications/anaconda3/lib/python3.7/threading.py in _wait_for_tstate_lock(self, block, timeout)
1059 assert self._is_stopped
-> 1060 elif lock.acquire(block, timeout):
1061 lock.release()
KeyboardInterrupt:
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
~/Project/python/test_venv/lib/python3.7/site-packages/IPython/core/interactiveshell.py in showtraceback(self, exc_tuple, filename, tb_offset, exception_only, running_compiled_code)
2043 # in the engines. This should return a list of strings.
-> 2044 stb = value._render_traceback_()
2045 except Exception:
AttributeError: 'KeyboardInterrupt' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
~/Project/python/test_venv/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_code(self, code_obj, result, async_)
3346 if result is not None:
3347 result.error_in_exec = sys.exc_info()[1]
-> 3348 self.showtraceback(running_compiled_code=True)
3349 else:
3350 outflag = False
~/Project/python/test_venv/lib/python3.7/site-packages/IPython/core/interactiveshell.py in showtraceback(self, exc_tuple, filename, tb_offset, exception_only, running_compiled_code)
2045 except Exception:
2046 stb = self.InteractiveTB.structured_traceback(etype,
-> 2047 value, tb, tb_offset=tb_offset)
2048
2049 self._showtraceback(etype, value, stb)
~/Project/python/test_venv/lib/python3.7/site-packages/IPython/core/ultratb.py in structured_traceback(self, etype, value, tb, tb_offset, number_of_lines_of_context)
1413 self.tb = tb
1414 return FormattedTB.structured_traceback(
-> 1415 self, etype, value, tb, tb_offset, number_of_lines_of_context)
1416
1417
~/Project/python/test_venv/lib/python3.7/site-packages/IPython/core/ultratb.py in structured_traceback(self, etype, value, tb, tb_offset, number_of_lines_of_context)
1313 # Verbose modes need a full traceback
1314 return VerboseTB.structured_traceback(
-> 1315 self, etype, value, tb, tb_offset, number_of_lines_of_context
1316 )
1317 elif mode == 'Minimal':
~/Project/python/test_venv/lib/python3.7/site-packages/IPython/core/ultratb.py in structured_traceback(self, etype, evalue, etb, tb_offset, number_of_lines_of_context)
1181 exception = self.get_parts_of_chained_exception(evalue)
1182 if exception:
-> 1183 formatted_exceptions += self.prepare_chained_exception_message(evalue.__cause__)
1184 etype, evalue, etb = exception
1185 else:
TypeError: can only concatenate str (not "list") to str
%% Cell type:code id: tags:
``` python
for level in db.database:
print("{:*^100}".format(level.level))
for m in level.knowledge:
print(m.uid, m.min_timestamp, m.max_timestamp, m.subjects, m.aim, m.origin, m.subject)
```
%% Output
*************************************************0**************************************************
*************************************************1**************************************************
C.1.68 1473880956 1522686863 ('Gau', 'Nei') ('C.1.Kme02',) (4,) ('Nei',)
C.1.99 1473880956 1522686863 ('Gau', 'Nei') ('C.1.Agg03',) (0, 5) ('Nei',)
C.1.118 1473880956 1522686863 ('Gau', 'Nei') ('C.1.Kme02',) (7,) ('Nei',)
C.1.149 1473880956 1522686863 ('Gau', 'Nei') ('C.1.Agg02',) (1, 2, 3, 6, 8) ('Nei',)
C.1.219 1473880956 1522686863 ('Gau', 'Nei') ('C.1.Agg03',) (13,) ('Gau',)
C.1.247 1473880956 1522686863 ('Gau', 'Nei') ('C.1.Agg02',) (12, 14) ('Nei',)
C.1.249 1473880956 1522686863 ('Gau', 'Nei') ('C.1.Agg02',) (15,) ('Nei',)
C.1.264 1473880956 1522686863 ('Gau', 'Nei') ('C.1.Agg02',) (11, 12, 15) ('Nei',)
C.1.268 1473880956 1522686863 ('Gau', 'Nei') ('C.1.Agg02',) (16,) ('Nei',)
C.1.282 1473880956 1522686863 ('Gau', 'Nei') ('C.1.Agg02',) (17,) ('Nei',)
C.1.297 1473880956 1522686863 ('Gau', 'Nei') ('C.1.Agg02',) (17, 14) ('Nei',)
*************************************************2**************************************************
C.2.38 1473880956 1522686863 ('Gau', 'Nei') ('C.2.Agg03',) ('C.1.118', 'C.1.68') ('Nei',)
C.2.79 1473880956 1522686863 ('Gau', 'Nei') ('C.2.Agg05',) ('C.1.219', 'C.1.68') ('Nei',)
C.2.88 1473880956 1522686863 ('Gau', 'Nei') ('C.2.Agg03',) ('C.1.268', 'C.1.68') ('Nei',)
*************************************************3**************************************************
C.3.31 1473880956 1522686863 ('Gau', 'Nei') ('C.3.Agg05',) ('C.2.79', 'C.2.38') ('Nei',)
C.3.40 1473880956 1522686863 ('Gau', 'Nei') ('C.3.Agg03',) ('C.2.88', 'C.2.38') ('Nei',)
*************************************************4**************************************************
C.4.11 1473880956 1522686863 ('Gau', 'Nei') ('C.4.Agg02',) ('C.3.40', 'C.3.31') ('Nei',)
%% Cell type:code id: tags:
``` python
for i in str(dbs[-1]).split("\n"):
print(i)
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment