Commit Graph
18795 Commits
Author SHA1 Message Date
Magne Sjaastad ba4752e005 Add support for std::pair<bool, T> in PdmDataValueField
Extend PdmDataValueField to handle std::pair<bool, ArithmeticType> as DataType. This makes it possible to perform validation on these fields.
2026-02-16 16:54:22 +01:00
Magne Sjaastad fb633397e7 Refactor string-to-index assignment and add debug support
Refactored RifEclipseSummaryAddress to use setter methods for string-to-index assignments (vector, name, LGR), centralizing logic and improving maintainability. Added debug-only string members for easier inspection in debug builds, wrapped in a struct to preserve default comparison behavior. Updated all relevant constructors and factory methods to use the new setters. No impact on release builds.
2026-02-16 16:54:04 +01:00
Magne Sjaastad a97cb38ce2 #13581 Missing curves for _DIFF vectors
In ensembles, the m_differenceAddresses was initialized only for one of the realizations causing the statistics to fail. Replace with direct string compare with "_DIFF"
2026-02-16 11:32:22 +01:00
Magne Sjaastad 9aa5a3d222 Move number formatting setting to CAF to enable use in UI editors
* Move RiaNumberFormat to cafPdmUiNumberFormat in caf framework
* Add unit test
2026-02-16 11:32:04 +01:00
Magne Sjaastad 6cdcc4493a #13615 Read cloud config files, do not store in preferences
Adds config file path to cloud service prefs.

