Failed test
Opened this issue · 0 comments
doncarlos999 commented
Hi there,
Thank you for producing this tool but I am having problems running the test code.
ubuntu@ip-172-31-92-187:~/dsnickfury/dependencies/elevation$ ~/dsnickfury/dependencies/anaconda2/bin/python -m pytest tests
============================================================================= test session starts ==============================================================================
platform linux2 -- Python 2.7.15, pytest-3.8.0, py-1.6.0, pluggy-0.7.1
rootdir: /home/ubuntu/dsnickfury/dependencies/elevation, inifile:
collected 5 items
tests/predict_test.py .FFs [ 80%]
tests/settings_test.py . [100%]
=================================================================================== FAILURES ===================================================================================
_________________________________________________________________________ PredictTest.test_agg_nicolo __________________________________________________________________________
self = <tests.predict_test.PredictTest testMethod=test_agg_nicolo>
def test_agg_nicolo(self):
import pickle
from elevation import settings
from elevation import aggregation
with open(settings.agg_nicolo_fixture_file, "r") as fh:
> nicolo_results = pickle.load(fh)
tests/predict_test.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../anaconda2/lib/python2.7/pickle.py:1384: in load
return Unpickler(file).load()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pickle.Unpickler instance at 0x7f43ed160758>
def load(self):
"""Read a pickled object representation from the open file.
Return the reconstituted object hierarchy specified in the file.
"""
self.mark = object() # any new unique object
self.stack = []
self.append = self.stack.append
read = self.read
dispatch = self.dispatch
try:
while 1:
key = read(1)
> dispatch[key](self)
E KeyError: 'v'
../anaconda2/lib/python2.7/pickle.py:864: KeyError
_________________________________________________________________________ PredictTest.test_predict_hmg _________________________________________________________________________
self = <tests.predict_test.PredictTest testMethod=test_predict_hmg>
def test_predict_hmg(self):
sys.stdout = sys.__stdout__
import elevation.load_data
from elevation import settings, options
from elevation.cmds import predict
hmg = predict.Predict(init_models=False).get_hmg_data()
wildtype = list(hmg['30mer'])[:settings.pred_test_num]
offtarget = list(hmg['30mer_mut'])[:settings.pred_test_num]
> predictions = predict.Predict().execute(wildtype, offtarget)
tests/predict_test.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
elevation/cmds/predict.py:69: in execute
nb_pred, individual_mut_pred = elevation.prediction_pipeline.predict(self.base_model, df, self.learn_options)
elevation/prediction_pipeline.py:181: in predict
predictions, model, learn_options, _tmpdata, feature_names, all_predictions_ind = predict_elevation(data=data, model=(model, learn_options), model_file=None, pam_audit=False, learn_options_override=learn_options_override,force_zero_intercept=False, naive_bayes_combine=True, verbose=verbose)
elevation/model_comparison.py:691: in predict_elevation
pred, nb_pred, feature_names = j.get()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <multiprocessing.pool.ApplyResult object at 0x7f43de04a950>, timeout = None
def get(self, timeout=None):
self.wait(timeout)
if not self._ready:
raise TimeoutError
if self._success:
return self._value
else:
> raise self._value
E ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
../anaconda2/lib/python2.7/multiprocessing/pool.py:572: ValueError
----------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------
from get_or_compute reading cached pickle /home/ubuntu/dsnickfury/dependencies/elevation/tmp/hmg_data.pkl
from get_or_compute reading cached pickle /home/ubuntu/dsnickfury/dependencies/elevation/tmp/base_model.pkl
from get_or_compute reading cached pickle /home/ubuntu/dsnickfury/dependencies/elevation/tmp/guideseq_data.pkl
from get_or_compute reading cached pickle /home/ubuntu/dsnickfury/dependencies/elevation/tmp/gspred.pkl
from get_or_compute reading cached pickle /home/ubuntu/dsnickfury/dependencies/elevation/tmp/cd33.pkl
from get_or_compute reading cached pickle /home/ubuntu/dsnickfury/dependencies/elevation/tmp/calibration_models.pkl
Time spent loading pickles: 24.1075861454
Time spent parsing input: 0.0105500221252
predict_elevation allocating 28 cores
start_range=0, end_range=999
predict_elevation: 0.00 perc. done (0 of 1000 using block_size=10000)
annot
=============================================================================== warnings summary ===============================================================================
/home/ubuntu/dsnickfury/dependencies/anaconda2/lib/python2.7/site-packages/pandas/util/testing.py:22: DeprecationWarning: Importing from numpy.testing.decorators is deprecated, import from numpy.testing instead.
from numpy.testing.decorators import slow # noqa
/home/ubuntu/dsnickfury/dependencies/anaconda2/lib/python2.7/site-packages/pandas/util/nosetester.py:13: DeprecationWarning: Importing from numpy.testing.nosetester is deprecated, import from numpy.testing instead.
from numpy.testing import nosetester
/home/ubuntu/dsnickfury/dependencies/anaconda2/lib/python2.7/site-packages/sklearn/cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
/home/ubuntu/dsnickfury/dependencies/anaconda2/lib/python2.7/site-packages/sklearn/ensemble/weight_boosting.py:29: DeprecationWarning: numpy.core.umath_tests is an internal NumPy module and should not be imported. It will be removed in a future NumPy release.
from numpy.core.umath_tests import inner1d
/home/ubuntu/dsnickfury/dependencies/anaconda2/lib/python2.7/site-packages/sklearn/grid_search.py:43: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. This module will be removed in 0.20.
DeprecationWarning)
/home/ubuntu/dsnickfury/dependencies/anaconda2/lib/python2.7/site-packages/sklearn/isotonic.py:13: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 80
from ._isotonic import _inplace_contiguous_isotonic_regression, _make_unique
/home/ubuntu/dsnickfury/dependencies/anaconda2/lib/python2.7/site-packages/sklearn/isotonic.py:13: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192, got 144
from ._isotonic import _inplace_contiguous_isotonic_regression, _make_unique
/home/ubuntu/dsnickfury/dependencies/elevation/elevation/prediction_pipeline.py:28: DeprecationWarning: The 'cachedir' parameter has been deprecated in version 0.12 and will be removed in version 0.14.
You provided "cachedir='/home/ubuntu/dsnickfury/dependencies/elevation/cache'", use "location='/home/ubuntu/dsnickfury/dependencies/elevation/cache'" instead.
memory = Memory(cachedir=settings.cachedir, verbose=0)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
========================================================== 2 failed, 2 passed, 1 skipped, 8 warnings in 26.92 seconds ==========================================================
Any help working out the issue would be greatly appreciated.