Commit Graph
315 Commits
Author SHA1 Message Date
Kristian Bendiksen 3eb63c0b8e #14772 Python: Add Case.replace_grid and forward replaceCase to it
First step in modernizing the command file interface: move the
implementation of legacy Ricf commands into object-oriented Rimc
methods, and let the Ricf command forward to them.

- Add RimCase_replaceGrid (PdmVoidObjectMethod on RimCase) with
  NewGridFile and optional ProjectFile parameters. Works for both
  Eclipse result cases and GeoMech cases. Generated in Python as
  Case.replace_grid().
- Add RicfCommandForwarding helpers for resolving ids to objects and
  converting std::expected results to PdmScriptResponse.
- RicfSingleCaseReplace::execute() now resolves the case and the
  executor's last project path, then forwards to RimCase_replaceGrid.
  Command file syntax and Commands.proto are unchanged.
- Case.replace() in Python is kept as a thin wrapper over
  replace_grid() and emits a DeprecationWarning.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen ef1ad39723 Python: Reject overwriting source summary vectors 2026-09-16 11:37:59 +02:00
Kristian Bendiksen dc1cc8e243 #14667 Python: Update tubing event interval test 2026-09-16 11:35:13 +02:00
Kristian Bendiksen 63bcc22485 #14667 Completions: Move MSW settings to segments 2026-09-16 11:35:13 +02:00
Magne Sjaastad d0d472aaa2 #14723 Python: Pin grpcio-tools to keep protobuf 6 gencode loadable
grpcio-tools 1.82.0+ (including its 1.82.0 pre-releases) bundles a
protoc that emits protobuf 7.35.x gencode, which no protobuf 6 runtime
can load. Pin grpcio-tools below that (excluding pre-releases via the
'.dev0' trick, since a plain '<1.82' bound already let a 1.82.0rc
release slip through once) and add a CI check that verifies the
generated *_pb2.py files stay within the protobuf floor declared in
pyproject.toml.

Only the load-bearing bounds are kept: protobuf's '>=6.33.5' floor
(must match the emitted gencode) and grpcio-tools' '<1.82.0.dev0'
ceiling. Non-load-bearing bounds (protobuf's '<8', grpcio-tools'
'>=1.81') were dropped since they don't change dependency resolution
or protect against anything the above doesn't already cover.
2026-09-11 05:46:28 -04:00
Kristian Bendiksen 71c5b5a97d #14612 Simulator Events: Remove Orion project naming 2026-09-09 13:01:26 +02:00
Kristian Bendiksen f38332b2e6 #14648 Reduce the risk of changed behaviour for text values in lists
A quote or an opening bracket is only given special meaning when it is the first character of a value. Brackets and parentheses are treated as ordinary characters for text based values, as nested containers are not possible for these types. Text values are then parsed as before, also when they contain unbalanced brackets, parentheses or quotes.

Items in a tuple are not quoted by the Python client, as the tuple parser does not support quoted strings.

Add unit tests for text values containing separator characters, white space, file paths, numbers, nested containers and 3D vectors.
2026-09-09 11:19:44 +02:00
Kristian Bendiksen 5ed45b8f19 #14648 Python: Support strings containing commas in list arguments
Lists sent from Python over gRPC are serialized as text, and the list parser split on every comma, also commas inside a string. A category name like "Coal,Calcite" was therefore split in two, and set_discrete_property_category_names() failed with "CategoryValues and CategoryNames must have matching sizes".

The list parser is now quote-aware, and ignores commas inside quoted strings and inside nested brackets and parentheses. A quoted item is parsed as a quoted string also when the surrounding text is unquoted, as is the case for text coming from Python. The Python client quotes and escapes strings in lists and tuples when they contain separator characters.

Add unit tests for the field serialization and a Python test for the category names.
2026-09-09 11:19:44 +02:00
Kristian Bendiksen 275b120688 #14683 Python: Generalize gRPC resource limit error 2026-09-07 18:58:05 +02:00
Kristian Bendiksen 2e5a3a3d17 #14683 Python: Preserve positional heartbeat callback 2026-09-07 18:58:05 +02:00
Kristian Bendiksen 35614d160e #14683 Serve liveness requests on the gRPC server thread
Requests are queued by the completion queue thread and processed from the main
thread. A long running request, or an open progress dialog in the GUI, therefore
left every request unanswered for as long as that operation lasted, including
the liveness checks a client uses to decide whether ResInsight is still there.

Let a callback declare that it touches no application state, and serve those
directly on the completion queue thread instead of queueing them. GetVersion is
the only such callback, since it reads compile-time constants only. Everything
that touches the project or the data model is still processed on the main
thread, so no request can observe or modify the data model while another one is
running.

