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

Wsegaicd support #201

Merged
merged 9 commits into from
Nov 20, 2020
Merged

Wsegaicd support #201

merged 9 commits into from
Nov 20, 2020

Conversation

tklov11
Copy link
Collaborator

@tklov11 tklov11 commented Nov 17, 2020

Support for WSEGSICD and WSEGAICD was added in response to issue #199. Functionality is included in

  • ecl2df/compdat.py
  • ecl2df/common.py
    -ecl2df/opmkeywords/WSEGSICD
    -ecl2df/opmkeywords/WSEGAICD

Two tests are added to

  • tests/test_compdat.py

New include files for testing are added to

  • tests/data/reek/eclipse/include/schedule/

@tklov11 tklov11 requested a review from berland November 20, 2020 09:53
ecl2df/common.py Outdated
@@ -54,6 +54,8 @@
"WELOPEN",
"WELSEGS",
"WELSPECS",
"WSEGSICD",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make list alphabetical.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

if "KEYWORD_IDX" in compdat_df.columns:
compdat_df.drop(["KEYWORD_IDX"], axis=1, inplace=True)

return dict(COMPDAT=compdat_df, COMPSEGS=compsegs_df, WELSEGS=welsegs_df)
if "KEYWORD_IDX" in wsegsicd_df.columns:
wsegsicd_df.drop(["KEYWORD_IDX"], axis=1, inplace=True)
Copy link
Collaborator

@berland berland Nov 20, 2020

Choose a reason for hiding this comment

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

I see this drop is not done for WELSEGS and COMPSEGS, for which WSEGxICD are analogues. So potentially it should not be done for WSEx*ICD or it should also be done for WELSEGS and COMPSEGS?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, her har det skjedd noe feil. La meg sjekke litt og gjøre en pull-request til.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, WSEGxICD is analogous to COMPDAT with only one record, so I used COMPDAT as a template. WELSEGS and COMPSEGS have two records. KEYWORD_IDX is not defined in WELSEGS and COMPSEGS and therefore not dumped. If KEYWORD_IDX should have been defined/dumped for WELSEGS and COMPSEGS I think you should discuss with the developer for those keywords?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks, that sounds reasonable. Maybe that information should be included as a code comment.

assert compdat_df["WELL"].unique()[0] == "OP_6"

# Check that we have not used the very long opm.io term here:
assert "CONNECTION_TRANSMISSIBILITY_FACTOR" not in compdat_df
Copy link
Collaborator

@berland berland Nov 20, 2020

Choose a reason for hiding this comment

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

This line should not be needed here, as it is tested further up?
Can you shorten the tests here to only those that are not tested elsewhere?

(test code also requires future maintenance, and superfluous test code increases maintenance burden)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ja, fjerner alt som er gjort før men legger inn en test for WSEGSICD i tillegg til WSEGAICD som ligger der fra tidligere.

@tklov11 tklov11 requested a review from berland November 20, 2020 12:06
Copy link
Collaborator

@berland berland left a comment

Choose a reason for hiding this comment

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

Good! Thanks for the contribution

Conflicts:
	tests/test_compdat.py
@tklov11 tklov11 merged commit 74d32f6 into equinor:master Nov 20, 2020
anders-kiaer pushed a commit to anders-kiaer/ecl2df that referenced this pull request Nov 25, 2020
* Added support for WSEGAICD and WSEGSICD in response to issue equinor#199

Co-authored-by: Trygve Kløv (ST RRR RM) <tklov@st-linrgsn199.st.statoil.no>
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