(
calibration, want_keys=("screen_size", "screen_resolution", "screen_distance")
)
| 9 | |
| 10 | |
| 11 | def _check_calibration( |
| 12 | calibration, want_keys=("screen_size", "screen_resolution", "screen_distance") |
| 13 | ): |
| 14 | missing_keys = [] |
| 15 | for key in want_keys: |
| 16 | if calibration.get(key, None) is None: |
| 17 | missing_keys.append(key) |
| 18 | |
| 19 | if missing_keys: |
| 20 | raise KeyError( |
| 21 | "Calibration object must have the following keys with valid values:" |
| 22 | f" {', '.join(missing_keys)}" |
| 23 | ) |
| 24 | else: |
| 25 | return True |
| 26 | |
| 27 | |
| 28 | def get_screen_visual_angle(calibration): |
no test coverage detected