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

Cleanup pybind11 remaining code

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Story Points:
      4
    • Sprint:
      DRP S17-4, DRP S17-5
    • Team:
      Data Release Production

      Description

      Use the checklist from DM-9182 to clean up code in all packages not covered by DM-9182 or DM-9188. Most work will probably be ip_diffim and meas_modelfit, as most other packages have relatively little wrapped C++.

        Attachments

          Issue Links

            Activity

            No builds found.
            jbosch Jim Bosch created issue -
            jbosch Jim Bosch made changes -
            Field Original Value New Value
            Epic Link DM-7717 [ 26925 ]
            jbosch Jim Bosch made changes -
            Link This issue is triggered by DM-9063 [ DM-9063 ]
            jbosch Jim Bosch made changes -
            Link This issue is blocked by DM-9099 [ DM-9099 ]
            jbosch Jim Bosch made changes -
            Link This issue blocks DM-9100 [ DM-9100 ]
            swinbank John Swinbank made changes -
            Assignee Jim Bosch [ jbosch ] Pim Schellart [ pschella ]
            swinbank John Swinbank made changes -
            Sprint DRP S17-3 [ 360 ] DRP S17-4 [ 363 ]
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment - - edited

            shapelet
            pex_logging
            pex_config (maybe test file)
            obs_subaru
            meas_extensions_simpleShape
            meas_extensions_shapeHSM
            meas_extensions_psfex
            meas_extensions_photometryKron
            meas_base
            ip_isr (include ordering)
            ip_diffim
            display_ds9
            coadd_utils
            coadd_chisquared
            base

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - - edited shapelet pex_logging pex_config (maybe test file) obs_subaru meas_extensions_simpleShape meas_extensions_shapeHSM meas_extensions_psfex meas_extensions_photometryKron meas_base ip_isr (include ordering) ip_diffim display_ds9 coadd_utils coadd_chisquared base
            pschella Pim Schellart [X] (Inactive) made changes -
            Epic Link DM-7717 [ 26925 ] DM-9155 [ 29718 ]
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            Moved to post-merge.

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - Moved to post-merge.
            pschella Pim Schellart [X] (Inactive) made changes -
            Status To Do [ 10001 ] In Progress [ 3 ]
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            shapelet done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - shapelet done
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            pex_logging done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - pex_logging done
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            obs_subaru done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - obs_subaru done
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            meas_extensions_simpleShape done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - meas_extensions_simpleShape done
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            meas_extensions_shapeHSM done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - meas_extensions_shapeHSM done
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            meas_extensions_psfex done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - meas_extensions_psfex done
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            meas_extensions_photometryKron done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - meas_extensions_photometryKron done
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment - - edited

            meas_base done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - - edited meas_base done
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            ip_isr done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - ip_isr done
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            display_ds9 done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - display_ds9 done
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            coadd_utils done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - coadd_utils done
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            coadd_chisquared done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - coadd_chisquared done
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            base done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - base done
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            ip_diffim done

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - ip_diffim done
            pschella Pim Schellart [X] (Inactive) made changes -
            Reviewers Russell Owen [ rowen ]
            Status In Progress [ 3 ] In Review [ 10004 ]
            Hide
            rowen Russell Owen added a comment -

            It looks to me as if you have not yet tackled import statements. I hope that can be part of this ticket. Do you need help with it?

            Also display_ds9 appears to be missing a .cc wrapper file (I hope you just forgot to push it after renaming it from `_xpa.cc` to `xpa.cc`).

            Show
            rowen Russell Owen added a comment - It looks to me as if you have not yet tackled import statements. I hope that can be part of this ticket. Do you need help with it? Also display_ds9 appears to be missing a .cc wrapper file (I hope you just forgot to push it after renaming it from `_xpa.cc` to `xpa.cc`).
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            I indeed left out the import statements. However, due to DM-9786 it seems likely that we will not need them (or at least not for cross imports). The reason is that we will likely switch to single (fat) modules to reduce the total build size (any further discussion on this point on that ticket please).

            I added the renamed file back as requested.

            Thanks!

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - I indeed left out the import statements. However, due to DM-9786 it seems likely that we will not need them (or at least not for cross imports). The reason is that we will likely switch to single (fat) modules to reduce the total build size (any further discussion on this point on that ticket please). I added the renamed file back as requested. Thanks!
            Hide
            rowen Russell Owen added a comment -

            OK. I'll accept that argument about imports, but even if we combine things we still need to import packages required by the pybind11 wrappers, for safety – whether that is done in __init__.py files or as pybind11 import statements. What shall we do about those imports? We must use pybind11 imports for pure pybind11 extensions that are intended to be usable standalone by code that is part of the same product. We can put the imports into __init__.py in other cases and I slightly lean towards that for simplicity (it makes them easier to find and modify). On the other hand putting imports in wrappers arguably gives cleaner encapsulation. Do Jim Bosch, Krzysztof Findeisen or Fred Moolekamp have an opinion?

            Show
            rowen Russell Owen added a comment - OK. I'll accept that argument about imports, but even if we combine things we still need to import packages required by the pybind11 wrappers, for safety – whether that is done in __init__.py files or as pybind11 import statements. What shall we do about those imports? We must use pybind11 imports for pure pybind11 extensions that are intended to be usable standalone by code that is part of the same product. We can put the imports into __init__.py in other cases and I slightly lean towards that for simplicity (it makes them easier to find and modify). On the other hand putting imports in wrappers arguably gives cleaner encapsulation. Do Jim Bosch , Krzysztof Findeisen or Fred Moolekamp have an opinion?
            Hide
            jbosch Jim Bosch added a comment -

            I still think they ought to go in the pybind11 files. But won't need nearly as many of them once we merge things into larger modules, because all of the intra-package dependencies will already be accounted for.

            Show
            jbosch Jim Bosch added a comment - I still think they ought to go in the pybind11 files. But won't need nearly as many of them once we merge things into larger modules, because all of the intra-package dependencies will already be accounted for.
            Hide
            rowen Russell Owen added a comment -

            My understanding is that this cleanup pass is an intermediate stage: the final stage will be to mostly combined the small wrappers into larger wrappers. That is stated as the justification for not having pybind11 import statements in the wrappers. But I am not very happy about this. I would much have this code be correct, with the imports in place so that the modules are self-contained, as we expect them to be. That way we can take our time about the final cleanup pass.

            But even if we do decide to go for a quick and dirty solution for imports, for now, something needs to be done because as far as I can see many imports packages are not being imported anywhere, not even the __init__.py files. This makes the code needlessly fragile.

            I'll put this back into In Progress.

            Show
            rowen Russell Owen added a comment - My understanding is that this cleanup pass is an intermediate stage: the final stage will be to mostly combined the small wrappers into larger wrappers. That is stated as the justification for not having pybind11 import statements in the wrappers. But I am not very happy about this. I would much have this code be correct, with the imports in place so that the modules are self-contained, as we expect them to be. That way we can take our time about the final cleanup pass. But even if we do decide to go for a quick and dirty solution for imports, for now, something needs to be done because as far as I can see many imports packages are not being imported anywhere, not even the __init__.py files. This makes the code needlessly fragile. I'll put this back into In Progress.
            rowen Russell Owen made changes -
            Status In Review [ 10004 ] In Progress [ 3 ]
            pschella Pim Schellart [X] (Inactive) made changes -
            Story Points 2 4
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            I added py::module::import statements for all cross package imports that were explicitly needed. Furthermore I changed all from __future__ import lines to the standard as requested.
            Finally I verified the build on Jenkins and fixed some minor issues here and there.
            Ready for second review.

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - I added py::module::import statements for all cross package imports that were explicitly needed. Furthermore I changed all from __future__ import lines to the standard as requested. Finally I verified the build on Jenkins and fixed some minor issues here and there. Ready for second review.
            pschella Pim Schellart [X] (Inactive) made changes -
            Status In Progress [ 3 ] In Review [ 10004 ]
            Hide
            rowen Russell Owen added a comment -

            Overall this looks great. Many of the packages can be merged with no changes. However, there are still a few missing imports in some packages and I found one or two other things.

            Show
            rowen Russell Owen added a comment - Overall this looks great. Many of the packages can be merged with no changes. However, there are still a few missing imports in some packages and I found one or two other things.
            rowen Russell Owen made changes -
            Status In Review [ 10004 ] Reviewed [ 10101 ]
            swinbank John Swinbank made changes -
            Sprint DRP S17-4 [ 363 ] DRP S17-4, DRP S17-5 [ 363, 364 ]
            swinbank John Swinbank made changes -
            Rank Ranked higher
            Hide
            pschella Pim Schellart [X] (Inactive) added a comment -

            Merged after implementing comments and CI.
            Thanks for the review!

            Show
            pschella Pim Schellart [X] (Inactive) added a comment - Merged after implementing comments and CI. Thanks for the review!
            pschella Pim Schellart [X] (Inactive) made changes -
            Resolution Done [ 10000 ]
            Status Reviewed [ 10101 ] Done [ 10002 ]
            swinbank John Swinbank made changes -
            Epic Link DM-9155 [ 29718 ] DM-10383 [ 32102 ]

              People

              Assignee:
              pschella Pim Schellart [X] (Inactive)
              Reporter:
              jbosch Jim Bosch
              Reviewers:
              Russell Owen
              Watchers:
              Jim Bosch, Pim Schellart [X] (Inactive), Russell Owen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.