Datasets:
Download scripts/paths.py from integMET/edge-ML-metabolomics-graph: direct link, hf CLI and curl.
- Browser
- Download file 1.77 kB
-
https://huggingface.co/datasets/integMET/edge-ML-metabolomics-graph/resolve/main/scripts/paths.py
- Command line
-
hf download hf://datasets/integMET/edge-ML-metabolomics-graph/scripts/paths.py
-
curl -L -o paths.py https://huggingface.co/datasets/integMET/edge-ML-metabolomics-graph/resolve/main/scripts/paths.py
1.77 kB
| """Where the released files live, so every script agrees on one layout. | |
| DATA_DIR the dataset repository checkout (default: this file's parent's parent) | |
| MODEL_DIR the model repository checkout (default: DATA_DIR) | |
| The default puts DATA_DIR one level above the directory holding these scripts, | |
| which is the repository root in the published layout and the data directory in | |
| the original working tree — so the same scripts run in both places unset. | |
| The layout mirrors the published repositories: | |
| DATA_DIR/graph.duckdb built by bootstrap.py | |
| DATA_DIR/data/... released source files | |
| DATA_DIR/graph/edge_ML_expected_ge5_pyg.pt released graph; rebuilt in place | |
| DATA_DIR/figures/... figures and the UMAP coordinate cache | |
| MODEL_DIR/edge_ML_expected_ge5_n2v.pt released embeddings | |
| build_graph.py writes the graph back to its released path, so every downstream | |
| script reads the same file whether you downloaded it or rebuilt it. | |
| """ | |
| import os | |
| import pathlib | |
| _DEFAULT = pathlib.Path(__file__).resolve().parent.parent | |
| DATA_DIR = pathlib.Path(os.environ.get("DATA_DIR", str(_DEFAULT))) | |
| MODEL_DIR = pathlib.Path(os.environ.get("MODEL_DIR", str(DATA_DIR))) | |
| GRAPH_DIR = DATA_DIR / "graph" | |
| FIGURES_DIR = DATA_DIR / "figures" | |
| for _d in (GRAPH_DIR, FIGURES_DIR): | |
| _d.mkdir(parents=True, exist_ok=True) | |
| DB_PATH = str(DATA_DIR / "graph.duckdb") | |
| GRAPH_PATH = str(GRAPH_DIR / "edge_ML_expected_ge5_pyg.pt") | |
| EMB_PATH = str(MODEL_DIR / "edge_ML_expected_ge5_n2v.pt") | |
| UMAP_NPY_PATH = str(FIGURES_DIR / "umap_coords.npy") | |
| def figure_path(mode: str) -> str: | |
| """Released figure name for 'light' or 'dark'.""" | |
| return str(FIGURES_DIR / f"umap_species_{mode}.png") | |