The allocated callback list is now used from both threads and is guarded by a
mutex. Shutdown takes a lock before flagging that it is in progress, so that it
waits for any dispatch already running on the completion queue thread and no new
request handler can be registered on a queue that is about to be shut down.

During a blocking call of 3.25 s, 65 pings were answered with a maximum latency
of 6.2 ms. Before this change none of them were answered until the call
completed.
2026-09-07 18:58:05 +02:00
Kristian Bendiksen 32f97bd862 #14683 Raise the gRPC message size limit for large payloads
A schedule generated from a full production history, or a large raw text block
imported into the event timeline, easily exceeds the gRPC default limit of 4 MB.
Such a call failed with "Received message larger than max (5119402 vs 4194304)"
even though both sides were healthy.

Raise the limit to 128 MB on the server and use a matching limit for the client
channels. A schedule of 19.5 MB is now returned without error.
2026-09-07 18:58:05 +02:00
Kristian Bendiksen 16ad832689 #14683 Python: Add context to connection and message size errors
A call that failed because the connection went away surfaced the raw gRPC text,
typically "Channel closed!", which says nothing about what happened. Translate
such failures through a single helper that explains that the connection to
ResInsight was lost while the call was running, and that names the message size
limit when that is the cause. The gRPC code and details are still carried on the
RipsError for callers that branch on them.
2026-09-07 18:58:05 +02:00
Kristian Bendiksen b0496f82d6 #14683 Python: Do not treat a busy ResInsight as a dead one
ResInsight serves gRPC requests from its main thread, so a long running call
leaves the heartbeat pings unanswered for as long as that call runs. The
heartbeat counted those timeouts as connection failures and closed the channel,
which aborted the very call the user was waiting for. The client reported
"RipsError: Channel closed!" while the ResInsight process was alive and well.

Classify a ping that fails with DEADLINE_EXCEEDED or RESOURCE_EXHAUSTED as a
busy server and never count it towards the failure threshold. Only failures
that indicate a broken connection declare the connection lost. A new
busy_warning_sec argument controls when a warning is logged for a server that
has been unresponsive for a while, so long operations are visible without being
killed.

Keep the process handle from Instance.launch so the heartbeat can check whether
ResInsight actually exited. A dead process is now detected immediately and
reported with its exit code instead of a bare channel error, and check_alive()
repeats that diagnosis.
2026-09-07 18:58:05 +02:00
Kristian Bendiksen 4e0abb456f Fix crash when deleting a sub plot of a multi plot in console mode
RimMultiPlot::recreatePlotWidgets() dereferenced the viewer unconditionally. The viewer does not exist in console mode, so deleting a summary plot from Python through the generic PdmObject delete() crashed ResInsight in onChildDeleted(). Return early when there is no viewer, matching the other viewer accesses in RimMultiPlot.

Add Python regression tests for deleting a single summary plot inside a multi plot and for deleting a whole multi plot, and an example showing how project tree objects are removed with delete().
2026-09-07 14:11:02 +02:00
Kristian Bendiksen e2dc024854 Python: Create ensemble curve sets when creating summary plot for ensemble
new_summary_plot() with an ensemble and an address string created an empty
plot. The address filters were applied to an empty list of summary cases, and
no curve sets were created. Use the summary cases of the ensemble, and make
sure the summary addresses are created before the address filters are applied.

Add example script showing how to create summary plots for an ensemble.
2026-09-04 15:32:09 +02:00
Kristian Bendiksen 7867205468 #14639 Orion Events: Allow signed operand in date arithmetic
A term operand had to be an unsigned integer or a DURATION variable, so
"DATE STARTUP = 2026-08-28 + -2" was rejected as a malformed declaration
instead of subtracting two days.

Accept an optional sign on the operand in date and duration expressions, and
share one pattern between the terms of a date expression and the UNTIL terms
of INSERT_DATE so the two cannot drift apart.

Fractional day offsets are still unsupported.
2026-09-01 11:56:59 +02:00
Kristian Bendiksen 98e39bc02f #14636 Orion Events: List COMMENT as valid item name
COMMENT is accepted on all keywords and is stored on the event instead of
being passed as keyword data, so it is not part of the item names reported
by opm-common. The validation error listed only the opm-common items, giving
no hint that COMMENT is allowed when a user mistyped it as COMMENTS.

