mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-27 07:30:20 -05:00
Replace the 1.0 grammar with a version 2.0 designed to be easier to parse and easier to write. Variables are now typed: DATE, DURATION (whole days) and WELL alias declarations replace the untyped SET, and using a variable of the wrong type produces an error citing both the use and declaration site. Well blocks open with an explicit WELL keyword (alias or double-quoted literal name), quoting is double quotes throughout, and date arithmetic accepts signed chains of integers and DURATION variables such as @START + RAMP - 2. ORIONEVENTS 1.x headers are rejected with a migration message. FILTER and PERFID are no longer parse errors; any KEY=VALUE attribute parses and the applier warns and ignores the not-yet-supported keys (FILTER, PERFID, DSHIFT) while still applying the rest of the event. The parser now recovers per line and reports every error in one pass via OrionParseError.errors, unknown variables, event types and keywords get difflib-based did-you-mean hints, and a stdlib-only validator CLI runs as python3 -m rips.orion_events <file>. The eager orion_events import in rips/__init__.py is replaced by a PEP 562 lazy import so the -m entry point does not trigger runpy's double-import warning. Update the shipped sample file and example script to the 2.0 syntax and extend the test suite from 27 to 55 tests covering typed declarations, offset arithmetic, alias resolution, multi-error diagnostics and the CLI.