Skip to content

Commit

Permalink
STY: Update to latest ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
mferrera committed Aug 16, 2024
1 parent 8402504 commit 934e94c
Show file tree
Hide file tree
Showing 82 changed files with 107 additions and 26 deletions.
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from datetime import date

import xtgeo
from autoclasstoc import PublicMethods

import xtgeo

version = xtgeo.__version__
release = xtgeo.__version__
project = "xtgeo"
Expand Down
1 change: 1 addition & 0 deletions examples/grid3d_compute_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from os.path import join as ojn

import numpy.ma as npma

import xtgeo

# from memory_profiler import profile
Expand Down
1 change: 1 addition & 0 deletions examples/grid3d_print_init_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import tempfile

import numpy as np

import xtgeo

EXPATH = pathlib.Path("../../xtgeo-testdata/3dgrids/reek")
Expand Down
1 change: 1 addition & 0 deletions examples/regsurf_compute_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from os.path import join as ojn

import numpy.ma as npma

import xtgeo

# from memory_profiler import profile
Expand Down
1 change: 1 addition & 0 deletions examples/wellpath_fence_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from pathlib import Path

import matplotlib.pyplot as plt

import xtgeo

TPATH = Path("../xtgeo-testdata")
Expand Down
2 changes: 1 addition & 1 deletion tests/jupyter/xtgeo1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
},
Expand Down
3 changes: 2 additions & 1 deletion tests/test_common/test_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions tests/test_common/test_cxtgeo_lowlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import numpy as np
import pytest

import xtgeo
from xtgeo import _cxtgeo

Expand Down
1 change: 1 addition & 0 deletions tests/test_common/test_sys.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import hashlib

import pytest

from xtgeo.common.sys import generic_hash


Expand Down
3 changes: 2 additions & 1 deletion tests/test_cube/test_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion tests/test_cube/test_cube_xtgformats_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions tests/test_etc/test_clib_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import numpy as np
import pytest

import xtgeo
from xtgeo import _cxtgeo
from xtgeo.io._file import FileWrapper
Expand Down
1 change: 1 addition & 0 deletions tests/test_etc/test_etc_make_avg_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import numpy as np
import pytest

import xtgeo
from xtgeo.common import XTGeoDialog
from xtgeo.surface import RegularSurface
Expand Down
1 change: 1 addition & 0 deletions tests/test_etc/test_etc_make_hcpv_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/eclrun_fixtures.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from os.path import join

import pytest

import xtgeo


Expand Down
3 changes: 2 additions & 1 deletion tests/test_grid3d/egrid_generator.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_grid3d/grdecl_grid_generator.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/grid_generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import hypothesis.strategies as st

import xtgeo

indices = st.integers(min_value=4, max_value=6)
Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/gridprop_generator.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_ecl_inte_head.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_ecl_logi_head.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np

from xtgeo.grid3d._ecl_logi_head import LogiHead
from xtgeo.grid3d._ecl_output_file import Simulator

Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_ecl_simpleb8_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import numpy as np
import pytest
import resfo

import xtgeo

xtg = xtgeo.XTGeoDialog()
Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_eclrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import numpy as np
import pytest

import xtgeo

from .eclrun_fixtures import * # noqa: F401, F403
Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_grdecl_format.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest.mock import mock_open, patch

import pytest

from xtgeo.grid3d._grdecl_format import open_grdecl


Expand Down
3 changes: 2 additions & 1 deletion tests/test_grid3d/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_grid_bytesio.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io

import numpy as np

import xtgeo


Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_grid_dual_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

import numpy as np
import pytest

import xtgeo.grid3d.grid


Expand Down
5 changes: 3 additions & 2 deletions tests/test_grid3d/test_grid_ecl_grid.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_grid3d/test_grid_egrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_grid_fence.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pathlib

import pytest

import xtgeo

REEKROOT = pathlib.Path("3dgrids/reek/REEK")
Expand Down
3 changes: 2 additions & 1 deletion tests/test_grid3d/test_grid_grdecl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/test_grid3d/test_grid_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion tests/test_grid3d/test_grid_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/test_grid3d/test_grid_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 GridProperty
Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_grid_property_etc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""Testing: test_grid_property more special functions"""

import pytest

from xtgeo.grid3d import _gridprop_roxapi


Expand Down
3 changes: 2 additions & 1 deletion tests/test_grid3d/test_grid_property_grdecl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/test_grid3d/test_grid_property_roff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_grid_roff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_grid_specialcases.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pathlib

import pytest

import xtgeo

SPE9 = pathlib.Path("3dgrids/bench_spe9")
Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_grid_vs_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pandas as pd
import pytest

import xtgeo

xtg = xtgeo.common.XTGeoDialog()
Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_grid_vs_well.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pathlib

import pytest

import xtgeo
from xtgeo.common import XTGeoDialog

Expand Down
3 changes: 2 additions & 1 deletion tests/test_grid3d/test_grid_xtgformats_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading

0 comments on commit 934e94c

Please sign in to comment.