Append COMMENT to the list of valid item names in the error message. Only the
diagnostic is affected, COMMENT is still handled as event metadata.
2026-09-01 11:56:59 +02:00
Kristian Bendiksen 1336eba81d #14635 Orion Events: Use well name alias for generic keywords 2026-09-01 11:56:59 +02:00
Kristian Bendiksen 3117b69069 #14637 Orion Events: Use perforation diameter 2026-09-01 11:56:59 +02:00
Kristian Bendiksen ebf0ef0cc0 #14637 #14641 Orion Events: Emit END first after date 2026-09-01 11:56:59 +02:00
Kristian Bendiksen d226e10e89 #14637 Orion Events: Rename report date directive 2026-09-01 11:56:59 +02:00
Kristian Bendiksen 753cd65672 #14637 Orion Events: Remove date prefix 2026-09-01 11:56:59 +02:00
Kristian Bendiksen b00471dce2 #14614 Orion Events: Add menu item for importing events from file
Add RicImportOrionEventsFeature to File -> Import -> Well Data and the well
path collection context menu. The feature opens a file dialog and launches
the Python interpreter asynchronously with the new --apply mode of the
rips.orion_events CLI, which connects back to the running instance through
RESINSIGHT_GRPC_PORT and applies the events to the well event timeline.
Output is shown in the Process Monitor panel.
2026-08-28 13:22:33 +02:00
Kristian Bendiksen 0cbb5f5935 #14615 Orion Events: Preserve historical keyword values 2026-08-27 10:14:27 +02:00
Kristian Bendiksen f88136eb6a #14573 Orion Events: Add recurring report dates 2026-08-26 14:28:42 +02:00
Kristian Bendiksen 74ffc822f2 #14538 Well path: Preserve renamed file well name
The renamed well path name is serialized correctly, but reopening the project reloads the source well path file and overwrites the saved name with the name from that file. The reload flag only protected the completion export name, despite the loader also updating the displayed well path name.

Only initialize the well path and export names from the source file during first import. Subsequent data reloads preserve the names stored in the project while continuing to refresh geometry and metadata.

Add an RMS well round-trip test that renames an imported well, saves and reopens the project, and verifies that the custom name is retained.
2026-08-25 08:25:20 +02:00
Kristian Bendiksen 565d7b7819 #14571 Orion Events: Expand Python usage examples 2026-08-24 13:26:19 +02:00
Kristian Bendiksen 41b7df5a20 #14571 Orion Events: Preserve post-processed events during merge 2026-08-24 13:26:19 +02:00
Kristian Bendiksen 64317dfad7 #14575 Orion Events: Rename WELLSPEC event to WELSPECS 2026-08-24 13:26:19 +02:00
Kristian Bendiksen da6eb2062c Orion Events: Align imported schedule output in example code 2026-08-24 13:26:19 +02:00
Kristian Bendiksen 0adf471a5d #14514 Orion Events: Include report dates in schedule 2026-08-24 13:26:19 +02:00
Kristian Bendiksen 15adbeb9a1 #14575 Orion Events: Add context to validation errors 2026-08-24 13:26:19 +02:00
Kristian Bendiksen e1b192ff86 #14570 Orion Events: Fix schedule user metadata 2026-08-24 13:26:19 +02:00
Kristian Bendiksen d6878ea562 #14513 Orion Events: Add raw schedule text events 2026-08-24 13:26:19 +02:00
Kristian Bendiksen 1803c636a5 Python: Fix keyword event example rendering 2026-08-24 13:26:19 +02:00
Kristian Bendiksen 2ef4814257 #13672 Python: Add APIs to arrange and link views 2026-08-24 12:43:44 +02:00
Kristian Bendiksen 51aa090668 Python: Restore WellTypeForExport enum export 2026-08-21 11:42:34 +02:00
Kristian Bendiksen ce12272721 #14557 Orion Events: Rename tubing event to segment 2026-08-20 11:02:55 +02:00
Kristian Bendiksen db1c1f1f13 #14554 Orion Events: Add WELLSPEC event 2026-08-20 11:02:55 +02:00
Kristian Bendiksen 3947e5ee4e Orion Events: Expand experimental schedule example 2026-08-20 11:02:55 +02:00
Kristian Bendiksen 27b45353ea Orion Events: Add restart schedule cutoff 2026-08-20 11:02:55 +02:00
Kristian Bendiksen 1278ee2404 Orion Events: Add group member events 2026-08-20 11:02:55 +02:00
Kristian Bendiksen c94d00a02a Orion Events: Merge matching dated events 2026-08-20 11:02:55 +02:00
Kristian Bendiksen 61f615ac4c Orion Events: Preserve event comments 2026-08-20 11:02:55 +02:00
Kristian Bendiksen c41e74b706 Orion Events: Verify aligned schedule columns 2026-08-20 11:02:55 +02:00
Kristian Bendiksen a362f868c3 Orion Events: Generate COMPORD for new wells 2026-08-20 11:02:55 +02:00
Kristian Bendiksen 0b7ce2252c Orion Events: Add schedule generation metadata 2026-08-20 11:02:55 +02:00
Kristian Bendiksen d57abe525d #14533 Orion events: Add group sections 2026-08-19 10:28:35 +02:00
Kristian Bendiksen 3932ac4519 #14535 Orion events: Parse boolean keyword values 2026-08-19 10:28:35 +02:00