xtgeo 4.10.1__cp313-cp313-win_amd64.whl → 4.11.0__cp313-cp313-win_amd64.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.

Potentially problematic release.


This version of xtgeo might be problematic. Click here for more details.

Binary file
Binary file
xtgeo/common/version.py CHANGED
@@ -1,7 +1,14 @@
1
1
  # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
3
 
4
- __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
5
12
 
6
13
  TYPE_CHECKING = False
7
14
  if TYPE_CHECKING:
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
9
16
  from typing import Union
10
17
 
11
18
  VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
12
20
  else:
13
21
  VERSION_TUPLE = object
22
+ COMMIT_ID = object
14
23
 
15
24
  version: str
16
25
  __version__: str
17
26
  __version_tuple__: VERSION_TUPLE
18
27
  version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
19
30
 
20
- __version__ = version = '4.10.1'
21
- __version_tuple__ = version_tuple = (4, 10, 1)
31
+ __version__ = version = '4.11.0'
32
+ __version_tuple__ = version_tuple = (4, 11, 0)
33
+
34
+ __commit_id__ = commit_id = 'gee9361dd9'
@@ -63,6 +63,7 @@ class CubeAttrs:
63
63
  _upper: RegularSurface | None = None # upper surf, resampled to cube map resolution
64
64
  _lower: RegularSurface | None = None # lower surf, resampled to cube map resolution
65
65
  _min_thickness_mask: RegularSurface | None = None # mask for min. thickness trunc.
66
+ _mask_map_by_traceidcode: RegularSurface | None = None # mask for traceidcode 2
66
67
 
67
68
  _result_attr_maps: dict = field(default_factory=dict) # holds the resulting maps
68
69
 
@@ -94,6 +95,7 @@ class CubeAttrs:
94
95
  else self.lower_surface
95
96
  )
96
97
 
