Skip to content

Commit

Permalink
Some fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Aug 25, 2024
1 parent a04ce83 commit 889e46f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 14 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ requires = ["setuptools", "setuptools_scm", "wheel", "scikit-build", "cmake", "c
[tool.ruff]
src = ["python"]
line-length = 88
target-version = "py38"

[tool.ruff.lint]
select = [
Expand Down
2 changes: 1 addition & 1 deletion python/resdata/grid/faults/fault_block_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.typeName(),
fault_block_kw.type_name,
len(fault_block_kw),
self.grid_ref.getGlobalSize(),
)
Expand Down
4 changes: 2 additions & 2 deletions python/resdata/grid/rd_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.typeName()
% rd_kw.type_name
)
self._select_equal(rd_kw, value)

Expand All @@ -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.typeName()
% rd_kw.type_name
)
self._deselect_equal(rd_kw, value)

Expand Down
4 changes: 2 additions & 2 deletions python/resdata/resfile/rd_kw.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ def get_rd_type(self):

@property
def header(self):
return (self.getName(), len(self), self.typeName())
return (self.get_name(), len(self), self.type_name)

@property
def array(self):
Expand Down Expand Up @@ -1033,7 +1033,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.getName(), len(self), self.typeName())
s = "%-8s %8d %-4s\n" % (self.get_name(), len(self), self.type_name)
lines = len(self) // width
if not fmt:
fmt = self.str_fmt + " "
Expand Down
5 changes: 0 additions & 5 deletions python/tests/rd_tests/test_npv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
import datetime
import math

try:
from unittest2 import skipIf, skipUnless, skipIf
except ImportError:
from unittest import skipIf, skipUnless, skipIf

from resdata.summary import Summary
from resdata.summary import ResdataNPV, NPVPriceVector

Expand Down
3 changes: 1 addition & 2 deletions python/tests/rd_tests/test_rd_kw.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import random
import warnings
import cwrap
import random

from resdata import ResDataType, ResdataTypeEnum, FileMode
from resdata.resfile import ResdataKW, ResdataFile, FortIO, openFortIO
Expand Down Expand Up @@ -423,7 +422,7 @@ def test_resize(self):
def test_typename(self):
kw = ResdataKW("KW", 100, ResDataType.RD_INT)

self.assertEqual(kw.typeName(), "INTE")
self.assertEqual(kw.typ_name, "INTE")

def test_string_alloc(self):
kw = ResdataKW("KW", 10, ResDataType.RD_STRING(30))
Expand Down
2 changes: 0 additions & 2 deletions python/tests/rd_tests/test_sum_equinor.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import os
import datetime

from unittest import skipIf, skipUnless, skipIf

from resdata.resfile import ResdataFile
from resdata.summary import Summary
from resdata import UnitSystem
Expand Down

0 comments on commit 889e46f

Please sign in to comment.