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
.- v1object
Left-hand side value to compare.
- v2object
Right-hand side value to compare.
- outputcallable or
None
A callable that takes a string, used (possibly repeatedly) to report inequalities (for example,
print
). Set toNone
to disable output.- rtol
float
, optional Relative tolerance for floating point comparisons.
- atol
float
, optional Absolute tolerance for floating point comparisons.
- dtypeclass, optional
Data type of values for comparison. May be
None
if values are not floating-point.
- name
- Returns:
See also
Notes
Floating point comparisons are performed by
numpy.allclose
.