Files
Volve-DIA/tests/test_names.py
lamlvh a3c175638f Add P0 infrastructure for the Volve-DIA benchmark
Set up the data, parsing and quality-control layer for a public benchmark
on the Volve daily drilling reports (DDR) and WITSML real-time data.

- Data manifest with SHA-256 hashes of the three Volve subtrees in use.
- DDR XML parser into DuckDB (1,759 reports, 26 wellbores, 23,447
  activities, 17 tables) with locked expected counts.
- Render QC of the publisher HTML against the XML (272,544 items).
- OCR client for the shared chandra vLLM service, with a page cache keyed
  on model, prompt hash, dpi, max_tokens and temperature, and OCR QC
  against the HTML on a 26-report pilot.
- Run logging (scripts/runlog.sh, logs/index.csv), the P0 runner and
  40 tests.
- Research plan, technical overview and progress page (in Vietnamese).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 12:52:22 +00:00

36 lines
1.3 KiB
Python

"""volve_dia.names: every spelling of a Volve wellbore maps to one canonical NPD code."""
import pytest
from volve_dia.names import canonical, stem, well_of
@pytest.mark.parametrize("name, expected", [
("NO 15/9-F-15 A", "15/9-F-15 A"), # DDR nameWellbore
("15_9_F_15_A", "15/9-F-15 A"), # DDR file stem
("15/9-F-15 A", "15/9-F-15 A"), # NPD code
("Norway-StatoilHydro-15_$47$_9-F-15A", "15/9-F-15 A"), # WITSML folder
("15/9-F-15A", "15/9-F-15 A"), # MetaFileInfo.txt
("NO 15/9-F-1 B", "15/9-F-1 B"),
("Norway-Statoil-NO 15_$47$_9-F-1 C", "15/9-F-1 C"),
("NA-NA-15_$47$_9-F-5", "15/9-F-5"),
("15_9_F_11_T2", "15/9-F-11 T2"),
("15_9_19_BT2", "15/9-19 BT2"),
("15_9_19_S", "15/9-19 S"),
(" NO 15/9-F-12 ", "15/9-F-12"),
])
def test_canonical(name, expected):
assert canonical(name) == expected
def test_stem_and_well():
assert stem("NO 15/9-F-15 A") == "15_9_F_15_A"
assert stem("15/9-19 BT2") == "15_9_19_BT2"
assert well_of("Norway-StatoilHydro-15_$47$_9-F-15A") == "15/9-F-15"
@pytest.mark.parametrize("name", ["", "F-15", "15/9", "Volve"])
def test_rejects_non_wellbores(name):
with pytest.raises(ValueError):
canonical(name)