Update src/utils/io.py
Browse files- src/utils/io.py +0 -7
src/utils/io.py
CHANGED
|
@@ -1,7 +1,3 @@
|
|
| 1 |
-
"""
|
| 2 |
-
io.py β Config loading, seeding, and I/O helpers.
|
| 3 |
-
"""
|
| 4 |
-
|
| 5 |
import os
|
| 6 |
import random
|
| 7 |
import json
|
|
@@ -12,7 +8,6 @@ import pandas as pd
|
|
| 12 |
import yaml
|
| 13 |
|
| 14 |
|
| 15 |
-
# ββ Reproducibility ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 16 |
|
| 17 |
def set_seed(seed: int = 17) -> None:
|
| 18 |
"""Set global seeds for Python, NumPy, and PyTorch."""
|
|
@@ -29,7 +24,6 @@ def set_seed(seed: int = 17) -> None:
|
|
| 29 |
pass
|
| 30 |
|
| 31 |
|
| 32 |
-
# ββ Config βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 33 |
|
| 34 |
def load_cfg(path: str = "env/config.yaml") -> dict:
|
| 35 |
"""Load a YAML config file and return as a dict."""
|
|
@@ -37,7 +31,6 @@ def load_cfg(path: str = "env/config.yaml") -> dict:
|
|
| 37 |
return yaml.safe_load(f)
|
| 38 |
|
| 39 |
|
| 40 |
-
# ββ Data helpers βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 41 |
|
| 42 |
def must_read_csv(p) -> pd.DataFrame:
|
| 43 |
"""Read a CSV, raising FileNotFoundError if missing."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import random
|
| 3 |
import json
|
|
|
|
| 8 |
import yaml
|
| 9 |
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
def set_seed(seed: int = 17) -> None:
|
| 13 |
"""Set global seeds for Python, NumPy, and PyTorch."""
|
|
|
|
| 24 |
pass
|
| 25 |
|
| 26 |
|
|
|
|
| 27 |
|
| 28 |
def load_cfg(path: str = "env/config.yaml") -> dict:
|
| 29 |
"""Load a YAML config file and return as a dict."""
|
|
|
|
| 31 |
return yaml.safe_load(f)
|
| 32 |
|
| 33 |
|
|
|
|
| 34 |
|
| 35 |
def must_read_csv(p) -> pd.DataFrame:
|
| 36 |
"""Read a CSV, raising FileNotFoundError if missing."""
|