diff --git a/.travis.yml b/.travis.yml index d15ecc7..b68b63f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ python: os: - linux - if: (branch =~ /^dev/) OR (repo == equinor/xtgeoapp-grd3dmaps) before_script: @@ -16,8 +15,6 @@ before_script: - pip install black && black --check *.py src tests/test*.py docs/*.py || echo - pip install flake8 - flake8 src tests docs - - git clone https://github.com/equinor/xtgeo-testdata.git ../xtgeo-testdata - script: - pip install -r requirements.txt diff --git a/docs/config-hc.rst b/docs/config-hc.rst index f3945ce..40382f6 100644 --- a/docs/config-hc.rst +++ b/docs/config-hc.rst @@ -62,7 +62,7 @@ The following example shows input from Eclipse where a Eclipse root name must ex .. code-block:: yaml input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: - 19991201 - 20021101 @@ -78,8 +78,8 @@ It is possible to use a grid spsfication from a ROFF file instead of an EGRID fi .. code-block:: yaml input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK - grid: ../xtgeo-testdata/3dgrids/reek/reek_grid_fromegrid.roff + eclroot: tests/data/reek/REEK + grid: tests/data/reek/reek_grid_fromegrid.roff dates: - 19991201 @@ -94,8 +94,8 @@ to make HC thickness maps from geomodels directly. .. code-block:: yaml input: - grid: ../xtgeo-testdata/3dgrids/reek/reek_geo_grid.roff - stoiip: {STOIIP: ../xtgeo-testdata/3dgrids/reek/reek_geo_stooip.roff} + grid: tests/data/reek/reek_geo_grid.roff + stoiip: {STOIIP: tests/data/reek/reek_geo_stooip.roff} dates: [19900101] The "STOIIP" in the example above is the name of the property within the ROFF file. @@ -113,7 +113,7 @@ Dates can now be read directly from an external global-variables YAML file: .. code-block:: yaml input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: !include_from tests/yaml/global_config3a.yml::global.DATES diffdates: !include_from tests/yaml/global_config3a.yml::global.DIFFDATES @@ -134,7 +134,7 @@ properties, either continuous of discrete. For example: - name: FACIES discrete: Yes - source: ../xtgeo-testdata/3dgrids/reek/reek_sim_facies2.roff + source: tests/data/reek/reek_sim_facies2.roff discrange: [1] # Filter for a discrete will be spesic number (code) diff --git a/docs/usage.rst b/docs/usage.rst index 66ba027..3c366a6 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -79,7 +79,7 @@ file, e.g. as: .. code-block:: yaml input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: !include_from ../../share/fmuconfig/output/global_variables.yml::global.DATES diffdates: !include_from ../../share/fmuconfig/output/global_variables.yml::global.DIFFDATES diff --git a/src/xtgeoapp_grd3dmaps/avghc/_compute_avg.py b/src/xtgeoapp_grd3dmaps/avghc/_compute_avg.py index 537e666..ca15bc1 100644 --- a/src/xtgeoapp_grd3dmaps/avghc/_compute_avg.py +++ b/src/xtgeoapp_grd3dmaps/avghc/_compute_avg.py @@ -1,13 +1,12 @@ import getpass -from time import localtime, strftime from collections import OrderedDict +from time import localtime, strftime + import numpy as np import numpy.ma as ma - import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.surface import RegularSurface - from xtgeoviz import quickplot xtg = XTGeoDialog() @@ -120,13 +119,12 @@ def do_avg_plotting(config, avgd): pcfg = _avg_plotsettings(config, zname, pname) - xtg.say("Plot to {}".format(plotfile)) + xtg.say(f"Plot to {plotfile}") usevrange = pcfg["valuerange"] faults = None if pcfg["faultpolygons"] is not None: - xtg.say("Try: {}".format(pcfg["faultpolygons"])) try: fau = xtgeo.polygons_from_file(pcfg["faultpolygons"], fformat="guess") faults = {"faults": fau} diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..521ae4a --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,31 @@ +"""Conftest.py pytest setup.""" +import os +import shutil + +import pytest + + +@pytest.fixture(name="datatree", scope="session", autouse=True) +def fixture_datatree(tmp_path_factory): + """Create a tmp folder structure for testing.""" + tmppath = tmp_path_factory.mktemp("grd3dmaps") + + shutil.copytree("tests/yaml", tmppath / "tests" / "yaml") + shutil.copytree("tests/data", tmppath / "tests" / "data") + + print("Temporary folder: ", tmppath) + os.chdir(tmppath) + return tmppath + + +@pytest.fixture(name="erttree", scope="session", autouse=True) +def fixture_erttree(tmp_path_factory): + """Create a tmp folder structure for testing ert connection.""" + tmppath = tmp_path_factory.mktemp("ertrun") + + shutil.copytree("tests/yaml", tmppath / "tests" / "yaml") + shutil.copytree("tests/data", tmppath / "tests" / "data") + + print("Temporary folder: ", tmppath) + os.chdir(tmppath) + return tmppath diff --git a/tests/data/reek/REEK.EGRID b/tests/data/reek/REEK.EGRID new file mode 100755 index 0000000..403b582 Binary files /dev/null and b/tests/data/reek/REEK.EGRID differ diff --git a/tests/data/reek/REEK.INIT b/tests/data/reek/REEK.INIT new file mode 100755 index 0000000..7ed8a23 Binary files /dev/null and b/tests/data/reek/REEK.INIT differ diff --git a/tests/data/reek/REEK.UNRST b/tests/data/reek/REEK.UNRST new file mode 100755 index 0000000..c3af089 Binary files /dev/null and b/tests/data/reek/REEK.UNRST differ diff --git a/tests/data/reek/reek--sim_swat--20021201_19991201.roff b/tests/data/reek/reek--sim_swat--20021201_19991201.roff new file mode 100644 index 0000000..baee7a0 Binary files /dev/null and b/tests/data/reek/reek--sim_swat--20021201_19991201.roff differ diff --git a/tests/data/reek/reek2_grid_w_zerolayer.roff b/tests/data/reek/reek2_grid_w_zerolayer.roff new file mode 100644 index 0000000..8aea768 Binary files /dev/null and b/tests/data/reek/reek2_grid_w_zerolayer.roff differ diff --git a/tests/data/reek/reek2_grid_w_zerolayer_dz.roff b/tests/data/reek/reek2_grid_w_zerolayer_dz.roff new file mode 100644 index 0000000..f4d322a Binary files /dev/null and b/tests/data/reek/reek2_grid_w_zerolayer_dz.roff differ diff --git a/tests/data/reek/reek_geo_grid.roff b/tests/data/reek/reek_geo_grid.roff new file mode 100644 index 0000000..d336e52 Binary files /dev/null and b/tests/data/reek/reek_geo_grid.roff differ diff --git a/tests/data/reek/reek_geo_stooip.roff b/tests/data/reek/reek_geo_stooip.roff new file mode 100644 index 0000000..d2b0ea9 Binary files /dev/null and b/tests/data/reek/reek_geo_stooip.roff differ diff --git a/tests/data/reek/reek_grid_fromegrid.roff b/tests/data/reek/reek_grid_fromegrid.roff new file mode 100644 index 0000000..da21510 Binary files /dev/null and b/tests/data/reek/reek_grid_fromegrid.roff differ diff --git a/tests/data/reek/reek_hcmap_rotated.gri b/tests/data/reek/reek_hcmap_rotated.gri new file mode 100644 index 0000000..57e8a6e Binary files /dev/null and b/tests/data/reek/reek_hcmap_rotated.gri differ diff --git a/tests/data/reek/reek_sim_facies2.roff b/tests/data/reek/reek_sim_facies2.roff new file mode 100644 index 0000000..10e0a27 Binary files /dev/null and b/tests/data/reek/reek_sim_facies2.roff differ diff --git a/tests/data/reek/reek_sim_grid.roff b/tests/data/reek/reek_sim_grid.roff new file mode 100644 index 0000000..09a58df Binary files /dev/null and b/tests/data/reek/reek_sim_grid.roff differ diff --git a/tests/data/reek/reek_sim_permx.roff b/tests/data/reek/reek_sim_permx.roff new file mode 100644 index 0000000..7d006ac Binary files /dev/null and b/tests/data/reek/reek_sim_permx.roff differ diff --git a/tests/data/reek/reek_sim_poro.roff b/tests/data/reek/reek_sim_poro.roff new file mode 100644 index 0000000..c131d12 Binary files /dev/null and b/tests/data/reek/reek_sim_poro.roff differ diff --git a/tests/data/reek/reek_sim_zone.roff b/tests/data/reek/reek_sim_zone.roff new file mode 100644 index 0000000..546573f Binary files /dev/null and b/tests/data/reek/reek_sim_zone.roff differ diff --git a/tests/data/reek/top_upper_reek_faultpoly.xyz b/tests/data/reek/top_upper_reek_faultpoly.xyz new file mode 100644 index 0000000..78f0e34 --- /dev/null +++ b/tests/data/reek/top_upper_reek_faultpoly.xyz @@ -0,0 +1,761 @@ +460442.178467 5933082.582123 1696.099487 +460443.011230 5933134.454590 1695.254517 +460458.031494 5933198.932831 1693.539917 +460480.887451 5933349.131836 1690.122192 +460478.841919 5933429.378601 1684.303589 +460495.364258 5933531.695862 1676.969238 +460507.251831 5933683.163269 1666.056152 +460510.558960 5933725.300781 1663.020142 +460515.361816 5933758.781860 1661.416748 +460541.261963 5933961.682129 1651.647583 +460540.847412 5934108.297607 1644.277222 +460536.260132 5934306.251709 1634.260742 +460536.082153 5934310.385132 1634.018799 +460536.331909 5934463.187378 1624.987061 +460535.780396 5934483.541382 1623.791626 +460544.232056 5934523.426147 1625.732422 +460559.978638 5934597.734375 1629.348145 +460568.633423 5934632.104126 1631.636841 +460568.651611 5934632.062744 1631.646973 +460573.130005 5934649.839966 1632.831787 +460578.503174 5934690.286621 1635.427124 +460607.067444 5934905.310547 1649.224609 +460639.592712 5935092.912842 1661.420898 +460646.246643 5935196.157959 1667.898804 +460647.832397 5935268.600342 1670.894287 +460647.670715 5935392.572754 1675.991699 +460638.834717 5935560.812744 1682.823120 +460619.547119 5935719.237549 1689.146240 +460608.266907 5935815.842285 1693.006958 +460598.449341 5935894.168701 1695.805420 +460589.030518 5935969.315674 1698.490479 +460588.416748 5935974.211914 1698.665405 +460585.017090 5935999.029541 1699.548218 +460564.809326 5936112.226318 1701.266846 +460551.286133 5936212.247314 1702.793335 +460542.008057 5936377.000732 1705.331909 +460539.119751 5936424.499023 1706.063354 +460538.217896 5936439.327637 1706.291748 +460534.962280 5936481.356201 1706.937622 +460508.274414 5936468.388184 1692.961792 +460508.396851 5936439.740234 1691.478638 +460507.949219 5936400.763916 1689.477051 +460504.720215 5936198.425049 1679.109619 +460508.703247 5936128.556641 1675.395508 +460518.024170 5936034.336182 1670.282593 +460512.308105 5935932.965820 1657.050415 +460503.299194 5935798.381104 1639.461670 +460498.230835 5935715.602539 1628.650513 +460503.529297 5935514.908447 1611.155884 +460500.442749 5935449.110596 1605.168091 +460482.997803 5935283.251709 1589.569458 +460492.343018 5935192.149414 1590.410034 +460497.240723 5935129.928955 1590.983887 +460490.307373 5934811.622803 1593.916504 +460490.748657 5934791.962891 1594.097778 +460493.068115 5934688.609375 1595.050537 +460482.934326 5934566.702515 1596.172852 +460477.672607 5934522.642578 1596.578247 +460476.802979 5934515.025024 1596.665527 +460476.769531 5934502.117432 1597.423096 +460472.156494 5934220.770630 1612.293335 +460475.743530 5934094.689087 1618.937866 +460476.583008 5934002.248413 1623.815674 +460448.760986 5933758.289917 1636.791260 +460449.112915 5933742.553284 1638.423462 +460450.351196 5933585.602295 1654.773071 +460438.546143 5933389.213501 1675.644409 +460447.414062 5933318.570435 1682.745728 +460444.036255 5933203.690399 1689.309570 +460436.794067 5933131.683167 1693.814209 +460442.178467 5933082.582123 1696.099487 +460441.245728 5933024.488556 1697.045776 +460443.025879 5932989.643250 1697.502319 +460441.089844 5932957.056641 1697.169067 +460454.848145 5932955.590698 1700.077148 +460457.045654 5932982.159424 1700.479614 +460447.427612 5933034.715393 1698.327271 +460442.178467 5933082.582123 1696.099487 +999.000000 999.000000 999.000000 +459777.658203 5934652.541260 1625.876343 +459821.312744 5934573.545654 1624.640991 +459868.342407 5934485.339111 1623.336792 +459897.159302 5934430.419922 1622.545044 +459977.941284 5934266.821533 1620.408081 +459992.051636 5934262.669067 1627.882324 +459993.154785 5934263.541138 1628.734375 +459952.750610 5934362.276245 1635.245850 +459908.619629 5934470.118774 1642.357910 +459907.116089 5934473.785522 1642.599976 +459898.896973 5934492.001587 1643.855957 +459856.265381 5934588.100220 1650.429688 +459846.959961 5934608.255127 1651.834351 +459801.534424 5934706.644897 1658.691650 +459785.337524 5934739.081787 1661.039551 +459776.099487 5934762.679932 1662.565918 +459713.652466 5934922.197266 1672.884033 +459692.187256 5934981.141113 1677.498047 +459675.317993 5935019.994141 1679.185181 +459665.341187 5935047.056152 1680.297241 +459617.748779 5935251.089844 1687.699707 +459610.912476 5935290.916504 1689.057373 +459589.410156 5935631.764648 1699.362183 +459585.530762 5935703.953369 1701.520630 +459584.607300 5935759.415283 1703.105835 +459583.737793 5935800.068604 1704.181274 +459581.071167 5935924.722656 1707.478638 +459580.861938 5935934.513672 1707.737671 +459575.722046 5936023.390137 1710.207764 +459574.601929 5936039.609131 1710.576172 +459556.430176 5936188.187988 1714.206055 +459552.484619 5936213.119873 1714.843872 +459546.121826 5936253.324951 1715.872559 +459514.294922 5936411.971191 1720.147827 +459512.122314 5936423.764160 1720.459351 +459497.386475 5936420.032715 1713.751221 +459497.456299 5936419.315674 1713.705444 +459517.781006 5936241.865723 1702.322876 +459521.229004 5936194.089111 1699.292114 +459527.498535 5936012.060547 1687.860474 +459526.921143 5935979.793701 1685.862427 +459522.440674 5935938.193848 1681.602417 +459505.035645 5935816.446777 1669.385254 +459503.620850 5935802.205078 1667.919800 +459516.609863 5935531.116211 1659.061035 +459523.002930 5935417.213867 1655.244385 +459526.376221 5935336.261475 1651.981079 +459546.139648 5935200.216064 1645.537598 +459569.243530 5935085.997314 1639.684570 +459604.330200 5934980.291992 1633.335205 +459606.543213 5934974.615234 1633.163940 +459629.387451 5934923.836426 1631.355957 +459682.683472 5934813.639404 1629.284790 +459721.120117 5934747.415405 1627.539917 +459777.658203 5934652.541260 1625.876343 +999.000000 999.000000 999.000000 +462242.888733 5935463.453613 1688.864624 +462204.861206 5935555.516602 1694.251465 +462195.031250 5935592.448975 1696.383423 +462162.477966 5935708.270996 1703.078857 +462116.769012 5935915.199219 1714.974121 +462113.769135 5935934.556641 1716.080078 +462107.839355 5935958.410645 1717.454834 +462105.874207 5935969.093750 1718.469604 +462099.809967 5936004.938477 1721.883545 +462083.567017 5936089.381348 1728.850830 +462070.581482 5936156.890137 1734.420898 +462048.067413 5936227.157959 1739.973755 +461995.331238 5936387.580566 1752.614624 +461993.953583 5936391.771484 1752.944824 +461980.535522 5936425.552002 1755.543701 +461967.952148 5936451.548340 1757.482178 +461961.326172 5936465.181152 1758.498047 +461875.874542 5936640.996338 1771.598999 +461869.254684 5936652.008545 1772.385132 +461861.067047 5936662.766113 1773.105957 +461750.163376 5936820.921387 1782.774536 +461733.726791 5936840.722656 1783.866821 +461702.676498 5936881.473633 1787.669312 +461606.107053 5936984.192383 1796.750488 +461605.011081 5936985.416016 1796.887817 +461526.704788 5937068.687500 1806.049805 +461447.017227 5937145.556152 1814.153687 +461447.909698 5937152.146484 1818.793823 +461448.344406 5937155.359375 1821.055786 +461449.928116 5937170.266602 1831.330688 +461450.901169 5937179.425781 1837.643311 +461451.051315 5937180.838379 1838.616821 +461404.608078 5937223.690918 1842.103149 +461307.653534 5937303.269043 1843.107544 +461223.751038 5937378.477051 1844.700684 +461151.305878 5937437.304199 1845.378784 +461150.436920 5937438.264648 1845.416016 +461105.359650 5937474.527344 1839.020020 +461096.549316 5937481.615234 1837.769897 +461078.396423 5937496.274902 1835.195679 +461062.865417 5937508.840332 1832.993652 +461000.736816 5937559.139648 1824.186279 +460948.621521 5937606.001953 1816.913696 +460919.972290 5937631.763184 1812.915649 +460925.594116 5937602.538086 1799.535400 +460932.643005 5937565.894043 1782.758545 +460973.017151 5937524.427734 1785.367554 +461010.236084 5937489.981445 1788.010376 +461077.364929 5937428.238770 1792.801392 +461107.449158 5937400.583496 1794.949341 +461126.412994 5937378.543945 1793.475342 +461171.931213 5937339.582520 1791.729126 +461301.258453 5937217.347656 1785.284790 +461429.498901 5937106.144531 1780.180542 +461428.371552 5937105.262207 1779.044434 +461420.597702 5937099.176270 1771.209473 +461403.858597 5937086.071777 1754.338257 +461402.622528 5937085.104492 1753.092651 +461398.971207 5937081.983887 1749.246094 +461393.562500 5937079.020508 1744.601685 +461366.398468 5937064.432617 1721.463623 +461393.721130 5937041.111328 1720.612061 +461546.076210 5936900.267090 1715.438843 +461606.076710 5936842.413086 1713.307861 +461663.032394 5936776.349121 1710.847168 +461691.176170 5936745.775635 1710.707886 +461734.863472 5936690.540771 1710.323853 +461779.748688 5936631.891602 1709.888428 +461811.970184 5936581.836182 1709.404175 +461903.504608 5936425.682129 1707.727661 +461919.018402 5936390.469238 1707.254883 +462007.507782 5936181.621094 1704.385376 +462007.667847 5936181.041992 1704.375854 +462043.379181 5936069.880615 1702.638062 +462072.597626 5935978.835449 1701.197144 +462073.031433 5935977.187744 1701.116211 +462078.502441 5935955.455078 1699.903320 +462081.757874 5935942.402344 1699.157104 +462095.285095 5935854.245850 1694.044678 +462132.448425 5935686.123291 1684.393433 +462159.087463 5935591.998535 1679.040527 +462175.221741 5935531.719482 1675.604492 +462207.035278 5935455.887939 1671.381714 +462220.317810 5935425.956299 1669.721191 +462234.038208 5935403.969727 1668.535767 +462257.797424 5935367.001465 1666.548584 +462289.858948 5935315.577148 1663.363647 +462388.653503 5935194.345703 1655.473022 +462400.316528 5935180.061035 1654.542847 +462435.389404 5935145.156250 1652.161743 +462440.583557 5935140.178711 1651.819092 +462507.509583 5935075.745117 1647.264771 +462546.905640 5935041.364990 1644.770630 +462656.890747 5934941.278320 1637.591675 +462729.409790 5934873.600830 1632.769409 +462781.886597 5934826.021484 1629.353271 +462817.966187 5934793.284180 1626.991577 +462909.347778 5934705.094604 1620.727661 +462971.750977 5934629.331543 1615.618652 +463051.269531 5934543.300293 1609.670776 +463061.128418 5934528.607666 1608.717896 +463119.172241 5934456.699829 1609.761108 +463159.845337 5934409.684448 1610.514160 +463225.204834 5934329.500854 1611.693970 +463273.932861 5934258.140015 1612.497681 +463319.031250 5934192.283936 1613.321899 +463489.511963 5933953.662842 1616.515137 +463549.407959 5933873.505981 1617.664795 +463585.195923 5933825.953247 1618.354248 +463713.797363 5933653.634644 1620.100220 +463804.405029 5933543.736694 1621.446045 +463863.305908 5933470.754639 1622.305298 +463889.500977 5933436.592590 1621.750610 +463921.730957 5933404.872131 1621.651245 +463994.733887 5933333.247314 1621.438843 +464030.183350 5933307.073242 1621.822266 +464092.646973 5933261.077209 1622.505005 +464152.779053 5933218.721741 1623.270996 +464179.409668 5933203.921936 1623.834106 +464232.912109 5933174.409241 1625.179443 +464278.473877 5933148.410553 1626.278320 +464300.213135 5933136.121979 1626.914917 +464319.428955 5933127.633942 1627.610352 +464398.031738 5933095.769714 1630.614502 +464549.994141 5933035.287445 1636.485107 +464661.577881 5932995.220978 1641.038696 +464743.911865 5932961.760620 1644.180786 +464845.726074 5932919.472214 1648.015381 +464850.367920 5932923.870224 1655.894165 +464847.471924 5932925.188873 1655.925659 +464794.171631 5932949.598770 1656.684692 +464717.305908 5932984.800873 1657.779419 +464659.229736 5933010.923889 1658.576172 +464595.070557 5933036.746338 1659.262695 +464409.292969 5933119.615570 1661.767212 +464345.086670 5933148.742432 1662.663940 +464297.521240 5933175.901581 1663.684570 +464263.000977 5933197.348053 1664.536011 +464261.169922 5933198.562775 1664.655640 +464246.888672 5933208.039001 1665.589111 +464209.609863 5933232.047943 1667.990356 +464206.427490 5933233.911194 1668.014648 +464116.151611 5933299.918213 1668.876587 +464055.137939 5933346.397400 1669.483521 +464031.295410 5933369.036316 1669.779297 +464010.210449 5933390.074707 1670.054199 +463954.861816 5933446.530029 1671.575073 +463952.866211 5933448.565430 1671.629883 +463894.289062 5933525.571106 1673.984009 +463823.405029 5933620.612305 1676.912964 +463787.705811 5933667.464172 1678.344360 +463716.197998 5933771.734131 1681.661133 +463646.033447 5933880.479370 1685.193237 +463561.598022 5933992.438232 1680.906982 +463449.645874 5934141.192383 1675.224365 +463286.335571 5934367.267456 1666.953003 +463215.123169 5934449.731201 1663.314087 +463215.056885 5934449.809204 1663.311401 +463192.019775 5934480.779907 1662.344482 +463160.665283 5934516.161011 1661.045898 +463111.396851 5934574.647217 1658.998169 +463094.096924 5934597.850586 1659.494751 +463051.853760 5934639.001953 1660.261963 +462980.471069 5934716.656128 1661.791504 +462975.782715 5934721.757080 1661.891968 +462950.186157 5934749.834106 1662.551392 +462830.848877 5934853.526611 1664.645752 +462815.568115 5934866.803955 1664.913940 +462789.212769 5934888.232422 1665.323486 +462709.193726 5934955.177490 1666.634766 +462680.570557 5934980.288574 1667.145752 +462563.136475 5935077.739014 1669.041504 +462533.919189 5935104.933594 1669.619385 +462491.534241 5935142.028320 1670.372803 +462466.157654 5935164.237549 1670.823853 +462425.097717 5935204.360596 1673.302490 +462367.548096 5935273.876465 1677.524170 +462316.560608 5935335.586914 1681.271240 +462269.843506 5935409.883057 1685.704224 +462255.464172 5935434.946045 1687.192261 +462242.888733 5935463.453613 1688.864624 +999.000000 999.000000 999.000000 +461615.997171 5934300.602905 1630.864502 +461659.773735 5934204.210327 1626.082275 +461706.163872 5934106.837402 1621.217529 +461731.976295 5934056.649780 1618.680298 +461779.868164 5933974.941284 1614.457764 +461787.911911 5933961.218384 1613.748535 +461833.778519 5933898.140991 1610.349365 +461906.387054 5933802.442383 1605.145142 +461945.645355 5933764.061035 1602.899048 +462006.434753 5933700.530334 1599.246948 +462012.125122 5933695.425659 1598.940918 +462081.470734 5933633.319946 1595.433350 +462094.573303 5933621.656128 1594.923340 +462110.812866 5933609.654968 1594.358643 +462139.302612 5933588.507324 1593.027344 +462154.933594 5933578.160095 1592.325562 +462172.471802 5933566.550537 1591.538208 +462234.902649 5933518.054077 1588.571899 +462265.284668 5933498.665527 1587.224365 +462328.699341 5933456.987610 1584.384033 +462375.234863 5933426.041199 1582.291504 +462432.309143 5933391.886963 1579.811890 +462484.935913 5933360.635742 1577.530762 +462515.195312 5933341.855469 1576.200806 +462583.647034 5933301.454041 1573.239502 +462612.349487 5933283.461792 1571.973755 +462661.510864 5933253.573608 1569.827148 +462729.533691 5933210.897125 1566.826782 +462732.577271 5933208.899475 1566.690552 +462735.067627 5933207.304382 1566.579956 +462831.888184 5933143.116913 1562.230835 +462832.806641 5933142.494781 1562.189331 +462848.149292 5933132.017792 1562.138916 +462865.577637 5933119.639038 1562.083374 +462962.196533 5933050.289276 1561.777954 +462965.921875 5933047.605133 1561.841553 +462982.920776 5933034.763062 1562.129517 +462998.553833 5933022.837006 1562.393799 +463064.634888 5932971.747223 1563.508057 +463085.980103 5932954.313828 1563.863892 +463139.098022 5932911.988968 1564.754150 +463177.831177 5932879.789322 1565.397583 +463234.040039 5932832.711975 1566.329834 +463240.012817 5932827.489265 1566.427979 +463245.118652 5932823.221657 1566.512695 +463307.049927 5932771.630962 1567.541016 +463330.974487 5932752.383522 1567.941284 +463375.381592 5932717.009699 1568.685547 +463393.981323 5932701.971186 1568.996338 +463438.815796 5932668.223331 1569.756226 +463456.361694 5932655.619698 1570.056152 +463469.010498 5932646.466843 1570.272095 +463531.088013 5932603.630287 1571.340942 +463531.699585 5932603.208542 1571.365479 +463571.684204 5932576.668457 1572.963379 +463669.275879 5932517.453110 1576.807251 +463727.307861 5932487.516724 1579.039917 +463781.522705 5932464.133453 1581.079468 +463815.949463 5932450.172089 1582.365723 +463826.787109 5932445.776642 1582.770508 +463879.164551 5932424.474304 1584.028809 +463958.778809 5932396.267151 1585.879883 +464072.941162 5932363.597565 1588.419922 +464132.957764 5932346.948181 1589.747437 +464195.019043 5932331.590210 1591.092896 +464329.095703 5932302.855621 1593.934326 +464388.073242 5932291.006897 1595.172485 +464457.736816 5932278.900879 1596.607178 +464463.492676 5932277.908020 1596.876831 +464558.473633 5932261.050049 1601.343750 +464657.743164 5932243.642853 1609.902710 +464704.923340 5932235.369873 1613.970581 +464742.407227 5932230.219666 1617.165894 +464831.389160 5932218.164764 1626.279419 +464897.168457 5932206.595337 1632.976318 +465035.181152 5932174.200928 1646.903687 +465093.696045 5932160.815125 1652.813965 +465197.365967 5932128.030151 1663.147461 +465251.400635 5932111.532532 1668.542358 +465257.005127 5932109.793274 1668.881592 +465373.659668 5932060.892029 1675.947144 +465444.046631 5932032.277832 1680.209961 +465461.471191 5932024.860168 1681.265381 +465560.114990 5931982.943176 1687.734375 +465572.701416 5931978.972534 1697.361938 +465462.900879 5932026.077026 1693.015869 +465446.428955 5932033.139282 1692.337158 +465366.259766 5932065.969788 1689.049561 +465259.580566 5932110.991516 1684.661743 +465250.604492 5932113.800476 1684.302124 +465190.365723 5932132.414124 1680.018921 +465173.722656 5932137.735901 1678.836060 +465096.531738 5932162.419800 1673.349609 +465026.075928 5932178.770264 1668.326538 +464902.512451 5932208.171570 1659.519287 +464820.881348 5932222.769043 1653.688843 +464734.137451 5932234.820160 1647.484619 +464657.521484 5932245.404785 1641.472900 +464557.894043 5932262.920715 1633.727051 +464494.626465 5932274.270264 1632.954834 +464489.334473 5932275.192078 1632.890381 +464488.876709 5932275.275269 1632.953735 +464459.373535 5932280.416290 1632.625977 +464454.010986 5932281.356201 1632.677490 +464391.690186 5932292.280518 1633.275391 +464308.027588 5932309.225128 1634.114990 +464222.856445 5932327.600586 1634.987793 +464185.755859 5932336.862427 1635.388184 +464133.639404 5932349.504669 1630.452881 +464117.850098 5932353.791077 1628.711060 +464108.145508 5932356.449554 1628.001709 +464049.779053 5932372.676727 1627.239624 +463979.418213 5932392.851929 1626.319092 +463871.045654 5932431.353607 1624.879517 +463825.530518 5932449.907166 1624.268066 +463807.580566 5932457.195831 1623.703613 +463733.982666 5932488.986511 1621.395630 +463654.694092 5932529.957031 1618.931519 +463598.969238 5932563.809891 1617.216675 +463532.020020 5932604.481628 1615.156494 +463530.081299 5932605.661537 1615.120850 +463522.212402 5932610.649788 1614.978149 +463456.149658 5932658.452713 1613.848145 +463396.899780 5932701.012878 1612.831055 +463376.686279 5932715.991698 1612.489502 +463357.184082 5932731.599010 1612.172974 +463322.414185 5932759.424568 1611.608887 +463292.734619 5932783.025105 1611.125488 +463242.364746 5932825.246117 1610.330078 +463157.337769 5932893.574509 1608.953735 +463150.678467 5932899.151779 1608.848511 +463147.124878 5932902.105881 1608.792114 +463138.227295 5932909.194992 1608.647339 +463058.977295 5932972.349396 1607.358398 +463003.129761 5933015.438721 1606.433960 +462964.037598 5933044.227661 1605.770996 +462961.807007 5933045.866302 1605.774658 +462865.197998 5933115.271942 1605.925415 +462829.332397 5933139.325104 1605.974243 +462818.944946 5933146.233398 1606.460693 +462741.301392 5933197.790497 1610.094360 +462656.545532 5933249.729797 1613.917480 +462650.456299 5933253.665466 1614.198853 +462628.064636 5933267.478333 1615.211914 +462606.486450 5933281.000549 1616.195068 +462557.579773 5933311.648071 1618.423462 +462542.960205 5933320.275085 1619.071899 +462431.518372 5933389.426453 1624.127197 +462430.349976 5933390.120300 1624.179077 +462429.086609 5933390.876282 1624.235474 +462323.747925 5933460.929810 1629.168701 +462317.202637 5933465.231750 1629.473633 +462251.299805 5933512.850098 1632.685181 +462166.937317 5933578.217651 1636.942017 +462146.899109 5933594.361206 1637.973511 +462138.088501 5933603.127930 1638.482178 +462127.074829 5933613.219299 1639.089233 +462103.204163 5933634.704834 1640.392456 +462093.014771 5933643.852478 1640.890381 +462068.559174 5933665.299744 1640.858521 +462027.582611 5933701.458862 1641.344238 +462025.719116 5933703.422119 1641.380859 +461966.092865 5933764.296875 1642.462524 +461942.171082 5933788.767212 1642.898560 +461941.179504 5933789.713867 1642.913574 +461937.079773 5933794.976929 1643.036865 +461841.558517 5933917.605225 1645.909180 +461817.805740 5933949.449707 1646.684692 +461742.203560 5934075.017456 1650.251953 +461740.711449 5934077.847168 1650.338379 +461678.569698 5934204.959351 1654.355347 +461621.938533 5934326.508301 1658.275146 +461602.725228 5934372.809448 1659.834717 +461567.063065 5934457.510742 1661.869995 +461535.596230 5934532.247314 1663.665894 +461476.758682 5934665.300659 1666.765869 +461434.966431 5934775.233398 1669.562134 +461429.890167 5934788.639160 1669.936768 +461415.508835 5934828.634033 1671.082031 +461374.836777 5934963.676758 1675.233521 +461363.117569 5935006.601318 1676.596802 +461337.407471 5935136.208252 1681.062134 +461325.186523 5935200.404053 1683.292480 +461316.044373 5935287.510986 1686.587280 +461315.432861 5935293.591797 1686.856812 +461310.260956 5935383.370117 1690.955566 +461305.800934 5935424.452393 1692.766602 +461304.359009 5935506.927002 1696.633789 +461306.223907 5935598.860840 1701.051270 +461305.660706 5935615.741699 1701.834595 +461303.521667 5935654.399414 1702.549561 +461306.987274 5935761.873779 1704.686401 +461310.290344 5935845.680176 1706.362305 +461312.184204 5935880.764404 1707.071899 +461316.221069 5935934.570312 1708.178223 +461321.036072 5936024.131836 1709.989380 +461332.829865 5936170.246094 1713.006714 +461335.144989 5936196.910156 1713.741821 +461338.496307 5936232.163818 1714.723511 +461340.255341 5936246.891846 1715.145630 +461350.127350 5936354.298828 1718.125122 +461350.741974 5936361.243164 1718.317017 +461362.694504 5936448.906494 1724.873779 +461363.200912 5936452.748291 1725.160156 +461370.734680 5936510.183105 1729.439331 +461371.012955 5936512.156250 1729.605591 +461383.898773 5936602.237793 1737.199341 +461384.877014 5936608.708740 1737.747192 +461385.912460 5936615.591553 1738.329834 +461398.375275 5936709.286377 1746.184692 +461404.895050 5936758.035400 1750.273071 +461405.510803 5936765.767822 1750.902222 +461405.876953 5936770.368164 1751.276489 +461416.020706 5936873.214355 1759.734741 +461418.559525 5936914.485352 1763.057861 +461422.602509 5936982.528809 1768.530273 +461425.110565 5937015.495117 1771.207031 +461426.802979 5937073.492188 1775.790161 +461426.917480 5937074.812500 1775.968018 +461427.142441 5937077.541504 1776.334961 +461429.498901 5937106.144531 1780.180542 +461428.371552 5937105.262207 1779.044434 +461420.597702 5937099.176270 1771.209473 +461403.858597 5937086.071777 1754.338257 +461402.622528 5937085.104492 1753.092651 +461398.971207 5937081.983887 1749.246094 +461393.562500 5937079.020508 1744.601685 +461366.398468 5937064.432617 1721.463623 +461363.681396 5936954.800781 1717.151001 +461362.047211 5936868.499512 1713.757202 +461357.168213 5936715.902100 1707.751709 +461348.024109 5936609.345459 1703.544556 +461345.688873 5936564.630371 1701.782715 +461338.100647 5936485.290527 1698.648315 +461337.591461 5936480.003174 1698.439453 +461334.194611 5936437.301514 1697.455566 +461328.789032 5936372.915527 1695.966797 +461317.118774 5936259.133301 1691.247192 +461315.021057 5936228.814209 1690.017578 +461312.937805 5936190.606201 1689.048218 +461297.460785 5936007.493896 1684.477661 +461290.015961 5935879.901367 1681.247314 +461289.765167 5935860.118652 1680.734009 +461284.861511 5935748.429199 1677.884277 +461281.738617 5935663.865234 1675.718628 +461283.511322 5935627.549072 1674.745972 +461285.855743 5935569.147949 1672.539551 +461284.960999 5935497.526367 1669.862549 +461286.548065 5935432.337158 1667.407593 +461294.871155 5935358.471680 1664.576172 +461299.328827 5935287.423828 1661.879883 +461300.777161 5935273.583008 1661.350220 +461307.439423 5935212.882568 1659.484375 +461324.166077 5935126.140869 1656.808228 +461345.166077 5935021.488525 1653.578613 +461364.478836 5934950.870117 1651.392456 +461397.605316 5934840.825928 1647.981689 +461417.821152 5934784.385986 1646.228027 +461426.322952 5934760.723755 1645.538696 +461464.444901 5934659.850220 1642.595093 +461511.739349 5934551.997559 1639.430786 +461591.043545 5934362.151855 1633.871094 +461615.997171 5934300.602905 1630.864502 +999.000000 999.000000 999.000000 +464726.762451 5930919.058960 1720.773560 +464945.402832 5930765.406372 1728.770630 +465065.609863 5930675.531738 1733.315918 +465161.973389 5930603.173340 1737.385254 +465166.318848 5930600.030762 1737.403809 +465274.870117 5930516.113037 1737.885864 +465283.484863 5930508.358154 1737.927856 +465402.799316 5930398.214600 1741.952637 +465412.523682 5930389.006348 1742.291138 +465440.681641 5930359.798828 1743.387329 +465503.309814 5930294.836426 1745.825317 +465550.101074 5930246.382080 1747.643188 +465561.176270 5930234.458496 1748.094238 +465614.585938 5930175.152100 1750.351196 +465668.545654 5930115.235107 1752.631348 +465693.695312 5930089.941162 1750.800293 +465778.685547 5930008.989502 1744.656738 +465778.582031 5930009.816406 1743.825684 +465775.657227 5930033.229492 1720.298706 +465716.378906 5930094.325439 1719.250244 +465683.564209 5930130.038086 1718.660034 +465633.802734 5930188.407227 1713.134644 +465535.991211 5930299.388428 1702.454224 +465442.947998 5930401.213379 1692.474731 +465394.295654 5930449.189941 1687.509766 +465350.150391 5930492.328613 1683.023682 +465307.077393 5930533.280762 1680.076538 +465189.642822 5930629.484131 1672.090088 +465161.094727 5930653.077881 1669.863770 +465042.557373 5930745.141724 1660.671021 +465039.318115 5930747.556030 1660.559082 +464744.556152 5930954.062866 1650.731323 +464664.883057 5931008.324463 1648.117676 +464483.414795 5931122.103149 1642.434937 +464410.903809 5931166.772461 1641.463013 +464333.805176 5931211.707275 1640.470703 +464179.009521 5931291.756958 1638.641479 +464106.912842 5931328.522095 1638.749023 +464045.243164 5931357.331299 1638.895874 +463913.977783 5931409.193848 1639.405518 +463850.521484 5931435.141602 1639.633667 +463653.708496 5931496.782959 1640.733398 +463621.061523 5931509.218506 1640.869873 +463571.135132 5931527.584961 1642.699097 +463411.440552 5931571.225220 1648.484863 +463310.026001 5931599.746582 1649.839355 +463109.811157 5931656.354126 1652.516968 +462848.456665 5931733.595642 1656.052246 +462731.636963 5931767.924622 1657.630005 +462700.539917 5931777.009460 1658.237183 +462664.124268 5931787.942627 1658.944214 +462643.961304 5931793.966980 1659.442017 +462444.111328 5931853.958008 1663.363403 +462317.902039 5931890.512512 1665.865112 +462207.507874 5931924.969299 1668.006226 +462158.699524 5931941.252258 1668.932983 +462155.967529 5931940.335327 1675.866943 +462209.662476 5931922.286926 1675.357544 +462314.199646 5931889.400085 1674.278564 +462432.091614 5931854.988647 1672.957520 +462477.277649 5931841.314819 1672.470093 +462641.415405 5931791.644470 1670.699341 +462665.189697 5931784.434631 1670.499390 +462718.220825 5931768.060913 1671.110352 +462748.391357 5931758.980835 1671.449829 +462900.493530 5931713.131531 1673.420532 +463145.461060 5931638.905029 1676.604736 +463226.700073 5931614.289429 1677.660645 +463239.559814 5931610.144897 1677.834473 +463415.096680 5931559.187622 1680.056152 +463444.326904 5931550.516846 1680.959229 +463548.207397 5931519.701538 1684.168579 +463607.035156 5931496.415771 1686.108032 +463670.590820 5931471.313477 1688.066284 +463832.023193 5931418.341187 1692.832520 +463935.507812 5931374.364868 1696.080933 +463990.411377 5931351.781128 1697.789917 +464092.263428 5931302.313477 1701.106323 +464191.910889 5931249.620850 1704.433716 +464266.682861 5931210.444214 1706.261353 +464398.647461 5931132.486694 1709.685425 +464455.814941 5931096.804810 1711.211670 +464591.648193 5931011.370483 1715.904175 +464726.762451 5930919.058960 1720.773560 +999.000000 999.000000 999.000000 +463887.463135 5932360.166138 1637.783081 +463999.547363 5932350.623230 1636.870605 +464028.820801 5932350.966583 1636.677979 +464022.396484 5932366.548401 1628.857178 +464019.637695 5932369.968292 1626.878296 +463894.453613 5932382.462555 1625.308594 +463858.974609 5932383.838196 1624.869995 +463845.490723 5932384.305359 1624.703491 +463804.211670 5932387.069733 1623.358521 +463773.009277 5932388.868866 1622.341064 +463695.759766 5932386.844696 1619.800049 +463646.764404 5932383.730927 1618.182373 +463509.654419 5932382.894012 1613.681641 +463506.755371 5932382.924500 1613.586670 +463505.694092 5932383.137054 1613.552612 +463500.498535 5932383.808228 1613.384399 +463311.917358 5932402.228973 1607.259521 +463310.801392 5932402.459442 1607.223755 +463268.804443 5932410.326538 1606.247437 +463143.592651 5932453.063965 1603.557251 +463102.121216 5932465.039459 1603.547485 +463070.173340 5932475.555786 1603.545288 +463034.610474 5932486.213043 1603.538452 +462975.194458 5932513.547180 1603.566895 +462837.651489 5932577.612595 1603.636230 +462778.659058 5932619.240593 1603.725220 +462713.831421 5932660.219921 1603.802979 +462664.741333 5932711.001079 1603.944458 +462536.737488 5932865.144241 1604.404419 +462533.641968 5932869.575684 1604.418457 +462368.148071 5933062.568237 1614.907959 +462288.918335 5933162.827515 1620.189453 +462211.472717 5933278.243225 1625.927246 +462195.530579 5933302.323792 1627.051880 +462104.167419 5933445.640137 1633.685059 +462085.793976 5933471.277283 1634.906372 +462079.143616 5933481.109375 1635.368042 +462011.737488 5933569.699829 1639.655029 +461988.417816 5933607.932190 1639.762817 +461978.753784 5933601.207520 1643.900269 +462002.122070 5933560.926636 1644.149292 +462042.623047 5933485.639526 1645.573730 +462056.328308 5933455.841919 1646.101074 +462094.058258 5933379.306885 1647.495117 +462120.444031 5933325.783325 1648.470093 +462140.611084 5933280.846741 1649.257568 +462185.176636 5933185.973267 1650.951172 +462219.795410 5933108.220459 1652.309326 +462223.373169 5933100.184967 1652.449707 +462229.920349 5933088.620575 1652.673584 +462284.221863 5933001.822968 1654.434814 +462306.007385 5932966.999802 1655.141357 +462429.901855 5932774.936798 1658.034058 +462508.129883 5932658.941078 1658.866577 +462509.444946 5932657.062241 1658.867188 +462517.504639 5932647.771736 1658.871460 +462526.170349 5932639.298897 1658.876099 +462639.765991 5932524.746155 1658.938232 +462692.650635 5932491.247147 1658.970459 +462757.543213 5932459.930634 1659.011719 +462892.130005 5932397.595581 1659.097778 +463090.206421 5932338.015411 1659.229736 +463140.371826 5932321.432373 1659.262939 +463188.310181 5932305.837128 1659.187500 +463190.492188 5932305.168335 1659.166626 +463202.848511 5932303.874573 1659.015991 +463276.314819 5932299.622650 1656.556274 +463317.802856 5932296.986206 1655.165283 +463368.856567 5932299.292603 1653.498657 +463389.635498 5932300.802063 1652.825073 +463494.859497 5932308.446198 1649.413696 +463521.136963 5932313.630829 1648.588501 +463574.999634 5932324.257965 1646.896973 +463636.588989 5932336.986664 1644.967407 +463679.227295 5932348.202545 1643.651123 +463721.686279 5932355.133850 1642.305908 +463726.770996 5932355.760529 1642.143188 +463747.621094 5932358.331116 1641.475830 +463813.453369 5932361.420197 1639.327881 +463852.016113 5932362.859924 1638.066528 +463875.192627 5932362.766907 1637.908203 +463887.463135 5932360.166138 1637.783081 +999.000000 999.000000 999.000000 +461441.696243 5937275.618164 1834.053345 +461442.270737 5937262.198242 1832.001221 +461447.017227 5937145.556152 1814.153687 +461447.909698 5937152.146484 1818.793823 +461448.344406 5937155.359375 1821.055786 +461449.928116 5937170.266602 1831.330688 +461450.901169 5937179.425781 1837.643311 +461451.051315 5937180.838379 1838.616821 +461449.411713 5937217.898438 1844.094849 +461449.119507 5937220.083008 1843.714844 +461441.696243 5937275.618164 1834.053345 +999.000000 999.000000 999.000000 diff --git a/tests/test_ert_hooks.py b/tests/test_ert_hooks.py index ca7ed6b..4ad56b1 100644 --- a/tests/test_ert_hooks.py +++ b/tests/test_ert_hooks.py @@ -1,19 +1,15 @@ +"""Suite for testing through ERT.""" import subprocess from pathlib import Path import yaml +XTGEOTESTDATA = "tests/data/reek" -TESTDIR = Path(__file__).absolute().parent -XTGEOTESTDATA = TESTDIR.parent.parent / "xtgeo-testdata" -assert ( - XTGEOTESTDATA.is_dir() -), "Please clone xtgeo-testdata alongside this repo for test to run" - - -def test_xtgeoapps_through_ert(tmpdir): - tmpdir.chdir() +def test_xtgeoapps_through_ert(erttree): + """Test through ERT.""" + print(f"ERT run on {erttree}") eclbase = "REEK" @@ -22,19 +18,13 @@ def test_xtgeoapps_through_ert(tmpdir): avg_conf = { "title": "Reek", "input": { - "folderroot": str(XTGEOTESTDATA / "3dgrids" / "reek"), + "folderroot": XTGEOTESTDATA, "grid": "$folderroot/reek2_grid_w_zerolayer.roff", "dz": "$folderroot/reek2_grid_w_zerolayer_dz.roff", }, "zonation": {"zranges": [{"ZERO": [15, 15]}]}, "plotsettings": { - "faultpolygons": str( - XTGEOTESTDATA - / "polygons" - / "reek" - / "1" - / "top_upper_reek_faultpoly.xyz" - ), + "faultpolygons": str(Path(XTGEOTESTDATA) / "top_upper_reek_faultpoly.xyz"), "dz": {"valuerange": [0, 3]}, }, "computesettings": { @@ -44,24 +34,22 @@ def test_xtgeoapps_through_ert(tmpdir): }, "output": {"tag": "avg1f", "mapfolder": ".", "plotfolder": "."}, } - Path("avg_conf.yml").write_text(yaml.dump(avg_conf)) + Path("avg_conf.yml").write_text(yaml.dump(avg_conf), encoding="utf8") # Configuration file for grid3d_thickness, # based on tests/yaml/avg1f.yml - eclroot = str(XTGEOTESTDATA / "3dgrids" / "reek" / "REEK") + eclroot = str(Path(XTGEOTESTDATA) / "REEK") # (eclroot cannot be only in yaml, it is overriden by the forward model # default argument) hc_conf = { "title": "Reek", "input": { - "grid": str( - XTGEOTESTDATA / "3dgrids" / "reek" / "reek_grid_fromegrid.roff" - ), + "grid": str(Path(XTGEOTESTDATA) / "reek_grid_fromegrid.roff"), "dates": ["19991201"], }, "output": {"tag": "hc1f", "mapfolder": ".", "plotfolder": "."}, } - Path("hc_conf.yml").write_text(yaml.dump(hc_conf)) + Path("hc_conf.yml").write_text(yaml.dump(hc_conf), encoding="utf8") ert_config = [ "ECLBASE " + eclbase + ".DATA", @@ -69,7 +57,6 @@ def test_xtgeoapps_through_ert(tmpdir): "NUM_REALIZATIONS 1", "RUNPATH .", ] - # Path("tmp").mkdir() ert_config.append("FORWARD_MODEL GRID3D_AVERAGE_MAP(=avg_conf.yml)") ert_config.append( @@ -78,7 +65,7 @@ def test_xtgeoapps_through_ert(tmpdir): + ")" ) - ert_config_filename = Path(tmpdir) / "xtgeoapps_test.ert" + ert_config_filename = Path(erttree) / "xtgeoapps_test.ert" ert_config_filename.write_text("\n".join(ert_config)) subprocess.call(["ert", "test_run", ert_config_filename]) diff --git a/tests/test_grid3d_average_map1.py b/tests/test_grid3d_average_map1.py index 540cf19..b100bd3 100644 --- a/tests/test_grid3d_average_map1.py +++ b/tests/test_grid3d_average_map1.py @@ -1,74 +1,130 @@ -import os -import sys +"""Testing suite average_map1.""" import shutil -import glob from pathlib import Path import pytest - import xtgeo -from xtgeo.common import XTGeoDialog - -import xtgeoapp_grd3dmaps.avghc.grid3d_average_map as xx - -xtg = XTGeoDialog() -logger = xtg.basiclogger(__name__) - -if not xtg.testsetup(): - sys.exit(-9) +import xtgeoapp_grd3dmaps.avghc.grid3d_average_map as grid3d_hc_thickness -TMPD = xtg.tmpdir -testpath = xtg.testpath +SOURCEPATH = Path(__file__).absolute().parent.parent -skiplargetest = pytest.mark.skipif(xtg.bigtest is False, reason="Big tests skip") -# ============================================================================= -# Do tests -# ============================================================================= - - -def test_average_map1a(): +def test_average_map1a(datatree): """Test HC thickness with YAML config example 1a ECL based""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/avg1a.yml"]) - + result = datatree / "map1a_folder" + result.mkdir(parents=True) + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/avg1a.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) + + z1poro = xtgeo.surface_from_file(result / "z1--avg1a_average_poro.gri") + assert z1poro.values.mean() == pytest.approx(0.1598, abs=0.001) -def test_average_map1b(): - """Test HC thickness with YAML config example 1b ROFF based""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/avg1b.yml"]) - z1poro = xtgeo.surface_from_file(os.path.join(TMPD, "z1--avg1b_average_por.gri")) +def test_average_map1b_output_docs(datatree): + """Test HC thickness with YAML config example 1b ROFF based. + + Note that plots here goes directly into the Sphinx documentation! + """ + result = datatree / "map1b_folder" + result.mkdir(parents=True) + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/avg1b.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) + + z1poro = xtgeo.surface_from_file(result / "z1--avg1b_average_por.gri") assert z1poro.values.mean() == pytest.approx(0.1598, abs=0.001) assert z1poro.values.std() == pytest.approx(0.04, abs=0.003) - imgs = glob.glob(os.path.join(TMPD, "*avg1b*.png")) - for img in imgs: - shutil.copy2(img, "docs/test_images/.") + # for auto documentation + for img in result.glob("*avg1b*.png"): + shutil.copy2(img, SOURCEPATH / "docs" / "test_images") -def test_average_map1c(): +def test_average_map1c(datatree): """Test HC thickness with YAML config example 1c ROFF based, rotated map""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/avg1c.yml"]) - - z1poro = xtgeo.surface_from_file(os.path.join(TMPD, "all--avg1c_average_por.gri")) + result = datatree / "map1c_folder" + result.mkdir(parents=True) + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/avg1c.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) + + z1poro = xtgeo.surface_from_file(result / "all--avg1c_average_por.gri") assert z1poro.values.mean() == pytest.approx(0.1678, abs=0.001) -def test_average_map1d(): +def test_average_map1d(datatree): """Test HC thickness with YAML config example 1d ROFF based, rotated map""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/avg1d.yml"]) - - -def test_average_map1e(): + result = datatree / "map1d_folder" + result.mkdir(parents=True) + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/avg1d.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) + mymap = xtgeo.surface_from_file(result / "all--avg1d_average_diffsat.gri") + assert mymap.values.mean() == pytest.approx(-0.8691, abs=0.001) + + +def test_average_map1e(datatree): """Test HC thickness with YAML config example 1e ROFF based, tuning""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/avg1e.yml"]) - - -def test_average_map1f(): + result = datatree / "map1e_folder" + result.mkdir(parents=True) + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/avg1e.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) + mymap = xtgeo.surface_from_file(result / "all--avg1e_average_diffsat.gri") + assert mymap.values.mean() == pytest.approx(-0.865748, abs=0.001) + + +def test_average_map1f(datatree): """Test HC thickness with YAML config example 1f ROFF based, zero layer""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/avg1f.yml"]) + result = datatree / "map1f_folder" + result.mkdir(parents=True) + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/avg1f.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) + mymap = xtgeo.surface_from_file(result / "lower--avg1f_average_dz.gri") + assert mymap.values.mean() == pytest.approx(2.633, abs=0.005) + mymap = xtgeo.surface_from_file(result / "zero--avg1f_average_dz.gri") + assert mymap.values.mask.all() diff --git a/tests/test_grid3d_average_map2.py b/tests/test_grid3d_average_map2.py index 80b045e..63b6161 100644 --- a/tests/test_grid3d_average_map2.py +++ b/tests/test_grid3d_average_map2.py @@ -1,55 +1,97 @@ -import os -from pathlib import Path - +"""Testing suite avg2.""" +import numpy.testing as nptest import pytest - import xtgeo -from xtgeo.common import XTGeoDialog - -import xtgeoapp_grd3dmaps.avghc.grid3d_average_map as xxx - -xtg = XTGeoDialog() -logger = xtg.basiclogger(__name__) - -if not xtg.testsetup(): - raise SystemExit - -TMPD = xtg.tmpdir -testpath = xtg.testpath - -skiplargetest = pytest.mark.skipif(xtg.bigtest is False, reason="Big tests skip") +import xtgeoapp_grd3dmaps.avghc.grid3d_average_map as grid3d_average_map # ============================================================================= # Do tests # ============================================================================= -def test_average_map2a(): +def test_average_map2a(datatree): """Test AVG with YAML config example 2a ECL based with filters""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - dump = os.path.join(TMPD, "avg2a.yml") - xxx.main(["--config", "tests/yaml/avg2a.yml", "--dump", dump]) - - -def test_average_map2b(): + result = datatree / "map2a_folder" + result.mkdir(parents=True) + dump = result / "avg2a.yml" + grid3d_average_map.main( + [ + "--config", + "tests/yaml/avg2a.yml", + "--dump", + str(dump), + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) + mymap = xtgeo.surface_from_file( + result / "zone2+3--avg2a_average_swat--20010101_19991201.gri" + ) + assert mymap.values.mean() == pytest.approx(0.0608, abs=0.001) + + +def test_average_map2b(datatree): """Test AVG with YAML config example 2b, filters, zonation from prop""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - dump = os.path.join(TMPD, "avg2b.yml") - xxx.main(["--config", "tests/yaml/avg2b.yml", "--dump", dump]) - - pfile = os.path.join(TMPD, "myzone1--avg2b_average_pressure--20010101.gri") + result = datatree / "map2b_folder" + result.mkdir(parents=True) + dump = result / "avg2b.yml" + grid3d_average_map.main( + [ + "--config", + "tests/yaml/avg2b.yml", + "--dump", + str(dump), + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) + + pfile = result / "myzone1--avg2b_average_pressure--20010101.gri" pres = xtgeo.surface_from_file(pfile) assert pres.values.mean() == pytest.approx(301.6917, abs=0.01) - -def test_average_map2c(): + # test dumped YAML file to reproduce result + result2 = datatree / "map2b_folder_rerun" + result2.mkdir(parents=True) + grid3d_average_map.main( + [ + "--config", + str(result / "avg2b.yml"), + "--mapfolder", + str(result2), + "--plotfolder", + str(result2), + ] + ) + pfile = result2 / "myzone1--avg2b_average_pressure--20010101.gri" + pres_rerun = xtgeo.surface_from_file(pfile) + nptest.assert_array_equal(pres.values, pres_rerun.values) + + +def test_average_map2c(datatree): """Test AVG with YAML config example 2c, filters, zonation from prop""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - dump = os.path.join(TMPD, "avg2c.yml") - xxx.main(["--config", "tests/yaml/avg2c.yml", "--dump", dump]) - - pfile = os.path.join(TMPD, "myzone1--avg2c_average_pressure--20010101.gri") + result = datatree / "map2c_folder" + result.mkdir(parents=True) + dump = result / "avg2c.yml" + grid3d_average_map.main( + [ + "--config", + "tests/yaml/avg2c.yml", + "--dump", + str(dump), + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) + + pfile = result / "myzone1--avg2c_average_pressure--20010101.gri" pres = xtgeo.surface_from_file(pfile) assert pres.values.mean() == pytest.approx(301.689869, abs=0.01) diff --git a/tests/test_grid3d_contacts1.py b/tests/test_grid3d_contacts1.py index 106975f..40e1348 100644 --- a/tests/test_grid3d_contacts1.py +++ b/tests/test_grid3d_contacts1.py @@ -1,32 +1,13 @@ -import os -from pathlib import Path - -# import shutil -# import glob -# import warnings - -from xtgeo.common import XTGeoDialog - -import xtgeoapp_grd3dmaps.contact.grid3d_contact_map as xx - -xtg = XTGeoDialog() - -xtg = XTGeoDialog() -logger = xtg.basiclogger(__name__) - -if not xtg.testsetup(): - raise SystemExit - -td = xtg.tmpdir -testpath = xtg.testpath -ojoin = os.path.join +"""Testing contacts, not finished!""" +import xtgeoapp_grd3dmaps.contact.grid3d_contact_map as grid3d_contacts # ============================================================================= # Do tests # ============================================================================= -def test_contact1a(): +def test_contact1a(datatree): """Test HC contacts with YAML config example 1a""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/contact1a.yml"]) + result = datatree / "contacts1a_folder" + result.mkdir(parents=True) + grid3d_contacts.main(["--config", "tests/yaml/contact1a.yml"]) diff --git a/tests/test_grid3d_hc_thickness1.py b/tests/test_grid3d_hc_thickness1.py index aa09925..299680d 100644 --- a/tests/test_grid3d_hc_thickness1.py +++ b/tests/test_grid3d_hc_thickness1.py @@ -1,143 +1,219 @@ -import os +"Suite for HC thickness test set 1." import shutil -import glob import warnings from pathlib import Path import numpy as np import pytest - import xtgeo -from xtgeo.common import XTGeoDialog - -import xtgeoapp_grd3dmaps.avghc.grid3d_hc_thickness as xx - -xtg = XTGeoDialog() - -xtg = XTGeoDialog() -logger = xtg.basiclogger(__name__) +import xtgeoapp_grd3dmaps.avghc.grid3d_hc_thickness as grid3d_hc_thickness -if not xtg.testsetup(): - raise SystemExit +SOURCEPATH = Path(__file__).absolute().parent.parent -TMPD = xtg.tmpdir -testpath = xtg.testpath -ojoin = os.path.join -# ============================================================================= -# Do tests -# ============================================================================= - - -def test_hc_thickness1a(): +def test_hc_thickness1a(datatree): """Test HC thickness with YAML config example 1a""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - dmp = ojoin(TMPD, "hc1a_dump.yml") - xx.main(["--config", "tests/yaml/hc_thickness1a.yml", "--dump", dmp]) - - allz = xtgeo.surface_from_file( - ojoin(TMPD, "all--oilthickness--20010101_19991201.gri") + result = datatree / "hc1a_folder" + result.mkdir(parents=True) + dump = result / "hc1a_dump.yml" + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness1a.yml", + "--dump", + str(dump), + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] ) - val = allz.values1d - print(np.nanmean(val), np.nanstd(val)) + allz = xtgeo.surface_from_file(result / "all--oilthickness--20010101_19991201.gri") + val = allz.values1d # -0.0574 in RMS volumetrics, but within range as different approach assert np.nanmean(val) == pytest.approx(-0.03653, 0.001) assert np.nanstd(val) == pytest.approx(0.199886, 0.001) -def test_hc_thickness1b(): - """HC thickness with YAML config example 1b; zonation in own YAML file""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/hc_thickness1b.yml"]) - imgs = glob.glob(ojoin(TMPD, "*hc1b*.png")) - print(imgs) - for img in imgs: - shutil.copy2(img, "docs/test_images/.") +def test_hc_thickness1b_output_docs(datatree): + """HC thickness with YAML config example 1b; zonation in own YAML file. + + Note that plots here goes into the Sphinx documentation! + """ + result = datatree / "hc1b_folder" + result.mkdir(parents=True) + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness1b.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) + for img in result.glob("*hc1b*.png"): + shutil.copy2(img, SOURCEPATH / "docs" / "test_images") + + prp = xtgeo.surface_from_file( + result / "replace_all_with_x--hc1b_oilthickness--19991201.gri" + ) + assert prp.values.mean() == pytest.approx(0.82378, abs=0.001) -def test_hc_thickness1c(): +def test_hc_thickness1c(datatree): """HC thickness with YAML config example 1c; no map settings""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/hc_thickness1c.yml"]) + result = datatree / "hc1c_folder" + result.mkdir(parents=True) + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness1c.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) + + prp = xtgeo.surface_from_file(result / "z1--hc1c_oilthickness--19991201.gri") + assert prp.values.mean() == pytest.approx(0.27483, abs=0.001) + + x1d = xtgeo.surface_from_file(result / "all--hc1c_oilthickness--19991201.gri") + assert x1d.values.mean() == pytest.approx(0.526, abs=0.001) -def test_hc_thickness1d(): +def test_hc_thickness1d(datatree): """HC thickness with YAML config example 1d; as 1c but use_porv instead""" - os.chdir(str(Path(__file__).absolute().parent.parent)) + result = datatree / "hc1d_folder" + result.mkdir(parents=True) warnings.simplefilter("error") - xx.main(["--config", "tests/yaml/hc_thickness1d.yml"]) + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness1d.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) - x1d = xtgeo.surface_from_file(ojoin(TMPD, "all--hc1d_oilthickness--19991201.gri")) + x1d = xtgeo.surface_from_file(result / "all--hc1d_oilthickness--19991201.gri") assert x1d.values.mean() == pytest.approx(0.516, abs=0.001) -def test_hc_thickness1e(): +def test_hc_thickness1e(datatree): """HC thickness with YAML config 1e; as 1d but use ROFF grid input""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/hc_thickness1e.yml"]) + result = datatree / "hc1e_folder" + result.mkdir(parents=True) + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness1e.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) - x1e = xtgeo.surface_from_file(ojoin(TMPD, "all--hc1e_oilthickness--19991201.gri")) - logger.info(x1e.values.mean()) + x1e = xtgeo.surface_from_file(result / "all--hc1e_oilthickness--19991201.gri") assert x1e.values.mean() == pytest.approx(0.516, abs=0.001) -def test_hc_thickness1f(): +def test_hc_thickness1f(datatree): """HC thickness with YAML config 1f; use rotated template map""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/hc_thickness1f.yml"]) + result = datatree / "hc1f_folder" + result.mkdir(parents=True) + + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness1f.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) - x1f = xtgeo.surface_from_file(ojoin(TMPD, "all--hc1f_oilthickness--19991201.gri")) - logger.info(x1f.values.mean()) + x1f = xtgeo.surface_from_file(result / "all--hc1f_oilthickness--19991201.gri") # other mean as the map is smaller; checked in RMS assert x1f.values.mean() == pytest.approx(1.0999, abs=0.0001) -def test_hc_thickness1g(): +def test_hc_thickness1g(datatree): """HC thickness with YAML config 1g; use rotated template map and both oil and gas""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/hc_thickness1g.yml"]) + result = datatree / "hc1g_folder" + result.mkdir(parents=True) + + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness1g.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) - x1g1 = xtgeo.surface_from_file(ojoin(TMPD, "all--hc1g_oilthickness--19991201.gri")) - logger.info(x1g1.values.mean()) + x1g1 = xtgeo.surface_from_file(result / "all--hc1g_oilthickness--19991201.gri") assert x1g1.values.mean() == pytest.approx(1.0999, abs=0.0001) - x1g2 = xtgeo.surface_from_file(ojoin(TMPD, "all--hc1g_gasthickness--19991201.gri")) - logger.info(x1g1.values.mean()) + x1g2 = xtgeo.surface_from_file(result / "all--hc1g_gasthickness--19991201.gri") assert x1g2.values.mean() == pytest.approx(0.000, abs=0.0001) -def test_hc_thickness1h(): +def test_hc_thickness1h(datatree): """Test HC thickness with YAML copy from 1a, with tuning to speed up""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/hc_thickness1h.yml"]) + result = datatree / "hc1h_folder" + result.mkdir(parents=True) + + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness1h.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) allz = xtgeo.surface_from_file( - ojoin(TMPD, "all--tuning_oilthickness--20010101_19991201.gri") + result / "all--tuning_oilthickness--20010101_19991201.gri" ) val = allz.values1d - print(np.nanmean(val), np.nanstd(val)) - # -0.0574 in RMS volumetrics, but within range as different approach assert np.nanmean(val) == pytest.approx(-0.0336, abs=0.005) assert np.nanstd(val) == pytest.approx(0.1717, abs=0.005) -def test_hc_thickness1i(): +def test_hc_thickness1i(datatree): """Test HC thickness with YAML config example 1i, based on 1a""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/hc_thickness1i.yml"]) + result = datatree / "hc1i_folder" + result.mkdir(parents=True) + + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness1i.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) allz = xtgeo.surface_from_file( - ojoin(TMPD, "all--hc1i_oilthickness--20010101_19991201.gri") + result / "all--hc1i_oilthickness--20010101_19991201.gri" ) - val = allz.values - - print(val.mean()) - # -0.0574 in RMS volumetrics, but within range as different approach - assert val.mean() == pytest.approx(-0.06, abs=0.01) + assert allz.values.mean() == pytest.approx(-0.06, abs=0.01) diff --git a/tests/test_grid3d_hc_thickness2.py b/tests/test_grid3d_hc_thickness2.py index fee335e..6061f0d 100644 --- a/tests/test_grid3d_hc_thickness2.py +++ b/tests/test_grid3d_hc_thickness2.py @@ -1,37 +1,28 @@ -import os -import sys -from pathlib import Path -import pytest import numpy as np - -from xtgeo.common import XTGeoDialog +import pytest import xtgeo +import xtgeoapp_grd3dmaps.avghc.grid3d_hc_thickness as grid3d_hc_thickness -import xtgeoapp_grd3dmaps.avghc.grid3d_hc_thickness as xx - -xtg = XTGeoDialog() - -xtg = XTGeoDialog() -logger = xtg.basiclogger(__name__) - -if not xtg.testsetup(): - sys.exit(-9) -TMPD = xtg.tmpdir -testpath = xtg.testpath - - -def test_hc_thickness2a(): +def test_hc_thickness2a(datatree): """HC thickness with YAML config example 2a; use STOOIP prop from RMS""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - xx.main(["--config", "tests/yaml/hc_thickness2a.yml"]) - - # read in result and check statistical values - allz = xtgeo.surface_from_file( - os.path.join(TMPD, "all--stoiip_oilthickness--19900101.gri") + result = datatree / "hc2a_folder" + result.mkdir(parents=True) + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness2a.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] ) + # read in result and check statistical values + allz = xtgeo.surface_from_file(result / "all--stoiip_oilthickness--19900101.gri") + val = allz.values1d val[val <= 0] = np.nan diff --git a/tests/test_grid3d_hc_thickness3.py b/tests/test_grid3d_hc_thickness3.py index 5467b67..fc4b57e 100644 --- a/tests/test_grid3d_hc_thickness3.py +++ b/tests/test_grid3d_hc_thickness3.py @@ -1,48 +1,67 @@ -import os -from pathlib import Path - import pytest - import xtgeo -from xtgeo.common import XTGeoDialog - -import xtgeoapp_grd3dmaps.avghc.grid3d_hc_thickness as xxx - -xtg = XTGeoDialog() - -xtg = XTGeoDialog() -logger = xtg.basiclogger(__name__) - -if not xtg.testsetup(): - raise SystemExit - -TMPD = xtg.tmpdir +import xtgeoapp_grd3dmaps.avghc.grid3d_hc_thickness as grid3d_hc_thickness -def test_hc_thickness3a(): +def test_hc_thickness3a(datatree): """HC thickness with external configfiles, HC 3a""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - dump = os.path.join(TMPD, "hc3a.yml") - xxx.main(["--config", "tests/yaml/hc_thickness3a.yml", "--dump", dump]) + result = datatree / "hc3a_folder" + result.mkdir(parents=True) + dump = result / "hc3a_dump.yml" + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness3a.yml", + "--dump", + str(dump), + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) + res = xtgeo.surface_from_file(result / "z2--hc1b_oilthickness--20010101.gri") + assert res.values.max() == pytest.approx(5.8094, abs=0.001) # qc'ed RMS -def test_hc_thickness3b(): +def test_hc_thickness3b(datatree): """HC thickness with external configfiles, HC 3b""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - dump = os.path.join(TMPD, "hc3b.yml") - xxx.main(["--config", "tests/yaml/hc_thickness3b.yml", "--dump", dump]) + result = datatree / "hc3b_folder" + result.mkdir(parents=True) + dump = result / "hc3b_dump.yml" + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness3b.yml", + "--dump", + str(dump), + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) + res = xtgeo.surface_from_file(result / "myzone1+3--hc1b_oilthickness--19991201.gri") + assert res.values.max() == pytest.approx(6.3532, abs=0.001) # qc'ed RMS -def test_hc_thickness3c(): +def test_hc_thickness3c(datatree): """HC thickness with external configfiles, HC 3c""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - dump = os.path.join(TMPD, "hc3c.yml") - xxx.main(["--config", "tests/yaml/hc_thickness3c.yml", "--dump", dump]) + result = datatree / "hc3c_folder" + result.mkdir(parents=True) + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness3c.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) - result = os.path.join(TMPD, "myfip1--hc3c_oilthickness--19991201.gri") - res = xtgeo.surface_from_file(result) + res = xtgeo.surface_from_file(result / "myfip1--hc3c_oilthickness--19991201.gri") assert res.values.max() == pytest.approx(13.5681, abs=0.001) # qc'ed RMS - result = os.path.join(TMPD, "myfip2--hc3c_oilthickness--19991201.gri") - res = xtgeo.surface_from_file(result) + res = xtgeo.surface_from_file(result / "myfip2--hc3c_oilthickness--19991201.gri") assert res.values.max() == pytest.approx(0.0, abs=0.001) # qc'ed RMS diff --git a/tests/test_grid3d_hc_thickness4.py b/tests/test_grid3d_hc_thickness4.py index 509d403..5b56f63 100644 --- a/tests/test_grid3d_hc_thickness4.py +++ b/tests/test_grid3d_hc_thickness4.py @@ -1,33 +1,25 @@ -import os -from pathlib import Path +"""Test suite hc 4.""" import pytest - import xtgeo -from xtgeo.common import XTGeoDialog - - -import xtgeoapp_grd3dmaps.avghc.grid3d_hc_thickness as xxx - -xtg = XTGeoDialog() - -xtg = XTGeoDialog() -logger = xtg.basiclogger(__name__) - -if not xtg.testsetup(): - raise SystemExit - -TMPD = xtg.tmpdir -testpath = xtg.testpath +import xtgeoapp_grd3dmaps.avghc.grid3d_hc_thickness as grid3d_hc_thickness -def test_hc_thickness4a(): +def test_hc_thickness4a(datatree): """HC thickness with external configfiles, HC 4a""" - os.chdir(str(Path(__file__).absolute().parent.parent)) - dump = os.path.join(TMPD, "hc4a.yml") - xxx.main(["--config", "tests/yaml/hc_thickness4a.yml", "--dump", dump]) + result = datatree / "hc4a_folder" + result.mkdir(parents=True) + grid3d_hc_thickness.main( + [ + "--config", + "tests/yaml/hc_thickness4a.yml", + "--mapfolder", + str(result), + "--plotfolder", + str(result), + ] + ) # check result - mapfile = os.path.join(TMPD, "all--hc4a_rockthickness.gri") - mymap = xtgeo.surface_from_file(mapfile) + mymap = xtgeo.surface_from_file(result / "all--hc4a_rockthickness.gri") assert mymap.values.mean() == pytest.approx(0.76590, abs=0.001) diff --git a/tests/test_hook_implementations.py b/tests/test_hook_implementations.py index d626e2c..d47e873 100644 --- a/tests/test_hook_implementations.py +++ b/tests/test_hook_implementations.py @@ -1,3 +1,4 @@ +"""Test suite for hook implementation.""" import os import shutil @@ -10,8 +11,8 @@ "Not testing ERT hooks when ERT is not installed", allow_module_level=True ) -from ert_shared.plugins.plugin_manager import ErtPluginManager import xtgeoapp_grd3dmaps.hook_implementations.jobs as jobs +from ert_shared.plugins.plugin_manager import ErtPluginManager EXPECTED_JOBS = { "GRID3D_AVERAGE_MAP": "xtgeoapp_grd3dmaps/config_jobs/GRID3D_AVERAGE_MAP", @@ -20,9 +21,10 @@ def test_hook_implementations(): - pm = ErtPluginManager(plugins=[jobs]) + """Test hook implementation.""" + pma = ErtPluginManager(plugins=[jobs]) - installable_jobs = pm.get_installable_jobs() + installable_jobs = pma.get_installable_jobs() for wf_name, wf_location in EXPECTED_JOBS.items(): assert wf_name in installable_jobs assert installable_jobs[wf_name].endswith(wf_location) @@ -31,7 +33,7 @@ def test_hook_implementations(): assert set(installable_jobs.keys()) == set(EXPECTED_JOBS.keys()) expected_workflow_jobs = {} - installable_workflow_jobs = pm.get_installable_workflow_jobs() + installable_workflow_jobs = pma.get_installable_workflow_jobs() for wf_name, wf_location in expected_workflow_jobs.items(): assert wf_name in installable_workflow_jobs assert installable_workflow_jobs[wf_name].endswith(wf_location) @@ -44,7 +46,7 @@ def test_job_config_syntax(): src_path = os.path.join(os.path.dirname(__file__), "../src") for _, job_config in EXPECTED_JOBS.items(): # Check (loosely) that double-dashes are enclosed in quotes: - with open(os.path.join(src_path, job_config)) as f_handle: + with open(os.path.join(src_path, job_config), encoding="utf8") as f_handle: for line in f_handle.readlines(): if not line.strip().startswith("--") and "--" in line: assert '"--' in line and " --" not in line @@ -55,17 +57,18 @@ def test_executables(): """Test executables listed in job configurations exist in $PATH""" src_path = os.path.join(os.path.dirname(__file__), "../src") for _, job_config in EXPECTED_JOBS.items(): - with open(os.path.join(src_path, job_config)) as f_handle: + with open(os.path.join(src_path, job_config), encoding="utf8") as f_handle: executable = f_handle.readlines()[0].split()[1] assert shutil.which(executable) def test_hook_implementations_job_docs(): - pm = ErtPluginManager(plugins=[jobs]) + """Testing hook job docs.""" + pma = ErtPluginManager(plugins=[jobs]) - installable_jobs = pm.get_installable_jobs() + installable_jobs = pma.get_installable_jobs() - docs = pm.get_documentation_for_jobs() + docs = pma.get_documentation_for_jobs() assert set(docs.keys()) == set(installable_jobs.keys()) diff --git a/tests/yaml/avg1a.yml b/tests/yaml/avg1a.yml index 7336f51..be16bbf 100644 --- a/tests/yaml/avg1a.yml +++ b/tests/yaml/avg1a.yml @@ -7,7 +7,7 @@ title: Reek # This is a case with only Eclipse input input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK grid: $eclroot.EGRID PORO: $eclroot.INIT PRESSURE--19991201: $eclroot.UNRST @@ -20,7 +20,7 @@ zonation: computesettings: zone: Yes all: Yes - mask_zeros: Yes # means that ouput maps will be set to undef where zero + mask_zeros: Yes # means that ouput maps will be set to undef where zero # map definition (not rotated maps only) mapsettings: @@ -32,8 +32,8 @@ mapsettings: nrow: 250 output: - tag: avg1a # the tag will added to file name as extra info, e.g. as - # z1--avg1a_average_poro.gri - mapfolder: TMP - plotfolder: TMP + tag: avg1a # the tag will added to file name as extra info, e.g. as + # z1--avg1a_average_poro.gri + mapfolder: /tmp + plotfolder: /tmp prefix: xxx diff --git a/tests/yaml/avg1b.yml b/tests/yaml/avg1b.yml index c8d23c8..af0f8ad 100644 --- a/tests/yaml/avg1b.yml +++ b/tests/yaml/avg1b.yml @@ -5,24 +5,24 @@ title: Reek input: # folderroot is a short form to a folder - folderroot: ../xtgeo-testdata/3dgrids/reek + folderroot: tests/data/reek grid: $folderroot/reek_sim_grid.roff por: $folderroot/reek_sim_poro.roff permz: $folderroot/reek_sim_permx.roff # zonation from file on YAML format zonation: - yamlfile: tests/yaml/avg1a_zone.yml # re-use 1a + yamlfile: tests/yaml/avg1a_zone.yml # re-use 1a computesettings: zone: Yes all: No - mask_zeros: Yes # means that ouput maps will be set to undef where zero + mask_zeros: Yes # means that ouput maps will be set to undef where zero # map definition not set; means deduced from grid output: - tag: avg1b # the tag will added to file name as extra info, e.g. as - # z1--avg1b_average_por.gri - mapfolder: TMP - plotfolder: TMP + tag: avg1b # the tag will added to file name as extra info, e.g. as + # z1--avg1b_average_por.gri + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/avg1c.yml b/tests/yaml/avg1c.yml index 546f54c..d5b57d7 100644 --- a/tests/yaml/avg1c.yml +++ b/tests/yaml/avg1c.yml @@ -3,25 +3,25 @@ title: Reek input: # folderroot is a short form to a folder - folderroot: ../xtgeo-testdata/3dgrids/reek + folderroot: tests/data/reek grid: $folderroot/reek_sim_grid.roff por: $folderroot/reek_sim_poro.roff permx: $folderroot/reek_sim_permx.roff # zonation from file on YAML format zonation: - yamlfile: tests/yaml/avg1a_zone.yml # re-use 1a + yamlfile: tests/yaml/avg1a_zone.yml # re-use 1a mapsettings: - templatefile: ../xtgeo-testdata/surfaces/reek/1/reek_hcmap_rotated.gri + templatefile: tests/data/reek/reek_hcmap_rotated.gri computesettings: - zone: Yes # compute for all indivual zones - all: Yes # compute for all zones total - mask_zeros: Yes # output maps will be set to undef where zero + zone: Yes # compute for all indivual zones + all: Yes # compute for all zones total + mask_zeros: Yes # output maps will be set to undef where zero plotsettings: - faultpolygons: ../xtgeo-testdata/polygons/reek/1/top_upper_reek_faultpoly.xyz + faultpolygons: tests/data/reek/top_upper_reek_faultpoly.xyz por: # general range for "por": valuerange: [0.1, 0.25] @@ -33,9 +33,8 @@ plotsettings: # generell settings for perm valuerange: [1, 2000] - output: - tag: avg1c # the tag will added to file name as extra info, e.g. as - # z1--avg1b_average_por.gri - mapfolder: TMP - plotfolder: TMP + tag: avg1c # the tag will added to file name as extra info, e.g. as + # z1--avg1b_average_por.gri + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/avg1d.yml b/tests/yaml/avg1d.yml index 9bf276f..31c7f32 100644 --- a/tests/yaml/avg1d.yml +++ b/tests/yaml/avg1d.yml @@ -3,27 +3,26 @@ title: Reek input: # folderroot is a short form to a folder - folderroot: ../xtgeo-testdata/3dgrids/reek + folderroot: tests/data/reek grid: $folderroot/reek_sim_grid.roff diffsat: $folderroot/reek--sim_swat--20021201_19991201.roff # zonation from file on YAML format zonation: - yamlfile: tests/yaml/avg1a_zone.yml # re-use 1a - + yamlfile: tests/yaml/avg1a_zone.yml # re-use 1a computesettings: - zone: No # if compute for all indivual zones - all: Yes # if compute for all zones total + zone: No # if compute for all indivual zones + all: Yes # if compute for all zones total plotsettings: - faultpolygons: ../xtgeo-testdata/polygons/reek/1/top_upper_reek_faultpoly.xyz + faultpolygons: tests/data/reek/top_upper_reek_faultpoly.xyz diffsat: # general range: valuerange: [-1, 1] output: - tag: avg1d # the tag will added to file name as extra info, e.g. as - # z1--avg1b_average_por.gri - mapfolder: TMP - plotfolder: TMP + tag: avg1d # the tag will added to file name as extra info, e.g. as + # z1--avg1b_average_por.gri + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/avg1e.yml b/tests/yaml/avg1e.yml index 3277efa..6b6b8f5 100644 --- a/tests/yaml/avg1e.yml +++ b/tests/yaml/avg1e.yml @@ -3,24 +3,23 @@ title: Reek input: # folderroot is a short form to a folder - folderroot: ../xtgeo-testdata/3dgrids/reek + folderroot: tests/data/reek grid: $folderroot/reek_sim_grid.roff diffsat: $folderroot/reek--sim_swat--20021201_19991201.roff # zonation from file on YAML format zonation: - yamlfile: tests/yaml/avg1a_zone.yml # re-use 1a - + yamlfile: tests/yaml/avg1a_zone.yml # re-use 1a computesettings: zone: No all: Yes tuning: - zone_avg: Yes # will average, weighted per zone first -> faster - coarsen: 2 # sample every 2'nd cell -> faster + zone_avg: Yes # will average, weighted per zone first -> faster + coarsen: 2 # sample every 2'nd cell -> faster plotsettings: - faultpolygons: ../xtgeo-testdata/polygons/reek/1/top_upper_reek_faultpoly.xyz + faultpolygons: tests/data/reek/top_upper_reek_faultpoly.xyz diffsat: # general range: valuerange: [-1, 1] @@ -28,5 +27,5 @@ plotsettings: output: tag: avg1e - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/avg1f.yml b/tests/yaml/avg1f.yml index d46392e..0560d42 100644 --- a/tests/yaml/avg1f.yml +++ b/tests/yaml/avg1f.yml @@ -3,27 +3,26 @@ title: Reek input: # folderroot is a short form to a folder - folderroot: ../xtgeo-testdata/3dgrids/reek + folderroot: tests/data/reek grid: $folderroot/reek2_grid_w_zerolayer.roff dz: $folderroot/reek2_grid_w_zerolayer_dz.roff # zonation from file on YAML format zonation: zranges: - - UPPER: [1, 6] - - LOWER: [8, 14] - - ZERO: [15, 15] - + - UPPER: [1, 6] + - LOWER: [8, 14] + - ZERO: [15, 15] computesettings: zone: Yes all: No tuning: - zone_avg: Yes # will average, weighted per zone first -> faster - coarsen: 2 # sample every 2'nd cell -> faster + zone_avg: Yes # will average, weighted per zone first -> faster + coarsen: 2 # sample every 2'nd cell -> faster plotsettings: - faultpolygons: ../xtgeo-testdata/polygons/reek/1/top_upper_reek_faultpoly.xyz + faultpolygons: tests/data/reek/top_upper_reek_faultpoly.xyz dz: # general range: valuerange: [0, 3] @@ -31,5 +30,5 @@ plotsettings: output: tag: avg1f - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/avg2a.yml b/tests/yaml/avg2a.yml index 2558116..c40b7b7 100644 --- a/tests/yaml/avg2a.yml +++ b/tests/yaml/avg2a.yml @@ -3,26 +3,22 @@ title: Reek # a zone filter instead) input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK grid: $eclroot.EGRID # alternative approach to read a variables and dates: properties: - - - name: PORO + - name: PORO source: $eclroot.INIT - - - name: SWAT + - name: SWAT source: $eclroot.UNRST dates: !include_from tests/yaml/global_config3a.yml::global.DATES diffdates: !include_from tests/yaml/global_config3a.yml::global.DIFFDATES - - - name: PRESSURE + - name: PRESSURE source: $eclroot.UNRST dates: !include_from tests/yaml/global_config3a.yml::global.DATES diffdates: !include_from tests/yaml/global_config3a.yml::global.DIFFDATES - # For filters, there are properties defined at the same grid layout as # the grid read in input # @@ -32,25 +28,22 @@ input: # in most cases to be combined with "prefix" setting under "output" filters: - - - name: PORO + - name: PORO source: $eclroot.INIT - intvrange: [0.0, 1.0] # Filter for a continuous will be an interval - - - name: FACIES + intvrange: [0.0, 1.0] # Filter for a continuous will be an interval + - name: FACIES discrete: Yes - source: ../xtgeo-testdata/3dgrids/reek/reek_sim_facies2.roff - discrange: [2] # Filter for a discrete will be spesic number sequence - - - name: Zone + source: tests/data/reek/reek_sim_facies2.roff + discrange: [2] # Filter for a discrete will be spesic number sequence + - name: Zone discrete: Yes - source: ../xtgeo-testdata/3dgrids/reek/reek_sim_zone.roff - discrange: [2, 3] # Filter for a discrete will be spesic number sequence + source: tests/data/reek/reek_sim_zone.roff + discrange: [2, 3] # Filter for a discrete will be spesic number sequence computesettings: zone: No all: Yes - mask_zeros: Yes # means that ouput maps will be set to undef where zero + mask_zeros: Yes # means that ouput maps will be set to undef where zero # map definition (unrotated maps only, for rotated maps use a maptemplate...) mapsettings: @@ -62,9 +55,9 @@ mapsettings: nrow: 250 output: - tag: avg2a # the tag will added to file name as extra info, e.g. as - # z1--avg1a_average_poro.gri + tag: avg2a # the tag will added to file name as extra info, e.g. as + # z1--avg1a_average_poro.gri - prefix: zone2+3 # replace the default 'all' prefix - mapfolder: TMP - plotfolder: TMP + prefix: zone2+3 # replace the default 'all' prefix + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/avg2b.yml b/tests/yaml/avg2b.yml index b8d35bd..d0e6c9f 100644 --- a/tests/yaml/avg2b.yml +++ b/tests/yaml/avg2b.yml @@ -2,54 +2,47 @@ title: Reek # Case with filters, read dates from global config, and read zonation from a 3D parameter input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK grid: $eclroot.EGRID # alternative approach to read a variables and dates: properties: - - - name: PORO + - name: PORO source: $eclroot.INIT - - - name: SWAT + - name: SWAT source: $eclroot.UNRST dates: !include_from tests/yaml/global_config3a.yml::global.DATES diffdates: !include_from tests/yaml/global_config3a.yml::global.DIFFDATES - - - name: PRESSURE + - name: PRESSURE source: $eclroot.UNRST dates: !include_from tests/yaml/global_config3a.yml::global.DATES diffdates: !include_from tests/yaml/global_config3a.yml::global.DIFFDATES - zonation: zproperty: name: Zone - source: ../xtgeo-testdata/3dgrids/reek/reek_sim_zone.roff + source: tests/data/reek/reek_sim_zone.roff zones: - - myzone1: [1] # refers to zonation numbers in 3D parameter + - myzone1: [1] # refers to zonation numbers in 3D parameter - myzone2+3: [2, 3] # # zranges: # - myzone1: [1, 5] # refers to K layers - filters: - - - name: PORO + - name: PORO source: $eclroot.INIT - intvrange: [0.0, 1.0] # Filter for a continuous will be an interval - - - name: FACIES + intvrange: [0.0, 1.0] # Filter for a continuous will be an interval + - name: FACIES discrete: Yes - source: ../xtgeo-testdata/3dgrids/reek/reek_sim_facies2.roff - discrange: [2] # Filter for a discrete will be spesic number sequence + source: tests/data/reek/reek_sim_facies2.roff + discrange: [2] # Filter for a discrete will be spesic number sequence computesettings: zone: Yes all: Yes - mask_zeros: Yes # means that ouput maps will be set to undef where zero + mask_zeros: Yes # means that ouput maps will be set to undef where zero # map definition (unrotated maps only, for rotated maps use a maptemplate...) mapsettings: @@ -61,8 +54,8 @@ mapsettings: nrow: 250 output: - tag: avg2b # the tag will added to file name as extra info, e.g. as - # z1--avg1a_average_poro.gri + tag: avg2b # the tag will added to file name as extra info, e.g. as + # z1--avg1a_average_poro.gri - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/avg2c.yml b/tests/yaml/avg2c.yml index fddba41..796f5ab 100644 --- a/tests/yaml/avg2c.yml +++ b/tests/yaml/avg2c.yml @@ -3,47 +3,42 @@ title: Reek # Props from restarts only input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK grid: $eclroot.EGRID # alternative approach to read a variables and dates: properties: - - - name: SWAT + - name: SWAT source: $eclroot.UNRST dates: !include_from tests/yaml/global_config3a.yml::global.DATES diffdates: !include_from tests/yaml/global_config3a.yml::global.DIFFDATES - - - name: PRESSURE + - name: PRESSURE source: $eclroot.UNRST dates: !include_from tests/yaml/global_config3a.yml::global.DATES diffdates: !include_from tests/yaml/global_config3a.yml::global.DIFFDATES - zonation: zproperty: name: Zone - source: ../xtgeo-testdata/3dgrids/reek/reek_sim_zone.roff + source: tests/data/reek/reek_sim_zone.roff zones: - - myzone1: [1] # refers to zonation numbers in 3D parameter + - myzone1: [1] # refers to zonation numbers in 3D parameter - myzone2+3: [2, 3] # # zranges: # - myzone1: [1, 5] # refers to K layers - filters: - - - name: FACIES + - name: FACIES discrete: Yes - source: ../xtgeo-testdata/3dgrids/reek/reek_sim_facies2.roff - discrange: [2] # Filter for a discrete will be spesic number sequence + source: tests/data/reek/reek_sim_facies2.roff + discrange: [2] # Filter for a discrete will be spesic number sequence computesettings: zone: Yes all: Yes - mask_zeros: Yes # means that ouput maps will be set to undef where zero + mask_zeros: Yes # means that ouput maps will be set to undef where zero # map definition (unrotated maps only, for rotated maps use a maptemplate...) mapsettings: @@ -55,8 +50,8 @@ mapsettings: nrow: 250 output: - tag: avg2c # the tag will added to file name as extra info, e.g. as - # z1--avg1a_average_poro.gri + tag: avg2c # the tag will added to file name as extra info, e.g. as + # z1--avg1a_average_poro.gri - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/contact1a.yml b/tests/yaml/contact1a.yml index a773d66..71a11dc 100644 --- a/tests/yaml/contact1a.yml +++ b/tests/yaml/contact1a.yml @@ -3,10 +3,10 @@ title: Reek # just give rootname in case of "eclipserun" model # input is what to be made maps of input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: - - 19991201 # the first date is the initial state - - 20021101 # the following will compute contact + - 19991201 # the first date is the initial state + - 20021101 # the following will compute contact # Zonation gives what zones to compute over, and typically is similar # to the zonation in RMS. Note that it is possible to read the zonation @@ -40,5 +40,5 @@ mapsettings: nrow: 200 output: - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/hc_thickness1a.yml b/tests/yaml/hc_thickness1a.yml index 806bd07..61b16be 100644 --- a/tests/yaml/hc_thickness1a.yml +++ b/tests/yaml/hc_thickness1a.yml @@ -1,15 +1,14 @@ title: Reek - # just give rootname in case of "eclipserun" model # input is what to be made maps of input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: - 19991201 - 20021101 - - 20021111 # this does not exist but script will ignore with warning - - 20010101-19991201 # difference map + - 20021111 # this does not exist but script will ignore with warning + - 20010101-19991201 # difference map # - 20030101--19991201 # difference map # Zonation gives what zones to compute over, and typically is similar @@ -32,7 +31,7 @@ computesettings: # choose oil, gas or both mode: oil critmode: No - shc_interval: [0.1, 1] # saturation interv + shc_interval: [0.1, 1] # saturation interv method: use_poro zone: Yes all: Yes @@ -47,5 +46,5 @@ mapsettings: nrow: 200 output: - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/hc_thickness1b.yml b/tests/yaml/hc_thickness1b.yml index 759a7e9..6762ebc 100644 --- a/tests/yaml/hc_thickness1b.yml +++ b/tests/yaml/hc_thickness1b.yml @@ -5,7 +5,7 @@ title: Reek # input is what to be made maps of input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: - 19991201 - 20010101-19991201 @@ -14,12 +14,11 @@ input: zonation: yamlfile: tests/yaml/hc_thickness1b_zonation.yml - computesettings: # choose oil, gas or both mode: oil critmode: No - shc_interval: [0.001, 1] # saturation interval + shc_interval: [0.001, 1] # saturation interval method: use_poro zone: No all: Yes @@ -38,17 +37,18 @@ mapsettings: # hieractical, which means that a general level setting will be # overridden by a more spesific setting, e.g. see below plotsettings: + faultpolygons: tests/data/reek/top_upper_reek_faultpoly.xyz - faultpolygons: ../xtgeo-testdata/polygons/reek/1/top_upper_reek_faultpoly.xyz - - valuerange: [0, 10] # value range min/max (values above below - # will be truncated in plot!) - diffvaluerange: [-3, 0] # value range min/max for date diffs + valuerange: + [0, 10] # value range min/max (values above below + # will be truncated in plot!) + diffvaluerange: [-3, 0] # value range min/max for date diffs - xlabelrotation: 25 # Rotate the X axis labels (if they may overlap) + xlabelrotation: 25 # Rotate the X axis labels (if they may overlap) - colortable: seismic # colours jet/rainbow/seismic/gnuplot/gnuplot2/... - # OR from RMS colour file + colortable: + seismic # colours jet/rainbow/seismic/gnuplot/gnuplot2/... + # OR from RMS colour file # individual settings will override general plot settings! Z1: @@ -59,7 +59,7 @@ plotsettings: valuerange: [0, 5] output: - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp tag: hc1b prefix: replace_all_with_x diff --git a/tests/yaml/hc_thickness1c.yml b/tests/yaml/hc_thickness1c.yml index 9a517dd..2852f9a 100644 --- a/tests/yaml/hc_thickness1c.yml +++ b/tests/yaml/hc_thickness1c.yml @@ -5,7 +5,7 @@ title: Reek # just give rootname in case of "eclipserun" model # input is what to be made maps of input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: - 19991201 @@ -24,12 +24,12 @@ computesettings: # choose oil, gas or both mode: oil critmode: No - shc_interval: [0.1, 1] # saturation interv + shc_interval: [0.1, 1] # saturation interv method: use_poro zone: Yes all: Yes output: tag: hc1c - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/hc_thickness1d.yml b/tests/yaml/hc_thickness1d.yml index 7f3b342..05c7f31 100644 --- a/tests/yaml/hc_thickness1d.yml +++ b/tests/yaml/hc_thickness1d.yml @@ -2,7 +2,7 @@ title: Reek # # Using PORV as method; should give similar result input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: - 19991201 @@ -19,12 +19,12 @@ computesettings: # choose oil, gas or both mode: oil critmode: No - shc_interval: [0.1, 1] # saturation interv + shc_interval: [0.1, 1] # saturation interv method: use_porv zone: Yes all: Yes output: tag: hc1d - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/hc_thickness1e.yml b/tests/yaml/hc_thickness1e.yml index 530fc80..eed444b 100644 --- a/tests/yaml/hc_thickness1e.yml +++ b/tests/yaml/hc_thickness1e.yml @@ -2,8 +2,8 @@ title: Reek # # Using PORV as method input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK - grid: ../xtgeo-testdata/3dgrids/reek/reek_grid_fromegrid.roff + eclroot: tests/data/reek/REEK + grid: tests/data/reek/reek_grid_fromegrid.roff dates: - 19991201 @@ -22,12 +22,12 @@ computesettings: # choose oil, gas or both mode: oil critmode: No - shc_interval: [0.1, 1] # saturation interv + shc_interval: [0.1, 1] # saturation interv method: use_porv zone: Yes all: Yes output: tag: hc1e - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/hc_thickness1f.yml b/tests/yaml/hc_thickness1f.yml index 75dc039..936dfce 100644 --- a/tests/yaml/hc_thickness1f.yml +++ b/tests/yaml/hc_thickness1f.yml @@ -3,8 +3,8 @@ title: Reek # Using PORV as method, and a rotated template map in mapsettings input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK - grid: ../xtgeo-testdata/3dgrids/reek/reek_grid_fromegrid.roff + eclroot: tests/data/reek/REEK + grid: tests/data/reek/reek_grid_fromegrid.roff dates: - 19991201 @@ -13,18 +13,18 @@ zonation: - Z1: [1, 5] mapsettings: - templatefile: ../xtgeo-testdata/surfaces/reek/1/reek_hcmap_rotated.gri + templatefile: tests/data/reek/reek_hcmap_rotated.gri computesettings: # choose oil, gas or both mode: oil critmode: No - shc_interval: [0.1, 1] # saturation interv + shc_interval: [0.1, 1] # saturation interv method: use_porv zone: Yes all: Yes output: tag: hc1f - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/hc_thickness1g.yml b/tests/yaml/hc_thickness1g.yml index 0c4dd11..a9e69fa 100644 --- a/tests/yaml/hc_thickness1g.yml +++ b/tests/yaml/hc_thickness1g.yml @@ -3,8 +3,8 @@ title: Reek # Using PORV as method, and a rotated template map in mapsettings input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK - grid: ../xtgeo-testdata/3dgrids/reek/reek_grid_fromegrid.roff + eclroot: tests/data/reek/REEK + grid: tests/data/reek/reek_grid_fromegrid.roff dates: - 19991201 @@ -13,18 +13,18 @@ zonation: - Z1: [1, 5] mapsettings: - templatefile: ../xtgeo-testdata/surfaces/reek/1/reek_hcmap_rotated.gri + templatefile: tests/data/reek/reek_hcmap_rotated.gri computesettings: # choose oil, gas or both mode: both critmode: No - shc_interval: [0.1, 1] # saturation interv + shc_interval: [0.1, 1] # saturation interv method: use_porv zone: Yes all: Yes output: tag: hc1g - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/hc_thickness1h.yml b/tests/yaml/hc_thickness1h.yml index 7df18e5..8cf65bb 100644 --- a/tests/yaml/hc_thickness1h.yml +++ b/tests/yaml/hc_thickness1h.yml @@ -2,16 +2,15 @@ title: Reek - # just give rootname in case of "eclipserun" model # input is what to be made maps of input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: - 19991201 - 20021101 - - 20021111 # this does not exist but script will ignore with warning - - 20010101-19991201 # difference map + - 20021111 # this does not exist but script will ignore with warning + - 20010101-19991201 # difference map # - 20030101--19991201 # difference map # Zonation gives what zones to compute over, and typically is similar @@ -34,7 +33,7 @@ computesettings: # choose oil, gas or both mode: oil critmode: No - shc_interval: [0.1, 1] # saturation interv + shc_interval: [0.1, 1] # saturation interv method: use_poro zone: Yes all: Yes @@ -53,5 +52,5 @@ mapsettings: output: tag: tuning - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/hc_thickness1i.yml b/tests/yaml/hc_thickness1i.yml index 0e49138..b821724 100644 --- a/tests/yaml/hc_thickness1i.yml +++ b/tests/yaml/hc_thickness1i.yml @@ -4,11 +4,11 @@ title: Reek # just give rootname in case of "eclipserun" model # input is what to be made maps of input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: - 19991201 - 20021101 - - 20010101-19991201 # difference map + - 20010101-19991201 # difference map # - 20030101--19991201 # difference map # Zonation gives what zones to compute over, and typically is similar @@ -31,7 +31,7 @@ computesettings: # choose oil, gas or both mode: oil critmode: No - shc_interval: [0.1, 1] # saturation interv + shc_interval: [0.1, 1] # saturation interv method: use_poro zone: Yes all: Yes @@ -51,5 +51,5 @@ mapsettings: output: tag: hc1i - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/hc_thickness1z.yml b/tests/yaml/hc_thickness1z.yml index d3bb076..984d074 100644 --- a/tests/yaml/hc_thickness1z.yml +++ b/tests/yaml/hc_thickness1z.yml @@ -4,7 +4,7 @@ title: Reek # # Using PORV as method; should give similar result input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: - 19991201 @@ -12,18 +12,18 @@ input: # to the zonation in RMS. zonation: # zranges will normally be the Zone parameter, defined as K range cells - zonefile: ../xtgeo-testdata/3dgrids/reek/reek_sim_zone.roff + zonefile: tests/data/reek/reek_sim_zone.roff computesettings: # choose oil, gas or both mode: oil critmode: No - shc_interval: [0.1, 1] # saturation interv + shc_interval: [0.1, 1] # saturation interv method: use_porv zone: Yes all: Yes output: tag: hc1d - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp diff --git a/tests/yaml/hc_thickness2a.yml b/tests/yaml/hc_thickness2a.yml index b162bb6..d322f7a 100644 --- a/tests/yaml/hc_thickness2a.yml +++ b/tests/yaml/hc_thickness2a.yml @@ -2,10 +2,10 @@ title: Reek # Use a STOIIP or HCPV property from RMS input: - grid: ../xtgeo-testdata/3dgrids/reek/reek_geo_grid.roff + grid: tests/data/reek/reek_geo_grid.roff # the name is the actual name of the parameter in the ROFF file # here STOIIP (if you don't know, try with "unknown" as name!) - stoiip: {STOIIP: ../xtgeo-testdata/3dgrids/reek/reek_geo_stooip.roff} + stoiip: { STOIIP: tests/data/reek/reek_geo_stooip.roff } # date will just be informative (on plots etc) in this case dates: [19900101] @@ -22,6 +22,6 @@ computesettings: all: Yes output: - mapfolder: TMP - plotfolder: TMP - tag: 'stoiip' # could be wise to tag the file name when using STOIIP + mapfolder: /tmp + plotfolder: /tmp + tag: "stoiip" # could be wise to tag the file name when using STOIIP diff --git a/tests/yaml/hc_thickness3a.yml b/tests/yaml/hc_thickness3a.yml index 4cc2fd6..d95174a 100644 --- a/tests/yaml/hc_thickness3a.yml +++ b/tests/yaml/hc_thickness3a.yml @@ -3,33 +3,29 @@ title: Reek # Reuse dates data from global config input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: !include_from tests/yaml/global_config3a.yml::global.DATES diffdates: !include_from tests/yaml/global_config3a.yml::global.DIFFDATES # zonation from file on YAML format zonation: !include hc_thickness1b_zonation.yml - # For filters, there are properties defined at the same grid layout as the grid read in input # If several filters, the will be cumulative filters: - - - name: PORO + - name: PORO source: $eclroot.INIT - intvrange: [0.2, 1.0] # Filter for a continuous will be an interval - - - name: FACIES + intvrange: [0.2, 1.0] # Filter for a continuous will be an interval + - name: FACIES discrete: Yes - source: ../xtgeo-testdata/3dgrids/reek/reek_sim_facies2.roff - discrange: [1] # Filter for a discrete will be spesic number (or codename?) - + source: tests/data/reek/reek_sim_facies2.roff + discrange: [1] # Filter for a discrete will be spesic number (or codename?) computesettings: # choose oil, gas or both mode: oil critmode: No - shc_interval: [0.001, 1] # saturation interval + shc_interval: [0.001, 1] # saturation interval method: use_poro zone: Yes all: No @@ -48,17 +44,18 @@ mapsettings: # hieractical, which means that a general level setting will be # overridden by a more spesific setting, e.g. see below plotsettings: + faultpolygons: tests/data/reek/top_upper_reek_faultpoly.xyz - faultpolygons: ../xtgeo-testdata/polygons/reek/1/top_upper_reek_faultpoly.xyz - - valuerange: [0, 10] # value range min/max (values above below - # will be truncated in plot!) - diffvaluerange: [-3, 0] # value range min/max for date diffs + valuerange: + [0, 10] # value range min/max (values above below + # will be truncated in plot!) + diffvaluerange: [-3, 0] # value range min/max for date diffs - xlabelrotation: 25 # Rotate the X axis labels (if they may overlap) + xlabelrotation: 25 # Rotate the X axis labels (if they may overlap) - colortable: rainbow # colours jet/rainbow/seismic/gnuplot/gnuplot2/... - # OR from RMS colour file + colortable: + rainbow # colours jet/rainbow/seismic/gnuplot/gnuplot2/... + # OR from RMS colour file # individual settings will override general plot settings! Z1: @@ -69,6 +66,6 @@ plotsettings: valuerange: [0, 5] output: - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp tag: hc1b diff --git a/tests/yaml/hc_thickness3b.yml b/tests/yaml/hc_thickness3b.yml index 5f77dfd..f61fa72 100644 --- a/tests/yaml/hc_thickness3b.yml +++ b/tests/yaml/hc_thickness3b.yml @@ -6,34 +6,30 @@ title: Reek # Reuse dates data from global config input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: !include_from tests/yaml/global_config3a.yml::global.DATES diffdates: !include_from tests/yaml/global_config3a.yml::global.DIFFDATES # For filters, there are properties defined at the same grid layout as the grid read in input # If several filters, they will be cumulative filters: - - - name: PORO + - name: PORO source: $eclroot.INIT - intvrange: [0.2, 1.0] # Filter for a continuous will be an interval - - - name: FACIES + intvrange: [0.2, 1.0] # Filter for a continuous will be an interval + - name: FACIES discrete: Yes - source: ../xtgeo-testdata/3dgrids/reek/reek_sim_facies2.roff - discrange: [1] # Filter for a discrete will be spesic number (or codename?) - - - name: Zone + source: tests/data/reek/reek_sim_facies2.roff + discrange: [1] # Filter for a discrete will be spesic number (or codename?) + - name: Zone discrete: Yes - source: ../xtgeo-testdata/3dgrids/reek/reek_sim_zone.roff - discrange: [1, 3] # Filter for a discrete will be spesic number - + source: tests/data/reek/reek_sim_zone.roff + discrange: [1, 3] # Filter for a discrete will be spesic number computesettings: # choose oil, gas or both mode: oil critmode: No - shc_interval: [0.001, 1] # saturation interval + shc_interval: [0.001, 1] # saturation interval method: use_poro zone: no all: yes @@ -52,17 +48,18 @@ mapsettings: # hieractical, which means that a general level setting will be # overridden by a more spesific setting, e.g. see below plotsettings: + faultpolygons: tests/data/reek/top_upper_reek_faultpoly.xyz - faultpolygons: ../xtgeo-testdata/polygons/reek/1/top_upper_reek_faultpoly.xyz - - valuerange: [0, 10] # value range min/max (values above below - # will be truncated in plot!) - diffvaluerange: [-3, 0] # value range min/max for date diffs + valuerange: + [0, 10] # value range min/max (values above below + # will be truncated in plot!) + diffvaluerange: [-3, 0] # value range min/max for date diffs - xlabelrotation: 25 # Rotate the X axis labels (if they may overlap) + xlabelrotation: 25 # Rotate the X axis labels (if they may overlap) - colortable: rainbow # colours jet/rainbow/seismic/gnuplot/gnuplot2/... - # OR from RMS colour file + colortable: + rainbow # colours jet/rainbow/seismic/gnuplot/gnuplot2/... + # OR from RMS colour file # individual settings will override general plot settings! Z1: @@ -73,7 +70,7 @@ plotsettings: valuerange: [0, 5] output: - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp tag: hc1b prefix: myzone1+3 diff --git a/tests/yaml/hc_thickness3c.yml b/tests/yaml/hc_thickness3c.yml index 3ecafb6..ca5c29c 100644 --- a/tests/yaml/hc_thickness3c.yml +++ b/tests/yaml/hc_thickness3c.yml @@ -7,7 +7,7 @@ title: Reek # Reuse dates data from global config input: - eclroot: ../xtgeo-testdata/3dgrids/reek/REEK + eclroot: tests/data/reek/REEK dates: !include_from tests/yaml/global_config3a.yml::global.DATES diffdates: !include_from tests/yaml/global_config3a.yml::global.DIFFDATES @@ -16,23 +16,21 @@ zonation: name: FIPNUM source: $eclroot.INIT zones: - - myfip1: [1] # can be a discrete selection, e.g. [1, 3, 6] + - myfip1: [1] # can be a discrete selection, e.g. [1, 3, 6] - myfip2: [2] # For filters, properties shall defined at the same grid layout as the grid read in input # If several filters, they will be cumulative filters: - - - name: PORO + - name: PORO source: $eclroot.INIT - intvrange: [0.0, 1.0] # Filter for a continuous will be an interval - + intvrange: [0.0, 1.0] # Filter for a continuous will be an interval computesettings: # choose oil, gas or both mode: oil critmode: No - shc_interval: [0.001, 1] # saturation interval + shc_interval: [0.001, 1] # saturation interval method: use_poro zone: yes all: yes @@ -51,17 +49,18 @@ mapsettings: # hieractical, which means that a general level setting will be # overridden by a more spesific setting, e.g. see below plotsettings: + faultpolygons: tests/data/reek/top_upper_reek_faultpoly.xyz - faultpolygons: ../xtgeo-testdata/polygons/reek/1/top_upper_reek_faultpoly.xyz - - valuerange: [0, 10] # value range min/max (values above below - # will be truncated in plot!) - diffvaluerange: [-3, 0] # value range min/max for date diffs + valuerange: + [0, 10] # value range min/max (values above below + # will be truncated in plot!) + diffvaluerange: [-3, 0] # value range min/max for date diffs - xlabelrotation: 25 # Rotate the X axis labels (if they may overlap) + xlabelrotation: 25 # Rotate the X axis labels (if they may overlap) - colortable: rainbow # colours jet/rainbow/seismic/gnuplot/gnuplot2/... - # OR from RMS colour file + colortable: + rainbow # colours jet/rainbow/seismic/gnuplot/gnuplot2/... + # OR from RMS colour file # individual settings will override general plot settings! Z1: @@ -72,6 +71,6 @@ plotsettings: valuerange: [0, 5] output: - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp tag: hc3c diff --git a/tests/yaml/hc_thickness4a.yml b/tests/yaml/hc_thickness4a.yml index 32924e9..1493563 100644 --- a/tests/yaml/hc_thickness4a.yml +++ b/tests/yaml/hc_thickness4a.yml @@ -10,29 +10,27 @@ title: Reek input: - grid: ../xtgeo-testdata/3dgrids/reek/reek_sim_grid.roff + grid: tests/data/reek/reek_sim_grid.roff zonation: zproperty: name: FIPNUM - source: ../xtgeo-testdata/3dgrids/reek/REEK.INIT + source: tests/data/reek/REEK.INIT zones: - - myfip1: [1] # can be a discrete selection, e.g. [1, 3, 6] + - myfip1: [1] # can be a discrete selection, e.g. [1, 3, 6] - myfip2: [2] # If several filters, they will be cumulative filters: - - - name: FACIES - source: ../xtgeo-testdata/3dgrids/reek/reek_sim_facies2.roff + - name: FACIES + source: tests/data/reek/reek_sim_facies2.roff discrete: Yes - discrange: {1: C_SAND, 2: HETR_SAND} # or as list: [1, 2] - - - tvdrange: [1610, 1640] + discrange: { 1: C_SAND, 2: HETR_SAND } # or as list: [1, 2] + - tvdrange: [1610, 1640] computesettings: # choose oil, gas, both, dz_only, rock - mode: rock # will only look at rock thickness, no HC saturation + mode: rock # will only look at rock thickness, no HC saturation zone: yes all: yes @@ -46,6 +44,6 @@ mapsettings: nrow: 200 output: - mapfolder: TMP - plotfolder: TMP + mapfolder: /tmp + plotfolder: /tmp tag: hc4a