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

Revisit wrapping C++ Control objects into Python Config objects.

    XMLWordPrintable

    Details

    • Type: Story
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: pex_config
    • Labels:
      None

      Description

      With the adoption of pybind11, we may now be able to clean up the magic that translates of C++ control objects to Python config objects. It will probably have to remain complex, but it might be able to work much better for users.

      I'm making this a DRP ticket because I think it will require significant pybind11 expertise. If some other team clearly owns pex_config it could be moved.

        Attachments

          Issue Links

            Activity

            Hide
            swinbank John Swinbank added a comment -

            DAX owns pex_config. CCing Fritz Mueller.

            Show
            swinbank John Swinbank added a comment - DAX owns pex_config. CCing Fritz Mueller .
            Hide
            jbosch Jim Bosch added a comment - - edited

            While wrapping meas_modelfit with pybind11 I was reminded how subtly fragile a lot of this stuff is; there are a lot of imports and some inspect calls to determine where a class should be imported from that just don't work very well, and the fact that these all tend to run at import time can make them very difficult to debug. That was all true under Swig, too, but the restructuring of Python modules we're doing in the pybind11 conversion upset the fragile balance in meas_modelfit and getting it working again was a pain. That package should probably be used to derived requirements for what the wrapping stuff should be able to do - the rest of the stack really doesn't exercise the hard cases (certainly the unit tests do not).

            Show
            jbosch Jim Bosch added a comment - - edited While wrapping meas_modelfit with pybind11 I was reminded how subtly fragile a lot of this stuff is; there are a lot of imports and some inspect calls to determine where a class should be imported from that just don't work very well, and the fact that these all tend to run at import time can make them very difficult to debug. That was all true under Swig, too, but the restructuring of Python modules we're doing in the pybind11 conversion upset the fragile balance in meas_modelfit and getting it working again was a pain. That package should probably be used to derived requirements for what the wrapping stuff should be able to do - the rest of the stack really doesn't exercise the hard cases (certainly the unit tests do not).
            Hide
            jbosch Jim Bosch added a comment -

            Another note: we should try to provide a C++ interface for creating Config objects from Control objects (which would probably have to import some pure-Python code, as the exceptions translation stuff does). Right now the need to declare config objects is a major reason we have to add pure-Python accompaniment to wrapper code in meas_modelfit (and the same is probably true in meas_base, though I haven't looked).

            Show
            jbosch Jim Bosch added a comment - Another note: we should try to provide a C++ interface for creating Config objects from Control objects (which would probably have to import some pure-Python code, as the exceptions translation stuff does). Right now the need to declare config objects is a major reason we have to add pure-Python accompaniment to wrapper code in meas_modelfit (and the same is probably true in meas_base, though I haven't looked).
            Hide
            jbosch Jim Bosch added a comment -

            And another note: we should update the macros to include setting the default, since we can now do that in C++11.

            Show
            jbosch Jim Bosch added a comment - And another note: we should update the macros to include setting the default, since we can now do that in C++11.
            Hide
            swinbank John Swinbank added a comment -

            Reviewed for DM-CCB, 2020-09-21. I'm not aware of any changes here.

            Show
            swinbank John Swinbank added a comment - Reviewed for DM-CCB, 2020-09-21. I'm not aware of any changes here.

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jbosch Jim Bosch
              Watchers:
              Fritz Mueller, Jim Bosch, John Swinbank
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Jenkins

                  No builds found.