forked from Ensembles/ert
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug ecl_region_select_equal__( )
- Loading branch information
1 parent
b97284f
commit 19c51b8
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env python | ||
# Copyright (C) 2017 Statoil ASA, Norway. | ||
# | ||
# The file 'test_region.py' is part of ERT - Ensemble based Reservoir Tool. | ||
# | ||
# ERT is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# ERT is distributed in the hope that it will be useful, but WITHOUT ANY | ||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. | ||
# | ||
# See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html> | ||
# for more details. | ||
from ert.ecl import EclGrid, EclKW, EclRegion, EclDataType | ||
from ert.ecl.faults import Layer | ||
from ert.test import ExtendedTestCase | ||
|
||
|
||
class RegionTest(ExtendedTestCase): | ||
|
||
def test_equal(self): | ||
grid = EclGrid.createRectangular( (10,10,1) , (1,1,1)) | ||
kw_int = EclKW( "INT" , grid.getGlobalSize( ) , EclDataType.ECL_INT ) | ||
kw_float = EclKW( "FLOAT" , grid.getGlobalSize( ) , EclDataType.ECL_FLOAT ) | ||
|
||
kw_int[0:49] = 1 | ||
region = EclRegion(grid, False) | ||
region.select_equal( kw_int , 1 ) | ||
glist = region.getGlobalList() | ||
for g in glist: | ||
self.assertEqual( kw_int[g] , 1 ) | ||
|
||
with self.assertRaises(ValueError): | ||
region.select_equal( kw_float , 1 ) |