resqpy 4.17.2__py3-none-any.whl → 4.17.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
resqpy/__init__.py CHANGED
@@ -28,6 +28,6 @@
28
28
 
29
29
  import logging
30
30
 
31
- __version__ = "4.17.2" # Set at build time
31
+ __version__ = "4.17.6" # Set at build time
32
32
  log = logging.getLogger(__name__)
33
33
  log.info(f"Imported resqpy version {__version__}")
@@ -8,7 +8,7 @@ import numpy as np
8
8
  import warnings
9
9
  import numba # type: ignore
10
10
  from numba import njit, prange # type: ignore
11
- from typing import Tuple, Optional, Dict
11
+ from typing import Tuple, Union, Dict
12
12
 
13
13
  import resqpy as rq
14
14
  import resqpy.crs as rqc
@@ -832,8 +832,7 @@ def find_faces_to_represent_surface_regular_dense_optimised(grid,
832
832
  # log.debug('finished preparing columns bisector')
833
833
  else:
834
834
  log.debug("preparing cells bisector")
835
- bisector, is_curtain = bisector_from_faces(tuple(grid.extent_kji), k_faces, j_faces, i_faces, raw_bisector,
836
- False)
835
+ bisector, is_curtain = bisector_from_faces(tuple(grid.extent_kji), k_faces, j_faces, i_faces, raw_bisector)
837
836
  if is_curtain:
838
837
  bisector = bisector[0] # reduce to a columns property
839
838
 
@@ -1146,6 +1145,9 @@ def find_faces_to_represent_surface_regular_optimised(grid,
1146
1145
  if progress_fn is not None:
1147
1146
  progress_fn(0.9)
1148
1147
 
1148
+ assert k_faces_kji0 is not None or j_faces_kji0 is not None or i_faces_kji0 is not None, \
1149
+ f'did not find any faces to represent {name}: surface does not intersect grid?'
1150
+
1149
1151
  log.debug("converting face sets into grid connection set")
1150
1152
  # NB: kji0 arrays in internal face protocol: used as cell_kji0 with polarity of 1
1151
1153
  # property lists have elements replaced with sorted and filtered equivalents
@@ -1212,8 +1214,8 @@ def find_faces_to_represent_surface_regular_optimised(grid,
1212
1214
  # log.debug('finished preparing columns bisector')
1213
1215
  else:
1214
1216
  log.debug("preparing cells bisector")
1215
- bisector, is_curtain = bisector_from_faces(tuple(grid.extent_kji), k_faces_kji0, j_faces_kji0, i_faces_kji0,
1216
- raw_bisector, True)
1217
+ bisector, is_curtain = bisector_from_face_indices(tuple(grid.extent_kji), k_faces_kji0, j_faces_kji0,
1218
+ i_faces_kji0, raw_bisector)
1217
1219
  if is_curtain:
1218
1220
  bisector = bisector[0] # reduce to a columns property
1219
1221
 
@@ -1311,8 +1313,8 @@ def find_faces_to_represent_surface(grid, surface, name, mode = "auto", feature_
1311
1313
 
1312
1314
 
1313
1315
  def bisector_from_faces( # type: ignore
1314
- grid_extent_kji: Tuple[int, int, int], k_faces: np.ndarray, j_faces: np.ndarray, i_faces: np.ndarray,
1315
- raw_bisector: bool, using_indices: bool) -> Tuple[np.ndarray, bool]:
1316
+ grid_extent_kji: Tuple[int, int, int], k_faces: Union[np.ndarray, None], j_faces: Union[np.ndarray, None],
1317
+ i_faces: Union[np.ndarray, None], raw_bisector: bool) -> Tuple[np.ndarray, bool]:
1316
1318
  """Creates a boolean array denoting the bisection of the grid by the face sets.
1317
1319
 
1318
1320
  arguments:
@@ -1321,8 +1323,6 @@ def bisector_from_faces( # type: ignore
1321
1323
  - j_faces (np.ndarray): a boolean array of which faces represent the surface in the j dimension
1322
1324
  - i_faces (np.ndarray): a boolean array of which faces represent the surface in the i dimension
1323
1325
  - raw_bisector (bool): if True, the bisector is returned without determining which side is shallower
1324
- - using_indices (bool): if True, k_faces etc. are list-like arrays of kji indices; if False, they
1325
- are full boolean arrays covering the internal faces
1326
1326
 
1327
1327
  returns:
1328
1328
  Tuple containing:
@@ -1334,21 +1334,88 @@ def bisector_from_faces( # type: ignore
1334
1334
  - the face sets must form a single 'sealed' cut of the grid (eg. not waving in and out of the grid)
1335
1335
  - any 'boxed in' parts of the grid (completely enclosed by bisecting faces) will be consistently
1336
1336
  assigned to either the True or False part
1337
- - a value of False for using_indices is DEPRECATED, pending proving of newer indices based approach
1337
+ - this function is DEPRECATED, pending proving of newer indices based approach
1338
1338
  """
1339
1339
  assert len(grid_extent_kji) == 3
1340
1340
 
1341
1341
  # find the surface boundary (includes a buffer slice where surface does not reach edge of grid)
1342
- if using_indices:
1343
- box = get_boundary_from_indices(k_faces, j_faces, i_faces, grid_extent_kji)
1344
- # set k_faces as bool arrays covering box
1345
- k_faces, j_faces, i_faces = _box_face_arrays_from_indices(k_faces, j_faces, i_faces, box)
1342
+ box = get_boundary(k_faces, j_faces, i_faces, grid_extent_kji)
1343
+ box_shape = box[1, :] - box[0, :]
1344
+
1345
+ # set up the bisector array for the bounding box
1346
+ box_array = np.zeros(box_shape, dtype = np.bool_)
1347
+
1348
+ # seed the bisector box array at (0, 0, 0)
1349
+ box_array[0, 0, 0] = True
1350
+
1351
+ # prepare to spread True values to neighbouring cells that are not the other side of a face
1352
+ if k_faces is None:
1353
+ open_k = np.ones((box_shape[0] - 1, box_shape[1], box_shape[2]), dtype = bool)
1346
1354
  else:
1347
- box = get_boundary(k_faces, j_faces, i_faces, grid_extent_kji)
1348
- # switch k_faces etc. to box coverage
1349
1355
  k_faces = k_faces[box[0, 0]:box[1, 0] - 1, box[0, 1]:box[1, 1], box[0, 2]:box[1, 2]]
1356
+ open_k = np.logical_not(k_faces)
1357
+ if j_faces is None:
1358
+ open_j = np.ones((box_shape[0], box_shape[1] - 1, box_shape[2]), dtype = bool)
1359
+ else:
1350
1360
  j_faces = j_faces[box[0, 0]:box[1, 0], box[0, 1]:box[1, 1] - 1, box[0, 2]:box[1, 2]]
1361
+ open_j = np.logical_not(j_faces)
1362
+ if i_faces is None:
1363
+ open_i = np.ones((box_shape[0], box_shape[1], box_shape[2] - 1), dtype = bool)
1364
+ else:
1351
1365
  i_faces = i_faces[box[0, 0]:box[1, 0], box[0, 1]:box[1, 1], box[0, 2]:box[1, 2] - 1]
1366
+ open_i = np.logical_not(i_faces)
1367
+
1368
+ # populate bisector array for box
1369
+ _fill_bisector(box_array, open_k, open_j, open_i)
1370
+
1371
+ # set up the full bisectors array and assigning the bounding box values
1372
+ array = np.zeros(grid_extent_kji, dtype = np.bool_)
1373
+ array[box[0, 0]:box[1, 0], box[0, 1]:box[1, 1], box[0, 2]:box[1, 2]] = box_array
1374
+
1375
+ # set bisector values outside of the bounding box
1376
+ _set_bisector_outside_box(array, box, box_array)
1377
+
1378
+ # check all array elements are not the same
1379
+ true_count = np.count_nonzero(array)
1380
+ cell_count = array.size
1381
+ assert (0 < true_count < cell_count), "face set for surface is leaky or empty (surface does not intersect grid)"
1382
+
1383
+ # negate the array if it minimises the mean k and determine if the surface is a curtain
1384
+ is_curtain = _shallow_or_curtain(array, true_count, raw_bisector)
1385
+
1386
+ return array, is_curtain
1387
+
1388
+
1389
+ def bisector_from_face_indices( # type: ignore
1390
+ grid_extent_kji: Tuple[int, int, int], k_faces_kji0: Union[np.ndarray, None], j_faces_kji0: Union[np.ndarray,
1391
+ None],
1392
+ i_faces_kji0: Union[np.ndarray, None], raw_bisector: bool) -> Tuple[np.ndarray, bool]:
1393
+ """Creates a boolean array denoting the bisection of the grid by the face sets.
1394
+
1395
+ arguments:
1396
+ - grid_extent_kji (Tuple[int, int, int]): the shape of the grid
1397
+ - k_faces_kji0 (np.ndarray): an int array of indices of which faces represent the surface in the k dimension
1398
+ - j_faces_kji0 (np.ndarray): an int array of indices of which faces represent the surface in the j dimension
1399
+ - i_faces_kji0 (np.ndarray): an int array of indices of which faces represent the surface in the i dimension
1400
+ - raw_bisector (bool): if True, the bisector is returned without determining which side is shallower
1401
+
1402
+ returns:
1403
+ Tuple containing:
1404
+ - array (np.ndarray): boolean bisectors array where values are True for cells on the side
1405
+ of the surface that has a lower mean k index on average and False for cells on the other side.
1406
+ - is_curtain (bool): True if the surface is a curtain (vertical), otherwise False.
1407
+
1408
+ notes:
1409
+ - the face sets must form a single 'sealed' cut of the grid (eg. not waving in and out of the grid)
1410
+ - any 'boxed in' parts of the grid (completely enclosed by bisecting faces) will be consistently
1411
+ assigned to either the True or False part
1412
+ """
1413
+ assert len(grid_extent_kji) == 3
1414
+
1415
+ # find the surface boundary (includes a buffer slice where surface does not reach edge of grid)
1416
+ box = get_boundary_from_indices(k_faces_kji0, j_faces_kji0, i_faces_kji0, grid_extent_kji)
1417
+ # set k_faces as bool arrays covering box
1418
+ k_faces, j_faces, i_faces = _box_face_arrays_from_indices(k_faces_kji0, j_faces_kji0, i_faces_kji0, box)
1352
1419
 
1353
1420
  box_shape = box[1, :] - box[0, :]
1354
1421
 
@@ -1359,9 +1426,18 @@ def bisector_from_faces( # type: ignore
1359
1426
  box_array[0, 0, 0] = True
1360
1427
 
1361
1428
  # prepare to spread True values to neighbouring cells that are not the other side of a face
1362
- open_k = np.logical_not(k_faces)
1363
- open_j = np.logical_not(j_faces)
1364
- open_i = np.logical_not(i_faces)
1429
+ if k_faces is None:
1430
+ open_k = np.ones((box_shape[0] - 1, box_shape[1], box_shape[2]), dtype = bool)
1431
+ else:
1432
+ open_k = np.logical_not(k_faces)
1433
+ if j_faces is None:
1434
+ open_j = np.ones((box_shape[0], box_shape[1] - 1, box_shape[2]), dtype = bool)
1435
+ else:
1436
+ open_j = np.logical_not(j_faces)
1437
+ if i_faces is None:
1438
+ open_i = np.ones((box_shape[0], box_shape[1], box_shape[2] - 1), dtype = bool)
1439
+ else:
1440
+ open_i = np.logical_not(i_faces)
1365
1441
 
1366
1442
  # populate bisector array for box
1367
1443
  _fill_bisector(box_array, open_k, open_j, open_i)
@@ -1534,9 +1610,9 @@ def shadow_from_faces(extent_kji, k_faces):
1534
1610
 
1535
1611
 
1536
1612
  def get_boundary( # type: ignore
1537
- k_faces: np.ndarray,
1538
- j_faces: np.ndarray,
1539
- i_faces: np.ndarray,
1613
+ k_faces: Union[np.ndarray, None],
1614
+ j_faces: Union[np.ndarray, None],
1615
+ i_faces: Union[np.ndarray, None],
1540
1616
  grid_extent_kji: Tuple[int, int, int],
1541
1617
  ) -> np.ndarray:
1542
1618
  """Cretaes a box of the indices that bound the surface (where the faces are True).
@@ -1561,6 +1637,9 @@ def get_boundary( # type: ignore
1561
1637
 
1562
1638
  for f_i, faces in enumerate([k_faces, j_faces, i_faces]):
1563
1639
 
1640
+ if faces is None:
1641
+ continue
1642
+
1564
1643
  # NB. k, j & i for rest of loop refer to indices of faces, regardless of which face set is being processed
1565
1644
 
1566
1645
  where_k, where_j, where_i = _where_true(faces)
@@ -1584,21 +1663,21 @@ def get_boundary( # type: ignore
1584
1663
  else:
1585
1664
  if min_k > 0:
1586
1665
  min_k -= 1
1587
- if max_k < j_faces.shape[0] - 1:
1666
+ if max_k < grid_extent_kji[0] - 1:
1588
1667
  max_k += 1
1589
1668
  if f_i == 1:
1590
1669
  max_j += 1
1591
1670
  else:
1592
1671
  if min_j > 0:
1593
1672
  min_j -= 1
1594
- if max_j < k_faces.shape[1] - 1:
1673
+ if max_j < grid_extent_kji[1] - 1:
1595
1674
  max_j += 1
1596
1675
  if f_i == 2:
1597
1676
  max_i += 1
1598
1677
  else:
1599
1678
  if min_i > 0:
1600
1679
  min_i -= 1
1601
- if max_i < k_faces.shape[2] - 1:
1680
+ if max_i < grid_extent_kji[2] - 1:
1602
1681
  max_i += 1
1603
1682
 
1604
1683
  if starting:
@@ -1629,9 +1708,9 @@ def get_boundary( # type: ignore
1629
1708
 
1630
1709
 
1631
1710
  def get_boundary_dict( # type: ignore
1632
- k_faces: np.ndarray,
1633
- j_faces: np.ndarray,
1634
- i_faces: np.ndarray,
1711
+ k_faces: Union[np.ndarray, None],
1712
+ j_faces: Union[np.ndarray, None],
1713
+ i_faces: Union[np.ndarray, None],
1635
1714
  grid_extent_kji: Tuple[int, int, int],
1636
1715
  ) -> Dict[str, int]:
1637
1716
  """Cretaes a dictionary of the indices that bound the surface (where the faces are True).
@@ -1783,63 +1862,6 @@ def intersect_numba(
1783
1862
  return faces, offsets, triangle_per_face
1784
1863
 
1785
1864
 
1786
- @njit # pragma: no cover
1787
- def _seed_array(
1788
- point: Tuple[int, int, int],
1789
- k_faces: np.ndarray,
1790
- j_faces: np.ndarray,
1791
- i_faces: np.ndarray,
1792
- box: np.ndarray,
1793
- array: np.ndarray,
1794
- ) -> Tuple[np.ndarray, int, int, int]:
1795
- """Sets values of the array True up until a face is hit in each direction.
1796
-
1797
- arguments:
1798
-
1799
- - point (Tuple[int, int, int]): coordinates of the initial seed point
1800
- - k_faces (np.ndarray): a boolean array of which faces represent the surface in the k dimension
1801
- - j_faces (np.ndarray): a boolean array of which faces represent the surface in the j dimension
1802
- - i_faces (np.ndarray): a boolean array of which faces represent the surface in the i dimension
1803
- - box (numpy int array of shape (2, 3)): the boundaries of the surface in python protocol
1804
- - array (np.ndarray): boolean array that will be seeded
1805
-
1806
- returns:
1807
- Tuple containing:
1808
-
1809
- - array (np.ndarray): boolean array that has been seeded.
1810
- - first_k (int): the index of the first k face in the k direction from the seed point or the
1811
- array size in the k direction if there are no k faces.
1812
- - first_j (int): the index of the first j face in the j direction from the seed point or the
1813
- array size in the j direction if there are no j faces.
1814
- - first_i (int): the index of the first i face in the i direction from the seed point or the
1815
- array size in the i direction if there are no i faces.
1816
-
1817
- note:
1818
-
1819
- - this function is DEPRECATED as it is no longer in use
1820
- """
1821
- k = point[0]
1822
- j = point[1]
1823
- i = point[2]
1824
-
1825
- first_k = 0
1826
- if k == 0:
1827
- first_k = _first_true(k_faces[box[0, 0]:box[1, 0] - 1, box[0, 1] + j, box[0, 2] + i])
1828
- array[:first_k, j, i] = True
1829
-
1830
- first_j = 0
1831
- if j == 0:
1832
- first_j = _first_true(j_faces[box[0, 0] + k, box[0, 1]:box[1, 1] - 1, box[0, 2] + i])
1833
- array[k, :first_j, i] = True
1834
-
1835
- first_i = 0
1836
- if i == 0:
1837
- first_i = _first_true(i_faces[box[0, 0] + k, box[0, 1] + j, box[0, 2]:box[1, 2] - 1])
1838
- array[k, j, :first_i] = True
1839
-
1840
- return array, first_k, first_j, first_i
1841
-
1842
-
1843
1865
  def _all_offsets(crs, k_offsets_list, j_offsets_list, i_offsets_list):
1844
1866
  if crs.xy_units == crs.z_units:
1845
1867
  return np.concatenate((k_offsets_list, j_offsets_list, i_offsets_list), axis = 0)
@@ -1913,8 +1935,9 @@ def _set_bisector_outside_box(a: np.ndarray, box: np.ndarray, box_array: np.ndar
1913
1935
  a[:, :, :box[0, 2]] = True
1914
1936
 
1915
1937
 
1916
- def _box_face_arrays_from_indices(k_faces: np.ndarray, j_faces: np.ndarray, i_faces: np.ndarray,
1917
- box: np.ndarray) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
1938
+ def _box_face_arrays_from_indices( # type: ignore
1939
+ k_faces_kji0: Union[np.ndarray, None], j_faces_kji0: Union[np.ndarray, None],
1940
+ i_faces_kji0: Union[np.ndarray, None], box: np.ndarray) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
1918
1941
  box_shape = box[1, :] - box[0, :]
1919
1942
  k_a = np.zeros((box_shape[0] - 1, box_shape[1], box_shape[2]), dtype = np.bool_)
1920
1943
  j_a = np.zeros((box_shape[0], box_shape[1] - 1, box_shape[2]), dtype = np.bool_)
@@ -1922,14 +1945,20 @@ def _box_face_arrays_from_indices(k_faces: np.ndarray, j_faces: np.ndarray, i_fa
1922
1945
  ko = box[0, 0]
1923
1946
  jo = box[0, 1]
1924
1947
  io = box[0, 2]
1925
- _set_face_array(k_a, k_faces, ko, jo, io)
1926
- _set_face_array(j_a, j_faces, ko, jo, io)
1927
- _set_face_array(i_a, i_faces, ko, jo, io)
1948
+ if k_faces_kji0 is not None:
1949
+ _set_face_array(k_a, k_faces_kji0, ko, jo, io)
1950
+ if j_faces_kji0 is not None:
1951
+ _set_face_array(j_a, j_faces_kji0, ko, jo, io)
1952
+ if i_faces_kji0 is not None:
1953
+ _set_face_array(i_a, i_faces_kji0, ko, jo, io)
1928
1954
  return k_a, j_a, i_a
1929
1955
 
1930
1956
 
1931
1957
  @njit # pragma: no cover
1932
1958
  def _set_face_array(a: np.ndarray, indices: np.ndarray, ko: int, jo: int, io: int):
1959
+ k: int = 0
1960
+ j: int = 0
1961
+ i: int = 0
1933
1962
  for ind in range(len(indices)):
1934
1963
  k = indices[ind, 0] - ko
1935
1964
  j = indices[ind, 1] - jo
@@ -1937,25 +1966,47 @@ def _set_face_array(a: np.ndarray, indices: np.ndarray, ko: int, jo: int, io: in
1937
1966
  a[k, j, i] = True
1938
1967
 
1939
1968
 
1940
- def get_boundary_from_indices(k_faces: np.ndarray, j_faces: np.ndarray, i_faces: np.ndarray,
1941
- grid_extent_kji: Tuple[int, int, int]) -> np.ndarray:
1969
+ def get_boundary_from_indices( # type: ignore
1970
+ k_faces_kji0: Union[np.ndarray, None], j_faces_kji0: Union[np.ndarray, None],
1971
+ i_faces_kji0: Union[np.ndarray, None], grid_extent_kji: Tuple[int, int, int]) -> np.ndarray:
1942
1972
  """Return python protocol box containing indices"""
1943
- k_min_kji0 = np.min(k_faces, axis = 0)
1944
- k_max_kji0 = np.max(k_faces, axis = 0)
1945
- j_min_kji0 = np.min(j_faces, axis = 0)
1946
- j_max_kji0 = np.max(j_faces, axis = 0)
1947
- i_min_kji0 = np.min(i_faces, axis = 0)
1948
- i_max_kji0 = np.max(i_faces, axis = 0)
1973
+ k_min_kji0 = None if k_faces_kji0 is None else np.min(k_faces_kji0, axis = 0)
1974
+ k_max_kji0 = None if k_faces_kji0 is None else np.max(k_faces_kji0, axis = 0)
1975
+ j_min_kji0 = None if j_faces_kji0 is None else np.min(j_faces_kji0, axis = 0)
1976
+ j_max_kji0 = None if j_faces_kji0 is None else np.max(j_faces_kji0, axis = 0)
1977
+ i_min_kji0 = None if i_faces_kji0 is None else np.min(i_faces_kji0, axis = 0)
1978
+ i_max_kji0 = None if i_faces_kji0 is None else np.max(i_faces_kji0, axis = 0)
1949
1979
  box = np.empty((2, 3), dtype = np.int32)
1950
- box[0, 0] = min(k_min_kji0[0], j_min_kji0[0], i_min_kji0[0])
1951
- box[0, 1] = min(k_min_kji0[1], j_min_kji0[1], i_min_kji0[1])
1952
- box[0, 2] = min(k_min_kji0[2], j_min_kji0[2], i_min_kji0[2])
1953
- box[1, 0] = max(k_max_kji0[0], j_max_kji0[0], i_max_kji0[0]) + 1
1954
- box[1, 1] = max(k_max_kji0[1], j_max_kji0[1], i_max_kji0[1]) + 1
1955
- box[1, 2] = max(k_max_kji0[2], j_max_kji0[2], i_max_kji0[2]) + 1
1956
- box[0, :] = np.maximum(box[0, :] - 1, 0)
1980
+ box[0, :] = grid_extent_kji
1981
+ box[1, :] = -1
1982
+ if k_min_kji0 is not None:
1983
+ box[0, 0] = k_min_kji0[0]
1984
+ box[0, 1] = k_min_kji0[1]
1985
+ box[0, 2] = k_min_kji0[2]
1986
+ box[1, 0] = k_max_kji0[0] # type: ignore
1987
+ box[1, 1] = k_max_kji0[1] # type: ignore
1988
+ box[1, 2] = k_max_kji0[2] # type: ignore
1989
+ if j_min_kji0 is not None:
1990
+ box[0, 0] = min(box[0, 0], j_min_kji0[0])
1991
+ box[0, 1] = min(box[0, 1], j_min_kji0[1])
1992
+ box[0, 2] = min(box[0, 2], j_min_kji0[2])
1993
+ box[1, 0] = max(box[1, 0], j_max_kji0[0]) # type: ignore
1994
+ box[1, 1] = max(box[1, 1], j_max_kji0[1]) # type: ignore
1995
+ box[1, 2] = max(box[1, 2], j_max_kji0[2]) # type: ignore
1996
+ if i_min_kji0 is not None:
1997
+ box[0, 1] = min(box[0, 1], i_min_kji0[0])
1998
+ box[0, 2] = min(box[0, 2], i_min_kji0[1])
1999
+ box[0, 2] = min(box[0, 2], i_min_kji0[2])
2000
+ box[1, 0] = max(box[1, 0], i_max_kji0[0]) # type: ignore
2001
+ box[1, 1] = max(box[1, 1], i_max_kji0[1]) # type: ignore
2002
+ box[1, 2] = max(box[1, 2], i_max_kji0[2]) # type: ignore
2003
+ assert np.all(box[1] >= box[0]), 'attempt to find bounding box when all faces None'
1957
2004
  # include buffer layer where box does not reach edge of grid
2005
+ box[0, :] = np.maximum(box[0, :] - 1, 0)
1958
2006
  extent_kji = np.array(grid_extent_kji, dtype = np.int32)
2007
+ box[1, :] += 2 # buffer layer and python protocol
2008
+ box[1, :] = np.minimum(box[1, :], extent_kji)
2009
+ assert np.all(box[0] >= 0)
2010
+ assert np.all(box[1] > box[0])
1959
2011
  assert np.all(box[1] <= grid_extent_kji)
1960
- box[1, :] = np.minimum(box[1, :] + 1, extent_kji)
1961
2012
  return box
@@ -949,7 +949,7 @@ class Surface(rqsb.BaseSurface):
949
949
  v_index = None
950
950
  for line in lines:
951
951
  if "VRTX" in line:
952
- words = line.rstrip().split(" ")
952
+ words = line.rstrip().split()
953
953
  v_i = int(words[1])
954
954
  if v_index is None:
955
955
  v_index = v_i
@@ -959,7 +959,7 @@ class Surface(rqsb.BaseSurface):
959
959
  v_index = v_i
960
960
  vertices.append(words[2:5])
961
961
  elif "TRGL" in line:
962
- triangles.append(line.rstrip().split(" ")[1:4])
962
+ triangles.append(line.rstrip().split()[1:4])
963
963
  assert len(vertices) >= 3, 'vertices missing'
964
964
  assert len(triangles) > 0, 'triangles missing'
965
965
  t_type = np.int32 if len(vertices) <= 2_147_483_647 else np.int64
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: resqpy
3
- Version: 4.17.2
3
+ Version: 4.17.6
4
4
  Summary: Python API for working with RESQML models
5
5
  Home-page: https://github.com/bp/resqpy
6
6
  License: MIT
@@ -1,4 +1,4 @@
1
- resqpy/__init__.py,sha256=oaXzrJ3znGh09f_UOkvMYW4bc7G2CG9pIWjbSpDIKiM,556
1
+ resqpy/__init__.py,sha256=Lf6nMJeSeQn5evJqE6vBeO_I-gtLOMh4Yuh6JAjcvMs,556
2
2
  resqpy/crs.py,sha256=R7DfcTP5xGv5pu9Y8RHA2WVM9DjBCSVMoHcz4RmQ7Yw,27646
3
3
  resqpy/derived_model/__init__.py,sha256=NFvMSOKI3cxmH7lAbddV43JjoUj-r2G7ExEfOqinD1I,1982
4
4
  resqpy/derived_model/_add_edges_per_column_property_array.py,sha256=cpW3gwp6MSYIrtvFmCjoJXcyUsgGuCDbgmwlJCJebUs,6410
@@ -48,7 +48,7 @@ resqpy/grid/_write_nexus_corp.py,sha256=yEVfiObsedEAXX6UG6ZTf56kZnQVkd3lLqE2NpL-
48
48
  resqpy/grid/_xyz.py,sha256=RLQWOdM_DRoCj4JypwB5gUJ78HTdk5JnZHSeAzuU634,13087
49
49
  resqpy/grid_surface/__init__.py,sha256=rPr5zFFRmUDbMEhnCYsweSC3xugtQ8LnhZOf8JLIqIc,2765
50
50
  resqpy/grid_surface/_blocked_well_populate.py,sha256=Lme1AR-nLWOUlNnmHMVThk6jEg_lAZxWWtL82Yksppw,35867
51
- resqpy/grid_surface/_find_faces.py,sha256=FeKfpGyUM-UjHJNEvtVOGMhEHq2OcywxwSjKJfioxLg,90009
51
+ resqpy/grid_surface/_find_faces.py,sha256=d9QoRdcXpK9TZgmzy1sNh2Vs1rzvW2KJkaJiLceMxCQ,93073
52
52
  resqpy/grid_surface/_grid_skin.py,sha256=D0cjHkcuT5KCKb-8EZfXgh0GgJj3kzOBS2wVNXg4bfY,26056
53
53
  resqpy/grid_surface/_grid_surface.py,sha256=l2NJo7Kiucolbb_TlLPC7NGdksg_JahkihfsrJVq99w,14379
54
54
  resqpy/grid_surface/_trajectory_intersects.py,sha256=Och9cZYU9Y7ofovhPzsLyIblRUl2xj9_5nHH3fMZp-A,22498
@@ -163,7 +163,7 @@ resqpy/surface/_base_surface.py,sha256=LsWrDrbuuaEVRgf2Dlbc-6ZvGQpjtrKuxF7Jjebvl
163
163
  resqpy/surface/_combined_surface.py,sha256=8TnNbSywjej6tW_vRr5zoVgBbvnadCaqWk6WyHWHTYQ,3082
164
164
  resqpy/surface/_mesh.py,sha256=yEFldNWT2g8MCGcU4mTeWzDrLHHGLLGLIle1gAjJ_lg,42352
165
165
  resqpy/surface/_pointset.py,sha256=niTkBik9hAvqrY8340K1TRG7mg4FMQbbp12WZiiXPMs,27416
166
- resqpy/surface/_surface.py,sha256=fdVLBC4vI8SwsGNFNZhhPFu0FStlXIgzwxGRBSh85LY,71703
166
+ resqpy/surface/_surface.py,sha256=yDU-5MdVtrRUeRU2X1AFn4dYqpO-D1ydbX49HIBVKIo,71697
167
167
  resqpy/surface/_tri_mesh.py,sha256=EmV4FhyjuusQFruW1SseufbnHF5YFoJ6Uvb07UJbH6s,26609
168
168
  resqpy/surface/_tri_mesh_stencil.py,sha256=eXt_HIKvsXGsjQ7nm_NbozR6ProQxPbeO52r79j80ig,16087
169
169
  resqpy/surface/_triangulated_patch.py,sha256=FKn_Irzp4aLFkkN_-tx1MLMKjEAiOLE8636sOA481TQ,26802
@@ -194,7 +194,7 @@ resqpy/well/_wellbore_marker_frame.py,sha256=xvYH2_2Ie3a18LReFymbUrZboOx7Rhv5DOD
194
194
  resqpy/well/blocked_well_frame.py,sha256=eK7Ca6PcqI3pK-XurZIcXAV5Z4B9PFe6H8a7DqVkmBo,22560
195
195
  resqpy/well/well_object_funcs.py,sha256=tWufc8wahihzMEO-Ou1dncIttrf4bNo1qmLgh3I2pOM,24717
196
196
  resqpy/well/well_utils.py,sha256=zwpYjT85nXAwWBhYB1Pygu2SgouZ-44k6hEOnpoMfBI,5969
197
- resqpy-4.17.2.dist-info/LICENSE,sha256=2duHPIkKQyESMdQ4hKjL8CYEsYRHXaYxt0YQkzsUYE4,1059
198
- resqpy-4.17.2.dist-info/METADATA,sha256=82xvzgf-VX_O4dY0-3dNaM8wiGxwnMcaP_dJg3cJ-EM,4028
199
- resqpy-4.17.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
200
- resqpy-4.17.2.dist-info/RECORD,,
197
+ resqpy-4.17.6.dist-info/LICENSE,sha256=2duHPIkKQyESMdQ4hKjL8CYEsYRHXaYxt0YQkzsUYE4,1059
198
+ resqpy-4.17.6.dist-info/METADATA,sha256=pdP1xm-XrjWUN6a0ZQbB1C-H4Id5AlNs39Ggc3lm6qU,4028
199
+ resqpy-4.17.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
200
+ resqpy-4.17.6.dist-info/RECORD,,