Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Aug 25, 2024
1 parent c9b9dc3 commit a04ce83
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions python/resdata/gravimetry/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 7 additions & 7 deletions python/resdata/grid/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions python/resdata/rft/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions python/resdata/summary/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/resdata/util/util/vector_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__()
Expand Down
2 changes: 1 addition & 1 deletion python/tests/rd_tests/test_faults.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion python/tests/rd_tests/test_rd_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
4 changes: 2 additions & 2 deletions python/tests/rd_tests/test_sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit a04ce83

Please sign in to comment.