Files
Volve-DIA/volve_dia/paths.py
lamlvh 17916650a5 Add M1: OCR hub import, WITSML, labels T1-T3, T4 questions, trial raters, draft protocol
- OCR: match the colleague's full-set Dataset Hub export to the DDRs by content
  (3,059/3,066 pages) and QC it against the HTML (CER 2.40%, exact 0.9181).
- WITSML parser and formation tops: 21 DDR wellbores with time logs, 1,384
  reports; WITSML 15/9-F-15 S is DDR 15/9-F-15.
- Deterministic labels T1-T3 (configs/labels.yaml), 1,662 T4 questions with SQL,
  pandas and raw-XML answers in full agreement.
- Trial label validation by three blind LLM raters (not an author or expert audit)
  and rater agreement script; draft protocol_v1 (not locked): split by well.
- Literature notes and BibTeX; docs, report and run_m1.sh synchronised.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 08:34:35 +00:00

63 lines
2.1 KiB
Python

"""Project paths. No absolute paths: everything is resolved from the repository root or from the
environment variables VOLVE_DIA_VOLVE_ROOT / VOLVE_DIA_OUTPUTS, which may also be set in `.env`."""
from __future__ import annotations
import os
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
def load_env(path: Path | None = None) -> None:
"""Read KEY=VALUE lines of `.env` into os.environ. Variables already set in the environment win."""
path = path or REPO_ROOT / ".env"
if not path.is_file():
return
for line in path.read_text(encoding="utf-8").splitlines():
line = line.strip()
if not line or line.startswith("#") or "=" not in line:
continue
key, value = line.split("=", 1)
os.environ.setdefault(key.strip(), value.strip().strip("'\""))
def volve_root() -> Path:
"""Volve directory downloaded from the Data Village (Well_technical_data/, WITSML Realtime drilling data/, ...)."""
env = os.environ.get("VOLVE_DIA_VOLVE_ROOT")
return Path(env) if env else REPO_ROOT / "data" / "Volve"
def well_technical_dir() -> Path:
return volve_root() / "Well_technical_data"
def ddr_xml_dir() -> Path:
"""1,759 WITSML 1.4 drillReport files: the ground truth of every label."""
return well_technical_dir() / "Daily Drilling Report - XML Version"
def ddr_html_dir() -> Path:
"""The same reports rendered to HTML by the publisher (what the PDF version prints)."""
return well_technical_dir() / "Daily Drilling Report - HTML Version"
def ddr_pdf_dir() -> Path:
return well_technical_dir() / "Daily Drilling report - PDF Version"
def witsml_dir() -> Path:
return volve_root() / "WITSML Realtime drilling data"
def outputs_dir() -> Path:
env = os.environ.get("VOLVE_DIA_OUTPUTS")
p = Path(env) if env else REPO_ROOT / "outputs"
p.mkdir(parents=True, exist_ok=True)
return p
def well_picks_file() -> Path:
"""Formation tops of the Volve wells (409 picks, 35 wellbores), fixed-width text."""
return volve_root() / "Geophysical_Interpretations" / "Wells" / "Well_picks_Volve_v1.dat"