445 Commits
Author SHA1 Message Date
Magne Sjaastad 96370a6077 Set rows_per_page in summary multi plot Python examples 2026-10-24 13:14:41 +02:00
Kristian Bendiksen e6dc62a160 Workflows: Add interactive editor for taskmaestro workflows
Build, copy and edit taskmaestro workflows in ResInsight and save them as
standard workflow.yaml + input.yaml.

- Python helper: catalog, load, save and export-registered subcommands,
  and run --registered for installed workflows
- C++ definition model with pure edit operations, port type checks,
  config field derivation, static validation and undo/redo
- Installed folder listing registered workflows (read-only, runnable,
  can be duplicated)
- Graph editor dock with task palette, drag-to-connect, context menus,
  automatic layout and debounced live validation
- New/Duplicate/Save/Save As/Rescan commands; unsaved edits run from a
  temporary folder and prompt before being discarded
- Update the design document and the user README
2026-10-23 20:23:54 +02:00
Magne Sjaastad 7222d6360e Scripting: read GeoMech time steps, result names and values 2026-10-23 09:28:19 +02:00
Magne Sjaastad 095a5a52b5 Treat pytest warnings as errors
Wrap calls to deprecated rips API in pytest.warns so the suite runs warning-free.
2026-10-22 15:38:00 +02:00
Magne Sjaastad 6a15c84463 #13485: Export unique top-level well paths for completions and MSW 2026-10-22 13:34:49 +02:00
Magne Sjaastad 848c2394bb Scripting: geomechanical cell result (replaces #14952)
Make RimGeoMechResultDefinition (position, field and component) and the view's cell result scriptable, as for grid views.
2026-10-21 06:49:14 +02:00
Magne Sjaastad 914cab9084 #13097: Expose Fixed Angle as scriptable field in Fishbones
Make RimFishbones::m_fixedInstallationRotationAngle scriptable so it
can be set from the Python API when using the Fixed Fishbones
orientation mode.
2026-10-21 06:46:35 +02:00
Magne Sjaastad 6e8e658f6d #14980: Remove global max segment length from segment collection
The global max segment length no longer exists, so segment subdivision is defined only by the segment intervals.
2026-10-19 21:13:13 +02:00
Kristian Bendiksen 8dc1d56bd3 #14688 Sim Events: Add API to query event dates and wells
Add event date and well queries with date, owner and event type/keyword
filters to SimulatorEventsDocument and WellEventTimeline, including
latest_event_date() and wells_with_msw_events() for building the
export_msw_for_wells list.
2026-10-19 12:00:28 +02:00
Kristian Bendiksen 360c3c69db #14684 Simulator Events: Allow schedule generation without a grid case
Grid-dependent keywords (WELSPECS, COMPORD, COMPDAT, COMPLUMP, WELSEGS, COMPSEGS, WSEGVALV, WSEGAICD) are skipped and reported as WARNING comments in the schedule header, so production-data-only setups can still generate DATES and well control keywords.
2026-10-19 12:00:28 +02:00
Kristian Bendiksen b2a85fb7a4 #14960 Sim Events: Use first segment MD as user defined reference MD
When a SEGMENT event is applied (SIMEVENTS mapping or timeline
set_timestamp), set the segment collection Reference MD Type to User
Defined and the reference MD to the start MD of the first segment
interval, so WELSEGS TOP_LENGTH matches the first segment.
2026-10-19 09:28:29 +02:00
Kristian Bendiksen 92c4fe8dc2 #14961 Sim Events: Add segment length usage to SIMEVENTS example 2026-10-19 09:28:29 +02:00
Kristian Bendiksen 8174e21561 #14961 Sim Events: Support segment lengths in SEGMENT events
Add FIXED_SEGMENT_LENGTH, MIN_SEGMENT_LENGTH and MAX_SEGMENT_LENGTH to
SIMEVENTS SEGMENT events. The lengths are stored on RimWellEventSegment
(new AddSegmentEvent arguments, 0 = not set) and applied to the segment
interval when the timeline is applied. Invalid combinations (fixed with
min/max, min > max, non-positive values) are reported as parse errors.
2026-10-19 09:28:29 +02:00
Kristian Bendiksen c56e921160 #14958 Sim Events: Move PRESSURE_COMPONENTS to WELSPECS
Move Pressure Drop and Length and Depth from the segment collection to
the well path completion settings. PRESSURE_COMPONENTS is now a dated
WELSPECS attribute used for the WELSEGS header at export, and is
rejected on SEGMENT events.
2026-10-19 09:28:29 +02:00
Kristian Bendiksen 2f86d4c210 #14956: Rename well event Tubing to Segment
Rename RimWellEventTubing to RimWellEventSegment (keyword WellEventSegment),
EventType::TUBING to SEGMENT, and the scripting method AddTubingEvent to
AddSegmentEvent (Python: add_segment_event). Update the project tree label,
schedule comments, Python helpers, examples, tests and docs.
2026-10-19 09:28:29 +02:00
hnilandClaude Opus 5 08f3aa1293 GrpcInterface: Build with protobuf where descriptor name() is a string_view
Newer protobuf (seen with 34.1) returns absl::string_view from the descriptor
name() accessors, which QString::fromStdString does not accept. An explicit
std::string conversion compiles against both the old and the new return type.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-16 12:57:16 +02:00
Magne Sjaastad 597a7775d9 #8370: Address review comments
Keep original additional summary files on Save As, reject cases combined with ensembles, keep unrestored additional file mappings, support growing file sets, update short names on ensemble import, simplify aggregator and example.
2026-10-16 09:57:12 +02:00
Magne Sjaastad d93aa839a6 #8370: Add Python SummaryEnsemble helpers, examples and tests 2026-10-16 09:57:12 +02:00
Magne Sjaastad 62b040ac42 #8370: Add Project.summary_ensembles and summary_plot_collection 2026-10-16 09:57:12 +02:00
Magne Sjaastad c323846ec5 #13475: Unified LGR completion export tables and single WELSPECL entry per well
* Export LGR completions in single COMPDATL, WPIMULTL and COMPLMPL tables
* Export only first WELSPECL entry per well
* Move LGR test well path to subfolder and format test
2026-10-15 15:25:49 +02:00
Magne Sjaastad 96bb127446 #14804: Make segment length fields scriptable and check them in Python test 2026-10-12 19:12:08 +02:00
Magne Sjaastad 97d132685b #14804: Address review comments on segment placement, ISEG gRPC, min/max validation 2026-10-12 19:12:08 +02:00
Magne Sjaastad d8f346e9ab #14804 MSW export: Segmentation controls per interval and around perforations
Add fixed, min and max segment length per segment interval (fixed is exclusive with min/max, min and max can be combined), connect COMPSEGS rows to the nearest segment node, and add collection options for a single segment before the first and after the last perforation.
2026-10-12 19:12:08 +02:00
Kristian Bendiksen 24e5d2b441 #14870 Schedule export: reject independent trees sharing an MSW name 2026-10-12 18:47:03 +02:00
Kristian Bendiksen f3d9d04281 #14870 Schedule export: export multilateral wells once per well name
Wells sharing an export name now produce one WELSPECS/COMPORD record,
one set of MSW keywords, and no duplicate COMPDAT/COMPLUMP connections.
Events on any well in the group trigger the group's keywords.

Connections in cells shared by several well paths of a group are combined
into one record. MSW keywords are exported for the well tree of the first
group member selected for MSW export.

Fixes #14870
2026-10-12 18:47:03 +02:00
Kristian Bendiksen 164dee3f4b #14873 Schedule export: valve events only emit WSEGVALV/WSEGAICD
VALVE events no longer trigger WELSPECS, COMPORD, WELSEGS and COMPSEGS.
WELSEGS/COMPSEGS are only regenerated for tubing and perforation events.

Fixes #14873
2026-10-12 18:47:03 +02:00
Kristian Bendiksen 65942d455d Workflows: Read workflow schemas with the taskmaestro CLI
Replace the rips.taskmaestro_helper introspect subcommand with
`python -m taskmaestro workflow describe --json`. RimWorkflowDescribeTools
converts the describe output (JSON schemas, depends_on, config_values)
into the workflow graph used by the Workflow UI. This also adds support
for collect dependencies and maps rips.Reservoir to EclipseCase pickers.
2026-10-05 19:56:36 +02:00
Kristian Bendiksen d63bde00e4 #14789 Workflow: Visualize taskmaestro DAG in native Qt view 2026-10-05 19:56:36 +02:00
Kristian Bendiksen 3a7b8f6be8 Workflows: Add UI for taskmaestro workflows
Discover taskmaestro workflows under ~/.taskmaestro/workflows/ and surface
them as a "Workflows" collection in the project tree alongside Scripts.
Each workflow's task input schema is auto-generated by introspecting the
Pydantic models via a Python helper (rips.taskmaestro_helper) and rendered
as PDM field bindings - scalars for str/int/float/bool, and PdmPtrField
pickers for fields typed as rips.Case / rips.WellPath / rips.View.

The Run button on a RimWorkflow writes input.yaml from current bindings
(rips object references serialized as __resinsight_ref__ maps), spawns
the helper's run subcommand, and streams output to a modeless log dialog.
The helper resolves __resinsight_ref__ markers back to live rips objects
via the running ResInsight's gRPC server before driving taskmaestro.
2026-10-05 19:56:36 +02:00
Magne Sjaastad c8ad00a904 NNC: Remove RigConnectionContainer, use std::vector<RigConnection> directly
RigConnectionContainer was a thin wrapper around std::vector<RigConnection> with no added value beyond push_back/reserve/remove_duplicates. Replace it everywhere with std::vector<RigConnection> and inline the remaining container-merge and deduplication logic at their single call sites.
2026-10-05 08:39:07 +02:00
Magne Sjaastad fc829069e8 Update expected NNC count in test_10kSync to match reduced NNC generation
The NNC geometry computation now only tests candidates in the neighbor pillar column for I/J fault faces, intentionally producing fewer NNCs (edge contacts and small non-zero-area overlaps outside the column are no longer generated). Update the test assertion from 3416 to 3345 to match.
2026-10-05 08:39:07 +02:00
Kristian Bendiksen 4977941896 #14821 Python: Report specific errors when import_surface fails
- Return std::expected from RimSurfaceCollection::importSurfacesFromFiles
  with a message naming the files that could not be imported
- Return specific errors from ImportSurface and NewSurface scripting
  methods instead of nullptr
- Import before deleting the surface to overwrite, so a failed overwrite
  keeps the existing surface
- Catch surfio exceptions in RifSurfio to avoid a crash on corrupt files
- Include the method name in the generic "no result" gRPC error
- Add Python tests for import_surface error handling
2026-10-05 08:30:33 +02:00
Kristian Bendiksen 1cfe49262a #14828: Do not create a view when creating a grid from the Python API
Previously a view was created and ACTNUM displayed when running with GUI.
Users can create a view explicitly through the API.

Fixes #14828.
2026-10-02 14:03:55 +02:00
Kristian Bendiksen 3046c7e09d #14829: Emit insert-date event comment above DATES keyword
Fixes #14829.
2026-10-02 12:36:54 +02:00
Magne Sjaastad b6704429cd Scope GRPC/ODB/OpenVDS/HDF5 build flags to avoid full rebuilds
- Remove unused SOURCE_GROUP_HEADER_FILES from GrpcInterface CMakeLists
- Scope the following defines to the files that need it ENABLE_GRPC, USE_ODB_API , USE_OPENVDS, USE_HDF5 
- RifOdbReader.cpp copied an odb_InstanceRepository by value, which
  fails to compile under MSVC's strict conformance mode due to an
  ambiguous implicit copy constructor in the vendor headers (diamond
  inheritance). Use a reference instead, since it was only ever read
  from.
2026-10-02 12:24:29 +02:00
Magne Sjaastad 34f5c52ca7 #13807 Add Python scripting support for generic view (surface/polygon visibility)
Based on magnesj/ResInsight#1078:
- Lift surfaceInViewCollection()/polygonInViewCollection() to virtual Rim3dView methods
- Make RimGeneric3dView scriptable as GenericView
- Add Project.create_generic_view() Python method
- RimcGridView surface/polygon methods now work on any Rim3dView
- Add Python tests and example script
2026-09-28 18:35:28 +02:00
Kristian Bendiksen 8324af966c #14666 Simulator Events: Expand INSERT_DATE into insert-date events
INSERT_DATE statements are now expanded into one timeline event per
occurrence instead of a list of bare dates, so each generated date keeps
the COMMENT of its statement.

- New RimWellEventInsertDate (EventType::INSERT_DATE): a date-only event
  that generates no keyword, added with
  WellEventTimeline.add_insert_date_event(event_date, comment).
- The schedule generator writes the comment of an insert-date event as
  "--" lines directly below its DATES keyword.
- generate_schedule(_text) no longer takes additional_dates; insert-date
  events are part of the timeline, but keep the previous behavior of not
  being filtered by set_timestamp().
- SimulatorEventsDocument.report_dates and ApplyReport.report_dates are
  replaced by SimulatorEventsDocument.insert_date_events/insert_dates;
  merging files drops insert dates repeating both date and comment.
2026-09-25 14:35:45 +02:00
Kristian Bendiksen 70e10cb386 #14666 Simulator Events: Align INSERT_DATE with other keyword events
INSERT_DATE is now a SCHEDULE event using KEY=VALUE attributes, and the file
format version is bumped to SIMEVENTS 1.2:

    <date-expr> INSERT_DATE [EVERY=<duration>] [UNTIL=<date-expr>]

- EVERY takes a duration literal, DURATION variable or expression
  (EVERY=1mon, EVERY=30d, EVERY=12mon, EVERY=12h) and must be positive.
  Occurrence n is start + n months (clamped), then + n times the fixed part,
  which preserves the dates of the previous DAY/MONTH/YEAR recurrences.
- UNTIL is an inclusive end date and requires EVERY; quote values with spaces.
- COMMENT is accepted and ignored; other attributes are rejected.
- SIMEVENTS 1.1 files and old-style INSERT_DATE lines are rejected with a
  migration hint showing the rewritten line.
2026-09-25 14:35:45 +02:00
Kristian Bendiksen cbd3d39a5c #14582 Simulator Events: Merge events from multiple files
Importing several SIMEVENTS files together now merges them into one document
before coalescing, so keyword events with the same owner, type and timestamp
are combined across files, not only within one file.

- Add merge_simulator_events_documents, parse_simulator_events_files and
  apply_simulator_events_files. Source locations carry the file name, so
  conflict warnings and errors identify both files.
- Reject mismatched UNIT, and a second RESTART or duplicate WELSPECS across
  files. Collect parse errors from all files in one pass.
- Warn when files declare the same FILTER name with different expressions,
  and keep each file's filter instead of reusing the first one.
- CLI accepts multiple files; the import dialog allows multi-selection.
2026-09-25 14:35:45 +02:00
Kristian Bendiksen b0f60c392f #14651 SIMEVENTS 1.1: datetime dates and Go-style durations
Increase the time resolution of the SIMEVENTS format and replace whole-day
integer offsets with Go-style duration literals.

- All DATE values are now datetimes with second resolution. A date-only
  literal means midnight; a time-of-day requires the 'T' separator and
  fractional seconds are rounded to the nearest second.
- DURATION values and offset terms are Go-style literals such as 5d,
  12h30m, 1.5h, 3mon and -3d. Units (mon, d, h, m, s) are mandatory, must
  appear in strictly descending order without repeats, and a fraction is
  allowed only on the last component (never on mon or s). Unitless numbers
  and the legacy DAYS suffix are rejected with hints.
- New Duration type keeps calendar months separate from the fixed
  timedelta part; adding months clamps to the end of shorter months, and
  str() renders the Go-style form.
- Header version bumped to 1.1; 1.0 files are rejected with a migration
  hint.
- Update tests, sample .events file, example script and
  docs/simulatorEvents.md.
2026-09-22 14:20:36 +02:00
Kristian Bendiksen fed0fa43c7 #14772 Python: GridCaseGroup.compute_statistics() treats an empty case_ids list as all cases
The legacy computeCaseGroupStatistics command could not distinguish an unset list from an
empty one, so [] meant all statistics cases. Keep that in the deprecation shim.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 4148e7a5b1 #14772 Create the export folder on demand in exportCompletions and exportMswCompletions
The legacy exportMsw and exportWellPathCompletions commands relied on the export
implementation creating the folder (RicWellPathExportCompletionsFileTools::openFileForExport),
so the default <project>/completions folder worked on a fresh project. The new Rimc methods
rejected a non-existent folder up front. Create it instead, and only fail if that fails.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen d17930d2b3 #14772 Python: Fix type annotations in new wrapper code 2026-09-22 14:19:23 +02:00
Kristian Bendiksen eac6fa3482 #14772 Python: Update examples to use the object methods instead of deprecated wrappers 2026-09-22 14:19:23 +02:00
Kristian Bendiksen 9a6a18cf5d #14772 Python: Remove dead View.export_sim_well_fracture_completions wrapper
The server side of this command was removed in #11871 (simulation well
fractures). The Python wrapper has been failing ever since.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen ebf7a061d8 #14772 Python: Add View.export_contour_map_to_text as object method and forward exportContourMapToText to it
Rim3dView_exportContourMapToText exports the contour map of an Eclipse
or GeoMech contour map view. The implementation is extracted from the
RICF_SOURCE_INIT feature RicExportContourMapToTextFeature into a static
helper returning std::expected, used by both the object method and the
legacy command.

