LSST Applications g0fba68d861+2e894914a0,g1ec0fe41b4+e220e2fb2f,g1f759649c2+d3ce33c3e0,g1fd858c14a+2b9bf32e51,g35bb328faa+fcb1d3bbc8,g4d2262a081+1dc91b7776,g53246c7159+fcb1d3bbc8,g56a49b3a55+1053ce1741,g60b5630c4e+d3ce33c3e0,g67b6fd64d1+fad15079a7,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g8180f54f50+9253e245c2,g8352419a5c+fcb1d3bbc8,g8852436030+f11a5d3b0b,g89139ef638+fad15079a7,g9125e01d80+fcb1d3bbc8,g94187f82dc+d3ce33c3e0,g989de1cb63+fad15079a7,g9ccd5d7f00+44d9ee3d90,g9d31334357+d3ce33c3e0,g9f33ca652e+9a8c17f5f6,gabe3b4be73+1e0a283bba,gabf8522325+94c30d56e9,gb1101e3267+90933e15fb,gb58c049af0+f03b321e39,gb89ab40317+fad15079a7,gc0af124501+26f6120d90,gcf25f946ba+f11a5d3b0b,gd6cbbdb0b4+8d7f1baacb,gd794735e4e+4bba874dfe,gdb1c4ca869+16879ca1a6,gde0f65d7ad+0609b2c34e,ge278dab8ac+4d6e48c014,ge410e46f29+fad15079a7,gf5e32f922b+fcb1d3bbc8,gf618743f1b+dd10d22602,gf67bdafdda+fad15079a7,w.2025.17
LSST Data Management Base Package
|
Public Member Functions | |
__init__ (self, config, field) | |
types (self) | |
__contains__ (self, k) | |
__len__ (self) | |
__iter__ (self) | |
__getitem__ (self, k, at=None, label="default") | |
__setitem__ (self, k, value, at=None, label="assignment") | |
__setattr__ (self, attr, value, at=None, label="assignment") | |
freeze (self) | |
__reduce__ (self) | |
keys (self) | |
values (self) | |
items (self) | |
__new__ (cls, *args, **kw) | |
setDefaults (self) | |
update (self, **kw) | |
load (self, filename, root="config") | |
loadFromStream (self, stream, root="config", filename=None, extraLocals=None) | |
loadFromString (self, code, root="config", filename=None, extraLocals=None) | |
save (self, filename, root="config") | |
saveToString (self, skipImports=False) | |
saveToStream (self, outfile, root="config", skipImports=False) | |
toDict (self) | |
validate (self) | |
formatHistory (self, name, **kwargs) | |
__delattr__ (self, attr, at=None, label="deletion") | |
__eq__ (self, other) | |
__ne__ (self, other) | |
__str__ (self) | |
__repr__ (self) | |
compare (self, other, shortcut=True, rtol=1e-8, atol=1e-8, output=None) | |
__init_subclass__ (cls, **kwargs) | |
Public Attributes | |
types | |
Protected Member Functions | |
_setSelection (self, value, at=None, label="assignment") | |
_getNames (self) | |
_setNames (self, value) | |
_delNames (self) | |
_getName (self) | |
_setName (self, value) | |
_delName (self) | |
_getActive (self) | |
_rename (self, fullname) | |
_save (self, outfile) | |
_collectImports (self) | |
_fromPython (cls, config_py) | |
Protected Attributes | |
dict | _dict = {} |
_selection = None | |
_config = config | |
_field = field | |
_typemap = None | |
bool | _frozen = True |
_name = name | |
dict | _fields = {} |
_source = getStackFrame() | |
Static Protected Attributes | |
dict | _storage [str, Any] |
dict | _history [str, list[Any]] |
set | _imports [Any] |
Properties | |
names = property(_getNames, _setNames, _delNames) | |
name = property(_getName, _setName, _delName) | |
active = property(_getActive) | |
history = property(lambda x: x._history) | |
Dictionary of instantiated configs, used to populate a `~lsst.pex.config.ConfigChoiceField`. Parameters ---------- config : `lsst.pex.config.Config` A configuration instance. field : `lsst.pex.config.Field`-type A configuration field. Note that the `lsst.pex.config.Field.fieldmap` attribute must provide key-based access to configuration classes, (that is, ``typemap[name]``).
Definition at line 166 of file configChoiceField.py.
lsst.pex.config.configChoiceField.ConfigInstanceDict.__init__ | ( | self, | |
config, | |||
field ) |
Definition at line 180 of file configChoiceField.py.
lsst.pex.config.configChoiceField.ConfigInstanceDict.__contains__ | ( | self, | |
k ) |
Definition at line 194 of file configChoiceField.py.
|
inherited |
|
inherited |
Definition at line 1593 of file config.py.
lsst.pex.config.configChoiceField.ConfigInstanceDict.__getitem__ | ( | self, | |
k, | |||
at = None, | |||
label = "default" ) |
Definition at line 290 of file configChoiceField.py.
|
inherited |
Run initialization for every subclass. Specifically registers the subclass with a YAML representer and YAML constructor (if pyyaml is available)
Definition at line 1662 of file config.py.
lsst.pex.config.configChoiceField.ConfigInstanceDict.__iter__ | ( | self | ) |
Definition at line 200 of file configChoiceField.py.
lsst.pex.config.configChoiceField.ConfigInstanceDict.__len__ | ( | self | ) |
Definition at line 197 of file configChoiceField.py.
|
inherited |
|
inherited |
Allocate a new `lsst.pex.config.Config` object. In order to ensure that all Config object are always in a proper state when handed to users or to derived `~lsst.pex.config.Config` classes, some attributes are handled at allocation time rather than at initialization. This ensures that even if a derived `~lsst.pex.config.Config` class implements ``__init__``, its author does not need to be concerned about when or even the base ``Config.__init__`` should be called.
Definition at line 1025 of file config.py.
lsst.pex.config.configChoiceField.ConfigInstanceDict.__reduce__ | ( | self | ) |
Definition at line 373 of file configChoiceField.py.
|
inherited |
lsst.pex.config.configChoiceField.ConfigInstanceDict.__setattr__ | ( | self, | |
attr, | |||
value, | |||
at = None, | |||
label = "assignment" ) |
Definition at line 341 of file configChoiceField.py.
lsst.pex.config.configChoiceField.ConfigInstanceDict.__setitem__ | ( | self, | |
k, | |||
value, | |||
at = None, | |||
label = "assignment" ) |
Definition at line 307 of file configChoiceField.py.
|
inherited |
|
protectedinherited |
Add module containing self to the list of things to import and then loops over all the fields in the config calling a corresponding collect method. The field method will call _collectImports on any configs it may own and return the set of things to import. This returned set will be merged with the set of imports for this config class.
Reimplemented in lsst.pex.config.configChoiceField.ConfigChoiceField.
Definition at line 1406 of file config.py.
|
protected |
Definition at line 255 of file configChoiceField.py.
|
protected |
Definition at line 234 of file configChoiceField.py.
|
protectedinherited |
Instantiate a `Config`-subclass from serialized Python form. Parameters ---------- config_py : `str` A serialized form of the Config as created by `Config.saveToStream`. Returns ------- config : `Config` Reconstructed `Config` instant.
Definition at line 1676 of file config.py.
|
protected |
Definition at line 274 of file configChoiceField.py.
|
protected |
Definition at line 241 of file configChoiceField.py.
|
protected |
Definition at line 220 of file configChoiceField.py.
|
protected |
Rename this config object in its parent `~lsst.pex.config.Config`. Parameters ---------- name : `str` New name for this config in its parent `~lsst.pex.config.Config`. Notes ----- This method uses the `~lsst.pex.config.Field.rename` method of individual `lsst.pex.config.Field` instances. `lsst.pex.config.Field` subclasses may need to implement a ``rename`` method for *this* method to work. See Also -------- lsst.pex.config.Field.rename
Reimplemented from lsst.pex.config.config.Config.
Definition at line 337 of file configChoiceField.py.
|
protectedinherited |
Save this config to an open stream object. Parameters ---------- outfile : file-like object Destination file object write the config into. Accepts strings not bytes.
Definition at line 1394 of file config.py.
|
protected |
Definition at line 248 of file configChoiceField.py.
|
protected |
Definition at line 227 of file configChoiceField.py.
|
protected |
Definition at line 203 of file configChoiceField.py.
|
inherited |
Compare this configuration to another `~lsst.pex.config.Config` for equality. Parameters ---------- other : `lsst.pex.config.Config` Other `~lsst.pex.config.Config` object to compare against this config. shortcut : `bool`, optional If `True`, return as soon as an inequality is found. Default is `True`. rtol : `float`, optional Relative tolerance for floating point comparisons. atol : `float`, optional Absolute tolerance for floating point comparisons. output : callable, optional A callable that takes a string, used (possibly repeatedly) to report inequalities. Returns ------- isEqual : `bool` `True` when the two `lsst.pex.config.Config` instances are equal. `False` if there is an inequality. See Also -------- lsst.pex.config.compareConfigs Notes ----- Unselected targets of `~lsst.pex.config.RegistryField` fields and unselected choices of `~lsst.pex.config.ConfigChoiceField` fields are not considered by this method. Floating point comparisons are performed by `numpy.allclose`.
Definition at line 1618 of file config.py.
|
inherited |
Format a configuration field's history to a human-readable format. Parameters ---------- name : `str` Name of a `~lsst.pex.config.Field` in this config. **kwargs Keyword arguments passed to `lsst.pex.config.history.format`. Returns ------- history : `str` A string containing the formatted history. See Also -------- lsst.pex.config.history.format
Definition at line 1523 of file config.py.
lsst.pex.config.configChoiceField.ConfigInstanceDict.freeze | ( | self | ) |
Freeze the config. Invoking this freeze method will create a local copy of the field attribute's typemap. This decouples this instance dict from the underlying objects type map ensuring that and subsequent changes to the typemap will not be reflected in this instance (i.e imports adding additional registry entries).
Reimplemented from lsst.pex.config.config.Config.
Reimplemented in lsst.pex.config.configChoiceField.ConfigChoiceField.
Definition at line 361 of file configChoiceField.py.
|
inherited |
Get configurations as ``(field name, field value)`` pairs. Returns ------- items : `~collections.abc.ItemsView` Iterator of tuples for each configuration. Tuple items are: 0. Field name. 1. Field value.
Definition at line 997 of file config.py.
|
inherited |
Get field names. Returns ------- names : `~collections.abc.KeysView` List of `lsst.pex.config.Field` names.
Definition at line 977 of file config.py.
|
inherited |
Modify this config in place by executing the Python code in a configuration file. Parameters ---------- filename : `str` Name of the configuration file. A configuration file is Python module. root : `str`, optional Name of the variable in file that refers to the config being overridden. For example, the value of root is ``"config"`` and the file contains:: config.myField = 5 Then this config's field ``myField`` is set to ``5``. See Also -------- lsst.pex.config.Config.loadFromStream lsst.pex.config.Config.loadFromString lsst.pex.config.Config.save lsst.pex.config.Config.saveToStream lsst.pex.config.Config.saveToString
Definition at line 1142 of file config.py.
|
inherited |
Modify this Config in place by executing the Python code in the provided stream. Parameters ---------- stream : file-like object, `str`, `bytes`, or `~types.CodeType` Stream containing configuration override code. If this is a code object, it should be compiled with ``mode="exec"``. root : `str`, optional Name of the variable in file that refers to the config being overridden. For example, the value of root is ``"config"`` and the file contains:: config.myField = 5 Then this config's field ``myField`` is set to ``5``. filename : `str`, optional Name of the configuration file, or `None` if unknown or contained in the stream. Used for error reporting. extraLocals : `dict` of `str` to `object`, optional Any extra variables to include in local scope when loading. Notes ----- For backwards compatibility reasons, this method accepts strings, bytes and code objects as well as file-like objects. New code should use `loadFromString` instead for most of these types. See Also -------- lsst.pex.config.Config.load lsst.pex.config.Config.loadFromString lsst.pex.config.Config.save lsst.pex.config.Config.saveToStream lsst.pex.config.Config.saveToString
Definition at line 1174 of file config.py.
|
inherited |
Modify this Config in place by executing the Python code in the provided string. Parameters ---------- code : `str`, `bytes`, or `~types.CodeType` Stream containing configuration override code. root : `str`, optional Name of the variable in file that refers to the config being overridden. For example, the value of root is ``"config"`` and the file contains:: config.myField = 5 Then this config's field ``myField`` is set to ``5``. filename : `str`, optional Name of the configuration file, or `None` if unknown or contained in the stream. Used for error reporting. extraLocals : `dict` of `str` to `object`, optional Any extra variables to include in local scope when loading. Raises ------ ValueError Raised if a key in extraLocals is the same value as the value of the root argument. See Also -------- lsst.pex.config.Config.load lsst.pex.config.Config.loadFromStream lsst.pex.config.Config.save lsst.pex.config.Config.saveToStream lsst.pex.config.Config.saveToString
Definition at line 1221 of file config.py.
|
inherited |
Save a Python script to the named file, which, when loaded, reproduces this config. Parameters ---------- filename : `str` Desination filename of this configuration. root : `str`, optional Name to use for the root config variable. The same value must be used when loading (see `lsst.pex.config.Config.load`). See Also -------- lsst.pex.config.Config.saveToStream lsst.pex.config.Config.saveToString lsst.pex.config.Config.load lsst.pex.config.Config.loadFromStream lsst.pex.config.Config.loadFromString
Reimplemented in lsst.pex.config.configChoiceField.ConfigChoiceField.
Definition at line 1277 of file config.py.
|
inherited |
Save a configuration file to a stream, which, when loaded, reproduces this config. Parameters ---------- outfile : file-like object Destination file object write the config into. Accepts strings not bytes. root : `str`, optional Name to use for the root config variable. The same value must be used when loading (see `lsst.pex.config.Config.load`). skipImports : `bool`, optional If `True` then do not include ``import`` statements in output, this is to support human-oriented output from ``pipetask`` where additional clutter is not useful. See Also -------- lsst.pex.config.Config.save lsst.pex.config.Config.saveToString lsst.pex.config.Config.load lsst.pex.config.Config.loadFromStream lsst.pex.config.Config.loadFromString
Definition at line 1339 of file config.py.
|
inherited |
Return the Python script form of this configuration as an executable string. Parameters ---------- skipImports : `bool`, optional If `True` then do not include ``import`` statements in output, this is to support human-oriented output from ``pipetask`` where additional clutter is not useful. Returns ------- code : `str` A code string readable by `loadFromString`. See Also -------- lsst.pex.config.Config.save lsst.pex.config.Config.saveToStream lsst.pex.config.Config.load lsst.pex.config.Config.loadFromStream lsst.pex.config.Config.loadFromString
Definition at line 1311 of file config.py.
|
inherited |
Subclass hook for computing defaults. Notes ----- Derived `~lsst.pex.config.Config` classes that must compute defaults rather than using the `~lsst.pex.config.Field` instances's defaults should do so here. To correctly use inherited defaults, implementations of ``setDefaults`` must call their base class's ``setDefaults``.
Reimplemented in lsst.pipe.tasks.background.MaskObjectsConfig, lsst.pipe.tasks.dataFrameActions._actions.NanoJansky, lsst.ip.diffim.dipoleMeasurement.DipoleMeasurementConfig, lsst.ip.diffim.subtractImages.AlardLuptonSubtractBaseConfig, lsst.ip.isr.ampOffset.AmpOffsetConfig, lsst.meas.algorithms.computeExPsf.ComputeExPsfConfig, lsst.meas.algorithms.measureApCorr.MeasureApCorrConfig, lsst.meas.algorithms.noise_covariance.ComputeNoiseCorrelationConfig, lsst.meas.algorithms.normalizedCalibrationFlux.NormalizedCalibrationFluxConfig, lsst.meas.algorithms.scaleVariance.ScaleVarianceConfig, lsst.meas.base.forcedMeasurement.ForcedMeasurementConfig, lsst.meas.modelfit.cmodel.cmodelContinued.CModelForcedConfig, lsst.meas.modelfit.cmodel.cmodelContinued.CModelSingleFrameConfig, lsst.meas.modelfit.psf.psfContinued.GeneralShapeletPsfApproxForcedConfig, and lsst.meas.modelfit.psf.psfContinued.GeneralShapeletPsfApproxSingleFrameConfig.
Definition at line 1071 of file config.py.
|
inherited |
Make a dictionary of field names and their values. Returns ------- dict_ : `dict` Dictionary with keys that are `~lsst.pex.config.Field` names. Values are `~lsst.pex.config.Field` values. See Also -------- lsst.pex.config.Field.toDict Notes ----- This method uses the `~lsst.pex.config.Field.toDict` method of individual fields. Subclasses of `~lsst.pex.config.Field` may need to implement a ``toDict`` method for *this* method to work.
Reimplemented in lsst.pex.config.configChoiceField.ConfigChoiceField.
Definition at line 1420 of file config.py.
lsst.pex.config.configChoiceField.ConfigInstanceDict.types | ( | self | ) |
Definition at line 191 of file configChoiceField.py.
|
inherited |
Update values of fields specified by the keyword arguments. Parameters ---------- **kw Keywords are configuration field names. Values are configuration field values. Notes ----- The ``__at`` and ``__label`` keyword arguments are special internal keywords. They are used to strip out any internal steps from the history tracebacks of the config. Do not modify these keywords to subvert a `~lsst.pex.config.Config` instance's history. Examples -------- This is a config with three fields: >>> from lsst.pex.config import Config, Field >>> class DemoConfig(Config): ... fieldA = Field(doc="Field A", dtype=int, default=42) ... fieldB = Field(doc="Field B", dtype=bool, default=True) ... fieldC = Field(doc="Field C", dtype=str, default="Hello world") >>> config = DemoConfig() These are the default values of each field: >>> for name, value in config.iteritems(): ... print(f"{name}: {value}") fieldA: 42 fieldB: True fieldC: 'Hello world' Using this method to update ``fieldA`` and ``fieldC``: >>> config.update(fieldA=13, fieldC="Updated!") Now the values of each field are: >>> for name, value in config.iteritems(): ... print(f"{name}: {value}") fieldA: 13 fieldB: True fieldC: 'Updated!'
Definition at line 1084 of file config.py.
|
inherited |
Validate the Config, raising an exception if invalid. Raises ------ lsst.pex.config.FieldValidationError Raised if verification fails. Notes ----- The base class implementation performs type checks on all fields by calling their `~lsst.pex.config.Field.validate` methods. Complex single-field validation can be defined by deriving new Field types. For convenience, some derived `lsst.pex.config.Field`-types (`~lsst.pex.config.ConfigField` and `~lsst.pex.config.ConfigChoiceField`) are defined in ``lsst.pex.config`` that handle recursing into subconfigs. Inter-field relationships should only be checked in derived `~lsst.pex.config.Config` classes after calling this method, and base validation is complete.
Reimplemented in lsst.fgcmcal.sedterms.Sedterm, lsst.pex.config.configChoiceField.ConfigChoiceField, lsst.pex.config.configurableActions.tests.ActionTest1, lsst.pex.config.configurableActions.tests.ActionTest2, lsst.pex.config.configurableActions.tests.ActionTest3, lsst.pex.config.configurableActions.tests.TestDivideAction, lsst.pipe.tasks.background.MaskObjectsConfig, lsst.pipe.tasks.measurementDriver.MeasurementDriverBaseConfig, lsst.afw.geom.transformConfig.RadialTransformConfig, lsst.meas.algorithms.gaussianPsfFactory.GaussianPsfFactory, lsst.meas.algorithms.measureApCorr.MeasureApCorrConfig, lsst.meas.algorithms.treecorrUtils.TreecorrConfig, lsst.meas.base.baseMeasurement.BaseMeasurementConfig, and lsst.meas.base.compensatedGaussian._compensatedTophat.SingleFrameCompensatedTophatFluxConfig.
Definition at line 1497 of file config.py.
|
inherited |
Get field values. Returns ------- values : `~collections.abc.ValuesView` Iterator of field values.
Definition at line 987 of file config.py.
|
protected |
Definition at line 184 of file configChoiceField.py.
|
protected |
Definition at line 182 of file configChoiceField.py.
|
protected |
Definition at line 185 of file configChoiceField.py.
|
protectedinherited |
|
protectedinherited |
|
staticprotectedinherited |
|
staticprotectedinherited |
|
protectedinherited |
|
protected |
Definition at line 183 of file configChoiceField.py.
|
protectedinherited |
|
staticprotectedinherited |
|
protected |
Definition at line 188 of file configChoiceField.py.
lsst.pex.config.configChoiceField.ConfigInstanceDict.types |
Definition at line 198 of file configChoiceField.py.
|
static |
Definition at line 283 of file configChoiceField.py.
|
staticinherited |
|
static |
Definition at line 268 of file configChoiceField.py.
|
static |
Definition at line 262 of file configChoiceField.py.