vigra icon indicating copy to clipboard operation
vigra copied to clipboard

Python argument type mismatch for AxisInfo

Open unidesigner opened this issue 7 years ago • 1 comments

Hi! I tried to compile vigra from the master branch on Ubuntu Linux 16.04 (gcc 5.4.0) and make check yields a traceback:

Traceback` (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File ".../vigra/build2/vigranumpy/test/test1.py", line 42, in <module>
    import vigra
  File ".../vigra/build2/vigranumpy/vigra/__init__.py", line 114, in <module>
    import vigra.arraytypes as arraytypes
  File ".../vigra/build2/vigranumpy/vigra/arraytypes.py", line 104, in <module>
    def newaxis(axisinfo=AxisInfo()):
ArgumentError: Python argument types in
    AxisInfo.__init__(AxisInfo)
did not match C++ signature:
    __init__(_object*, vigra::AxisInfo)
    __init__(_object*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > key='?', vigra::AxisInfo::AxisType typeFlags=vigra.vigranumpycore.AxisType.UnknownAxisType, double resolution=0.0, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > description='')

If I change AxisInfo() to AxisInfo in vigranumpy/lib/arraytypes.py, I get the following traceback:

ERROR: Failure: TypeError (No registered converter was able to produce a C++ rvalue of type std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > from this Python object of type str)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File ".../vigra/build2/vigranumpy/test/test1.py", line 42, in <module>
    import vigra
  File ".../vigra/build2/vigranumpy/vigra/__init__.py", line 115, in <module>
    import vigra.impex as impex
TypeError: No registered converter was able to produce a C++ rvalue of type std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > from this Python object of type str

Any idea of what is going wrong? Thanks!

unidesigner avatar May 10 '17 19:05 unidesigner

Maybe also useful: On branch version-1-11-rc, make check fails with

[ 67%] Linking CXX executable test_multiarray_chunked
Running test_multiarray_chunked
Entering test suite ChunkedMultiArrayTestSuite

Failure in ChunkedMultiArrayTest<Array>::testMultiThreaded()
Unexpected signal: memory access violation

Fatal error - aborting test suite ChunkedMultiArrayTestSuite.

test/multiarray/CMakeFiles/test_multiarray_chunked.dir/build.make:132: recipe for target 'test/multiarray/test_multiarray_chunked' failed

However, after installing I can import vigra in Python and it seems to work fine.

unidesigner avatar May 10 '17 19:05 unidesigner