98
+ # the template surface is the topology that defines the resulting attribute maps
97
99
  self._template_surface = (
98
100
  upper
99
101
  if isinstance(self.upper_surface, (float, int))
@@ -184,7 +186,7 @@ class CubeAttrs:
184
186
  from xtgeo import Cube # avoid circular import by having this here
185
187
 
186
188
  cubev = self.cube.values.copy() # copy, so we don't change the input instance
187
- cubev[self.cube.traceidcodes == 2] = np.nan # set dead traces to nan
189
+ cubev[self.cube.traceidcodes == 2] = 0.0 # set traceidcode 2 to zero
188
190
 
189
191
  # Create a boolean mask based on the threshold
190
192
  mask = self._depth_array < self._outside_depth
@@ -311,13 +313,20 @@ class CubeAttrs:
311
313
  attr_map = self._upper.copy()
312
314
  attr_map.values = np.ma.masked_invalid(values)
313
315
 
316
+ # apply mask for the cube's dead traces (traceidcode 2)
317
+ attr_map.values = np.ma.masked_where(
318
+ self.cube.traceidcodes == 2, attr_map.values
319
+ )
320
+
314
321
  # now resample to the original input map
315
322
  attr_map_resampled = self._template_surface.copy()
316
323
  attr_map_resampled.resample(attr_map)
317
324
 
318
- attr_map_resampled.values = np.ma.masked_where(
319
- self.upper_surface.values.mask, attr_map_resampled.values
320
- )
325
+ # Use template_surface consistently for masking (it's already set correctly)
326
+ if hasattr(self._template_surface.values, "mask"):
327
+ attr_map_resampled.values = np.ma.masked_where(
328
+ self._template_surface.values.mask, attr_map_resampled.values
329
+ )
321
330
 
322
331
  self._result_attr_maps[attr_name] = attr_map_resampled
323
332
 
@@ -1053,13 +1053,18 @@ def inactivate_inside(
1053
1053
  raise RuntimeError("Problems with one or more polygons. Not closed?")
1054
1054
 
1055
1055
 
1056
- def collapse_inactive_cells(self: Grid) -> None:
1056
+ def collapse_inactive_cells(self: Grid, internal: bool = True) -> None:
1057
1057
  """Collapse inactive cells."""
1058
- self._set_xtgformat1()
1058
+ logger.debug("Collapsing inactive cells...")
1059
+ self._set_xtgformat2()
1059
1060
 
1060
- _cxtgeo.grd3d_collapse_inact(
1061
- self.ncol, self.nrow, self.nlay, self._zcornsv, self._actnumsv
1062
- )
1061
+ grid_cpp = _internal.grid3d.Grid(self)
1062
+ new_zcornsv = grid_cpp.collapse_inactive_cells(collapse_internal=internal)
1063
+
1064
+ if new_zcornsv is not None:
1065
+ self._zcornsv = new_zcornsv
1066
+
1067
+ logger.debug("Collapsing inactive cells done")
1063
1068
 
1064
1069
 
1065
1070
  def copy(self: Grid) -> Grid:
xtgeo/grid3d/grid.py CHANGED
@@ -2295,7 +2295,7 @@ class Grid(_Grid3D):
2295
2295
  * maxangle_topbase_proj (degrees) max angle projected (bird view)
2296
2296
  * minangle_sides (degress) minimum angle, all side surfaces
2297
2297
  * maxangle_sides (degress) maximum angle, all side surfaces
2298
- * collapsed (int) Integer, 1 of one or more corners are collpased in Z
2298
+ * collapsed (int) Integer, 1 of one or more corners are collapsed in Z
2299
2299
  * faulted (int) Integer, 1 if cell is faulted (one or more neighbours offset)
2300
2300
  * negative_thickness (int) Integer, 1 if cell has negative thickness
2301
2301
  * concave_proj (int) 1 if cell is concave seen from projected bird view
@@ -2332,7 +2332,7 @@ class Grid(_Grid3D):
2332
2332
  inside: bool = True,
2333
2333
  force_close: bool = False,
2334
2334
  ) -> None:
2335
- """Inacativate grid inside a polygon.
2335
+ """Inactivate grid inside a polygon.
2336
2336
 
2337
2337
  The Polygons instance may consist of several polygons. If a polygon
2338
2338
  is open, then the flag force_close will close any that are not open
@@ -2359,14 +2359,30 @@ class Grid(_Grid3D):
2359
2359
  layer_range: tuple[int, int] | None = None,
2360
2360
  force_close: bool = False,
2361
2361
  ) -> None:
2362
- """Inacativate grid outside a polygon."""
2362
+ """Inactivate grid outside a polygon."""
2363
2363
  self.inactivate_inside(
2364
2364
  poly, layer_range=layer_range, inside=False, force_close=force_close
2365
2365
  )
2366
2366
 
2367
- def collapse_inactive_cells(self) -> None:
2368
- """Collapse inactive layers where, for I J with other active cells."""
2369
- _grid_etc1.collapse_inactive_cells(self)
2367
+ def collapse_inactive_cells(self, internal: bool = True) -> None:
2368
+ """Collapse inactive layers per I J column (~vertically).
2369
+
2370
+ Seen by I,J column, the inactive cells are collapsed to the first active cell in
2371
+ the column. First transversed from top, then from bottom. If no active cells in
2372
+ the column, the (invisible) Z coordinates are averaged to one common location.
2373
+
2374
+ If `internal` is True (default), then also internal inactive cells (i.e.
2375
+ inactive "hole" surrounded by active cells) are collapsed. In this case the Z
2376
+ coordinates of the adjacent active cells are moved to fill the gap.
2377
+
2378
+ The current grid instance will be updated.
2379
+
2380
+ Args:
2381
+ internal: If True (default), then the internal collapse is also done.
2382
+
2383
+ .. versionchanged:: 4.11 Added ``internal option``, algorithm is improved
2384
+ """
2385
+ _grid_etc1.collapse_inactive_cells(self, internal=internal)
2370
2386
 
