Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Property Tree Array Retrieval Mechanism #5922

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

bska
Copy link
Member

@bska bska commented Jan 28, 2025

This PR adds a new member function

template <typename T>
std::optional<std::vector<T>>
PropertyTree::get_child_items_as_vector(const std::string& child) const;

which retrieves an array-type property value from a property tree. Initially defined for int and double, but could be extended to std::string, float, or other element types as needed.

This is in preparation of making a revised version of #5801.

@bska
Copy link
Member Author

bska commented Jan 28, 2025

I'm creating this PR in draft mode because it depends on, and contains, the earlier PR #5921. I will keep the PR in a draft state until such time as it is ready for review.

@bska bska force-pushed the property-tree-get-children-as-vector branch 2 times, most recently from bd2d5ed to 02a0715 Compare January 29, 2025 14:02
@bska
Copy link
Member Author

bska commented Jan 29, 2025

The prerequisite PR #5921, and its follow-up cousin #5927, have both been merged into the master branch. Marking this PR as "ready for review" now and I'm running a build check.

@bska bska marked this pull request as ready for review January 29, 2025 14:04
@bska
Copy link
Member Author

bska commented Jan 29, 2025

jenkins build this please

opm/simulators/linalg/PropertyTree.cpp Outdated Show resolved Hide resolved
opm/simulators/linalg/PropertyTree.cpp Outdated Show resolved Hide resolved
This commit adds a new member function

    template <typename T>
    std::optional<std::vector<T>>
    get_child_items_as_vector(const std::string& child) const;

which retrieves an array-type property value from a property tree.
Initially defined for 'int' and 'double', but could be extended to
'std::string', 'float', or other element types as needed.
@bska bska force-pushed the property-tree-get-children-as-vector branch from 02a0715 to 03ac2cb Compare January 29, 2025 14:43
@bska
Copy link
Member Author

bska commented Jan 29, 2025

jenkins build this please

1 similar comment
@bska
Copy link
Member Author

bska commented Jan 29, 2025

jenkins build this please

@bska
Copy link
Member Author

bska commented Jan 29, 2025

There was build (regression test) failure earlier, but I just reran the build check and it came back green. I'm going to merge this, albeit a bit hesitantly, into the master branch. The earlier build failure suggests that something may be wrong in our system and I'll keep an eye out for that.

@bska bska merged commit aa5c52e into OPM:master Jan 29, 2025
1 check passed
@bska bska deleted the property-tree-get-children-as-vector branch January 29, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants