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>
This commit is contained in:
34
tests/test_ddr_xml.py
Normal file
34
tests/test_ddr_xml.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""volve_dia.ddr.xml on the Volve DDR XML files (skipped without the data)."""
|
||||
|
||||
import pytest
|
||||
|
||||
from volve_dia import paths
|
||||
from volve_dia.ddr.xml import parse_dir, parse_file
|
||||
|
||||
XML = paths.ddr_xml_dir()
|
||||
pytestmark = [pytest.mark.data, pytest.mark.skipif(not XML.is_dir(), reason="missing the DDR XML folder")]
|
||||
|
||||
|
||||
def test_parse_file():
|
||||
p = parse_file(XML / "15_9_F_12_2008_01_01.xml")
|
||||
r = p.report
|
||||
assert (r["report_id"], r["wellbore"], r["file_wellbore"], r["file_date"]) == (
|
||||
"15_9_F_12_2008_01_01", "15/9-F-12", "15/9-F-12", "2008-01-01")
|
||||
assert r["nameWellbore"] == "NO 15/9-F-12" and r["dTimStart"] == "2007-12-31T00:00:00+01:00"
|
||||
assert (r["reportNo"], r["daysAhead"], r["tightWell"], r["waterDepth"]) == (98, 110.6, 0, 91.0)
|
||||
assert r["distDrill"] is None and p.sentinels[("reports", "distDrill")] == 1 # -999.99 in the file
|
||||
assert p.units[("reports", "waterDepth")] == ("m", "")
|
||||
assert {k: len(v) for k, v in p.sections.items()} == {"fluids": 1, "pore_pressure": 1, "activities": 19}
|
||||
a = p.sections["activities"][0]
|
||||
assert (a["act_id"], a["code_main"], a["code_sub"], a["state"], a["md"]) == (
|
||||
"15_9_F_12_2008_01_01:000", "drilling", "bop/wellhead equipment", "ok", 0.0)
|
||||
|
||||
|
||||
def test_parse_dir_counts():
|
||||
t = parse_dir(XML)
|
||||
r, a = t["reports"], t["activities"]
|
||||
assert len(r) == 1759 and r["wellbore"].nunique() == 26 and r["stem_ok"].all()
|
||||
assert len(a) == 23447 and (a["state"] == "fail").sum() == 480
|
||||
assert (a["stateDetailActivity"] == "equipment failure").sum() == 1975
|
||||
assert (a["duration_h"] > 0).all() and a["act_id"].is_unique
|
||||
assert t["units"].groupby(["table", "column"]).size().max() == 1
|
||||
Reference in New Issue
Block a user