Skip to content

Commit

Permalink
Fix Layer.copy
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Apr 10, 2024
1 parent b5401eb commit 94e39fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/resdata/grid/faults/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(self, nx, ny):
@classmethod
def copy(cls, src):
layer = Layer(src.getNX(), src.getNY())
layer._copy(layer, src)
layer._copy(src)
return layer

def _assert_ij(self, i, j):
Expand Down
6 changes: 6 additions & 0 deletions python/tests/rd_tests/test_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ def test_create_layer(self):
layer = Layer(10, 10)
self.assertTrue(isinstance(layer, Layer))

def test_layer_copy(self):
layer = Layer(10, 10)
layer_copy = Layer.copy(layer)
assert layer.get_nx() == layer_copy.get_nx()
assert layer.get_ny() == layer_copy.get_ny()

def test_add_cell(self):
layer = Layer(10, 10)
with self.assertRaises(ValueError):
Expand Down

0 comments on commit 94e39fd

Please sign in to comment.