#14514 Remove PERFID and DSHIFT from the ORIONEVENTS format

They are not planned as part of the file format. PERFID on a completion event is now an unknown-attribute error like any other unrecognized key, and DSHIFT on keyword events is forwarded unchanged instead of being stripped with a warning. FILTER keeps its ignore-with-warning behavior outside PERFORATION events.
This commit is contained in:
Kristian Bendiksen committed 2026-08-19 10:28:35 +02:00
1 parent b3d0256941
commit afb13508dc
3 files changed
+21 -21

No files matched your search

+7 -7
View File
@@ -103,8 +103,8 @@ Notes on the grammar:
searched in STATIC_NATIVE, then DYNAMIC_NATIVE, then GENERATED results; a
``TYPE.`` qualifier (``STATIC``/``DYNAMIC``/``GENERATED`` or the full
``*_NATIVE`` form, case-insensitive) restricts the search to that type.
* Any other attribute key parses; keys the applier does not support yet
(``PERFID``, ``DSHIFT``) are ignored with a warning when applied.
* Any other attribute key parses; ``FILTER`` on events other than
PERFORATION is ignored with a warning when applied.
* The parser recovers per line and reports **all** errors in one pass: the
raised :class:`OrionParseError` carries one :class:`ParseIssue` per problem.
Unknown names come with "did you mean" suggestions where possible.
@@ -853,11 +853,11 @@ class ApplyReport:
_POLICIES = ("warn", "error", "skip")
# Attributes accepted on a keyword event but intentionally not emitted.
_IGNORED_KEYWORD_ATTRS = {"DSHIFT", "FILTER", "PERFID"}
_IGNORED_KEYWORD_ATTRS = {"FILTER"}
# Completion event attribute handling: (required, known-optional) per type.
# FILTER is applied on PERFORATION events; FILTER/PERFID are accepted on the
# other completion events but ignored with a warning.
# FILTER is applied on PERFORATION events; it is accepted on the other
# completion events but ignored with a warning.
_PERF_REQUIRED = ("MDSTART", "MDEND")
_PERF_KNOWN = {"MDSTART", "MDEND", "RADIUS", "SKIN", "COMPLETION_NUMBER", "FILTER"}
_TUBING_REQUIRED = ("MDSTART", "MDEND")
@@ -872,7 +872,7 @@ _VALVE_KNOWN = {"MD", "TYPE", "STATE", "CV", "AREA"} | {
}
_STATE_REQUIRED = ("STATE",)
_STATE_KNOWN = {"STATE"}
_COMPLETION_IGNORED = {"FILTER", "PERFID"}
_COMPLETION_IGNORED = {"FILTER"}
_PERF_IGNORED = _COMPLETION_IGNORED # backwards-compatible alias
# ORIONEVENTS -> Eclipse item-name translations per keyword.
@@ -1189,7 +1189,7 @@ def _apply_perforation(
ctx: Optional[_FilterContext] = None,
) -> None:
if not _check_completion_attrs(
event, "PERFORATION", _PERF_KNOWN, _PERF_REQUIRED, report, ignored={"PERFID"}
event, "PERFORATION", _PERF_KNOWN, _PERF_REQUIRED, report, ignored=set()
):
return
@@ -227,11 +227,6 @@ class TestParsing:
assert filter_attr.quoted is True
assert doc.wells[0].events[0].attributes["MDEND"].value == 2
def test_perfid_attribute_parses(self):
text = 'ORIONEVENTS 2.0\nWELL "W"\n @2018-01-01 PERFORATION MDSTART=1 MDEND=2 PERFID=Valysar\n'
doc = parse_orion_events(text)
assert doc.wells[0].events[0].attributes["PERFID"].value == "Valysar"
def test_trailing_comment_ignored_but_not_inside_quotes(self):
text = (
'ORIONEVENTS 2.0\nWELL "W"\n'
@@ -752,17 +747,18 @@ class TestApplying:
assert data["NEW_VALUE"] == 50 # VALUE -> NEW_VALUE
assert data["CMODE"] == "BHP"
def test_dshift_is_ignored_with_warning(self):
def test_keyword_attributes_forward_without_special_casing(self):
# DSHIFT is not part of the format; it forwards unchanged like any
# other attribute instead of being stripped.
text = (
'ORIONEVENTS 2.0\nWELL "55_33-A-1"\n'
" @2018-01-01 WCONHIST STATUS=OPEN CMODE=ORAT DSHIFT=10\n"
)
timeline, report = self._apply(text)
data = timeline.keyword_calls[0]["keyword_data"]
assert "DSHIFT" not in data
# Event date is NOT shifted.
assert data["DSHIFT"] == 10
assert timeline.keyword_calls[0]["event_date"] == "2018-01-01"
assert any("DSHIFT" in w for w in report.warnings)
assert not report.warnings
def test_report_dates_on_apply_report(self):
text = (
@@ -778,14 +774,18 @@ class TestApplying:
assert report.report_dates == ["2018-03-01", "2018-07-01"]
assert report.events_applied == 1
def test_perfid_on_perforation_warns_and_applies(self):
def test_perfid_on_perforation_is_unknown_attribute_error(self):
# PERFID is not part of the format; it is rejected like any other
# unknown completion attribute.
text = (
'ORIONEVENTS 2.0\nWELL "55_33-A-1"\n'
" @2018-01-01 PERFORATION MDSTART=1 MDEND=2 PERFID=Valysar\n"
)
timeline, report = self._apply(text)
assert report.events_applied == 1
assert any("PERFID" in w for w in report.warnings)
assert report.events_applied == 0
assert report.events_skipped == 1
assert any("PERFID" in e for e in report.errors)
assert not timeline.perf_calls
def test_filter_on_keyword_event_warns_and_applies(self):
text = (
+2 -2
View File
@@ -183,7 +183,7 @@ Event lines are `@<date_expr> <EVENT_TYPE> KEY=VALUE ...`. Inside a WELL block,
|---|---|---|
| `STATE` | yes | `well_state`: `OPEN`, `SHUT` or `STOP` |
Unknown attributes on a completion event are an error and skip the event. `PERFID` is accepted but ignored with a warning (reserved for future use); on completion events other than `PERFORATION`, `FILTER` is likewise ignored with a warning.
Unknown attributes on a completion event are an error and skip the event. On completion events other than `PERFORATION`, `FILTER` is ignored with a warning.
### Well keyword events
@@ -194,7 +194,7 @@ Any other event type in a WELL block is passed through as an Eclipse well keywor
| `WCONHIST` | `VFP` → `VFP_TABLE` |
| `WELTARG` | `VALUE` → `NEW_VALUE` |
All other keywords (`WRFTPLT`, `WCONPROD`, `WELOPEN`, ...) forward attributes unchanged, so attribute keys must match the Eclipse item names ResInsight uses for that keyword. `DSHIFT`, `FILTER` and `PERFID` are ignored with a warning.
All other keywords (`WRFTPLT`, `WCONPROD`, `WELOPEN`, ...) forward attributes unchanged, so attribute keys must match the Eclipse item names ResInsight uses for that keyword. `FILTER` is ignored with a warning.
An event type that closely resembles a misspelled built-in (e.g. `PERFORATIN`) is **not** passed through as a keyword; it is handled by the `on_unknown_event` policy with a "did you mean" hint.