Uploaded image for project: 'Request For Comments'
  1. Request For Comments
  2. RFC-717

Rename meas_deblender's python/lsst/meas/deblender/deblend.py



    • Type: RFC
    • Status: Implemented
    • Resolution: Done
    • Component/s: DM
    • Labels:


      meas_deblender contains the file python/lsst/meas/deblender/deblend.py, which defines SourceDeblendTask and SourceDeblendConfig.

      meas_deblender also contains the file python/lsst/meas/deblender/baseline.py, which contains — amongst other things — the function deblend.

      Finally, it contains the file python/lsst/meas/deblender/__init__.py, which does:

      from .baseline import *
      from .deblend import *

      The intention here seems to be to lift the contents of baseline.py into the lsst.meas.deblender namespace. Unfortunately, the deblend() function is shadowed by deblend.py, and so isn't accessible:

      [ins] In [1]: import lsst.meas.deblender                      
      [ins] In [2]: lsst.meas.deblender.deblend                     
      Out[2]: <module 'lsst.meas.deblender.deblend' from '/ssd/swinbank/meas_deblender/python/lsst/meas/deblender/deblend.py'>
      [ins] In [3]: lsst.meas.deblender.baseline.deblend            
      Out[3]: <function lsst.meas.deblender.baseline.deblend ....

      This, in itself, is a fairly minor inconvenience (anybody trying to call lsst.meas.deblender.deblend() has presumably long since given up). However, it means that documentation for deblend() is not accessible to Sphinx using the standard .. automodapi:: lsst.meas.deblender syntax.

      There are a couple of ways to make these docs appear. First, one could add a .. automodapi:: lsst.meas.deblender.baseline. That works, but has the downside that the non-shadowed content of baseline.py now appears in the documentation twice. One could fix that by not lifting baseline into lsst.meas.deblender... but that's an incompatible API change.

      My proposed alternative is to rename deblend.py to sourceDeblendTask.py. This is in-keeping with the spirit (if not quite the letter) of the coding standards.

      Currently, SourceDeblendTask is accessible as both lsst.meas.deblender.SourceDeblendTask and lsst.meas.deblender.deblend.SourceDeblendTask. This change would remove the latter, thereby introducing a backwards-incompatible change to the API. I contend that all reasonable consumers are using the former (a contention which is supported by a brief grep of our existing code), so I expect breakage to be minimal. I therefore suggest that making this change without the normal deprecation period would be appropriate. However, I'd welcome feedback from the community in general and the DM-CCB in particular as to whether they agree.


          Issue Links


            swinbank John Swinbank created issue -
            swinbank John Swinbank made changes -
            Field Original Value New Value
            Status Proposed [ 10805 ] Flagged [ 10606 ]
            swinbank John Swinbank made changes -
            Link This issue relates to DM-15552 [ DM-15552 ]
            gcomoretto Gabriele Comoretto [X] (Inactive) made changes -
            Remote Link This issue links to "Page (Confluence)" [ 25369 ]
            gcomoretto Gabriele Comoretto [X] (Inactive) made changes -
            Status Flagged [ 10606 ] Board Recommended [ 11405 ]
            swinbank John Swinbank made changes -
            Link This issue is triggering DM-26187 [ DM-26187 ]
            swinbank John Swinbank made changes -
            Status Board Recommended [ 11405 ] Adopted [ 10806 ]
            gcomoretto Gabriele Comoretto [X] (Inactive) made changes -
            Remote Link This issue links to "Page (Confluence)" [ 25379 ]
            swinbank John Swinbank made changes -
            Resolution Done [ 10000 ]
            Status Adopted [ 10806 ] Implemented [ 11105 ]


              swinbank John Swinbank
              swinbank John Swinbank
              Fred Moolekamp, John Parejko, John Swinbank, Kian-Tat Lim, Tim Jenness
              0 Vote for this issue
              5 Start watching this issue


                Planned End:


                  No builds found.