Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: meas_base
-
Labels:
-
Story Points:3
-
Epic Link:
-
Sprint:Science Pipelines DM-W15-1
-
Team:Data Release Production
Description
meas_base currently has a single Swig library (like most packages), defined within a single .i file (like some packages). It also registers all of its plugins in a single python module, plugins.py.
Instead, it should:
- Have two Swig libraries: one for the interfaces and helper classes, and one for plugin algorithms. Most downstream packages will only want to %import (and hence #include) the interface, and having them build against everything slows the build down unnecessarily. The package _init_.py should import all symbols from both libraries, so the change would be transparent to the user.
- Have separate .i files for each algorithm or small group of algorithms. Each of these could %import the interface library file and the pure-Python registry code, and then register the plugins wrapped there within a %pythoncode block. That'd make the implementation of the algorithms a bit less scattered throughout the package, making them easier to maintain and better examples for new plugins.
Jim:
I was not able to find a solution to the SWIG problems I encountered when I tried to put the plugins into a separate swig library from the Results, ResultMappers, and Inputs. So as we talked about on Sunday, I put the plugins in separate .i files but included them in baseLib.i
I also tried the experiment of creating a plugin in a separate module and importing baseLib.i. I found that this will only work if I include a line in the pythoncode in wrapMeasurementAlgorithmEx to do:
from lsst.meas.base import *
The reason is that if CONTROL or INPUT are defined in lsst.meas.base, they are not imported by the outside module swig library and are not found when the pythoncode is executed.
I would like a better solution to this problem, if you have one.