LSSTApplications
18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
|
Functions | |
def | getComparisonName (name1, name2) |
def | compareScalars (name, v1, v2, output, rtol=1E-8, atol=1E-8, dtype=None) |
def | compareConfigs (name, c1, c2, shortcut=True, rtol=1E-8, atol=1E-8, output=None) |
def pex.config.comparison.compareConfigs | ( | name, | |
c1, | |||
c2, | |||
shortcut = True , |
|||
rtol = 1E-8 , |
|||
atol = 1E-8 , |
|||
output = None |
|||
) |
Compare two `lsst.pex.config.Config` instances for equality. This function is a helper for `lsst.pex.config.Config.compare`. Parameters ---------- name : `str` Name to use when reporting differences, typically created by `getComparisonName`. v1 : `lsst.pex.config.Config` Left-hand side config to compare. v2 : `lsst.pex.config.Config` Right-hand side config to compare. 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. For example: `print`. Returns ------- areEqual : `bool` `True` when the two `lsst.pex.config.Config` instances are equal. `False` if there is an inequality. See also -------- lsst.pex.config.compareScalars Notes ----- Floating point comparisons are performed by `numpy.allclose`. If ``c1`` or ``c2`` contain `~lsst.pex.config.RegistryField` or `~lsst.pex.config.ConfigChoiceField` instances, *unselected* `~lsst.pex.config.Config` instances will not be compared.
Definition at line 111 of file comparison.py.
def pex.config.comparison.compareScalars | ( | name, | |
v1, | |||
v2, | |||
output, | |||
rtol = 1E-8 , |
|||
atol = 1E-8 , |
|||
dtype = None |
|||
) |
Compare two scalar values for equality. This function is a helper for `lsst.pex.config.Config.compare`. Parameters ---------- name : `str` Name to use when reporting differences, typically created by `getComparisonName`. v1 : object Left-hand side value to compare. v2 : object Right-hand side value to compare. output : callable or `None` A callable that takes a string, used (possibly repeatedly) to report inequalities (for example, `print`). Set to `None` to disable output. rtol : `float`, optional Relative tolerance for floating point comparisons. atol : `float`, optional Absolute tolerance for floating point comparisons. dtype : class, optional Data type of values for comparison. May be `None` if values are not floating-point. Returns ------- areEqual : `bool` `True` if the values are equal, `False` if they are not. See also -------- lsst.pex.config.compareConfigs Notes ----- Floating point comparisons are performed by `numpy.allclose`.
Definition at line 62 of file comparison.py.
def pex.config.comparison.getComparisonName | ( | name1, | |
name2 | |||
) |
Create a comparison name that is used for printed output of comparisons. Parameters ---------- name1 : `str` Name of the first configuration. name2 : `str` Name of the second configuration. Returns ------- name : `str` When ``name1`` and ``name2`` are equal, the returned name is simply one of the names. When they are different the returned name is formatted as ``"{name1} / {name2}"``.
Definition at line 40 of file comparison.py.