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

Function _prune_redundant_directions

scripts/clear_database.py:76–86  ·  view source on GitHub ↗

Drop generic directions when a more specific sibling exists.

(direction_weights: Dict[str, float])

Source from the content-addressed store, hash-verified

74
75
76def _prune_redundant_directions(direction_weights: Dict[str, float]) -> Dict[str, float]:
77 """Drop generic directions when a more specific sibling exists."""
78 pruned = dict(direction_weights)
79
80 for primary, redundant_keys in REDUNDANT_DIRECTION_MAP.items():
81 if primary not in pruned:
82 continue
83 for redundant_key in redundant_keys:
84 pruned.pop(redundant_key, None)
85
86 return pruned
87
88
89def _select_seed_directions(role_name: str, parsed: Dict[str, Any]) -> Dict[str, float]:

Callers 1

_select_seed_directionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected