davidcaron / pye57

Read and write e57 point clouds from Python
MIT License
71 stars 41 forks source link

Dependencies: Upgrade Libe57Format to version 3 #50

Closed dancergraham closed 3 months ago

dancergraham commented 9 months ago

Version 3 of Libe57Format removes some of the variables used by this wrapper and the line cls_ImageFile.def("extensionsLookupPrefix", &ImageFile::extensionsLookupPrefix, "prefix"_a, "uri"_a); seems to cause an error

      src/pye57/libe57_wrapper.cpp(478): error C2672: 'pybind11::class_<e57::ImageFile>::def' : fonction correspondante surchargée introuvable
      src/pye57/libe57_wrapper.cpp(478): error C2784: 'pybind11::class_<e57::ImageFile> &pybind11::class_<e57::ImageFile>::def(pybind11::detail::initimpl::pickle_factory<Args...> &&,const Extra &...)' : impossible de déduire l'argument modèle pour 'pybind11::detail::initimpl::pickle_factory<Args...> &&' à partir de 'const char [23]'
dancergraham commented 9 months ago

For some reason commenting out that line seems to allow the library to build correctly. I'm still getting 4 errors, the first one because I have removed all the min and max attributes, the other three because I have removed the format version attributes. These were moved to a separate namespace in version 3


FAILED tests/test_main.py::test_constants - AttributeError: module 'pye57.libe57' has no attribute 'INT8_MIN'
FAILED tests/test_main.py::test_unsupported_point_field - AttributeError: module 'pye57.libe57' has no attribute 'E57_FORMAT_MAJOR'
FAILED tests/test_main.py::test_read_write_single_scan - AttributeError: module 'pye57.libe57' has no attribute 'E57_FORMAT_MAJOR'
FAILED tests/test_main.py::test_copy_file - AttributeError: module 'pye57.libe57' has no attribute 'E57_FORMAT_MAJOR'
dancergraham commented 9 months ago

Making progress... Adding the new header file for the version clears the version number errors but I now get ErrorValueOutOfBounds errors when writing 0.0 as a datetime in all the same tests...

dancergraham commented 9 months ago

Ahh got it... This was because e57 double min is the minimum value but DBL min is the minimum positive value

dancergraham commented 8 months ago

I'm making more progress, I think I just need to fix the return value of variables where the previously used e57 variable type has been removed, e.g.

======================================================================== FAILURES =========================================================================
_____________________________________________________________________ test_constants ______________________________________________________________________

    def test_constants():
        assert libe57.CHECKSUM_POLICY_NONE == 0
        assert libe57.CHECKSUM_POLICY_SPARSE == 25
        assert libe57.CHECKSUM_POLICY_HALF == 50
        assert libe57.CHECKSUM_POLICY_ALL == 100
        assert libe57.E57_INT8_MIN == -128
>       assert libe57.E57_INT8_MAX == 127
E       AssertionError: assert '\x7f' == 127
E        +  where '\x7f' = libe57.E57_INT8_MAX

tests\test_main.py:65: AssertionError
================================================================= short test summary info =================================================================
FAILED tests/test_main.py::test_constants - AssertionError: assert '\x7f' == 127
dancergraham commented 3 months ago

This is now closed ... next step v4!