This change makes the configuration file used to set the preferences accessible within the application. The fields are now set to read-only and IO disabled by default.
2026-02-13 14:53:33 +01:00
Magne Sjaastad aa3372efce Add support for Reservoir Grid Ensembles
Introduce RimReservoirGridEnsemble and RimReservoirGridEnsembleBase to manage ensembles of grid-only Eclipse cases. Enable detection of identical grids for shared operations and statistics. Integrate grid ensembles into project structure, UI, and menu system. Refactor statistics and view handling to support both case groups and grid ensembles via a common interface. Add deferred grid loading, robust case referencing, and migration for well data source fields. New features and menu items allow creation and management of grid ensembles from file sets, enabling new workflows for grid-only ensemble analysis.
2026-02-13 14:35:52 +01:00
Magne Sjaastad 5819c14034 Rename to dock window in 3D to Data Sources 2026-02-13 14:35:52 +01:00
Magne Sjaastad 472d7fa296 Add readGridDimensions 2026-02-13 14:35:52 +01:00
magnesj 10e8d9e39a Fixes by clang-tidy 2026-02-13 08:22:16 +01:00
JJ e1cc5a8186 Sector model export: Handle removing keyword blocks (#13607)
* Add support for removing block keywords
2026-02-12 18:07:26 +01:00
Magne Sjaastad a2b3445692 Add support for custom percentiles in ensemble statistics
Introduced custom percentile handling for ensemble statistics:
- Added "CUSTOM" statistics type and percentile field to RifEclipseSummaryAddress
- Refactored RimEnsembleStatisticsCase to store and compute arbitrary percentiles
- RimEnsembleStatistics now parses custom percentiles from UI input
- RimEnsembleCurveSet and related interfaces updated to handle custom percentile curves and labels
- Hashing and statistics calculations now include custom percentiles for cache validity
2026-02-12 14:25:48 +01:00
Magne Sjaastad 8f365ea340 Refactor mean calculation into static helper method 2026-02-12 14:25:48 +01:00
Kristian Bendiksen 1ec53cc3f2 #13425 Fix ICD/AICD valve output in schedule generation
ICD valves now produce WSEGVALV and AICD valves now produce WSEGAICD
in the generated schedule. Three root causes were fixed:

- Create per-event valve templates with proper parameters instead of
  reusing default templates that lack orifice diameter and AICD fields
- Use perforation interval range for ICD/AICD valve positioning so
  valveLocations() returns non-empty results for the accumulator
- Add 5 AICD parameter fields to the Python API and event classes
2026-02-12 08:15:22 +01:00
Kristian Bendiksen 82e2dbc434 #13425 Fix WELSEGS date scoping: tubing events only appear at their event dates
Tubing event diameter/roughness values were leaking into earlier date
sections in the generated schedule. The WELSEGS collection functions
did not filter intervals by export date, unlike COMPSEGS and other
keywords which already received the exportDate parameter.

Thread exportDate through collectWelsegsData, collectWelsegsDataRecursively,
and collectWelsegsSegment. Add date-aware overloads of getDiameterAtMD and
getRoughnessAtMD that use isActiveOnDate to filter intervals. Update test
to verify tubing values only appear at their scheduled dates.
2026-02-12 08:15:22 +01:00
Kristian Bendiksen 6782d6a40e Refactor: remove unused code. 2026-02-12 08:15:22 +01:00
Kristian Bendiksen 561006c60c Refactor: Use export date instead of time step for MSW export. 2026-02-12 08:15:22 +01:00
Kristian Bendiksen a4dad97024 #13425 Add time-dependent well events and schedule data generation
Implement timeline-based event system for managing temporal changes in
well completions, perforations, valves, and production controls.

Features:
- Event timeline container with date-based querying
- Six event types: PERF, VALVE, TUBING, WSTATE, WTYPE, WCONTROL
- Schedule keyword generation (DATES, COMPDAT, WELSEGS, WCONPROD, WCONINJE)
- Multi-well schedule generation support
- Python GRPC API for event management
- YAML configuration file support
- Comprehensive test suite

Implementation:
- New directory: ApplicationLibCode/ProjectDataModel/WellEvents/
- Event classes inherit from RimWellEvent base class
- RimWellEventTimeline integrated into RimWellPath
- RicScheduleDataGenerator for multi-well schedule export
- Python API: event_timeline(), add_perf_event(), add_valve_event(), etc.
- Tests verify all event types and YAML config parsing

#13425 Add date tracking to valves and diameter/roughness intervals

Add creation date fields to RimWellPathValve and RimDiameterRoughnessInterval
to support filtering objects by date during completion data export.

- Add m_useCustomStartDate and m_startDate fields
- Add enableCustomStartDate(), setCustomStartDate(), isActiveOnDate() methods
- Set creation dates when applying valve and tubing events in RimWellEventTimeline

#13425 Add date-based filtering for schedule data export

Add optional export date parameter to MSW data collection functions to filter
valves and perforations based on their creation dates during schedule export.

- Add exportDate parameter to collectWsegvalvData, collectWsegAicdData,
  collectWsegSicdData, and collectCompsegData functions
- Filter valves by checking isActiveOnDate() on the associated RimWellPathValve
- Add RimPerforationInterval reference to RicMswPerforation for date filtering
- Pass export date from RicScheduleDataGenerator through the extraction chain

This ensures segment numbers reflect the full model while only including
objects active on the export date in output keywords.

Add test to prove compsegs changes over time.

#13425 Fix mypy type checking errors in well_events.py

- Add type annotations to all function parameters
- Fix generic type hints (dict -> Dict[str, Any])
- Import Any type for proper type safety
- Add type: ignore for method reassignment
- All 31 tests pass

#13425 Add schedule-level keyword events for non-well-specific keywords

Add a new event type called "Keyword Event" for schedule-level Eclipse
keywords (RPTRST, GRUPTREE, RPTSCHED, etc.) that are NOT tied to a
specific well path. This complements the existing RimWellEventKeyword
which operates at the well level.

- Add RimKeywordEvent class inheriting from RimWellEvent with null wellPath
- Add SCHEDULE_KEYWORD enum value to EventType
- Add addKeywordEvent() method to RimWellEventTimeline
- Add AddKeywordEvent Python API method to RimcWellEventTimeline
- Update RicScheduleDataGenerator to output global keywords after well sections
- Add Python wrapper add_keyword_event() with type inference
- Add tests and examples for RPTRST, GRUPTREE keywords
2026-02-12 08:15:22 +01:00
Magne Sjaastad 96eabcfd96 Fixes color shading for formation annotation.
Addresses an issue where color shading for formation annotations was not working as expected due to a null color legend in `RimWellLogTrack`.

Implements a fallback mechanism to use the default legend colors when the color shading legend is not available, ensuring proper visualization of formation annotations.

Related to https://github.com/OPM/ResInsight/issues/12974
2026-02-11 11:13:00 +01:00
Magne Sjaastad cb8a069ccd Add support for custom validation callbacks on fields
* Add support for custom validation callbacks on fields

Introduce setCustomValidationCallback to PdmFieldHandle, allowing custom validation logic via user-provided lambdas or functions. The validate() method now invokes this callback if set, in addition to built-in checks. Includes comprehensive unit tests for custom and combined validation scenarios. Backward compatible: default behavior unchanged if no callback is set.
2026-02-09 16:48:42 +01:00
Magne Sjaastad 93bd0b9c9d Refactor well log track settings into modular classes
* Refactor well log track settings into modular classes

Major refactoring of RimWellLogTrack to delegate property axis, formation, region annotation, and well path attribute settings to dedicated settings classes. Introduces RimWellLogPropertyAxisSettings, RimWellLogFormationSettings, RimWellLogRegionAnnotationSettings, and RimWellLogWellPathAttributeSettings, each encapsulating related fields, UI logic, and option handling. Old fields are retained for migration and backward compatibility. Updates enums and signatures for consistency.
2026-02-09 15:33:18 +01:00
Kristian Bendiksen 3449c8fea8 CI: Replace black with ruff for Python linting
Switch from black to ruff for Python code linting and formatting.
Ruff provides both linting (ruff check) and formatting (ruff format)
in a single fast tool.
2026-02-09 08:27:23 +01:00
Kristian Bendiksen f4dd29f70f Python: Fix ruff linting warnings
- Remove unused imports in test files
- Fix bare except clause to use except Exception
- Fix None comparisons to use 'is not None' / 'is None'
- Remove unused variable assignments
- Add noqa comments for intentional patterns (star imports, method
  redefinition for different classes, import after sys.path modification)
- Apply ruff formatting
2026-02-09 08:27:23 +01:00
Kristian Bendiksen 83eda0adcf Python: Replace os.spawnv with subprocess.Popen in Instance.launch
Use subprocess.Popen instead of os.spawnv to launch ResInsight, avoiding
fork() deprecation warnings in multi-threaded contexts with gRPC.
2026-02-09 08:27:23 +01:00
Kristian Bendiksen c09e09007b Python: Use spawn instead of fork for multiprocessing in tests
Set multiprocessing start method to "spawn" in conftest.py to avoid
fork() deprecation warnings when gRPC threads are present.
2026-02-09 08:27:23 +01:00
Magne Sjaastad af8213509a Improve description of statistical formulas (#13567)
* Refactor and extend percentile calculation utilities

Refactored percentile and quantile calculation logic for improved flexibility and maintainability. Added helper functions for quantile/percentile validation, introduced a new vector-based calculatePercentiles method, and updated calculateStatisticsCurves to use it. Refactored nearest-rank and interpolated percentile methods to accept percentiles as vectors and improved parameter validation. Enhanced documentation throughout and updated function signatures in the header for clarity.
2026-02-08 11:52:42 +01:00
Magne Sjaastad e8cd19f38c Revert use of Azure for caching, use GitHub Cache
Use of Azure for caching is not working well for private forks of ResInsight. Use a custom vcpkg-cache to store binaries on Github cache.

https://github.com/TAServers/vcpkg-cache

This reverts commit 006a316749.
This reverts commit 1101d74b69.
2026-02-06 21:48:32 +01:00
JJ 49147019a7 Python: Return names of imported properties (#13576)
* Python: Return names of imported properties
2026-02-06 19:34:34 +01:00
Kristian Bendiksen 1a07abb794 Fix build workflow for fork PRs
Make vcpkg binary caching conditional on secret availability. When
AZURE_VCPKG_STORAGE_ACCOUNT is not available (fork PRs), fall back to
building dependencies from source instead of failing.
2026-02-06 13:56:25 +01:00
Kristian Bendiksen c53761bbbf Fix Python linting workflow for fork PRs
The peter-evans/create-pull-request action fails for fork PRs because
it tries to fetch a branch that only exists in the fork. Add conditional
logic to handle fork PRs differently:

- Fork PRs: Run black --check --diff and fail if formatting issues exist
- Same-repo PRs and pushes: Keep existing behavior (run black, create fix PR)
2026-02-06 13:56:25 +01:00
Kristian Bendiksen 0dfbcd34f6 #13562 Add python api for getting parent well path
Fixes #13562.
2026-02-06 13:32:22 +01:00
Kristian Bendiksen 9ad2a76f1d #13571 Python: Fix issubclass check for PDM method return types
- Use issubclass() instead of exact class name matching
- Instantiate using child class to preserve subclass type
- Enables polymorphic return types in Python API

Fixes #13571.
2026-02-06 13:32:22 +01:00
Kristian Bendiksen ed995d1891 #10749 Python: Unify TypeVars and add bound for mypy compatibility
- Unify class-level TypeVars D and X into single module-level PdmObjectT
- Add bound="PdmObjectBase" for better type safety

Fixes #10749.
2026-02-06 13:32:22 +01:00
Magne Sjaastad e41b1be924 Refactor RifEclipseSummaryAddress to use string pool indices
Replaced direct string members with indices into RiaStringPool for vector, well, group, and LGR names. Updated all constructors, accessors, and logic to use the string pool for storage and retrieval. This change reduces memory usage and improves performance for repeated string values.

Fixes by clang-format
2026-02-05 13:49:00 +01:00
Magne Sjaastad cff1ab08c4 Add thread-safe RiaStringPool utility and unit tests
Introduce RiaStringPool for efficient shared string storage and retrieval by index, with thread-safe access using shared mutex. Pre-allocate empty string at index 0. Add comprehensive unit tests covering core functionality, concurrency, edge cases, and realistic usage.
2026-02-05 13:49:00 +01:00
Magne Sjaastad 2573c17aed #13545 Add Python support for std::pair
- add test for Python generator
- add Python support for std::pair<bool, float/double>
2026-02-04 20:30:45 +01:00
Magne Sjaastad f1f25ca760 #13510 Add exclusion support to range selection parsing
Range selection functions now support exclusion tokens (e.g., "!4", "!5-7") for omitting values or ranges. UI placeholder texts and documentation updated to reflect new syntax. Comprehensive tests added for exclusion cases, including edge scenarios. Open-ended exclusion ranges are safely ignored in min/max variant. This enhances flexibility and precision for value selection.
2026-02-04 18:07:28 +01:00
Kristian Bendiksen 71eb461f13 #13528 Add .w extension support for RMSWell files
Files with .w extension are now interpreted as RMSWell format instead of
falling back to ASCII parsing. Added file dialog filter and Python test.
2026-02-04 18:07:10 +01:00
magnesj e18518a960 Bump to version 2025.12.1-dev.08 2026-02-04 15:12:36 +01:00
Kristian Bendiksen da923b5731 #10751 Fix os.kill() on Windows by using SIGTERM instead of CTRL_C_EVENT
Fixes #10751.
2026-02-04 15:00:02 +01:00
JJ fe3cf9b94a Handle vector names with colon as groups in summary data explorer (#13555)
* Handle vector names with colon as groups in summary data explorer
2026-02-04 14:59:26 +01:00
Magne Sjaastad 83cefdd412 Update QMinimizePanel to use standard Qt expand/collapse icons (#13544)
* Update QMinimizePanel to use standard Qt expand/collapse icons

Replaced custom expand/collapse icons with standard Qt style icons for better platform consistency. Improved title bar layout by increasing right margin, vertically centering the title label, and updating the collapse button styling for a cleaner appearance and subtle hover effect.
2026-02-04 08:47:08 +01:00
Magne Sjaastad 913eab2065 Update cell count logic for radial grids and add bounds check
Refined total and active cell count calculations in Rim3dOverlayInfoConfig to exclude temporary grid cells for radial grids, ensuring overlay info is accurate. Added a bounds check in RigActiveCellInfo::gridActiveCellCounts to prevent out-of-range access.
2026-02-03 20:14:12 +01:00
Magne Sjaastad 058918a85e Improve UI labels for grid slices in radial and Cartesian modes
Enhance slice feature constructors and UI logic to support context-aware labeling for both Cartesian and radial grids. Axis and slice labels now clearly indicate both physical and index names (e.g., "Radial (I)", "Theta (J)"). Context menus and filter UIs display the appropriate labels based on grid type, improving clarity and usability.
2026-02-03 20:14:12 +01:00
Magne Sjaastad bda3522bd4 Improve error handling in createFilteredTimeStepInfos()
Add detailed logging and vector size checks when reading time step info from dynamic results. Now resize reportNumbersOnFile if needed, log errors on size mismatches, and always return an initialized vector. This increases robustness and aids debugging.
2026-02-03 20:14:12 +01:00
Magne Sjaastad 88524ac13f Add network summary keywords and refactor keyword import
Added keywords_network.json with network-related summary keywords.
Updated resource file to include the new JSON. Refactored keyword
import logic to accept multiple files, enabling loading of all
summary keyword sets (Eclipse, 6x, and network). This enhances
extensibility and supports network property summaries.
2026-02-03 17:14:45 +01:00
Magne Sjaastad adc450ead8 Update opm-common submodule to latest commit 2026-02-03 17:14:45 +01:00
Kristian Bendiksen 3e19046776 Janitor: remove unused code. 2026-02-02 16:49:11 +01:00
Magne Sjaastad 5356f078a5 #13435 Improve string list parsing for backslashes and quotes
Enhanced parsing in PdmFieldScriptingCapabilityIOHandler to correctly handle backslashes and escape sequences in both quoted and unquoted strings. Unquoted Windows paths now preserve backslashes, while quoted strings process escape sequences as expected. Added unit tests to verify correct handling of both cases.

Add tests for Windows-style path handling in rips API

Introduce test_windows_paths.py with two pytest tests to verify correct handling of Windows-style file paths (backslashes) in the rips Python API.
2026-02-02 16:35:53 +01:00
Magne Sjaastad d47de408aa Add pytest Windows 2026-02-02 16:35:39 +01:00
Kristian Bendiksen 116c3b83a5 #13530 Fix RMS well path import with spaces in well names
The RMS well parser now correctly handles well names containing spaces.
Previously, ReadNext<std::string>() stopped at the first whitespace,
causing parsing failures. The fix reads line 3 as a whole and parses
coordinates from the end, treating remaining tokens as the well name.
2026-02-02 14:26:19 +01:00