How do I get the history of a configuration object?

I often want to know who set a configuration parameter. If you just want to know its value then --show config is your friend (you’ll need backslashes \ if you still use [t]csh):

$ runFoo --show config=*apFlux* ...

But if you want to know where it’s set I don’t know a better way than:

  1. Create a file “” containing

    import lsst.pex.config.history as pcHist
    import pdb

  2. Say runFoo -C ...

  3. At the pdb prompt type

    (pdb) print pcHist.format(root.measurement.slots, ‘apFlux’)
    base_CircularApertureFlux_3_0 /Users/rhl/LSST/processFile/bin/ config = ProcessFileConfig()
    /Users/rhl/LSST/processFile/bin/ doc=SingleFrameMeasurementTask.ConfigClass.doc)
    meas/base/ doc="Mapping from algorithms to special aliases in Source."
    meas/base/ doc=“the name of the algorithm used to set the source aperture flux slot”)
    base_CircularApertureFlux_2 /Users/rhl/LSST/processFile/bin/ args = parser.parse_args(namespace=args)
    pex/config/ execfile(filename, {}, local) root.measurement.slots.apFlux = ‘base_CircularApertureFlux_2’

which (in this case) tells me that I set the offending value in line 10

My long-dormant bin/ script has been pushed to branch u/ktlim/configDoc of pex_config. It may help a little in these situations. Caution: it probably repeats code that’s been incorporated into lsst.pex.config.format and may need other cleanups.