Parse an explicit target weight expressed as a 0-1 decimal.
(value: Any)
| 1347 | |
| 1348 | |
| 1349 | def parse_weight_target(value: Any) -> Optional[float]: |
| 1350 | """Parse an explicit target weight expressed as a 0-1 decimal.""" |
| 1351 | raw = str(value or "").strip() |
| 1352 | if not raw: |
| 1353 | return None |
| 1354 | try: |
| 1355 | parsed = float(raw) |
| 1356 | except ValueError: |
| 1357 | return None |
| 1358 | if 0.0 <= parsed <= 1.0: |
| 1359 | return parsed |
| 1360 | return None |
| 1361 | |
| 1362 | |
| 1363 | def build_profile_update_result( |
no outgoing calls
no test coverage detected