The Python EclipseContourMap/GeoMechContourMap.export_to_text() wrappers
are kept as aliases of the generated method.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen b1a822e7ac #14772 Python: Add Project.run_octave_script as object method and forward runOctaveScript to it
RimProject_runOctaveScript takes Case objects (empty means all Eclipse
cases) and runs the script once per case through the existing
multi-case process launcher. RicfRunOctaveScript resolves the case ids
and forwards to it.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 54c5ef7dad #14772 Python: Add GeoMechCase.create_well_bore_stability_plot as object method and forward createWellBoreStabilityPlot to it
RimGeoMechCase_createWellBoreStabilityPlot takes a WellPath object and
a time step and returns the plot. WBS parameters cannot be passed as a
method argument (child objects are not supported as gRPC method
parameters), so the C++ setter is available for the Ricf forwarder and
the Python wrapper copies a WbsParameters object into the created
plot's Parameters child instead.

The Python wrapper moves from Case to GeoMechCase, accepts both a
WellPath object and (deprecated) a well path name, and keeps the
optional parameters argument.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen 6a2e7a2a21 #14772 Python: Add WellLogPlot.export_data_as_las/ascii as object methods and forward exportWellLogPlotData to them
RimWellLogPlot_exportDataAsLas and RimWellLogPlot_exportDataAsAscii
return the exported file names. RicfExportWellLogPlotData picks the
method from the exportFormat and forwards to it. Add
RicfForwarding::findWellLogPlot().

The Python wrappers keep their signature and List[str] return value,
now calling the object methods. The misspelled export_tvdrkb argument
is kept as a deprecated alias of export_tvd_rkb.
2026-09-22 14:19:23 +02:00
Kristian Bendiksen e3e09c0d1f #14772 Python: Add WellPath.export_geometry as object method and forward exportWellPaths to it
RimWellPath_exportGeometry writes the well path to a .dev file in an
explicit folder. RicfExportWellPaths resolves the well path names (empty
means all) and the WELLPATHS export folder from the command file
executor, then forwards to it per well path.
Project.export_well_paths() in Python is kept and emits a
DeprecationWarning.
2026-09-22 14:19:23 +02:00