Repository navigation
Resync opm keywords with upstream #555
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
Open
larsevj
wants to merge
5
commits into
master
Choose a base branch
from
fix_and_update_opm_keywords
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2596ec5
Drop columns that are all NaN/None in keyworddata_to_df
larsevj 15b015b
Resync opm keywords with upstream
larsevj 28a7941
Move runmetoupdate to scripts
larsevj fd30e1d
Fix python warning
larsevj cdf2256
Add workflow to check opmkeywords
larsevj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Check OPM Keywords | ||
|
|
||
| on: | ||
| schedule: | ||
| # Run weekly on Monday at 00:00 UTC | ||
| - cron: '0 0 * * 1' | ||
|
|
||
| jobs: | ||
| check-opmkeywords: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Run opmkeywords sync script | ||
| run: | | ||
| set -euo pipefail | ||
| cd scripts | ||
| bash runmetoupdate.sh src/res2df/opmkeywords | ||
|
|
||
| - name: Check for changes | ||
| run: | | ||
| if [ -n "$(git status --porcelain src/res2df/opmkeywords/)" ]; then | ||
| echo "::error::OPM keywords are out of date!" | ||
| echo "The following files have changed:" | ||
| git status --porcelain src/res2df/opmkeywords/ | ||
| echo "" | ||
| echo "Please run 'cd scripts && bash runmetoupdate.sh' locally and commit the changes." | ||
| git diff src/res2df/opmkeywords/ | ||
| exit 1 | ||
| else | ||
| echo "OPM keywords are up to date." | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Run this to download a fresh copy of E100 keyword metadata from opm-common | ||
|
|
||
| # Default output directory (if not provided as an argument) | ||
| OUTPUT_DIR=${1:-"./"} | ||
|
|
||
| # Ensure the output directory exists | ||
| mkdir -p "$OUTPUT_DIR" | ||
|
|
||
| # Remember to sync the keyword list here with the list in common.py | ||
| keywords=" | ||
| BRANPROP | ||
| COMPDAT | ||
| COMPLUMP | ||
| COMPSEGS | ||
| DENSITY | ||
| EQLDIMS | ||
| EQUIL | ||
| FAULTS | ||
| GRUPNET | ||
| GRUPTREE | ||
| NODEPROP | ||
| PBVD | ||
| PDVD | ||
| PVDG | ||
| PVDO | ||
| PVTG | ||
| PVTO | ||
| PVTW | ||
| ROCK | ||
| RSVD | ||
| RVVD | ||
| SGFN | ||
| SGOF | ||
| SGWFN | ||
| SLGOF | ||
| SOF2 | ||
| SOF3 | ||
| SWFN | ||
| SWOF | ||
| TABDIMS | ||
| VFPPROD | ||
| VFPINJ | ||
| WCONHIST | ||
| WCONINJE | ||
| WCONINJH | ||
| WCONPROD | ||
| WELOPEN | ||
| WELSEGS | ||
| WELSPECS | ||
| WLIST | ||
| WSEGAICD | ||
| WSEGSICD | ||
| WSEGVALV | ||
| " | ||
|
|
||
| for keyword in $keywords; do | ||
| firstletter=${keyword:0:1} | ||
| wget https://raw.githubusercontent.com/OPM/opm-common/master/opm/input/eclipse/share/keywords/000_Eclipse100/$firstletter/$keyword -O "$OUTPUT_DIR/$keyword" | ||
|
|
||
| # Assume that the presence of num_tables in some keywords is sort of a bug: | ||
| perl -p -i -e 's/num_tables/size/g' "$OUTPUT_DIR/$keyword" | ||
|
|
||
| # Fix multi-line comments in JSON files by replacing newlines with spaces | ||
| perl -0777 -p -i -e 's/"comment"\s*:\s*"((?:[^"\\]|\\.)*)"/"comment": "\1"/g; s/\n/ /g if /"comment":/' "$OUTPUT_DIR/$keyword" | ||
|
|
||
|
|
||
| # Pretty-print all json files (this is also done upstream) | ||
|
|
||
| if jq '.' "$OUTPUT_DIR/$keyword" > "$OUTPUT_DIR/$keyword.tmp"; then | ||
| rm "$OUTPUT_DIR/$keyword" && mv "$OUTPUT_DIR/$keyword.tmp" "$OUTPUT_DIR/$keyword" | ||
| else | ||
| rm "$OUTPUT_DIR/$keyword.tmp" | ||
| fi | ||
|
|
||
| git add "$OUTPUT_DIR/$keyword" | ||
| done | ||
|
|
||
| git status . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the test failed due to more columns expected in the new version of
opmkeywords