Float (or float-sequence) comparison within tolerance. Used where float32 round-trip through mitk.Color loses precision relative to the double-precision Python input.
(a, b, tol=1e-6)
| 23 | |
| 24 | |
| 25 | def _close(a, b, tol=1e-6): |
| 26 | """Float (or float-sequence) comparison within tolerance. |
| 27 | |
| 28 | Used where float32 round-trip through mitk.Color loses precision |
| 29 | relative to the double-precision Python input. |
| 30 | """ |
| 31 | if isinstance(a, (list, tuple)): |
| 32 | return len(a) == len(b) and all(abs(x - y) <= tol for x, y in zip(a, b)) |
| 33 | return abs(a - b) <= tol |
| 34 | |
| 35 | |
| 36 | class TestPropertyNotOwnedError: |
no outgoing calls
no test coverage detected