From d4192cb92c507e875b748b7d8cd9fdf3ac9c49af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Fri, 26 Jan 2024 09:25:06 +0100 Subject: [PATCH] Format python code with black 24.1 --- python/resdata/__init__.py | 1 + python/resdata/geometry/__init__.py | 1 + python/resdata/geometry/cpolyline.py | 1 + python/resdata/geometry/cpolyline_collection.py | 1 + python/resdata/gravimetry/rd_subsidence.py | 1 + python/resdata/grid/rd_grid.py | 1 + python/resdata/grid/rd_region.py | 1 + python/resdata/rd_util.py | 1 + python/resdata/resfile/fortio.py | 1 + python/resdata/resfile/rd_file.py | 1 + python/resdata/summary/__init__.py | 1 - python/resdata/util/util/stringlist.py | 1 + python/tests/rd_tests/test_sum_equinor.py | 4 ++-- 13 files changed, 13 insertions(+), 3 deletions(-) diff --git a/python/resdata/__init__.py b/python/resdata/__init__.py index a78fe8d2c..fc1395a60 100644 --- a/python/resdata/__init__.py +++ b/python/resdata/__init__.py @@ -29,6 +29,7 @@ alternative fails, the loader will try the default load behaviour before giving up completely. """ + import ctypes as ct import os.path import sys diff --git a/python/resdata/geometry/__init__.py b/python/resdata/geometry/__init__.py index 83851e7d6..50e558a21 100644 --- a/python/resdata/geometry/__init__.py +++ b/python/resdata/geometry/__init__.py @@ -2,6 +2,7 @@ Simple package for working with 2D geometry. """ + import resdata from cwrap import Prototype diff --git a/python/resdata/geometry/cpolyline.py b/python/resdata/geometry/cpolyline.py index 31cd9ac73..559fe797a 100644 --- a/python/resdata/geometry/cpolyline.py +++ b/python/resdata/geometry/cpolyline.py @@ -1,6 +1,7 @@ """ Create a polygon """ + import ctypes import os.path diff --git a/python/resdata/geometry/cpolyline_collection.py b/python/resdata/geometry/cpolyline_collection.py index b5957466e..80608ac31 100644 --- a/python/resdata/geometry/cpolyline_collection.py +++ b/python/resdata/geometry/cpolyline_collection.py @@ -1,6 +1,7 @@ """ Create a polygon """ + import ctypes from cwrap import BaseCClass diff --git a/python/resdata/gravimetry/rd_subsidence.py b/python/resdata/gravimetry/rd_subsidence.py index 217443d87..0ad6b7bb8 100644 --- a/python/resdata/gravimetry/rd_subsidence.py +++ b/python/resdata/gravimetry/rd_subsidence.py @@ -6,6 +6,7 @@ different surveys. The implementation is a thin wrapper around the rd_subsidence.c implementation in the resdata library. """ + from cwrap import BaseCClass from resdata import ResdataPrototype from resdata.util.util import monkey_the_camel diff --git a/python/resdata/grid/rd_grid.py b/python/resdata/grid/rd_grid.py index 752d2a5fc..b1472c55c 100644 --- a/python/resdata/grid/rd_grid.py +++ b/python/resdata/grid/rd_grid.py @@ -7,6 +7,7 @@ implemented in the Grid class. The rd_grid module is a thin wrapper around the rd_grid.c implementation from the resdata library. """ + import ctypes import warnings diff --git a/python/resdata/grid/rd_region.py b/python/resdata/grid/rd_region.py index 8360fb0fe..79222208f 100644 --- a/python/resdata/grid/rd_region.py +++ b/python/resdata/grid/rd_region.py @@ -10,6 +10,7 @@ When the selection process is complete the region instance can be queried for the corresponding list of indices. """ + from functools import wraps import ctypes diff --git a/python/resdata/rd_util.py b/python/resdata/rd_util.py index 0060be3eb..50932e08f 100644 --- a/python/resdata/rd_util.py +++ b/python/resdata/rd_util.py @@ -9,6 +9,7 @@ In addition to the enum definitions there are a few stateless functions from rd_util.c which are not bound to any class type. """ + from __future__ import absolute_import import ctypes diff --git a/python/resdata/resfile/fortio.py b/python/resdata/resfile/fortio.py index bf77162b3..98dc7681b 100644 --- a/python/resdata/resfile/fortio.py +++ b/python/resdata/resfile/fortio.py @@ -21,6 +21,7 @@ support passing of FortIO handles to the underlying C functions. A more extensive wrapping of the fortio implementation would be easy. """ + import ctypes import os diff --git a/python/resdata/resfile/rd_file.py b/python/resdata/resfile/rd_file.py index ec107d7f6..04c074748 100644 --- a/python/resdata/resfile/rd_file.py +++ b/python/resdata/resfile/rd_file.py @@ -20,6 +20,7 @@ [1]: In particular for restart files, which do not have a special RestartFile class, there is some specialized functionality. """ + import ctypes import datetime import re diff --git a/python/resdata/summary/__init__.py b/python/resdata/summary/__init__.py index 4805d1d32..44cc63424 100644 --- a/python/resdata/summary/__init__.py +++ b/python/resdata/summary/__init__.py @@ -4,7 +4,6 @@ used as basis for queries on summary vectors. """ - import resdata.util.util import resdata.geometry diff --git a/python/resdata/util/util/stringlist.py b/python/resdata/util/util/stringlist.py index eb4a0911f..8cd6b2f55 100644 --- a/python/resdata/util/util/stringlist.py +++ b/python/resdata/util/util/stringlist.py @@ -15,6 +15,7 @@ return a normal python list of string objects, used in this way you hardly need to notice that the StringList class is at play. """ + from resdata import ResdataPrototype from cwrap import BaseCClass diff --git a/python/tests/rd_tests/test_sum_equinor.py b/python/tests/rd_tests/test_sum_equinor.py index 04d815679..0f46400dd 100755 --- a/python/tests/rd_tests/test_sum_equinor.py +++ b/python/tests/rd_tests/test_sum_equinor.py @@ -488,8 +488,8 @@ def test_ix_case(self): ) self.assertIsNotNone(eclipse_summary) - hwell_padder = ( - lambda key: key if key.split(":")[-1] != "HWELL_PR" else key + "OD" + hwell_padder = lambda key: ( + key if key.split(":")[-1] != "HWELL_PR" else key + "OD" ) self.assertEqual( intersect_summary.keys("WWCT*"),