diff --git a/python/resdata/grid/faults/fault_block_layer.py b/python/resdata/grid/faults/fault_block_layer.py index cb5d177fa..aa095b07f 100644 --- a/python/resdata/grid/faults/fault_block_layer.py +++ b/python/resdata/grid/faults/fault_block_layer.py @@ -111,7 +111,7 @@ def scan_keyword(self, fault_block_kw): raise ValueError( "The fault block keyword had wrong type/size: type:%s size:%d grid_size:%d" % ( - fault_block_kw.type_name, + fault_block_kw.type_name(), len(fault_block_kw), self.grid_ref.getGlobalSize(), ) @@ -126,7 +126,7 @@ def load_keyword(self, fault_block_kw): raise ValueError( "The fault block keyword had wrong type/size: type:%s size:%d grid_size:%d" % ( - fault_block_kw.type_name, + fault_block_kw.type_name(), len(fault_block_kw), self.grid_ref.getGlobalSize(), ) diff --git a/python/resdata/grid/rd_region.py b/python/resdata/grid/rd_region.py index 8955338ea..add2e7bec 100644 --- a/python/resdata/grid/rd_region.py +++ b/python/resdata/grid/rd_region.py @@ -552,7 +552,7 @@ def select_equal(self, rd_kw, value, intersect=False): if not rd_kw.data_type.is_int(): raise ValueError( "The select_equal method must have an integer valued keyword - got:%s" - % rd_kw.type_name + % rd_kw.type_name() ) self._select_equal(rd_kw, value) @@ -565,7 +565,7 @@ def deselect_equal(self, rd_kw, value): if not rd_kw.data_type.is_int(): raise ValueError( "The select_equal method must have an integer valued keyword - got:%s" - % rd_kw.type_name + % rd_kw.type_name() ) self._deselect_equal(rd_kw, value) diff --git a/python/resdata/resfile/rd_kw.py b/python/resdata/resfile/rd_kw.py index c4b73d463..c57c1bf57 100644 --- a/python/resdata/resfile/rd_kw.py +++ b/python/resdata/resfile/rd_kw.py @@ -975,7 +975,6 @@ def type(self): def data_type(self): return self._get_data_type() - @property def type_name(self): return self.data_type.type_name @@ -991,7 +990,7 @@ def get_rd_type(self): @property def header(self): - return (self.get_name(), len(self), self.type_name) + return (self.get_name(), len(self), self.type_name()) @property def array(self): @@ -1033,7 +1032,7 @@ def str(self, width=5, max_lines=10, fmt=None): the elements. The implementation of the builtin method __str__() is based on this method. """ - s = "%-8s %8d %-4s\n" % (self.get_name(), len(self), self.type_name) + s = "%-8s %8d %-4s\n" % (self.get_name(), len(self), self.type_name()) lines = len(self) // width if not fmt: fmt = self.str_fmt + " " diff --git a/python/tests/rd_tests/test_rd_kw.py b/python/tests/rd_tests/test_rd_kw.py index 914cfb2e7..58f321a15 100644 --- a/python/tests/rd_tests/test_rd_kw.py +++ b/python/tests/rd_tests/test_rd_kw.py @@ -422,7 +422,7 @@ def test_resize(self): def test_typename(self): kw = ResdataKW("KW", 100, ResDataType.RD_INT) - self.assertEqual(kw.type_name, "INTE") + self.assertEqual(kw.type_name(), "INTE") def test_string_alloc(self): kw = ResdataKW("KW", 10, ResDataType.RD_STRING(30))