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

Function _load_single_tsv

analysis.py:45–63  ·  view source on GitHub ↗

Load a single TSV file into a DataFrame. Returns None if missing/empty.

(path: str)

Source from the content-addressed store, hash-verified

43# ---------------------------------------------------------------------------
44
45def _load_single_tsv(path: str) -> pd.DataFrame | None:
46 """Load a single TSV file into a DataFrame. Returns None if missing/empty."""
47 if not os.path.exists(path):
48 return None
49
50 df = pd.read_csv(path, sep='\t')
51 if len(df) == 0:
52 return None
53
54 # Normalise column names to lowercase
55 df.columns = [c.strip().lower() for c in df.columns]
56
57 # Convert numeric columns
58 for col in ['experiment', 'throughput_tflops', 'latency_us', 'pct_peak',
59 'speedup_vs_pytorch', 'peak_vram_mb']:
60 if col in df.columns:
61 df[col] = pd.to_numeric(df[col], errors='coerce')
62
63 return df
64
65
66def load_results(path: str = "results.tsv") -> pd.DataFrame | None:

Callers 1

load_resultsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected