Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-19582

Add cross-language GenericMap unit tests

    XMLWordPrintable

Details

    • Improvement
    • Status: Done
    • Resolution: Done
    • None
    • afw
    • None

    Description

      GenericMap has unit tests in both C++ and Python, but they do not actually pass data between the two languages. It would be helpful to verify that a Python object can be correctly retrieved (as a Storable) in C++, and that objects added from C++ can be modified from Python.

      However, I don't see a way to write such tests without pybind11-wrapping test functions written in C++, so some caution should be taken to ensure the wrappers don't pollute the Python API.

      Attachments

        Issue Links

          Activity

            Adding to AP F19-1, since the review for DM-19575 made me a bit nervous about whether cross-language support actually works as intended.

            krzys Krzysztof Findeisen added a comment - Adding to AP F19-1, since the review for DM-19575 made me a bit nervous about whether cross-language support actually works as intended.

            DummyPsf does not appear in the Doxygen or Sphinx docs, so it's probably a good example of how to handle test wrappers.

            krzys Krzysztof Findeisen added a comment - DummyPsf does not appear in the Doxygen or Sphinx docs, so it's probably a good example of how to handle test wrappers.
            krzys Krzysztof Findeisen added a comment - - edited

            Bugs fixed:

            • Building afw with Scons no longer issues an "ignoring a non-existent file" warning
            • GenericMap's policy on type conversions is now explicitly described in the API docs
            • Python builtin integers are no longer demoted to int, nor Python floats to float, when inserted into a GenericMap (but see DM-21268, below)
            • Storable values (i.e., non-pointers) can now be retrieved from a GenericMap in Python
            • Storage and retrieval of integers in C++ now work consistently across platforms

            Bugs deferred:

            • GenericMap's weakly-typed insert method turns C-strings into bool [DM-21216].
            • GenericMap cannot consistently handle integers and floats from Python, particularly Numpy's explicit-length types [DM-21268].
            • A Python Storable may be prematurely garbage-collected [DM-21314].
            krzys Krzysztof Findeisen added a comment - - edited Bugs fixed: Building afw with Scons no longer issues an "ignoring a non-existent file" warning GenericMap 's policy on type conversions is now explicitly described in the API docs Python builtin integers are no longer demoted to int , nor Python floats to float , when inserted into a GenericMap (but see DM-21268 , below) Storable values (i.e., non-pointers) can now be retrieved from a GenericMap in Python Storage and retrieval of integers in C++ now work consistently across platforms Bugs deferred: GenericMap 's weakly-typed insert method turns C-strings into bool [ DM-21216 ]. GenericMap cannot consistently handle integers and floats from Python, particularly Numpy's explicit-length types [ DM-21268 ]. A Python Storable may be prematurely garbage-collected [ DM-21314 ].

            Hi jbosch, sorry to keep asking you for reviews, but this ticket requires a lot of pybind11 expertise. Would you be willing to look at it? It's 564 lines.

            krzys Krzysztof Findeisen added a comment - Hi jbosch , sorry to keep asking you for reviews, but this ticket requires a lot of pybind11 expertise. Would you be willing to look at it? It's 564 lines.

            People

              krzys Krzysztof Findeisen
              krzys Krzysztof Findeisen
              Jim Bosch
              Jim Bosch, Krzysztof Findeisen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Jenkins

                  No builds found.