Commit ·
25ab447
1
Parent(s): 20f9c98
Case-insensitive on_hf match (HF lowercases repo slugs)
Browse files
app.py
CHANGED
|
@@ -185,8 +185,12 @@ def _load_catalog() -> pd.DataFrame:
|
|
| 185 |
df = pd.read_csv(CSV_PATH)
|
| 186 |
df["nchans"] = df["nchans_set"].apply(_parse_mode_from_json_col)
|
| 187 |
df["sfreq"] = df["sampling_freqs"].apply(_parse_mode_from_json_col)
|
| 188 |
-
|
| 189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
for col in ("n_subjects", "n_records", "n_tasks"):
|
| 191 |
df[col] = pd.to_numeric(df[col], errors="coerce").fillna(0).astype(int)
|
| 192 |
extra = ["dataset_title", "doi", "duration_hours_total"]
|
|
|
|
| 185 |
df = pd.read_csv(CSV_PATH)
|
| 186 |
df["nchans"] = df["nchans_set"].apply(_parse_mode_from_json_col)
|
| 187 |
df["sfreq"] = df["sampling_freqs"].apply(_parse_mode_from_json_col)
|
| 188 |
+
# HF normalizes slugs to lowercase when creating repos; compare that way
|
| 189 |
+
# so mixed-case entries (e.g. "EEG2025r1") still flag correctly.
|
| 190 |
+
on_hub = {s.lower() for s in _hf_repos()}
|
| 191 |
+
df["on_hf"] = df["dataset"].apply(
|
| 192 |
+
lambda s: "✓" if str(s).lower() in on_hub else ""
|
| 193 |
+
)
|
| 194 |
for col in ("n_subjects", "n_records", "n_tasks"):
|
| 195 |
df[col] = pd.to_numeric(df[col], errors="coerce").fillna(0).astype(int)
|
| 196 |
extra = ["dataset_title", "doi", "duration_hours_total"]
|