2371
2387
  def crop(
2372
2388
  self,
@@ -10,10 +10,17 @@ The metadata works through the various datatypes in XTGeo. For example::
10
10
 
11
11
  """
12
12
 
13
+ from __future__ import annotations
14
+
15
+ from typing import TYPE_CHECKING, Any
16
+
13
17
  import xtgeo
14
18
  from xtgeo.common.constants import UNDEF
15
19
  from xtgeo.common.log import null_logger
16
20
 
21
+ if TYPE_CHECKING:
22
+ from datetime import datetime
23
+
17
24
  logger = null_logger(__name__)
18
25
 
19
26
 
@@ -50,10 +57,10 @@ class _OptionalMetaData:
50
57
  self._name = "A Longer Descriptive Name e.g. from SMDA"
51
58
  self._shortname = "TheShortName"
52
59
  self._datatype = None
53
- self._md5sum = None
60
+ self._md5sum: str | None = None
54
61
  self._description = "Some description"
55
62
  self._crs = None
56
- self._datetime = None
63
+ self._datetime: datetime | None = None
57
64
  self._deltadatetime = None
58
65
  self._visuals = {"colortable": "rainbow", "lower": None, "upper": None}
59
66
  self._domain = "depth"
@@ -68,29 +75,29 @@ class _OptionalMetaData:
68
75
  self._source = "unknown"
69
76
 
70
77
  @property
71
- def name(self):
78
+ def name(self) -> str:
72
79
  return self._name
73
80
 
74
81
  @name.setter
75
- def name(self, newname):
82
+ def name(self, newname: str) -> None:
76
83
  # TODO: validation
77
84
  self._name = newname
78
85
 
79
86
  @property
80
- def datetime(self):
87
+ def datetime(self) -> datetime | None:
81
88
  return self._datetime
82
89
 
83
90
  @datetime.setter
84
- def datetime(self, newdate):
91
+ def datetime(self, newdate: datetime) -> None:
85
92
  # TODO: validation
86
93
  self._datetime = newdate
87
94
 
88
95
  @property
89
- def shortname(self):
96
+ def shortname(self) -> str:
90
97
  return self._shortname
91
98
 
92
99
  @shortname.setter
93
- def shortname(self, newname):
100
+ def shortname(self, newname: str) -> None:
94
101
  if not isinstance(newname, str):
95
102
  raise ValueError("The shortname must be a string.")
96
103
  if len(newname) >= 32:
@@ -99,11 +106,11 @@ class _OptionalMetaData:
99
106
  self._shortname = newname
100
107
 
101
108
  @property
102
- def description(self):
109
+ def description(self) -> str:
103
110
  return self._description
104
111
 
105
112
  @description.setter
106
- def description(self, newstr):
113
+ def description(self, newstr: str) -> None:
107
114
  if not isinstance(newstr, str):
108
115
  raise ValueError("The description must be a string.")
109
116
  if len(newstr) >= 64:
@@ -115,7 +122,7 @@ class _OptionalMetaData:
115
122
  self._description = newstr
116
123
 
117
124
  @property
118
- def md5sum(self):
125
+ def md5sum(self) -> str | None:
119
126
  """Set or get the md5 checksum of file content.
120
127
 
121
128
  See generate_hash() method in e.g. RegularSurface.
@@ -123,11 +130,11 @@ class _OptionalMetaData:
123
130
  return self._md5sum
124
131
 
125
132
  @md5sum.setter
126
- def md5sum(self, newhash):
133
+ def md5sum(self, newhash: str) -> None:
127
134
  # TODO: validation
128
135
  self._md5sum = newhash
129
136
 
130
- def get_meta(self):
137
+ def get_meta(self) -> dict[str, Any]:
131
138
  """Return metadata as an dict."""
132
139
  meta = {}
133
140
  for key in self.__slots__:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: xtgeo
3
- Version: 4.10.1
3
+ Version: 4.11.0
4
4
  Summary: XTGeo is a Python library for 3D grids, surfaces, wells, etc
5
5
  Keywords: grids,surfaces,wells,cubes
6
6
  Author-Email: Equinor <fg_fmu-atlas@equinor.com>
@@ -1,8 +1,8 @@
1
1
  cxtgeo.py,sha256=TdHva0vqjD5B_9jA6kxvev9i2kvZ4Oftc1bQoLdFNXQ,33972
2
2
  cxtgeoPYTHON_wrap.c,sha256=E76gd7QM28i3EYkuQEA1V_-3cxzXxsi_b151ZcEszxk,655525
3
3
  xtgeo/__init__.py,sha256=edNCOXuPS5qjutDGX5-2Pz0T2Lpx1GoeG3IoeXUdBw8,5834
4
- xtgeo/_cxtgeo.cp313-win_amd64.pyd,sha256=tjPrGiXnYx110Jk2kK67t-fTDI1xuhAvLBvWqpRQzoE,728064
5
- xtgeo/_internal.cp313-win_amd64.pyd,sha256=i0ImMJPKCLYo-ylyIfi_qJJc5vvr0RoFXhvAOdlOpGk,910848
4
+ xtgeo/_cxtgeo.cp313-win_amd64.pyd,sha256=sW472vaPr4QBXwJ7-dY7d3X3qmHYrHW_K8SJWoUPocg,720896
5
+ xtgeo/_internal.cp313-win_amd64.pyd,sha256=uc6sJW1i5EC-rBtKs7wzjfdCNTI2xuYa_Q9nbRK_j3M,971264
6
6
  xtgeo/common/__init__.py,sha256=6R_OizhLnAoJUmUoQtGqgNvGcn1HWc4udc6YvRRlxWQ,480
7
7
  xtgeo/common/_angles.py,sha256=fAX5FzgqIjjIDe9_C7gy6zPjdaSQuzMb8Z2XdKSx-6Y,851
8
8
  xtgeo/common/_xyz_enum.py,sha256=gb1PVOWMTRb4YGDq9Q0YVVkKqMyI_xBg1vUBvOLXlfs,1095
@@ -12,14 +12,14 @@ xtgeo/common/exceptions.py,sha256=OZyU9C8cS4NhCnjQyREfuoVy9mdvGCiccd4nC9yn_N4,12
12
12
  xtgeo/common/log.py,sha256=8-wTrZd87UNr_ZEb_lZvR1khUeKmIO_UECMpV_Q_btM,2835
13
13
  xtgeo/common/sys.py,sha256=lvvmS4D7qaAVVg5UueNSt44WeEgpZcmyINEGKLHXctM,5144
14
14
  xtgeo/common/types.py,sha256=LanIGZh0HU2XXfJelZA-FC__J6fLB1DzuN7jj7hNSgU,362
15
- xtgeo/common/version.py,sha256=webkQYCLapKyXq4N-wy_1-S59jreweESFu1CwTt_iwA,534
15
+ xtgeo/common/version.py,sha256=cUrL8yRkWKktCAzG1Q7nFkTmqJi0-LynyrYt5bBPYCE,748
16
16
  xtgeo/common/xtgeo_dialog.py,sha256=XX445byFvdRjT2Eg9Mgd3ChRQ9d1Mj5MEdsBRYBSo8A,17733
17
17
  xtgeo/cube/__init__.py,sha256=5_F9Cefu4081jIwDqsyJGKTlrVLe1UfwI8wQXVRYPDM,169
18
18
  xtgeo/cube/_cube_export.py,sha256=YcU_0c_kFyh8T_ytY8XRR9Bmt8KK3J1taMLzo_w_m4c,6659
19
19
  xtgeo/cube/_cube_import.py,sha256=F6uWEXWxX0a4Px6HVa0pRCPNcfr36bMe_559CSf4h9c,17314
20
20
  xtgeo/cube/_cube_roxapi.py,sha256=UvU4yr1b1ZTyYxBIj7_ei2aub_VqAdP9S_6znpzDJ14,5101
21
21
  xtgeo/cube/_cube_utils.py,sha256=Mx79j29QLBJQ8wlwAfVgb-xN0ud7ilRIh6jOx7HMs2o,7727
22
- xtgeo/cube/_cube_window_attributes.py,sha256=CN2nweAwnREtE-5pANWTwCDG0KLH9-SL2K4zwVCqs0U,12435
22
+ xtgeo/cube/_cube_window_attributes.py,sha256=NAgm2WCjpiFx5eLUM5G0HqUSf0SKaVb6hVOXMD7x3zs,12956
23
23
  xtgeo/cube/cube1.py,sha256=QKqKIGH814zehx-avRuett996cx8lI-2bYyjuqaCmkw,35864
24
24
  xtgeo/grid3d/__init__.py,sha256=yctcaBS-PW_s3hCd7xq-XZZi514R_fgcpIrMnETZ87w,347
25
25
  xtgeo/grid3d/_ecl_grid.py,sha256=Oqe0_4ErUZkM-le4EnM6hMqXGMpMZyrr9-W9Xa7ZN1A,26679
@@ -34,7 +34,7 @@ xtgeo/grid3d/_grid3d.py,sha256=rTqfhwK4dNX1A5M-xUC-9hWwfxrkX6_TVgwc79KCXCI,769
34
34
  xtgeo/grid3d/_grid3d_fence.py,sha256=yDmKwlErNCl13vV7opJjKlzlwCzwk2gSJnzIb4jGpHg,9501
35
35
  xtgeo/grid3d/_grid3d_utils.py,sha256=VBbdzah_D8yeaMU4vMQRYTFRKq95QaGqPk4oXYBWdHw,7477
36
36
  xtgeo/grid3d/_grid_boundary.py,sha256=xNumtMeOfjmwS5vzv1Nl_yZpGiDEQXk896pXzugdUVs,2384
37
- xtgeo/grid3d/_grid_etc1.py,sha256=fhjSSt1QDbXBX4FadWkufH7Q4jOquIbIaBNWC3yUI7Q,44538
37
+ xtgeo/grid3d/_grid_etc1.py,sha256=VAdNNruPf_xq8vW9kX7-ICHINafdOuEYILBjLCsqHGo,44747
38
38
  xtgeo/grid3d/_grid_export.py,sha256=krz3cL-38QYa4x7RjIH_1JyiNVMtyOpL3ZVWnfUmAWo,7391
39
39
  xtgeo/grid3d/_grid_hybrid.py,sha256=4xtZlZSzn0BY8Kl8TY6Su3QtCH16ax-Tf49ItvHaRPk,1666
40
40
  xtgeo/grid3d/_grid_import.py,sha256=Y11JDjf5tZkDth69aTtbkMfMjRbVvSnQbV3lt-jCuA8,2672
@@ -57,14 +57,14 @@ xtgeo/grid3d/_gridprops_import_eclrun.py,sha256=M7hvBazZPjYsKOYBL1SHCcYqztgonARu
57
57
  xtgeo/grid3d/_gridprops_import_roff.py,sha256=fCCMwa8OgLXk9zMvFpr4nfsKLkmBFKKLSfLwUHenyTA,2550
58
58
  xtgeo/grid3d/_roff_grid.py,sha256=kppx044-JmfLvaIt5NPABnIoLwJ1BGQc2gFeog7Cl0g,17742
59
59
  xtgeo/grid3d/_roff_parameter.py,sha256=9gVlFMyT2QbwUvm_FCJG0hTvJPrK2Y86kbeljs2eCbc,11376
60
- xtgeo/grid3d/grid.py,sha256=TcQzPUxUYHilN3qmgZ29wWLchNoRY714O_2uh94l15U,107808
60
+ xtgeo/grid3d/grid.py,sha256=AY91CcoeaZQtEAyuHz1UmZROh6VPq2z56CKBbG6Dn9g,108604
61
61
  xtgeo/grid3d/grid_properties.py,sha256=OlIyo1PXrTRFHGn8avXdBXNpFM5DJuLjVRB9koayKGQ,24993
62
62
  xtgeo/grid3d/grid_property.py,sha256=Fd1CC2_pSg4cLS7EGHHtDhSIk8w3VRrQ_fXUX3-1mMo,46687
63
63
  xtgeo/grid3d/types.py,sha256=eaBHJL91zXV0ipaY30K_ZpEdUfjj681CoAbKfvNZ_5Q,290
64
64
  xtgeo/io/__init__.py,sha256=k5OQUG7ePoTleAh8ECiwowCg1imL6dx9O7gPUArcQQw,23
65
65
  xtgeo/io/_file.py,sha256=-bacKEMpbPMF1al3gqoV5pu0J57g26mRdSasxNk20Gg,21085
66
66
  xtgeo/metadata/__init__.py,sha256=VV81ga8OzzrowieSQZ5bZxo3Ug70Dch89iwZF1mOshA,337
67
- xtgeo/metadata/metadata.py,sha256=HD98hyOA1gb0nazvgE7KoXuGBMJ4wsQa1wi1tqL7GDM,12568
67
+ xtgeo/metadata/metadata.py,sha256=0EVNcXXDh3mimYNZYW3FIYe3bXIzeEKRyqZOzBhu31E,12874
68
68
  xtgeo/roxutils/__init__.py,sha256=_f2qb32IFeZ_8YhcTDFlNgsWyH0HPDJQ7V0qUbjmUSs,99
69
69
  xtgeo/roxutils/_roxar_loader.py,sha256=mKg3SsHJDzaGEYQwuY2yPcTxOnCybKmq3IeLmteCJPg,1958
70
70
  xtgeo/roxutils/_roxutils_etc.py,sha256=Lma5Hskrld2PDLicSTkASse2t3eqxvtnure9uDCyjxo,3852
@@ -111,7 +111,7 @@ xtgeo/xyz/_xyz_oper.py,sha256=_uCR-PYEsPQkBKh82oDvUsz7Y2vqsjqoiEdfmd8HIEU,20058
111
111
  xtgeo/xyz/_xyz_roxapi.py,sha256=NWgnPShA8amuHgSTqvy5_y21Qyx2s_6IWP1qPyHTPb8,26585
112
112
  xtgeo/xyz/points.py,sha256=UhcdR7nEw3Lxa496UMOWOm5IkpQLC_IRU0FcFLpEV-o,23253
113
113
  xtgeo/xyz/polygons.py,sha256=JjvA5BiW0HzaVmuZjnKB55n0OJXZfjOBQHfSNcZBDiA,28791
114
- xtgeo-4.10.1.dist-info/METADATA,sha256=BgjBbVjXQOmIf5Rb2f9KsWqpP5CMTilfqnLgm5kLzqw,5789
115
- xtgeo-4.10.1.dist-info/WHEEL,sha256=9y7ongB9C9SKxcdQbfZEuRQ0kgbFdtXA-x9tA6LgmEA,106
116
- xtgeo-4.10.1.dist-info/licenses/LICENSE.md,sha256=fTqV5eBpeAZO0_jit8j4Ref9ikBSlHJ8xwj5TLg7gFk,7817
117
- xtgeo-4.10.1.dist-info/RECORD,,
114
+ xtgeo-4.11.0.dist-info/METADATA,sha256=_ORJH3UT7GiS4VR4R8EJ5sw4uahZ_BjT6yugeM_76sU,5789
115
+ xtgeo-4.11.0.dist-info/WHEEL,sha256=_PdgJ-W7uMAsWwnGnEdiicDU_PKcobRdffEM23gmN6g,106
116
+ xtgeo-4.11.0.dist-info/licenses/LICENSE.md,sha256=fTqV5eBpeAZO0_jit8j4Ref9ikBSlHJ8xwj5TLg7gFk,7817
117
+ xtgeo-4.11.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: scikit-build-core 0.11.4
2
+ Generator: scikit-build-core 0.11.5
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp313-cp313-win_amd64
5
5