Skip to content

All tests fails except for the basic one #8

@Hamz-a

Description

@Hamz-a

I wanted to work with the shortest path graph kernel and encountered errors while running the test:

 pykernels git:(master) ✗ python -m unittest tests.shortestpath    
EE
======================================================================
ERROR: testLabeledSPKernel (tests.shortestpath.TestShortestPath)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/shortestpath.py", line 39, in testLabeledSPKernel
    self.assertTrue((K.gram(data)==self.answers_labeled[i]).all())
  File "pykernels/base.py", line 32, in gram
    return self._compute(data, data)
  File "pykernels/graph/shortestpath.py", line 100, in _compute
    labels_1, numlabels)
  File "pykernels/graph/shortestpath.py", line 67, in _create_accum_list_labeled
    max_lab - min_lab
ValueError: operands could not be broadcast together with shapes (10,10,10) (10,10,100) 

======================================================================
ERROR: testSPKernel (tests.shortestpath.TestShortestPath)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/shortestpath.py", line 32, in testSPKernel
    self.assertTrue((K.gram(data)==self.answers_unlabeled[i]).all())
  File "pykernels/base.py", line 32, in gram
    return self._compute(data, data)
  File "pykernels/graph/shortestpath.py", line 94, in _compute
    accum_list_1 = self._create_accum_list(sp_1, maxpath)
  File "pykernels/graph/shortestpath.py", line 83, in _create_accum_list
    accum[:ind.max() + 1] += np.bincount(ind.astype(int))
ValueError: object too deep for desired array

----------------------------------------------------------------------
Ran 2 tests in 3.157s

FAILED (errors=2)

Then I noticed that all other tests failed as well except for the test written in basic.py. I've tried to debug the errors but couldn't solve it. Not sure if there's something wrong with the test data, the test or the actual code?

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