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

Add cross-language GenericMap unit tests

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      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

            Hide
            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.

            Show
            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.
            Hide
            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.

            Show
            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.
            Hide
            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].
            Show
            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 ].
            Hide
            krzys Krzysztof Findeisen added a comment -

            Hi Jim Bosch, 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.

            Show
            krzys Krzysztof Findeisen added a comment - Hi Jim Bosch , 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

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

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.