MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / parse_weight_target

Function parse_weight_target

agents/master-coordinator/main.py:1349–1360  ·  view source on GitHub ↗

Parse an explicit target weight expressed as a 0-1 decimal.

(value: Any)

Source from the content-addressed store, hash-verified

1347
1348
1349def 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
1363def build_profile_update_result(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected