From 66c4dbc43fa942bac476ccaa5ae40b497565b1b8 Mon Sep 17 00:00:00 2001 From: Peter Verveer Date: Fri, 25 Oct 2024 11:03:42 +0000 Subject: [PATCH] Fix bug with static and dynamic perforations --- .../jobs/fm_well_trajectory/resinsight.py | 10 ++- .../test_well_trajectory_resinsight.py | 32 ++++++++ .../well_trajectory/resinsight/SPE1CASE1.DATA | 1 + .../resinsight/SPE1CASE1.SMSPEC | Bin 0 -> 440 bytes .../resinsight/SPE1CASE1.UNRST | Bin 0 -> 61208 bytes .../resinsight/SPE1CASE1.UNSMRY | Bin 0 -> 224 bytes .../well_trajectory/resinsight/config.yml | 69 +++++++++--------- .../resinsight/config_dynamic_perforation.yml | 43 +++++++++++ .../resinsight/config_static_perforation.yml | 43 +++++++++++ 9 files changed, 159 insertions(+), 39 deletions(-) create mode 100644 tests/testdata/well_trajectory/resinsight/SPE1CASE1.SMSPEC create mode 100644 tests/testdata/well_trajectory/resinsight/SPE1CASE1.UNRST create mode 100644 tests/testdata/well_trajectory/resinsight/SPE1CASE1.UNSMRY create mode 100644 tests/testdata/well_trajectory/resinsight/config_dynamic_perforation.yml create mode 100644 tests/testdata/well_trajectory/resinsight/config_static_perforation.yml diff --git a/src/everest_models/jobs/fm_well_trajectory/resinsight.py b/src/everest_models/jobs/fm_well_trajectory/resinsight.py index 03c71768..a1641c83 100644 --- a/src/everest_models/jobs/fm_well_trajectory/resinsight.py +++ b/src/everest_models/jobs/fm_well_trajectory/resinsight.py @@ -155,7 +155,7 @@ def _find_time_step( def _create_tracks( - properties: Iterable[str], + properties: Iterable[Union[DynamicDomainProperty, StaticDomainProperty]], property_type: str, case: rips.Case, well_path: rips.WellPath, @@ -163,9 +163,11 @@ def _create_tracks( time_step_num: Optional[int] = None, ) -> None: for property in properties: - track = well_log_plot.new_well_log_track(f"Track: {property}", case, well_path) + track = well_log_plot.new_well_log_track( + f"Track: {property.key}", case, well_path + ) track.add_extraction_curve( - case, well_path, property_type, property, time_step_num + case, well_path, property_type, property.key, time_step_num ) @@ -364,7 +366,7 @@ def _generate_welspecs( lines = file_obj.readlines() with open(export_filename, "w") as file_obj: - welspecs = False, False + welspecs, compdat = False, False for line in lines: stripped_line = line.strip() if not stripped_line or stripped_line.startswith("--"): diff --git a/tests/jobs/well_trajectory/test_well_trajectory_resinsight.py b/tests/jobs/well_trajectory/test_well_trajectory_resinsight.py index 4c5a37b3..634c58f0 100644 --- a/tests/jobs/well_trajectory/test_well_trajectory_resinsight.py +++ b/tests/jobs/well_trajectory/test_well_trajectory_resinsight.py @@ -95,3 +95,35 @@ def test_well_trajectory_resinsight_main_entry_point_mixed( output = expected.relative_to("expected_mixed") assert output.is_file() assert filecmp.cmp(expected, output, shallow=False) + + +@pytest.mark.resinsight +def test_well_trajectory_resinsight_main_entry_point_no_mlt_static_perforation( + copy_testdata_tmpdir, +): + copy_testdata_tmpdir(Path(TEST_DATA) / "resinsight") + for path in Path.cwd().glob("mlt_*.json"): + path.unlink() + main_entry_point("-c config_static_perforation.yml -E SPE1CASE1".split()) + + for expected in Path("expected").glob("**/*"): + if expected.is_file(): + output = expected.relative_to("expected") + assert output.is_file() + assert filecmp.cmp(expected, output, shallow=False) + + +@pytest.mark.resinsight +def test_well_trajectory_resinsight_main_entry_point_no_mlt_dynamic_perforation( + copy_testdata_tmpdir, +): + copy_testdata_tmpdir(Path(TEST_DATA) / "resinsight") + for path in Path.cwd().glob("mlt_*.json"): + path.unlink() + main_entry_point("-c config_dynamic_perforation.yml -E SPE1CASE1".split()) + + for expected in Path("expected").glob("**/*"): + if expected.is_file(): + output = expected.relative_to("expected") + assert output.is_file() + assert filecmp.cmp(expected, output, shallow=False) diff --git a/tests/testdata/well_trajectory/resinsight/SPE1CASE1.DATA b/tests/testdata/well_trajectory/resinsight/SPE1CASE1.DATA index e1a0524f..28c890ca 100644 --- a/tests/testdata/well_trajectory/resinsight/SPE1CASE1.DATA +++ b/tests/testdata/well_trajectory/resinsight/SPE1CASE1.DATA @@ -387,6 +387,7 @@ WCONINJE DATES 1 'JAN' 2015 / +2 'JAN' 2015 / / END diff --git a/tests/testdata/well_trajectory/resinsight/SPE1CASE1.SMSPEC b/tests/testdata/well_trajectory/resinsight/SPE1CASE1.SMSPEC new file mode 100644 index 0000000000000000000000000000000000000000..a5e88bd5997e8425d3e32f16725c40604f2c48c1 GIT binary patch literal 440 zcmb_Yy9&cF40KcIYx0=Ud;g%Ds6`V>T(BKV_WpN&rFX%GBy(jBo$%=_%NS$(khN3s z#+Zg2*#akE2Yd>*QB#(f9qRMFlZZ@R=l&G*qNnc%4aqt1!(yHmbpu=q_Q*AOXP-K~ zU(qMgaUZ%N! WJIB0LFB!et|8oDp@mn7#x%~n2xiQQD literal 0 HcmV?d00001 diff --git a/tests/testdata/well_trajectory/resinsight/SPE1CASE1.UNRST b/tests/testdata/well_trajectory/resinsight/SPE1CASE1.UNRST new file mode 100644 index 0000000000000000000000000000000000000000..fbd2414d04fcc37cc2a25e6aa2a8e441db7539f4 GIT binary patch literal 61208 zcmeHQ3v^V)8Qu`&CEAsOuTn^hMYIa|MA5LbNp2n*UI_{aids*xVwDP2Ky4Q#f>6tW zHhaqBwAiAk^??*Dc(6oJP!LUp3LX%Hl8T}=RN{lGbpE^d+r1ff?rZPvCS>NE$v^YY zH~;_7H+Sydo$T%e0)b$qHhjocgY)tNfj~~#kP#Y}L7v-E-H<`jmulf6u3D79w7ZqJ z2LicWui$?Pn=EzWO3Jw$a*hem-YB;*+NnR4DVx(GUYW-8eLQm;@dSUTam`sg4>VeS z!sSGsSMq$Ep(D|S=Tmv6Sjac|p)pb-Td=1qT>LTmwtv^59g2x!KJ9r$25V!O(>WoaH2FpGEzK|dpVwG8s|woi*w3VDJQZ`^GAGkG^}~?LtIflndkXD zo9BjCQ%;x*nIZEvD#OV16zd7H#uW6l&Q9lPfydKA~8*7{vsZD3+c;Y!9vtUiS;Au zvsL$d9eZ7;mu*`7aOe32y+REah3@%e-p$}c z0KH6-H?d8oGe@T8&&-A&<=hCj5*!s@p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RPi;dk33sAW_5fog$Z@1_9F%mvS!=Hc|X%`>EX0L zbBUMPg?~u5ameht)n{!!H@`W5Qtzn@@iL(fy`7900LYrE8Ew}0>(bM%AKIBqJoDkW8(nqVtE~eiK z*ArW_{)wuYvoQ*;XDeb>^&+K<)rd91$upvjP)?fhx_ z)STYIJJ6pk&H3Hs?=RoUBzoXv((`#j&E(Sz3ed-@mq}zZP5U~hSQbLI8lrCt+%#MnDK|T z=!1PZcE2@t=y)w!yF!Z=ueHX}csQoIwn(eqf0iXy$4t3NtA2h7$M&?rmfK=d*CED7s(H1U4cT%KhIZodA9%_SBUM<8%% zpB}rM@Nmh9{au~l6vjIP11HS9|I%G!s+?H3?0Y{ppY`mdOAEuqp3f>rhDXo?ns`6U zZ(Kh&eR<_$`Hjn`SlcJeqDlFU4^6hm{-q(maq^1%#$~0}Hfc*6Tt+9mpd>NmQOE`9|4fcI|Olo}M`Ai#9R5`Sq?q`9(V7`^c GMezSsst%$6 literal 0 HcmV?d00001 diff --git a/tests/testdata/well_trajectory/resinsight/SPE1CASE1.UNSMRY b/tests/testdata/well_trajectory/resinsight/SPE1CASE1.UNSMRY new file mode 100644 index 0000000000000000000000000000000000000000..09d403d55fc8bd1c8bbc2457a27324bfa72e2945 GIT binary patch literal 224 zcmZQzU=Rp)4fJpcQcz%EU|{t03vmU~0zk|H;zMZxUr#^J;1JgUkQlO>|3Cm!6W|!+ z=o<_+hbhR_(FZ6FGKT|*VF1L&XCD(#9%L_0`=ADa)!?$vzJY