Skip to content

Nosetests failures, mainly to do with Booleans and float64 #138

@neildhir

Description

@neildhir

Currently getting this when running nosetests having dealt with the interp1q to interp1 issue.

user:~/GaitAnalysisToolKit$ nosetests
............./usr/lib/python2.7/unittest/case.py:393: FutureWarning: get_store is deprecated and be removed in a future version
HDFStore(path, **kwargs) is the replacement
  return self.run(*args, **kwds)
/usr/lib/python2.7/unittest/case.py:329: FutureWarning: get_store is deprecated and be removed in a future version
HDFStore(path, **kwargs) is the replacement
  testMethod()
..E.....EE..E.E...E.E......F......E.....
======================================================================
ERROR: gaitanalysis.tests.test_gait.test_find_constant_speed
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/tests/test_gait.py", line 35, in test_find_constant_speed
    indice, constant_speed_time = find_constant_speed(time, speed, plot=False)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/gait.py", line 78, in find_constant_speed
    return len(time) - (new_indice), time[len(time) - new_indice]
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

======================================================================
ERROR: gaitanalysis.tests.test_motek.TestDFlowData.test_clean_data
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/tests/test_motek.py", line 1121, in test_clean_data
    data.clean_data(ignore_hbm=True)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 1472, in clean_data
    df = self._identify_missing_markers(df)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 826, in _identify_missing_markers
    data_frame = identifier.identify(columns=self.marker_column_labels)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 173, in identify
    self.data_frame[are_constant] = np.nan
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2328, in __setitem__
    self._setitem_frame(key, value)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2366, in _setitem_frame
    self._where(-key, value, inplace=True)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/generic.py", line 5098, in _where
    raise ValueError(msg.format(dtype=dt))
ValueError: Boolean array expected for the condition, not float64

======================================================================
ERROR: gaitanalysis.tests.test_motek.TestDFlowData.test_clean_data_options
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/tests/test_motek.py", line 1236, in test_clean_data_options
    data.clean_data()
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 1472, in clean_data
    df = self._identify_missing_markers(df)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 826, in _identify_missing_markers
    data_frame = identifier.identify(columns=self.marker_column_labels)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 173, in identify
    self.data_frame[are_constant] = np.nan
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2328, in __setitem__
    self._setitem_frame(key, value)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2366, in _setitem_frame
    self._where(-key, value, inplace=True)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/generic.py", line 5098, in _where
    raise ValueError(msg.format(dtype=dt))
ValueError: Boolean array expected for the condition, not float64

======================================================================
ERROR: gaitanalysis.tests.test_motek.TestDFlowData.test_express
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/tests/test_motek.py", line 1072, in test_express
    data.clean_data()
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 1472, in clean_data
    df = self._identify_missing_markers(df)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 826, in _identify_missing_markers
    data_frame = identifier.identify(columns=self.marker_column_labels)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 173, in identify
    self.data_frame[are_constant] = np.nan
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2328, in __setitem__
    self._setitem_frame(key, value)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2366, in _setitem_frame
    self._where(-key, value, inplace=True)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/generic.py", line 5098, in _where
    raise ValueError(msg.format(dtype=dt))
ValueError: Boolean array expected for the condition, not float64

======================================================================
ERROR: gaitanalysis.tests.test_motek.TestDFlowData.test_extract_processed_data
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/tests/test_motek.py", line 1271, in test_extract_processed_data
    dflow_data.clean_data()
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 1472, in clean_data
    df = self._identify_missing_markers(df)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 826, in _identify_missing_markers
    data_frame = identifier.identify(columns=self.marker_column_labels)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 173, in identify
    self.data_frame[are_constant] = np.nan
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2328, in __setitem__
    self._setitem_frame(key, value)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2366, in _setitem_frame
    self._where(-key, value, inplace=True)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/generic.py", line 5098, in _where
    raise ValueError(msg.format(dtype=dt))
ValueError: Boolean array expected for the condition, not float64

======================================================================
ERROR: gaitanalysis.tests.test_motek.TestDFlowData.test_identify_missing_markers
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/tests/test_motek.py", line 892, in test_identify_missing_markers
    identified = dflow_data._identify_missing_markers(data_frame)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 826, in _identify_missing_markers
    data_frame = identifier.identify(columns=self.marker_column_labels)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 173, in identify
    self.data_frame[are_constant] = np.nan
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2328, in __setitem__
    self._setitem_frame(key, value)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2366, in _setitem_frame
    self._where(-key, value, inplace=True)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/generic.py", line 5098, in _where
    raise ValueError(msg.format(dtype=dt))
ValueError: Boolean array expected for the condition, not float64

======================================================================
ERROR: gaitanalysis.tests.test_motek.TestDFlowData.test_interpolate_missing_markers
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/tests/test_motek.py", line 912, in test_interpolate_missing_markers
    identified = dflow_data._identify_missing_markers(df)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 826, in _identify_missing_markers
    data_frame = identifier.identify(columns=self.marker_column_labels)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 173, in identify
    self.data_frame[are_constant] = np.nan
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2328, in __setitem__
    self._setitem_frame(key, value)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2366, in _setitem_frame
    self._where(-key, value, inplace=True)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/generic.py", line 5098, in _where
    raise ValueError(msg.format(dtype=dt))
ValueError: Boolean array expected for the condition, not float64

======================================================================
ERROR: gaitanalysis.tests.test_motek.TestMissingMarkerIdentfier.test_identify
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/tests/test_motek.py", line 112, in test_identify
    identified = identifier.identify(columns=marker_columns)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/motek.py", line 173, in identify
    self.data_frame[are_constant] = np.nan
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2328, in __setitem__
    self._setitem_frame(key, value)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 2366, in _setitem_frame
    self._where(-key, value, inplace=True)
  File "/usr/local/lib/python2.7/dist-packages/pandas/core/generic.py", line 5098, in _where
    raise ValueError(msg.format(dtype=dt))
ValueError: Boolean array expected for the condition, not float64

======================================================================
FAIL: gaitanalysis.tests.test_motek.TestDFlowData.test_orient_accelerometers
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/user/cloud/GaitAnalysisToolKit/gaitanalysis/tests/test_motek.py", line 1062, in test_orient_accelerometers
    -relabeled_data['Back_Left_AccY'])
  File "/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 1395, in assert_allclose
    verbose=verbose, header=header, equal_nan=equal_nan)
  File "/usr/local/lib/python2.7/dist-packages/numpy/testing/utils.py", line 778, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Not equal to tolerance rtol=1e-07, atol=0

(mismatch 100.0%)
 x: array([ 0.,  0.,  0., ...,  0.,  0.,  0.])
 y: array([ 0.095853,  0.085894,  0.075927, ..., -0.859578, -0.864645,
       -0.869626])

----------------------------------------------------------------------
Ran 53 tests in 22.233s

FAILED (errors=8, failures=1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions