MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / load_results

Function load_results

analysis.py:66–105  ·  view source on GitHub ↗

Parse results.tsv into a pandas DataFrame, also merging any TSV files found in workspace/results/ (written by orchestrate.py). Returns None if no data is found.

(path: str = "results.tsv")

Source from the content-addressed store, hash-verified

64
65
66def load_results(path: str = "results.tsv") -> pd.DataFrame | None:
67 """
68 Parse results.tsv into a pandas DataFrame, also merging any TSV files
69 found in workspace/results/ (written by orchestrate.py).
70 Returns None if no data is found.
71 """
72 frames: list[pd.DataFrame] = []
73
74 # Load the root results.tsv
75 root_df = _load_single_tsv(path)
76 if root_df is not None:
77 frames.append(root_df)
78
79 # Also load all TSV files in workspace/results/ (orchestrate.py output)
80 if os.path.isdir(WORKSPACE_RESULTS_DIR):
81 for fname in sorted(os.listdir(WORKSPACE_RESULTS_DIR)):
82 if fname.endswith(".tsv"):
83 ws_path = os.path.join(WORKSPACE_RESULTS_DIR, fname)
84 ws_df = _load_single_tsv(ws_path)
85 if ws_df is not None:
86 frames.append(ws_df)
87
88 if not frames:
89 return None
90
91 df = pd.concat(frames, ignore_index=True)
92 if len(df) == 0:
93 return None
94
95 # Validate columns against expected set
96 missing = [c for c in EXPECTED_COLUMNS if c not in df.columns]
97 extra = [c for c in df.columns if c not in EXPECTED_COLUMNS]
98 if missing or extra:
99 print(f"WARNING: TSV columns do not match expected schema.")
100 if missing:
101 print(f" Missing columns: {missing}")
102 if extra:
103 print(f" Unexpected columns: {extra}")
104
105 return df
106
107
108def load_baselines() -> dict | None:

Callers 1

mainFunction · 0.85

Calls 1

_load_single_tsvFunction · 0.85

Tested by

no test coverage detected