diff --git a/python/resdata/gravimetry/__init__.py b/python/resdata/gravimetry/__init__.py index 1035865aa..e74a01cd8 100644 --- a/python/resdata/gravimetry/__init__.py +++ b/python/resdata/gravimetry/__init__.py @@ -1,10 +1,10 @@ """ - rd_grav/ResdataGrav: Class used to simplify evaluation of - modelling time-lapse gravitational surveys. +rd_grav/ResdataGrav: Class used to simplify evaluation of + modelling time-lapse gravitational surveys. - rd_subsidence/ResdataSubsidence: Small class used to evaluate simulated - subsidence from simulations; analogous to the EcLGrav - functionality. +rd_subsidence/ResdataSubsidence: Small class used to evaluate simulated + subsidence from simulations; analogous to the EcLGrav + functionality. """ from .rd_grav import ResdataGrav diff --git a/python/resdata/grid/__init__.py b/python/resdata/grid/__init__.py index 9e88a4aa2..cbfab5e16 100644 --- a/python/resdata/grid/__init__.py +++ b/python/resdata/grid/__init__.py @@ -1,13 +1,13 @@ """ - rd_grid/Grid: This will load a GRID or EGRID file, and - can then subsequently be used for queries about the grid. +rd_grid/Grid: This will load a GRID or EGRID file, and + can then subsequently be used for queries about the grid. - rd_region/ResdataRegion: Convenience class to support selecting cells - in a grid based on a wide range of criteria. Can be used as a - mask in operations on ResdataKW instances. +rd_region/ResdataRegion: Convenience class to support selecting cells + in a grid based on a wide range of criteria. Can be used as a + mask in operations on ResdataKW instances. - rd_grid_generator/GridGenerator: This can be used to generate various - grids. +rd_grid_generator/GridGenerator: This can be used to generate various + grids. """ import resdata.util.util diff --git a/python/resdata/rft/__init__.py b/python/resdata/rft/__init__.py index 03686f016..1db117979 100644 --- a/python/resdata/rft/__init__.py +++ b/python/resdata/rft/__init__.py @@ -1,6 +1,6 @@ """ - rd_rft/[ResdataRFTFile , ResdataRFT , ResdataRFTCell]: Loads an RFT/PLT - file, and can afterwords be used to support various queries. +rd_rft/[ResdataRFTFile , ResdataRFT , ResdataRFTCell]: Loads an RFT/PLT + file, and can afterwords be used to support various queries. """ from .well_trajectory import WellTrajectory diff --git a/python/resdata/summary/__init__.py b/python/resdata/summary/__init__.py index 44cc63424..f5b03ab2f 100644 --- a/python/resdata/summary/__init__.py +++ b/python/resdata/summary/__init__.py @@ -1,7 +1,7 @@ """ - rd_sum/Summary: This will load summary results; - both data file(s) and the SMSPEC file. The RdSum object can be - used as basis for queries on summary vectors. +rd_sum/Summary: This will load summary results; + both data file(s) and the SMSPEC file. The RdSum object can be + used as basis for queries on summary vectors. """ import resdata.util.util diff --git a/python/resdata/util/util/vector_template.py b/python/resdata/util/util/vector_template.py index c950d25cd..d42db20f3 100644 --- a/python/resdata/util/util/vector_template.py +++ b/python/resdata/util/util/vector_template.py @@ -61,7 +61,7 @@ def __bool__(self): """ Will evaluate to False for empty vector. """ - return len(self) == 0 + return len(self) != 0 def __nonzero__(self): return self.__bool__() diff --git a/python/tests/rd_tests/test_faults.py b/python/tests/rd_tests/test_faults.py index 5135eee59..31d1fbc45 100644 --- a/python/tests/rd_tests/test_faults.py +++ b/python/tests/rd_tests/test_faults.py @@ -94,7 +94,7 @@ def test_empty_fault(self): f = Fault(self.grid, "NAME") self.assertEqual("NAME", f.getName()) - with self.assertRaises(KeyError): + with self.assertRaises(Exception): # noqa: B017 g = f["Key"] def test_empty_faultLine(self): diff --git a/python/tests/rd_tests/test_rd_type.py b/python/tests/rd_tests/test_rd_type.py index 910f14c11..0ee263999 100644 --- a/python/tests/rd_tests/test_rd_type.py +++ b/python/tests/rd_tests/test_rd_type.py @@ -120,7 +120,7 @@ def test_equals(self): self.assertTrue(a.is_equal(b)) self.assertEqual(a, b) - for otype, osize in set(test_base) - set(rd_type, elem_size): + for otype, osize in set(test_base) - {rd_type, elem_size}: self.assertFalse(a.is_equal(ResDataType(otype, osize))) self.assertNotEqual(a, ResDataType(otype, osize)) diff --git a/python/tests/rd_tests/test_sum.py b/python/tests/rd_tests/test_sum.py index 9fdc0239f..ade663f10 100644 --- a/python/tests/rd_tests/test_sum.py +++ b/python/tests/rd_tests/test_sum.py @@ -647,8 +647,8 @@ def test_load_case(self): self.assertFloatEqual(case.sim_length, 545.0) fopr = case.numpy_vector("FOPR") - for _time_index, value in enumerate(fopr): - self.assertEqual(value, value) + for time_index, value in enumerate(fopr): + self.assertEqual(fopr[time_index], value) # noqa: PLR1736 def test_load_case_lazy_and_eager(self): path = os.path.join(self.TESTDATA_ROOT, "local/ECLIPSE/cp_simple3/SHORT.UNSMRY")