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

Function norm

experiments/human_eval/draw_interest_drift_paperflow_style.py:81–90  ·  view source on GitHub ↗
(values: dict[str, float], method: str, direction: str)

Source from the content-addressed store, hash-verified

79
80
81def norm(values: dict[str, float], method: str, direction: str) -> float:
82 vals = list(values.values())
83 lo, hi = min(vals), max(vals)
84 if hi == lo:
85 score = 0.5
86 else:
87 score = (values[method] - lo) / (hi - lo)
88 if direction == "down":
89 score = 1 - score
90 return score
91
92
93def x_pos(score: float) -> float:

Callers 2

draw_pngFunction · 0.85
write_svgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected