Details
-
Type:
RFC
-
Status: Implemented
-
Resolution: Done
-
Component/s: DM
-
Labels:None
Description
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.
You could go a bit further and rename it to _sourceDeblendTask.py to make it even clearer that people aren't supposed to address is directly.