Skip to content

Deprecate Action RST Dimension Function#5238

Open
bska wants to merge 1 commit into
OPM:masterfrom
bska:deprecate-action-rst-dimfunc
Open

Deprecate Action RST Dimension Function#5238
bska wants to merge 1 commit into
OPM:masterfrom
bska:deprecate-action-rst-dimfunc

Conversation

@bska

@bska bska commented Jul 1, 2026

Copy link
Copy Markdown
Member

This PR moves away from representing restart file action dimensions as a linear array with unnamed indices and instead switches to using the named helper functions entriesPer*() as a means of allocating the individual ACTIONX restart file arrays. This, in turn, requires making the entriesPerLine() and entriesPerZLACT() helper functions public instead of private in CreateActionRSTDims.cpp.

While here, simplify the implementations of these functions and fix a latent bug in Actdims::line_size() which used std::div() with mixed mode arithmetic (std::size_t and int) for which there is no direct overload in the standard library. We also introduce range checking for the various ACTDIMS items and add Doxygen style documentation to class Actdims and the entriesPer*() functions.

@bska bska added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Jul 1, 2026
@bska

bska commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

jenkins build this please

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR deprecates the legacy “linear array of unnamed indices” representation for ACTION restart dimensions and shifts allocation/stride computation to named entriesPer*() helper functions, while also hardening Actdims with clearer semantics, documentation, and safer arithmetic.

Changes:

  • Expose and use named entriesPer*() helpers for ACTIONX restart array sizing/strides; deprecate createActionRSTDims().
  • Refactor AggregateActionxData allocation to avoid passing around the legacy dims vector.
  • Improve Actdims with range checking, Doxygen docs, and a safer line_size() implementation.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_AggregateActionxData.cpp Updates tests to use entriesPer*() stride helpers instead of indexing into a dims vector.
opm/output/eclipse/WriteRestartHelpers.hpp Publishes entriesPerLine()/entriesPerZLACT() and adds Doxygen + deprecation annotation for legacy dims API.
opm/output/eclipse/CreateActionRSTDims.cpp Implements the public entriesPer*() helpers and keeps (now-deprecated) createActionRSTDims() as a wrapper.
opm/output/eclipse/AggregateActionxData.hpp Updates internal constructor signature to remove dependency on legacy dims vector.
opm/output/eclipse/AggregateActionxData.cpp Allocates ACTIONX arrays using entriesPer*() and num_actions rather than the legacy dims vector.
opm/input/eclipse/Schedule/Action/Actdims.hpp Adds Doxygen docs and inlines simple accessors for ACTDIMS fields.
opm/input/eclipse/Schedule/Action/Actdims.cpp Adds ACTDIMS range validation and fixes line_size() to avoid mixed-type std::div() usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_AggregateActionxData.cpp Outdated
Comment thread opm/output/eclipse/CreateActionRSTDims.cpp Outdated
Comment thread opm/output/eclipse/WriteRestartHelpers.hpp Outdated
Comment thread opm/output/eclipse/WriteRestartHelpers.hpp Outdated
Comment thread opm/output/eclipse/WriteRestartHelpers.hpp Outdated
@bska bska force-pushed the deprecate-action-rst-dimfunc branch from 8e0cb9d to d653608 Compare July 2, 2026 07:57
@bska bska requested a review from Copilot July 2, 2026 08:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread opm/output/eclipse/WriteRestartHelpers.hpp Outdated
@bska bska force-pushed the deprecate-action-rst-dimfunc branch from bbd7081 to 1b5d0b6 Compare July 2, 2026 08:37

@akva2 akva2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. A couple of very petty observations.

Comment thread opm/output/eclipse/AggregateActionxData.cpp Outdated
Comment thread opm/output/eclipse/CreateActionRSTDims.cpp Outdated
@bska bska force-pushed the deprecate-action-rst-dimfunc branch from 1b5d0b6 to 8924cd7 Compare July 2, 2026 09:41
@bska

bska commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

A couple of very petty observations.

Not petty at all–clear improvements of the patch.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread opm/input/eclipse/Schedule/Action/Actdims.cpp
Comment thread opm/input/eclipse/Schedule/Action/Actdims.cpp
@bska bska force-pushed the deprecate-action-rst-dimfunc branch from 8665f35 to 586e007 Compare July 2, 2026 10:06
@bska bska requested a review from Copilot July 2, 2026 10:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Comment thread tests/test_AggregateActionxData.cpp
Comment thread tests/test_AggregateActionxData.cpp
Comment thread tests/test_AggregateActionxData.cpp
@bska bska force-pushed the deprecate-action-rst-dimfunc branch from 586e007 to 2dc4f4c Compare July 2, 2026 10:21
@bska bska requested a review from Copilot July 2, 2026 10:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread opm/output/eclipse/CreateActionRSTDims.cpp Outdated
@bska bska force-pushed the deprecate-action-rst-dimfunc branch from 2dc4f4c to f1b0782 Compare July 2, 2026 10:40
@bska bska requested a review from Copilot July 2, 2026 10:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread opm/output/eclipse/CreateActionRSTDims.cpp
Comment thread opm/input/eclipse/Schedule/Action/Actdims.hpp Outdated
@bska bska force-pushed the deprecate-action-rst-dimfunc branch from 46c3037 to 8a3cdb6 Compare July 2, 2026 11:29
@bska bska requested a review from Copilot July 2, 2026 11:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread opm/output/eclipse/CreateActionRSTDims.cpp
Comment thread opm/input/eclipse/Schedule/Action/Actdims.cpp
This commit moves away from representing restart file action
dimensions as a linear array with unnamed indices and instead
switches to using the named helper functions entriesPer*() as a
means of allocating the individual ACTIONX restart file arrays.
This, in turn, requires making the entriesPerLine() and
entriesPerZLACT() helper functions public instead of private in
CreateActionRSTDims.cpp.

While here, simplify the implementations of these functions and fix
a latent bug in Actdims::line_size() which used std::div() with
mixed mode arithmetic (std::size_t and int) for which there is no
direct overload in the standard library.  We also introduce range
checking for the various ACTDIMS items and add Doxygen style
documentation to class Actdims and the entriesPer*() functions.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@bska bska force-pushed the deprecate-action-rst-dimfunc branch from 8a3cdb6 to 46deda8 Compare July 2, 2026 11:59
@bska bska requested a review from Copilot July 2, 2026 12:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants