Skip to content

Commit

Permalink
Rename WellTypeEnum
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Nov 1, 2023
1 parent e64d825 commit 3e1d01a
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion python/resdata/well/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from cwrap import Prototype

from .well_type_enum import WellTypeEnum
from .well_type_enum import WellType
from .well_connection_direction_enum import WellConnectionDirection
from .well_connection import WellConnection
from .well_segment import WellSegment
Expand Down
4 changes: 2 additions & 2 deletions python/resdata/well/well_state.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from cwrap import BaseCClass

from resdata import ResdataPrototype
from resdata.well import WellTypeEnum, WellConnection
from resdata.well import WellType, WellConnection
from resdata.util.util import CTime


Expand Down Expand Up @@ -87,7 +87,7 @@ def simulationTime(self):
return self._sim_time()

def wellType(self):
"""@rtype: WellTypeEnum"""
"""@rtype: WellType"""
return self._well_type()

def hasGlobalConnections(self):
Expand Down
22 changes: 11 additions & 11 deletions python/resdata/well/well_type_enum.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from cwrap import BaseCEnum


class WellTypeEnum(BaseCEnum):
class WellType(BaseCEnum):
TYPE_NAME = "well_type_enum"
RD_WELL_ZERO = None
RD_WELL_PRODUCER = None
RD_WELL_WATER_INJECTOR = None
RD_WELL_GAS_INJECTOR = None
RD_WELL_OIL_INJECTOR = None
ZERO = None
PRODUCER = None
WATER_INJECTOR = None
GAS_INJECTOR = None
OIL_INJECTOR = None


WellTypeEnum.addEnum("RD_WELL_ZERO", 0)
WellTypeEnum.addEnum("RD_WELL_PRODUCER", 1)
WellTypeEnum.addEnum("RD_WELL_OIL_INJECTOR", 2)
WellTypeEnum.addEnum("RD_WELL_WATER_INJECTOR", 3)
WellTypeEnum.addEnum("RD_WELL_GAS_INJECTOR", 4)
WellType.addEnum("ZERO", 0)
WellType.addEnum("PRODUCER", 1)
WellType.addEnum("OIL_INJECTOR", 2)
WellType.addEnum("WATER_INJECTOR", 3)
WellType.addEnum("GAS_INJECTOR", 4)
26 changes: 13 additions & 13 deletions python/tests/well_tests/test_rd_well.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from resdata.well import (
WellInfo,
WellConnection,
WellTypeEnum,
WellConnectionDirection,
WellSegment,
WellType,
)


Expand Down Expand Up @@ -355,7 +355,7 @@ def checkWellInfo(well_info, well_count, report_step_count):
def test_well_type_enum(self):
source_file_path = "lib/include/resdata/well/well_conn.hpp"
# The header file has duplicated symbols, so the simple test fails.
# self.assertEnumIsFullyDefined(WellTypeEnum, "well_type_enum", source_file_path)
# self.assertEnumIsFullyDefined(WellType, "well_type_enum", source_file_path)

def test_well_connection_direction_enum(self):
source_file_path = "lib/include/resdata/well/well_conn.hpp"
Expand Down Expand Up @@ -418,7 +418,7 @@ def test_well_time_line(self):
# testing __getitem__ and its well state
ws = wtl[0]
self.assertTrue(ws.isOpen())
self.assertEqual(ws.wellType(), WellTypeEnum.RD_WELL_PRODUCER)
self.assertEqual(ws.wellType(), WellType.PRODUCER)
self.assertTrue(ws.isMultiSegmentWell())
pfx = "WellState("
self.assertEqual(pfx, repr(ws)[: len(pfx)])
Expand All @@ -430,11 +430,11 @@ def test_well_state(self):
open_states = {True: 0, False: 0}
msw_states = {True: 0, False: 0}
well_types = {
WellTypeEnum.RD_WELL_ZERO: 0,
WellTypeEnum.RD_WELL_PRODUCER: 0,
WellTypeEnum.RD_WELL_GAS_INJECTOR: 0,
WellTypeEnum.RD_WELL_OIL_INJECTOR: 0,
WellTypeEnum.RD_WELL_WATER_INJECTOR: 0,
WellType.ZERO: 0,
WellType.PRODUCER: 0,
WellType.GAS_INJECTOR: 0,
WellType.OIL_INJECTOR: 0,
WellType.WATER_INJECTOR: 0,
}

segments = set()
Expand Down Expand Up @@ -472,11 +472,11 @@ def test_well_state(self):
self.assertEqual(msw_states[True], 169)
self.assertEqual(msw_states[False], 53)

self.assertEqual(well_types[WellTypeEnum.RD_WELL_ZERO], 0)
self.assertEqual(well_types[WellTypeEnum.RD_WELL_WATER_INJECTOR], 0)
self.assertEqual(well_types[WellTypeEnum.RD_WELL_OIL_INJECTOR], 0)
self.assertEqual(well_types[WellTypeEnum.RD_WELL_GAS_INJECTOR], 1)
self.assertEqual(well_types[WellTypeEnum.RD_WELL_PRODUCER], 221)
self.assertEqual(well_types[WellType.ZERO], 0)
self.assertEqual(well_types[WellType.WATER_INJECTOR], 0)
self.assertEqual(well_types[WellType.OIL_INJECTOR], 0)
self.assertEqual(well_types[WellType.GAS_INJECTOR], 1)
self.assertEqual(well_types[WellType.PRODUCER], 221)

self.assertEqual(len(connections), connections_count)

Expand Down
2 changes: 1 addition & 1 deletion python/tests/well_tests/test_rd_well2.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from resdata.well import (
WellInfo,
WellConnection,
WellTypeEnum,
WellType,
WellConnectionDirection,
WellSegment,
)
Expand Down
2 changes: 1 addition & 1 deletion python/tests/well_tests/test_rd_well3.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from resdata.well import (
WellInfo,
WellConnection,
WellTypeEnum,
WellType,
WellConnectionDirection,
WellSegment,
)
Expand Down
2 changes: 1 addition & 1 deletion python/tests/well_tests/test_well_missing_ICON.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from resdata.well import (
WellInfo,
WellConnection,
WellTypeEnum,
WellType,
WellConnectionDirection,
WellSegment,
)
Expand Down

0 comments on commit 3e1d01a

Please sign in to comment.