compareScalars

lsst.pex.config.compareScalars(name, v1, v2, output, rtol=1e-08, atol=1e-08, 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.

Notes

Floating point comparisons are performed by numpy.allclose.