Fail if a value in the components dict is not a real number or None.
(compdict: Mapping[Any, Any])
| 50 | return {convert(k): v for k, v in compdict.items()} |
| 51 | |
| 52 | def _validate_values(compdict: Mapping[Any, Any]) -> None: |
| 53 | """Fail if a value in the components dict is not a real number or None.""" |
| 54 | for name, value in compdict.items(): |
| 55 | if value is not None and not isinstance(value, numbers.Real): |
| 56 | raise ValueError( |
| 57 | f"Invalid value {value} for component {name}, " |
| 58 | "please provide a real number or None instead" |
| 59 | ) |
| 60 | |
| 61 | _validate_values(compdict) |
| 62 | compdict = without_none_values(_map_keys(compdict)) |
no test coverage detected