From 47ba1bc169d76013acbbd144d100c1892d6eaa50 Mon Sep 17 00:00:00 2001 From: mferrera Date: Mon, 9 Dec 2024 08:50:37 +0100 Subject: [PATCH] STY: Fix linting with latest ruff --- docs/conf.py | 3 ++- examples/grid3d_compute_stats.py | 1 + examples/grid3d_print_init_csv.py | 1 + examples/regsurf_compute_stats.py | 1 + examples/wellpath_fence_sample.py | 1 + src/xtgeo/cube/cube1.py | 12 +++++------- src/xtgeo/grid3d/grid_property.py | 2 +- src/xtgeo/surface/regular_surface.py | 6 +++--- src/xtgeo/well/blocked_wells.py | 4 ++-- src/xtgeo/well/well1.py | 2 +- src/xtgeo/xyz/_xyz_io.py | 2 +- tests/jupyter/xtgeo1.ipynb | 2 +- tests/test_common/test_calc.py | 3 ++- tests/test_common/test_cxtgeo_lowlevel.py | 1 + tests/test_common/test_sys.py | 1 + tests/test_cube/test_cube.py | 3 ++- tests/test_cube/test_cube_deprecations.py | 1 + tests/test_cube/test_cube_xtgformats_io.py | 3 ++- tests/test_etc/test_clib_errors.py | 1 + tests/test_etc/test_etc_make_avg_maps.py | 1 + tests/test_etc/test_etc_make_hcpv_maps.py | 1 + tests/test_grid3d/eclrun_fixtures.py | 1 + tests/test_grid3d/egrid_generator.py | 3 ++- tests/test_grid3d/grdecl_grid_generator.py | 3 ++- tests/test_grid3d/grid_generator.py | 1 + tests/test_grid3d/gridprop_generator.py | 1 + tests/test_grid3d/test_ecl_inte_head.py | 1 + tests/test_grid3d/test_ecl_logi_head.py | 1 + tests/test_grid3d/test_ecl_simpleb8_cases.py | 1 + tests/test_grid3d/test_eclrun.py | 1 + tests/test_grid3d/test_grdecl_format.py | 1 + tests/test_grid3d/test_grid.py | 3 ++- tests/test_grid3d/test_grid3d_deprecations.py | 3 ++- tests/test_grid3d/test_grid_bytesio.py | 1 + tests/test_grid3d/test_grid_dual_index.py | 1 + tests/test_grid3d/test_grid_ecl_grid.py | 5 +++-- tests/test_grid3d/test_grid_egrid.py | 3 ++- tests/test_grid3d/test_grid_fence.py | 1 + tests/test_grid3d/test_grid_grdecl.py | 3 ++- tests/test_grid3d/test_grid_operations.py | 3 ++- tests/test_grid3d/test_grid_properties.py | 3 ++- tests/test_grid3d/test_grid_property.py | 3 ++- tests/test_grid3d/test_grid_property_etc.py | 1 + tests/test_grid3d/test_grid_property_grdecl.py | 3 ++- tests/test_grid3d/test_grid_property_roff.py | 3 ++- tests/test_grid3d/test_grid_roff.py | 1 + tests/test_grid3d/test_grid_specialcases.py | 1 + tests/test_grid3d/test_grid_vs_points.py | 1 + tests/test_grid3d/test_grid_vs_well.py | 1 + tests/test_grid3d/test_grid_xtgformats_io.py | 3 ++- tests/test_grid3d/test_gridprop_import_eclrun.py | 3 ++- tests/test_grid3d/test_gridprops_list_properties.py | 1 + tests/test_io/test_file.py | 1 + tests/test_opm_integration/test_grid_io.py | 3 ++- tests/test_opm_integration/test_gridprop_io.py | 3 ++- tests/test_plot/test_grid3dsliceplot.py | 1 + tests/test_roxarapi/test_roxarapi_reek.py | 1 + tests/test_surface/test_deprecation.py | 3 ++- tests/test_surface/test_file_io.py | 3 ++- tests/test_surface/test_ijxyz_spec.py | 1 + tests/test_surface/test_new_surface.py | 3 ++- tests/test_surface/test_regular_surface.py | 3 ++- tests/test_surface/test_regular_surface_bytesio.py | 1 + tests/test_surface/test_regular_surface_in_other.py | 1 + tests/test_surface/test_regular_surface_resample.py | 1 + tests/test_surface/test_regular_surface_vs_cube.py | 1 + tests/test_surface/test_regular_surface_vs_grd3d.py | 1 + tests/test_surface/test_regular_surface_vs_points.py | 1 + .../test_regular_surface_xtgformats_io.py | 3 ++- tests/test_surface/test_surf_xyz_from_ij.py | 1 + tests/test_surface/test_surface_cube_attrs.py | 1 + tests/test_surface/test_surfaces.py | 1 + tests/test_surface/test_swapaxis.py | 1 + tests/test_surface/test_val_from_xy.py | 1 + tests/test_surface/test_zmap_spec.py | 1 + tests/test_well/conftest.py | 1 + tests/test_well/test_blockedwell.py | 1 + tests/test_well/test_blockedwells.py | 1 + tests/test_well/test_well.py | 1 + tests/test_well/test_well_deprecations.py | 3 ++- tests/test_well/test_well_hdf5.py | 1 + tests/test_well/test_well_to_points.py | 1 + tests/test_well/test_well_vs_grid.py | 1 + tests/test_well/test_well_vs_surface.py | 1 + tests/test_well/test_well_xyzdata_class.py | 1 + tests/test_well/test_wells.py | 1 + tests/test_xyz/test_points.py | 3 ++- tests/test_xyz/test_points_from_surface.py | 1 + tests/test_xyz/test_points_from_wells.py | 1 + tests/test_xyz/test_points_poly.py | 1 + tests/test_xyz/test_points_vs_other.py | 1 + tests/test_xyz/test_polygon.py | 1 + tests/test_xyz/test_xyz_deprecated.py | 3 ++- tests/test_xyz/test_xyz_roxapi_mock.py | 3 ++- 94 files changed, 131 insertions(+), 46 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 7798a6f98..a79521834 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,8 +1,9 @@ from datetime import date -import xtgeo from autoclasstoc import PublicMethods +import xtgeo + version = xtgeo.__version__ release = xtgeo.__version__ project = "xtgeo" diff --git a/examples/grid3d_compute_stats.py b/examples/grid3d_compute_stats.py index 81729d99a..7566ecfd6 100644 --- a/examples/grid3d_compute_stats.py +++ b/examples/grid3d_compute_stats.py @@ -7,6 +7,7 @@ from os.path import join as ojn import numpy.ma as npma + import xtgeo # from memory_profiler import profile diff --git a/examples/grid3d_print_init_csv.py b/examples/grid3d_print_init_csv.py index e6fcf1177..b334f5898 100644 --- a/examples/grid3d_print_init_csv.py +++ b/examples/grid3d_print_init_csv.py @@ -6,6 +6,7 @@ import tempfile import numpy as np + import xtgeo EXPATH = pathlib.Path("../../xtgeo-testdata/3dgrids/reek") diff --git a/examples/regsurf_compute_stats.py b/examples/regsurf_compute_stats.py index f6308c659..9f08697ae 100644 --- a/examples/regsurf_compute_stats.py +++ b/examples/regsurf_compute_stats.py @@ -8,6 +8,7 @@ from os.path import join as ojn import numpy.ma as npma + import xtgeo # from memory_profiler import profile diff --git a/examples/wellpath_fence_sample.py b/examples/wellpath_fence_sample.py index d6048b413..a205adad8 100644 --- a/examples/wellpath_fence_sample.py +++ b/examples/wellpath_fence_sample.py @@ -2,6 +2,7 @@ from pathlib import Path import matplotlib.pyplot as plt + import xtgeo TPATH = Path("../xtgeo-testdata") diff --git a/src/xtgeo/cube/cube1.py b/src/xtgeo/cube/cube1.py index 1bd09c854..4f05ea497 100644 --- a/src/xtgeo/cube/cube1.py +++ b/src/xtgeo/cube/cube1.py @@ -101,7 +101,7 @@ def wrapper(cls, *args, **kwargs): DeprecationWarning, ) cfile = args[0] - fformat = args[1] if len(args) > 1 else kwargs.get("fformat", None) + fformat = args[1] if len(args) > 1 else kwargs.get("fformat") mfile = FileWrapper(cfile) fmt = mfile.fileformat(fformat) @@ -1045,9 +1045,8 @@ def scan_segy_traces(sfile: str, outfile: FileLike = None): oflag = False # if outfile is none, it means that you want to plot on STDOUT if outfile is None: - fx = tempfile.NamedTemporaryFile(delete=False, prefix="tmpxgeo") - fx.close() - outfile = fx.name + with tempfile.NamedTemporaryFile(delete=False, prefix="tmpxgeo") as fx: + outfile = fx.name logger.info("TMP file name is %s", outfile) oflag = True @@ -1082,9 +1081,8 @@ def scan_segy_header(sfile: str, outfile: FileLike = None): flag = False # if outfile is none, it means that you want to print on STDOUT if outfile is None: - fc = tempfile.NamedTemporaryFile(delete=False, prefix="tmpxtgeo") - fc.close() - outfile = fc.name + with tempfile.NamedTemporaryFile(delete=False, prefix="tmpxtgeo") as fc: + outfile = fc.name logger.info("TMP file name is %s", outfile) flag = True diff --git a/src/xtgeo/grid3d/grid_property.py b/src/xtgeo/grid3d/grid_property.py index 3d1ae69b2..367be3930 100644 --- a/src/xtgeo/grid3d/grid_property.py +++ b/src/xtgeo/grid3d/grid_property.py @@ -248,7 +248,7 @@ def wrapper(self: GridProperty, *args: Any, **kwargs: Any) -> Callable: "myprop = xtgeo.gridproperty_from_file('some_name.roff') instead", DeprecationWarning, ) - fformat = kwargs.get("fformat", None) + fformat = kwargs.get("fformat") mfile = FileWrapper(pfile) fmt = mfile.fileformat(fformat) diff --git a/src/xtgeo/surface/regular_surface.py b/src/xtgeo/surface/regular_surface.py index 1778bfce2..85d56a6ee 100644 --- a/src/xtgeo/surface/regular_surface.py +++ b/src/xtgeo/surface/regular_surface.py @@ -285,8 +285,8 @@ def wrapper(cls, *args, **kwargs): DeprecationWarning, ) sfile = kwargs.get("sfile", args[0]) - fformat = kwargs.get("fformat", None) - values = kwargs.get("values", None) + fformat = kwargs.get("fformat") + values = kwargs.get("values") if isinstance(values, bool) and values is False: load_values = False else: @@ -337,7 +337,7 @@ def wrapper(cls, *args, **kwargs): and kwargs.get("xori", 0.0) == kwargs.get("yori", 0.0) == 0.0 and kwargs.get("xinc", 25.0) == kwargs.get("yinc", 25.0) == 25.0 ) - values = kwargs.get("values", None) + values = kwargs.get("values") if values is None and default: default_values = [ [1, 6, 11], diff --git a/src/xtgeo/well/blocked_wells.py b/src/xtgeo/well/blocked_wells.py index b88f1c625..436f48a38 100644 --- a/src/xtgeo/well/blocked_wells.py +++ b/src/xtgeo/well/blocked_wells.py @@ -179,7 +179,7 @@ def from_roxar(self, *args, **kwargs): # pragma: no cover project = args[0] gname = args[1] bwname = args[2] - lognames = kwargs.get("lognames", None) + lognames = kwargs.get("lognames") ijk = kwargs.get("ijk", True) _blockedwells_roxapi.import_bwells_roxapi( @@ -208,7 +208,7 @@ def _from_roxar(self, *args, **kwargs): # pragma: no cover project = args[0] gname = args[1] bwname = args[2] - lognames = kwargs.get("lognames", None) + lognames = kwargs.get("lognames") ijk = kwargs.get("ijk", True) _blockedwells_roxapi.import_bwells_roxapi( diff --git a/src/xtgeo/well/well1.py b/src/xtgeo/well/well1.py index fca8d7e1d..02a70df70 100644 --- a/src/xtgeo/well/well1.py +++ b/src/xtgeo/well/well1.py @@ -772,7 +772,7 @@ def to_roxar(self, *args, **kwargs): trajectory = kwargs.get("trajectory", "Drilled trajectory") logrun = kwargs.get("logrun", "log") realisation = kwargs.get("realisation", 0) - update_option = kwargs.get("update_option", None) + update_option = kwargs.get("update_option") logger.debug("Not in use: realisation %s", realisation) diff --git a/src/xtgeo/xyz/_xyz_io.py b/src/xtgeo/xyz/_xyz_io.py index bfee3e9c3..c8cbea854 100644 --- a/src/xtgeo/xyz/_xyz_io.py +++ b/src/xtgeo/xyz/_xyz_io.py @@ -214,7 +214,7 @@ def to_file( KeyError if pfilter is set and key(s) are invalid """ - filter_deprecated = kwargs.get("filter", None) + filter_deprecated = kwargs.get("filter") if filter_deprecated is not None and pfilter is None: pfilter = filter_deprecated diff --git a/tests/jupyter/xtgeo1.ipynb b/tests/jupyter/xtgeo1.ipynb index ad66cdac0..fbf727b20 100644 --- a/tests/jupyter/xtgeo1.ipynb +++ b/tests/jupyter/xtgeo1.ipynb @@ -23,7 +23,7 @@ "metadata": {}, "outputs": [], "source": [ - "reekfile = '../xtgeo-testdata/3dgrids/reek/REEK.EGRID'\n", + "reekfile = \"../xtgeo-testdata/3dgrids/reek/REEK.EGRID\"\n", "reekgrid = xtgeo.grid3d.Grid(reekfile)" ] }, diff --git a/tests/test_common/test_calc.py b/tests/test_common/test_calc.py index 50f22ca5a..9700b65e5 100644 --- a/tests/test_common/test_calc.py +++ b/tests/test_common/test_calc.py @@ -3,9 +3,10 @@ import numpy as np import pytest +from hypothesis import given, strategies as st + import xtgeo import xtgeo.common.calc as xcalc -from hypothesis import given, strategies as st from xtgeo import _cxtgeo xtg = xtgeo.XTGeoDialog() diff --git a/tests/test_common/test_cxtgeo_lowlevel.py b/tests/test_common/test_cxtgeo_lowlevel.py index ad2a767aa..aaf0534d3 100644 --- a/tests/test_common/test_cxtgeo_lowlevel.py +++ b/tests/test_common/test_cxtgeo_lowlevel.py @@ -2,6 +2,7 @@ import numpy as np import pytest + import xtgeo from xtgeo import _cxtgeo diff --git a/tests/test_common/test_sys.py b/tests/test_common/test_sys.py index 815a4137c..265d6a0b0 100644 --- a/tests/test_common/test_sys.py +++ b/tests/test_common/test_sys.py @@ -1,6 +1,7 @@ import hashlib import pytest + from xtgeo.common.sys import generic_hash diff --git a/tests/test_cube/test_cube.py b/tests/test_cube/test_cube.py index c1ad567b3..50a79debc 100644 --- a/tests/test_cube/test_cube.py +++ b/tests/test_cube/test_cube.py @@ -4,8 +4,9 @@ import numpy as np import pytest import segyio -import xtgeo from hypothesis import HealthCheck, given, settings + +import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.cube import Cube from xtgeo.cube._cube_import import ( diff --git a/tests/test_cube/test_cube_deprecations.py b/tests/test_cube/test_cube_deprecations.py index 11e22e41b..b10d3a593 100644 --- a/tests/test_cube/test_cube_deprecations.py +++ b/tests/test_cube/test_cube_deprecations.py @@ -1,4 +1,5 @@ import pytest + import xtgeo diff --git a/tests/test_cube/test_cube_xtgformats_io.py b/tests/test_cube/test_cube_xtgformats_io.py index 9a9f21ee0..d9e17ada7 100644 --- a/tests/test_cube/test_cube_xtgformats_io.py +++ b/tests/test_cube/test_cube_xtgformats_io.py @@ -2,9 +2,10 @@ from os.path import join import pytest -import xtgeo from numpy.testing import assert_allclose +import xtgeo + @pytest.mark.benchmark(group="import/export") def test_benchmark_cube_export(benchmark, tmp_path, testdata_path): diff --git a/tests/test_etc/test_clib_errors.py b/tests/test_etc/test_clib_errors.py index 1b108929d..66cd48c3e 100644 --- a/tests/test_etc/test_clib_errors.py +++ b/tests/test_etc/test_clib_errors.py @@ -2,6 +2,7 @@ import numpy as np import pytest + import xtgeo from xtgeo import _cxtgeo from xtgeo.io._file import FileWrapper diff --git a/tests/test_etc/test_etc_make_avg_maps.py b/tests/test_etc/test_etc_make_avg_maps.py index 333fd40ab..ee86c182a 100644 --- a/tests/test_etc/test_etc_make_avg_maps.py +++ b/tests/test_etc/test_etc_make_avg_maps.py @@ -2,6 +2,7 @@ import numpy as np import pytest + import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.surface import RegularSurface diff --git a/tests/test_etc/test_etc_make_hcpv_maps.py b/tests/test_etc/test_etc_make_hcpv_maps.py index 7b8c7ddbe..ce9716448 100644 --- a/tests/test_etc/test_etc_make_hcpv_maps.py +++ b/tests/test_etc/test_etc_make_hcpv_maps.py @@ -3,6 +3,7 @@ import numpy as np import numpy.ma as ma import pytest + import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.surface import RegularSurface diff --git a/tests/test_grid3d/eclrun_fixtures.py b/tests/test_grid3d/eclrun_fixtures.py index b25943af8..c4bf49733 100644 --- a/tests/test_grid3d/eclrun_fixtures.py +++ b/tests/test_grid3d/eclrun_fixtures.py @@ -1,6 +1,7 @@ from os.path import join import pytest + import xtgeo diff --git a/tests/test_grid3d/egrid_generator.py b/tests/test_grid3d/egrid_generator.py index 5016c57c0..9101df194 100644 --- a/tests/test_grid3d/egrid_generator.py +++ b/tests/test_grid3d/egrid_generator.py @@ -1,8 +1,9 @@ import hypothesis.strategies as st import numpy as np -import xtgeo.grid3d._egrid as xtge from hypothesis.extra.numpy import arrays +import xtgeo.grid3d._egrid as xtge + from .grdecl_grid_generator import ( coordinate_types, finites, diff --git a/tests/test_grid3d/grdecl_grid_generator.py b/tests/test_grid3d/grdecl_grid_generator.py index b3e1ce1b7..7f47d84ff 100644 --- a/tests/test_grid3d/grdecl_grid_generator.py +++ b/tests/test_grid3d/grdecl_grid_generator.py @@ -1,8 +1,9 @@ import hypothesis.strategies as st import numpy as np +from hypothesis.extra.numpy import arrays + import xtgeo.grid3d._ecl_grid as eclgrid import xtgeo.grid3d._grdecl_grid as ggrid -from hypothesis.extra.numpy import arrays from .grid_generator import indices diff --git a/tests/test_grid3d/grid_generator.py b/tests/test_grid3d/grid_generator.py index aaabfc501..5b9112d5b 100644 --- a/tests/test_grid3d/grid_generator.py +++ b/tests/test_grid3d/grid_generator.py @@ -1,4 +1,5 @@ import hypothesis.strategies as st + import xtgeo indices = st.integers(min_value=4, max_value=6) diff --git a/tests/test_grid3d/gridprop_generator.py b/tests/test_grid3d/gridprop_generator.py index 723c2924f..66b189fee 100644 --- a/tests/test_grid3d/gridprop_generator.py +++ b/tests/test_grid3d/gridprop_generator.py @@ -1,6 +1,7 @@ import hypothesis.strategies as st import numpy as np from hypothesis.extra.numpy import arrays + from xtgeo.grid3d import GridProperty from .grdecl_grid_generator import finites diff --git a/tests/test_grid3d/test_ecl_inte_head.py b/tests/test_grid3d/test_ecl_inte_head.py index 2415e895b..210866ebb 100644 --- a/tests/test_grid3d/test_ecl_inte_head.py +++ b/tests/test_grid3d/test_ecl_inte_head.py @@ -1,5 +1,6 @@ import numpy as np import pytest + from xtgeo.grid3d._ecl_inte_head import InteHead, Phases from xtgeo.grid3d._ecl_output_file import Simulator, TypeOfGrid, UnitSystem diff --git a/tests/test_grid3d/test_ecl_logi_head.py b/tests/test_grid3d/test_ecl_logi_head.py index 637bf4a25..602c8316c 100644 --- a/tests/test_grid3d/test_ecl_logi_head.py +++ b/tests/test_grid3d/test_ecl_logi_head.py @@ -1,4 +1,5 @@ import numpy as np + from xtgeo.grid3d._ecl_logi_head import LogiHead from xtgeo.grid3d._ecl_output_file import Simulator diff --git a/tests/test_grid3d/test_ecl_simpleb8_cases.py b/tests/test_grid3d/test_ecl_simpleb8_cases.py index 44e0009b1..a8820840e 100644 --- a/tests/test_grid3d/test_ecl_simpleb8_cases.py +++ b/tests/test_grid3d/test_ecl_simpleb8_cases.py @@ -22,6 +22,7 @@ import numpy as np import pytest import resfo + import xtgeo xtg = xtgeo.XTGeoDialog() diff --git a/tests/test_grid3d/test_eclrun.py b/tests/test_grid3d/test_eclrun.py index a56d8165f..596fbbb15 100644 --- a/tests/test_grid3d/test_eclrun.py +++ b/tests/test_grid3d/test_eclrun.py @@ -3,6 +3,7 @@ import numpy as np import pytest + import xtgeo from .eclrun_fixtures import * # noqa: F401, F403 diff --git a/tests/test_grid3d/test_grdecl_format.py b/tests/test_grid3d/test_grdecl_format.py index 2f91e6efd..008bb1daf 100644 --- a/tests/test_grid3d/test_grdecl_format.py +++ b/tests/test_grid3d/test_grdecl_format.py @@ -1,6 +1,7 @@ from unittest.mock import mock_open, patch import pytest + from xtgeo.grid3d._grdecl_format import open_grdecl diff --git a/tests/test_grid3d/test_grid.py b/tests/test_grid3d/test_grid.py index eccffbb87..bb9d73e02 100644 --- a/tests/test_grid3d/test_grid.py +++ b/tests/test_grid3d/test_grid.py @@ -6,8 +6,9 @@ import numpy as np import pytest -import xtgeo from hypothesis import given + +import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.grid3d import Grid diff --git a/tests/test_grid3d/test_grid3d_deprecations.py b/tests/test_grid3d/test_grid3d_deprecations.py index 9077c1d84..3e0758b46 100644 --- a/tests/test_grid3d/test_grid3d_deprecations.py +++ b/tests/test_grid3d/test_grid3d_deprecations.py @@ -3,9 +3,10 @@ import numpy as np import pytest -import xtgeo from hypothesis import given from packaging import version + +import xtgeo from xtgeo import GridProperties, GridProperty from xtgeo.common.version import __version__ as xtgeo_version diff --git a/tests/test_grid3d/test_grid_bytesio.py b/tests/test_grid3d/test_grid_bytesio.py index fbc34956a..0f303435a 100644 --- a/tests/test_grid3d/test_grid_bytesio.py +++ b/tests/test_grid3d/test_grid_bytesio.py @@ -7,6 +7,7 @@ import io import numpy as np + import xtgeo diff --git a/tests/test_grid3d/test_grid_dual_index.py b/tests/test_grid3d/test_grid_dual_index.py index 4a0e7c296..2caac9175 100644 --- a/tests/test_grid3d/test_grid_dual_index.py +++ b/tests/test_grid3d/test_grid_dual_index.py @@ -57,6 +57,7 @@ import numpy as np import pytest + import xtgeo.grid3d.grid diff --git a/tests/test_grid3d/test_grid_ecl_grid.py b/tests/test_grid3d/test_grid_ecl_grid.py index 9d15bde72..a616b6b55 100644 --- a/tests/test_grid3d/test_grid_ecl_grid.py +++ b/tests/test_grid3d/test_grid_ecl_grid.py @@ -1,11 +1,12 @@ import hypothesis.strategies as st import numpy as np import pytest +from hypothesis import HealthCheck, assume, given, settings +from numpy.testing import assert_allclose + import xtgeo import xtgeo.grid3d._egrid as xtg_egrid import xtgeo.grid3d._grdecl_grid as ggrid -from hypothesis import HealthCheck, assume, given, settings -from numpy.testing import assert_allclose from xtgeo.grid3d._ecl_grid import ( inverse_transform_xtgeo_coord_by_mapaxes, transform_xtgeo_coord_by_mapaxes, diff --git a/tests/test_grid3d/test_grid_egrid.py b/tests/test_grid3d/test_grid_egrid.py index aff0ab490..a1dbd5c2a 100644 --- a/tests/test_grid3d/test_grid_egrid.py +++ b/tests/test_grid3d/test_grid_egrid.py @@ -5,9 +5,10 @@ import numpy as np import pytest import resfo +from hypothesis import HealthCheck, assume, given, settings + import xtgeo as xtg import xtgeo.grid3d._egrid as xtge -from hypothesis import HealthCheck, assume, given, settings from .egrid_generator import ( egrids, diff --git a/tests/test_grid3d/test_grid_fence.py b/tests/test_grid3d/test_grid_fence.py index 6eae9239a..8ac577f6e 100644 --- a/tests/test_grid3d/test_grid_fence.py +++ b/tests/test_grid3d/test_grid_fence.py @@ -1,6 +1,7 @@ import pathlib import pytest + import xtgeo REEKROOT = pathlib.Path("3dgrids/reek/REEK") diff --git a/tests/test_grid3d/test_grid_grdecl.py b/tests/test_grid3d/test_grid_grdecl.py index 74eb41456..20fc3f800 100644 --- a/tests/test_grid3d/test_grid_grdecl.py +++ b/tests/test_grid3d/test_grid_grdecl.py @@ -5,10 +5,11 @@ import hypothesis.strategies as st import numpy as np import pytest +from hypothesis import HealthCheck, assume, given, settings + import xtgeo import xtgeo.grid3d._ecl_grid as ecl_grid import xtgeo.grid3d._grdecl_grid as ggrid -from hypothesis import HealthCheck, assume, given, settings from xtgeo.grid3d import Grid from xtgeo.grid3d._grdecl_format import open_grdecl from xtgeo.grid3d._grid_import_ecl import grid_from_ecl_grid diff --git a/tests/test_grid3d/test_grid_operations.py b/tests/test_grid3d/test_grid_operations.py index 16c484884..df7ba6862 100644 --- a/tests/test_grid3d/test_grid_operations.py +++ b/tests/test_grid3d/test_grid_operations.py @@ -3,9 +3,10 @@ import pathlib import pytest -import xtgeo from hypothesis import given +import xtgeo + from .grid_generator import xtgeo_grids EMEGFILE = pathlib.Path("3dgrids/eme/1/emerald_hetero_grid.roff") diff --git a/tests/test_grid3d/test_grid_properties.py b/tests/test_grid3d/test_grid_properties.py index fc552eec0..cae6e2649 100644 --- a/tests/test_grid3d/test_grid_properties.py +++ b/tests/test_grid3d/test_grid_properties.py @@ -5,8 +5,9 @@ import hypothesis.strategies as st import pytest -import xtgeo from hypothesis import assume, given + +import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.common.exceptions import InvalidFileFormatError from xtgeo.grid3d import GridProperties, GridProperty diff --git a/tests/test_grid3d/test_grid_property.py b/tests/test_grid3d/test_grid_property.py index adbe952d3..4aa704ef4 100644 --- a/tests/test_grid3d/test_grid_property.py +++ b/tests/test_grid3d/test_grid_property.py @@ -8,8 +8,9 @@ import numpy as np import numpy.ma as npma import pytest -import xtgeo from hypothesis import HealthCheck, example, given, settings + +import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.common.exceptions import KeywordNotFoundError from xtgeo.grid3d import Grid, GridProperty diff --git a/tests/test_grid3d/test_grid_property_etc.py b/tests/test_grid3d/test_grid_property_etc.py index 9437cb009..23ec3e1ea 100644 --- a/tests/test_grid3d/test_grid_property_etc.py +++ b/tests/test_grid3d/test_grid_property_etc.py @@ -2,6 +2,7 @@ """Testing: test_grid_property more special functions""" import pytest + from xtgeo.grid3d import _gridprop_roxapi diff --git a/tests/test_grid3d/test_grid_property_grdecl.py b/tests/test_grid3d/test_grid_property_grdecl.py index 3d5707a9b..0aeb0c88b 100644 --- a/tests/test_grid3d/test_grid_property_grdecl.py +++ b/tests/test_grid3d/test_grid_property_grdecl.py @@ -3,9 +3,10 @@ import hypothesis.strategies as st import numpy as np import pytest -import xtgeo from hypothesis import HealthCheck, assume, given, settings from numpy.testing import assert_allclose + +import xtgeo from xtgeo.grid3d._gridprop_import_grdecl import read_grdecl_3d_property from .grid_generator import xtgeo_grids as grids diff --git a/tests/test_grid3d/test_grid_property_roff.py b/tests/test_grid3d/test_grid_property_roff.py index b777a6e76..0b66cfb0e 100644 --- a/tests/test_grid3d/test_grid_property_roff.py +++ b/tests/test_grid3d/test_grid_property_roff.py @@ -4,9 +4,10 @@ import numpy as np import pytest import roffio -import xtgeo from hypothesis import HealthCheck, given, settings from hypothesis.extra.numpy import arrays + +import xtgeo from xtgeo.grid3d import GridProperty from xtgeo.grid3d._roff_parameter import RoffParameter diff --git a/tests/test_grid3d/test_grid_roff.py b/tests/test_grid3d/test_grid_roff.py index f4847500d..428c0d4cd 100644 --- a/tests/test_grid3d/test_grid_roff.py +++ b/tests/test_grid3d/test_grid_roff.py @@ -9,6 +9,7 @@ from hypothesis import given from hypothesis.extra.numpy import arrays from numpy.testing import assert_allclose + from xtgeo import _cxtgeo from xtgeo.grid3d import Grid from xtgeo.grid3d._grid_import_roff import handle_deprecated_xtgeo_roff_file diff --git a/tests/test_grid3d/test_grid_specialcases.py b/tests/test_grid3d/test_grid_specialcases.py index 1f2fad62f..3cf1c2b0b 100644 --- a/tests/test_grid3d/test_grid_specialcases.py +++ b/tests/test_grid3d/test_grid_specialcases.py @@ -9,6 +9,7 @@ import pathlib import pytest + import xtgeo SPE9 = pathlib.Path("3dgrids/bench_spe9") diff --git a/tests/test_grid3d/test_grid_vs_points.py b/tests/test_grid3d/test_grid_vs_points.py index 093d0fa11..f95c3baf3 100644 --- a/tests/test_grid3d/test_grid_vs_points.py +++ b/tests/test_grid3d/test_grid_vs_points.py @@ -2,6 +2,7 @@ import pandas as pd import pytest + import xtgeo xtg = xtgeo.common.XTGeoDialog() diff --git a/tests/test_grid3d/test_grid_vs_well.py b/tests/test_grid3d/test_grid_vs_well.py index bb477e9f0..cb9ab6998 100644 --- a/tests/test_grid3d/test_grid_vs_well.py +++ b/tests/test_grid3d/test_grid_vs_well.py @@ -1,6 +1,7 @@ import pathlib import pytest + import xtgeo from xtgeo.common import XTGeoDialog diff --git a/tests/test_grid3d/test_grid_xtgformats_io.py b/tests/test_grid3d/test_grid_xtgformats_io.py index af5cc3855..8c4ea1d75 100644 --- a/tests/test_grid3d/test_grid_xtgformats_io.py +++ b/tests/test_grid3d/test_grid_xtgformats_io.py @@ -6,9 +6,10 @@ import hypothesis.strategies as st import numpy as np import pytest -import xtgeo from hypothesis import HealthCheck, given, settings from numpy.testing import assert_allclose + +import xtgeo from xtgeo.common import XTGeoDialog xtg = XTGeoDialog() diff --git a/tests/test_grid3d/test_gridprop_import_eclrun.py b/tests/test_grid3d/test_gridprop_import_eclrun.py index 3ee2504c7..a2559525d 100644 --- a/tests/test_grid3d/test_gridprop_import_eclrun.py +++ b/tests/test_grid3d/test_gridprop_import_eclrun.py @@ -8,9 +8,10 @@ import numpy as np import pytest import resfo +from hypothesis import HealthCheck, assume, given, settings + import xtgeo import xtgeo.grid3d._find_gridprop_in_eclrun as xtg_im_ecl -from hypothesis import HealthCheck, assume, given, settings from xtgeo.grid3d._ecl_inte_head import InteHead from xtgeo.grid3d._ecl_logi_head import LogiHead from xtgeo.grid3d._ecl_output_file import Phases diff --git a/tests/test_grid3d/test_gridprops_list_properties.py b/tests/test_grid3d/test_gridprops_list_properties.py index c7f686af8..ba73a8fd6 100644 --- a/tests/test_grid3d/test_gridprops_list_properties.py +++ b/tests/test_grid3d/test_gridprops_list_properties.py @@ -2,6 +2,7 @@ from pathlib import Path import pytest + from xtgeo.common import XTGeoDialog from xtgeo.common.exceptions import InvalidFileFormatError from xtgeo.grid3d import list_gridproperties diff --git a/tests/test_io/test_file.py b/tests/test_io/test_file.py index 2617eb1db..e4d2035cb 100644 --- a/tests/test_io/test_file.py +++ b/tests/test_io/test_file.py @@ -4,6 +4,7 @@ from collections import ChainMap import pytest + import xtgeo from xtgeo.common.exceptions import InvalidFileFormatError from xtgeo.io._file import FileFormat, FileWrapper diff --git a/tests/test_opm_integration/test_grid_io.py b/tests/test_opm_integration/test_grid_io.py index 5d2c32de0..f9238c25d 100644 --- a/tests/test_opm_integration/test_grid_io.py +++ b/tests/test_opm_integration/test_grid_io.py @@ -1,10 +1,11 @@ import os import pytest -import xtgeo from hypothesis import given, settings from numpy.testing import assert_allclose +import xtgeo + from ..test_grid3d.grid_generator import xtgeo_grids # noqa diff --git a/tests/test_opm_integration/test_gridprop_io.py b/tests/test_opm_integration/test_gridprop_io.py index 462d3eb18..045103204 100644 --- a/tests/test_opm_integration/test_gridprop_io.py +++ b/tests/test_opm_integration/test_gridprop_io.py @@ -5,8 +5,9 @@ import numpy as np import pytest import resfo -import xtgeo from hypothesis import given, settings + +import xtgeo from xtgeo.grid3d._ecl_inte_head import InteHead from xtgeo.grid3d._ecl_logi_head import LogiHead from xtgeo.grid3d._ecl_output_file import Simulator, TypeOfGrid, UnitSystem diff --git a/tests/test_plot/test_grid3dsliceplot.py b/tests/test_plot/test_grid3dsliceplot.py index 40b76740f..68264cf74 100644 --- a/tests/test_plot/test_grid3dsliceplot.py +++ b/tests/test_plot/test_grid3dsliceplot.py @@ -1,6 +1,7 @@ import pathlib import pytest + import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.plot import Grid3DSlice diff --git a/tests/test_roxarapi/test_roxarapi_reek.py b/tests/test_roxarapi/test_roxarapi_reek.py index a99867803..fb17ca311 100644 --- a/tests/test_roxarapi/test_roxarapi_reek.py +++ b/tests/test_roxarapi/test_roxarapi_reek.py @@ -17,6 +17,7 @@ import numpy as np import pytest + import xtgeo from xtgeo.common import XTGeoDialog, null_logger diff --git a/tests/test_surface/test_deprecation.py b/tests/test_surface/test_deprecation.py index d8c278f29..1af60b9ad 100644 --- a/tests/test_surface/test_deprecation.py +++ b/tests/test_surface/test_deprecation.py @@ -2,8 +2,9 @@ import deprecation import pytest -import xtgeo from packaging import version + +import xtgeo from xtgeo.common.version import __version__ as xtgeo_version diff --git a/tests/test_surface/test_file_io.py b/tests/test_surface/test_file_io.py index 16c86cc93..bda343344 100644 --- a/tests/test_surface/test_file_io.py +++ b/tests/test_surface/test_file_io.py @@ -1,8 +1,9 @@ import deprecation import numpy as np import pytest -import xtgeo from hypothesis import given, strategies as st + +import xtgeo from xtgeo import Cube, RegularSurface diff --git a/tests/test_surface/test_ijxyz_spec.py b/tests/test_surface/test_ijxyz_spec.py index 797d3c57d..db2d4dcc4 100644 --- a/tests/test_surface/test_ijxyz_spec.py +++ b/tests/test_surface/test_ijxyz_spec.py @@ -5,6 +5,7 @@ import numpy as np import pytest + import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.surface._regsurf_ijxyz_parser import SurfaceIJXYZ diff --git a/tests/test_surface/test_new_surface.py b/tests/test_surface/test_new_surface.py index 70b9be5db..849f59d84 100644 --- a/tests/test_surface/test_new_surface.py +++ b/tests/test_surface/test_new_surface.py @@ -1,8 +1,9 @@ import hypothesis.strategies as st import numpy as np import pytest -import xtgeo from hypothesis import assume, given + +import xtgeo from xtgeo import RegularSurface diff --git a/tests/test_surface/test_regular_surface.py b/tests/test_surface/test_regular_surface.py index c989d9ec8..f21f4ed75 100644 --- a/tests/test_surface/test_regular_surface.py +++ b/tests/test_surface/test_regular_surface.py @@ -6,8 +6,9 @@ import numpy as np import pandas as pd import pytest -import xtgeo from packaging import version + +import xtgeo from xtgeo import RegularSurface from xtgeo.common import XTGeoDialog from xtgeo.common.version import __version__ as xtgeo_version diff --git a/tests/test_surface/test_regular_surface_bytesio.py b/tests/test_surface/test_regular_surface_bytesio.py index 3fbbe8034..93f570597 100644 --- a/tests/test_surface/test_regular_surface_bytesio.py +++ b/tests/test_surface/test_regular_surface_bytesio.py @@ -6,6 +6,7 @@ import threading import pytest + import xtgeo from xtgeo.common import XTGeoDialog diff --git a/tests/test_surface/test_regular_surface_in_other.py b/tests/test_surface/test_regular_surface_in_other.py index e6063c830..e40ca3bac 100644 --- a/tests/test_surface/test_regular_surface_in_other.py +++ b/tests/test_surface/test_regular_surface_in_other.py @@ -3,6 +3,7 @@ import numpy as np import numpy.ma as ma import pytest + import xtgeo from xtgeo.common import XTGeoDialog diff --git a/tests/test_surface/test_regular_surface_resample.py b/tests/test_surface/test_regular_surface_resample.py index 1d47f4323..24d786584 100644 --- a/tests/test_surface/test_regular_surface_resample.py +++ b/tests/test_surface/test_regular_surface_resample.py @@ -4,6 +4,7 @@ import numpy as np import pytest + import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.surface import RegularSurface diff --git a/tests/test_surface/test_regular_surface_vs_cube.py b/tests/test_surface/test_regular_surface_vs_cube.py index 1b198b3cd..55857a80d 100644 --- a/tests/test_surface/test_regular_surface_vs_cube.py +++ b/tests/test_surface/test_regular_surface_vs_cube.py @@ -3,6 +3,7 @@ import numpy as np import numpy.ma as ma import pytest + import xtgeo from xtgeo.common import XTGeoDialog diff --git a/tests/test_surface/test_regular_surface_vs_grd3d.py b/tests/test_surface/test_regular_surface_vs_grd3d.py index 9cbcc3f47..c87fcc3f1 100644 --- a/tests/test_surface/test_regular_surface_vs_grd3d.py +++ b/tests/test_surface/test_regular_surface_vs_grd3d.py @@ -2,6 +2,7 @@ import numpy as np import pytest + import xtgeo from xtgeo.common import XTGeoDialog diff --git a/tests/test_surface/test_regular_surface_vs_points.py b/tests/test_surface/test_regular_surface_vs_points.py index 14e77f45d..18d61ef06 100644 --- a/tests/test_surface/test_regular_surface_vs_points.py +++ b/tests/test_surface/test_regular_surface_vs_points.py @@ -1,6 +1,7 @@ import pathlib import pytest + import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.surface import RegularSurface diff --git a/tests/test_surface/test_regular_surface_xtgformats_io.py b/tests/test_surface/test_regular_surface_xtgformats_io.py index 01fdea8a5..c06021205 100644 --- a/tests/test_surface/test_regular_surface_xtgformats_io.py +++ b/tests/test_surface/test_regular_surface_xtgformats_io.py @@ -4,8 +4,9 @@ from os.path import join import pytest -import xtgeo from numpy.testing import assert_allclose + +import xtgeo from xtgeo.common import XTGeoDialog xtg = XTGeoDialog() diff --git a/tests/test_surface/test_surf_xyz_from_ij.py b/tests/test_surface/test_surf_xyz_from_ij.py index b5169963a..deccc3fb4 100644 --- a/tests/test_surface/test_surf_xyz_from_ij.py +++ b/tests/test_surface/test_surf_xyz_from_ij.py @@ -1,5 +1,6 @@ import numpy as np import pytest + import xtgeo from xtgeo import _cxtgeo diff --git a/tests/test_surface/test_surface_cube_attrs.py b/tests/test_surface/test_surface_cube_attrs.py index cee818652..d07cdd7b0 100644 --- a/tests/test_surface/test_surface_cube_attrs.py +++ b/tests/test_surface/test_surface_cube_attrs.py @@ -1,6 +1,7 @@ import pathlib import pytest + import xtgeo xtg = xtgeo.common.XTGeoDialog() diff --git a/tests/test_surface/test_surfaces.py b/tests/test_surface/test_surfaces.py index 231ea751c..ca6552ac7 100644 --- a/tests/test_surface/test_surfaces.py +++ b/tests/test_surface/test_surfaces.py @@ -5,6 +5,7 @@ import numpy as np import pytest + import xtgeo xtg = xtgeo.common.XTGeoDialog() diff --git a/tests/test_surface/test_swapaxis.py b/tests/test_surface/test_swapaxis.py index 09d357c2c..224d25323 100644 --- a/tests/test_surface/test_swapaxis.py +++ b/tests/test_surface/test_swapaxis.py @@ -1,4 +1,5 @@ import pytest + from xtgeo import RegularSurface diff --git a/tests/test_surface/test_val_from_xy.py b/tests/test_surface/test_val_from_xy.py index 79d9c1ba4..8f1911dfe 100644 --- a/tests/test_surface/test_val_from_xy.py +++ b/tests/test_surface/test_val_from_xy.py @@ -1,5 +1,6 @@ import numpy as np import pytest + import xtgeo diff --git a/tests/test_surface/test_zmap_spec.py b/tests/test_surface/test_zmap_spec.py index 73bb1579a..4fb03e238 100644 --- a/tests/test_surface/test_zmap_spec.py +++ b/tests/test_surface/test_zmap_spec.py @@ -2,6 +2,7 @@ from io import StringIO import pytest + import xtgeo from xtgeo.surface._zmap_parser import ZMAPFormatException, ZMAPSurface, parse_zmap diff --git a/tests/test_well/conftest.py b/tests/test_well/conftest.py index 8db06267e..d0b0831d9 100644 --- a/tests/test_well/conftest.py +++ b/tests/test_well/conftest.py @@ -1,4 +1,5 @@ import pytest + import xtgeo diff --git a/tests/test_well/test_blockedwell.py b/tests/test_well/test_blockedwell.py index 02ed0f081..4daf32572 100644 --- a/tests/test_well/test_blockedwell.py +++ b/tests/test_well/test_blockedwell.py @@ -1,6 +1,7 @@ from os.path import join import pytest + import xtgeo from xtgeo.common import XTGeoDialog diff --git a/tests/test_well/test_blockedwells.py b/tests/test_well/test_blockedwells.py index ed14ffac2..ecd4efa00 100644 --- a/tests/test_well/test_blockedwells.py +++ b/tests/test_well/test_blockedwells.py @@ -1,6 +1,7 @@ from os.path import join import pytest + import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.well import BlockedWells diff --git a/tests/test_well/test_well.py b/tests/test_well/test_well.py index 9853c3f69..3dc4f1dd0 100644 --- a/tests/test_well/test_well.py +++ b/tests/test_well/test_well.py @@ -3,6 +3,7 @@ import numpy as np import pandas as pd import pytest + import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.well import Well diff --git a/tests/test_well/test_well_deprecations.py b/tests/test_well/test_well_deprecations.py index e0449fa22..a9cc268f5 100644 --- a/tests/test_well/test_well_deprecations.py +++ b/tests/test_well/test_well_deprecations.py @@ -1,6 +1,7 @@ import pytest -import xtgeo from packaging import version + +import xtgeo from xtgeo import Well from xtgeo.common.version import __version__ as xtgeo_version diff --git a/tests/test_well/test_well_hdf5.py b/tests/test_well/test_well_hdf5.py index 514181144..b416c13f6 100644 --- a/tests/test_well/test_well_hdf5.py +++ b/tests/test_well/test_well_hdf5.py @@ -1,4 +1,5 @@ import pytest + from xtgeo.well._well_io import import_wlogs diff --git a/tests/test_well/test_well_to_points.py b/tests/test_well/test_well_to_points.py index 8259d0b6d..68bb2cbf4 100644 --- a/tests/test_well/test_well_to_points.py +++ b/tests/test_well/test_well_to_points.py @@ -1,6 +1,7 @@ import pathlib import pytest + import xtgeo from xtgeo.common import XTGeoDialog diff --git a/tests/test_well/test_well_vs_grid.py b/tests/test_well/test_well_vs_grid.py index fa475cfab..019e87c92 100644 --- a/tests/test_well/test_well_vs_grid.py +++ b/tests/test_well/test_well_vs_grid.py @@ -3,6 +3,7 @@ import pathlib import pytest + import xtgeo from xtgeo.common import XTGeoDialog diff --git a/tests/test_well/test_well_vs_surface.py b/tests/test_well/test_well_vs_surface.py index ebc5b66e3..123f6f669 100644 --- a/tests/test_well/test_well_vs_surface.py +++ b/tests/test_well/test_well_vs_surface.py @@ -1,6 +1,7 @@ from os.path import join import pytest + import xtgeo xtg = xtgeo.common.XTGeoDialog() diff --git a/tests/test_well/test_well_xyzdata_class.py b/tests/test_well/test_well_xyzdata_class.py index 70a61d915..6799bea6d 100644 --- a/tests/test_well/test_well_xyzdata_class.py +++ b/tests/test_well/test_well_xyzdata_class.py @@ -2,6 +2,7 @@ import pandas as pd import pytest + from xtgeo.common import _AttrType from xtgeo.xyz._xyz_data import _XYZData diff --git a/tests/test_well/test_wells.py b/tests/test_well/test_wells.py index 73069bc50..aeaa01e49 100644 --- a/tests/test_well/test_wells.py +++ b/tests/test_well/test_wells.py @@ -1,6 +1,7 @@ from os.path import join import pytest + import xtgeo from xtgeo.common import XTGeoDialog from xtgeo.well import Wells diff --git a/tests/test_xyz/test_points.py b/tests/test_xyz/test_points.py index 5a69ab68f..afeb3903d 100644 --- a/tests/test_xyz/test_points.py +++ b/tests/test_xyz/test_points.py @@ -4,8 +4,9 @@ import numpy as np import pandas as pd import pytest -import xtgeo from hypothesis import given, strategies as st + +import xtgeo from xtgeo.xyz import Points PFILE = pathlib.Path("points/eme/1/emerald_10_random.poi") diff --git a/tests/test_xyz/test_points_from_surface.py b/tests/test_xyz/test_points_from_surface.py index d891ed20e..c594a806e 100644 --- a/tests/test_xyz/test_points_from_surface.py +++ b/tests/test_xyz/test_points_from_surface.py @@ -1,6 +1,7 @@ import pathlib import pandas as pd + import xtgeo SURFACE = pathlib.Path("surfaces/reek/1/topreek_rota.gri") diff --git a/tests/test_xyz/test_points_from_wells.py b/tests/test_xyz/test_points_from_wells.py index 8bfe79d39..4b3653721 100644 --- a/tests/test_xyz/test_points_from_wells.py +++ b/tests/test_xyz/test_points_from_wells.py @@ -2,6 +2,7 @@ import pathlib import pytest + import xtgeo from xtgeo.xyz import Points diff --git a/tests/test_xyz/test_points_poly.py b/tests/test_xyz/test_points_poly.py index ee08eb37d..bd4580f68 100644 --- a/tests/test_xyz/test_points_poly.py +++ b/tests/test_xyz/test_points_poly.py @@ -2,6 +2,7 @@ import sys import pytest + import xtgeo from xtgeo.xyz import Points, Polygons diff --git a/tests/test_xyz/test_points_vs_other.py b/tests/test_xyz/test_points_vs_other.py index 42dae272a..7c6779d23 100644 --- a/tests/test_xyz/test_points_vs_other.py +++ b/tests/test_xyz/test_points_vs_other.py @@ -1,6 +1,7 @@ import pathlib import pytest + import xtgeo SFILE1A = pathlib.Path("surfaces/reek/1/topupperreek.gri") diff --git a/tests/test_xyz/test_polygon.py b/tests/test_xyz/test_polygon.py index 28988dde8..700879458 100644 --- a/tests/test_xyz/test_polygon.py +++ b/tests/test_xyz/test_polygon.py @@ -3,6 +3,7 @@ import numpy as np import pandas as pd import pytest + import xtgeo from xtgeo.xyz import Points, Polygons diff --git a/tests/test_xyz/test_xyz_deprecated.py b/tests/test_xyz/test_xyz_deprecated.py index d977fd51b..68a8f6865 100644 --- a/tests/test_xyz/test_xyz_deprecated.py +++ b/tests/test_xyz/test_xyz_deprecated.py @@ -5,8 +5,9 @@ import pandas as pd import pytest -import xtgeo from packaging import version + +import xtgeo from xtgeo.common.version import __version__ as xtgeo_version PFILE1A = pathlib.Path("polygons/reek/1/top_upper_reek_faultpoly.zmap") diff --git a/tests/test_xyz/test_xyz_roxapi_mock.py b/tests/test_xyz/test_xyz_roxapi_mock.py index a98fa8c59..d23d13aa4 100644 --- a/tests/test_xyz/test_xyz_roxapi_mock.py +++ b/tests/test_xyz/test_xyz_roxapi_mock.py @@ -6,9 +6,10 @@ import numpy as np import pandas as pd import pytest -import xtgeo from pandas.testing import assert_frame_equal +import xtgeo + @pytest.fixture def point_set():