Skip to content

Commit

Permalink
CLN: format with latest ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
mferrera committed Mar 1, 2024
1 parent 9004ebb commit b06ccbe
Show file tree
Hide file tree
Showing 22 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions bin/xtgls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""xtgls: a small script for listing xtg formatted files."""

import argparse
import json
import pathlib
Expand Down
1 change: 1 addition & 0 deletions examples/grid3d_prop_as_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Make a regularmap from a property at a given K layer
By JRIV
"""

import os

import xtgeo
Expand Down
1 change: 1 addition & 0 deletions examples/surface_slice_grid3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
JRIV
"""

import os
import pathlib
import tempfile
Expand Down
1 change: 1 addition & 0 deletions src/xtgeo/grid3d/_grdecl_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
of how these keywords are layed out in a text file, and see GrdeclGrid
for how the grid geometry is interpreted from these keywords.
"""

from __future__ import annotations

from dataclasses import dataclass
Expand Down
1 change: 1 addition & 0 deletions src/xtgeo/grid3d/_grid3d_fence.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Some grid utilities, file scanning etc."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions src/xtgeo/grid3d/_grid_import_ecl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Grid import functions for Eclipse, new approach (i.e. version 2)."""

from __future__ import annotations

from typing import TYPE_CHECKING, Any
Expand Down
1 change: 1 addition & 0 deletions src/xtgeo/grid3d/_grid_import_roff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Private module, Grid Import private functions for ROFF format."""

from __future__ import annotations

import pathlib
Expand Down
7 changes: 3 additions & 4 deletions src/xtgeo/grid3d/_grid_import_xtgcpgeom.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Private module, Grid Import private functions for xtgeo based formats."""

from __future__ import annotations

import json
Expand Down Expand Up @@ -52,13 +53,11 @@ class _META(TypedDict):


@overload
def convert_subgrids(sdict: dict[str, int]) -> dict[str, range]:
...
def convert_subgrids(sdict: dict[str, int]) -> dict[str, range]: ...


@overload
def convert_subgrids(sdict: None) -> None:
...
def convert_subgrids(sdict: None) -> None: ...


def convert_subgrids(sdict: dict[str, int] | None) -> dict[str, range] | None:
Expand Down
1 change: 1 addition & 0 deletions src/xtgeo/grid3d/_grid_refine.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Private module for refinement of a grid."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions src/xtgeo/grid3d/_grid_wellzone.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Private module for grid vs well zonelog checks."""

from __future__ import annotations

from typing import TYPE_CHECKING, Literal
Expand Down
1 change: 1 addition & 0 deletions src/xtgeo/grid3d/_gridprop_import_grdecl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Importing grid props from GRDECL, ascii or binary"""

from __future__ import annotations

from typing import TYPE_CHECKING, Any
Expand Down
1 change: 1 addition & 0 deletions src/xtgeo/grid3d/_gridprop_lowlevel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""GridProperty (not GridProperies) low level functions"""

from __future__ import annotations

from typing import TYPE_CHECKING, Literal
Expand Down
1 change: 1 addition & 0 deletions src/xtgeo/grid3d/_gridprop_op1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Various grid property operations"""

from __future__ import annotations

from typing import TYPE_CHECKING, List, Literal, Optional, Tuple, Union
Expand Down
1 change: 1 addition & 0 deletions src/xtgeo/grid3d/_gridprop_roxapi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding: utf-8
"""Roxar API functions for XTGeo Grid Property."""

from __future__ import annotations

import contextlib
Expand Down
1 change: 1 addition & 0 deletions src/xtgeo/surface/_regsurf_roxapi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding: utf-8
"""Roxar API functions for XTGeo RegularSurface."""

import os
import tempfile

Expand Down
1 change: 0 additions & 1 deletion src/xtgeo/surface/regular_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
# For functions with mask=... ,the should be replaced with asmasked=...
# --------------------------------------------------------------------------------------


from __future__ import annotations

import functools
Expand Down
1 change: 0 additions & 1 deletion src/xtgeo/xyz/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""The XTGeo xyz (points and polygons) package."""


# flake8: noqa
from xtgeo.xyz._xyz import XYZ
from xtgeo.xyz.points import Points
Expand Down
1 change: 0 additions & 1 deletion src/xtgeo/xyz/_xyz_oper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# coding: utf-8
"""Various operations on XYZ data"""


import numpy as np
import pandas as pd
import shapely.geometry as sg
Expand Down
1 change: 1 addition & 0 deletions src/xtgeo/xyz/_xyz_roxapi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding: utf-8
"""Roxar API functions for XTGeo Points/Polygons"""

from __future__ import annotations

import os
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
@@ -1,5 +1,6 @@
# coding: utf-8
"""Testing: test_grid_property more special functions"""

import pytest
from xtgeo.grid3d import _gridprop_roxapi

Expand Down
4 changes: 2 additions & 2 deletions tests/test_grid3d/test_grid_property_roff.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_xtgeo_codes(param, expected_codes):


def test_to_file(tmp_path):
roff_param = RoffParameter(1, 1, 2, "", b"\x01\xFF")
roff_param = RoffParameter(1, 1, 2, "", b"\x01\xff")
roff_param.to_file(tmp_path / "param.roff")
vals = roffio.read(tmp_path / "param.roff")
assert vals["parameter"] == {"name": "", "data": b"\x01\xff"}
Expand All @@ -166,7 +166,7 @@ def test_to_file_codes():
1,
2,
"a",
b"\x01\xFF",
b"\x01\xff",
code_names=["a", "b"],
code_values=np.array([1, 2], dtype=np.int32),
)
Expand Down
1 change: 1 addition & 0 deletions tests/test_grid3d/test_grid_xtgformats_io.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding: utf-8
"""Testing new xtgf and hdf5/h5 formats."""

from os.path import join

import hypothesis.strategies as st
Expand Down

0 comments on commit b06ccbe

Please sign in to comment.