resqpy 4.15.2__py3-none-any.whl → 4.15.3__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.15.2" # Set at build time
31
+ __version__ = "4.15.3" # Set at build time
32
32
  log = logging.getLogger(__name__)
33
33
  log.info(f"Imported resqpy version {__version__}")
@@ -122,6 +122,7 @@ class Surface(rqsb.BaseSurface):
122
122
  self.set_from_mesh_file(mesh_file, mesh_format, quad_triangles = quad_triangles)
123
123
  elif tsurf_file is not None:
124
124
  self.set_from_tsurf_file(tsurf_file)
125
+ self._load_normal_vector_from_extra_metadata()
125
126
 
126
127
  @classmethod
127
128
  def from_tri_mesh(cls, tri_mesh, exclude_nans = False):
@@ -715,7 +716,7 @@ class Surface(rqsb.BaseSurface):
715
716
 
716
717
  _, p = self.triangles_and_points()
717
718
  crs = rqc.Crs(self.model, uuid = self.crs_uuid)
718
- if crs.xy_units == self.z_units:
719
+ if crs.xy_units == crs.z_units:
719
720
  return p
720
721
  unit_adjusted_p = p.copy()
721
722
  wam.convert_lengths(unit_adjusted_p[:, 2], crs.z_units, crs.xy_units)
@@ -1203,7 +1204,12 @@ class Surface(rqsb.BaseSurface):
1203
1204
  if not self.title:
1204
1205
  self.title = 'surface'
1205
1206
 
1206
- tri_rep = super().create_xml(add_as_part = False, title = title, originator = originator)
1207
+ em = None
1208
+ if self.normal_vector is not None:
1209
+ assert len(self.normal_vector) == 3
1210
+ em = {'normal vector': f'{self.normal_vector[0]},{self.normal_vector[1]},{self.normal_vector[2]}'}
1211
+
1212
+ tri_rep = super().create_xml(add_as_part = False, title = title, originator = originator, extra_metadata = em)
1207
1213
 
1208
1214
  # todo: if crs_uuid is None, attempt to set to surface patch crs uuid (within patch loop, below)
1209
1215
  if crs_uuid is not None:
@@ -1309,6 +1315,16 @@ class Surface(rqsb.BaseSurface):
1309
1315
 
1310
1316
  return tri_rep
1311
1317
 
1318
+ def _load_normal_vector_from_extra_metadata(self):
1319
+ if self.normal_vector is None and self.extra_metadata is not None:
1320
+ nv_str = self.extra_metadata.get('normal vector')
1321
+ if nv_str is not None:
1322
+ nv_words = nv_str.split(',')
1323
+ assert len(nv_words) == 3, f'failed to convert normal vector string into triplet: {nv_str}'
1324
+ self.normal_vector = np.empty(3, dtype = float)
1325
+ for i in range(3):
1326
+ self.normal_vector[i] = float(nv_words[i])
1327
+
1312
1328
 
1313
1329
  def distill_triangle_points(t, p):
1314
1330
  """Returns a (triangles, points) pair with points distilled as only those used from p."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: resqpy
3
- Version: 4.15.2
3
+ Version: 4.15.3
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=1N5jJSAyFYcePLkWhkHyGucSXmyEQ5A6OG-E4EcXCV4,556
1
+ resqpy/__init__.py,sha256=r7QbJGeY0yRz0RSVM02LadY_UinMzGd4aFsL9UFKYZQ,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
@@ -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=bhHfIjRg9xWhv1aWW9oDhTK6LlwS5rZBST1ONJuG8pg,42192
165
165
  resqpy/surface/_pointset.py,sha256=niTkBik9hAvqrY8340K1TRG7mg4FMQbbp12WZiiXPMs,27416
166
- resqpy/surface/_surface.py,sha256=4MB3XHK6TzvYkNOZKXFZPwwqm1c6NfFpqAXmLuDg3yM,69947
166
+ resqpy/surface/_surface.py,sha256=yXWHCmcjdsqOPpoLr106VEcKRLpYxQhbm1WL9nj40Rc,70786
167
167
  resqpy/surface/_tri_mesh.py,sha256=rqWk64m9mL4Gzk-R1bI-ThA0OEBdMUFjHyezbGMd0gg,26465
168
168
  resqpy/surface/_tri_mesh_stencil.py,sha256=0FgsWSPUIIt3k9_-FURy4J2idA3Ps2AXWJpcFX1o8OU,16087
169
169
  resqpy/surface/_triangulated_patch.py,sha256=cmZVssA5Yde0JzgawkahlZFNFcmgxJS59HxirOu7nQ4,25907
@@ -194,7 +194,7 @@ resqpy/well/_wellbore_marker_frame.py,sha256=xvYH2_2Ie3a18LReFymbUrZboOx7Rhv5DOD
194
194
  resqpy/well/blocked_well_frame.py,sha256=Lg7TgynfPv9WkklXTLt9VN6uBXWUqX1LI-Xmv_FBqYk,22555
195
195
  resqpy/well/well_object_funcs.py,sha256=LYTcC07ezlBxClfrug_B4iXXZUkXDPgsVufNzp361Wo,24703
196
196
  resqpy/well/well_utils.py,sha256=zwpYjT85nXAwWBhYB1Pygu2SgouZ-44k6hEOnpoMfBI,5969
197
- resqpy-4.15.2.dist-info/LICENSE,sha256=2duHPIkKQyESMdQ4hKjL8CYEsYRHXaYxt0YQkzsUYE4,1059
198
- resqpy-4.15.2.dist-info/METADATA,sha256=BZlYamJi7EBFtoNIK9fEbBpvcqj1FuFqwuGcouzC1JU,4028
199
- resqpy-4.15.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
200
- resqpy-4.15.2.dist-info/RECORD,,
197
+ resqpy-4.15.3.dist-info/LICENSE,sha256=2duHPIkKQyESMdQ4hKjL8CYEsYRHXaYxt0YQkzsUYE4,1059
198
+ resqpy-4.15.3.dist-info/METADATA,sha256=NiXPxrPsYq6wDzVcv6l38349rvPD7ZGhGdiQMjKbQZE,4028
199
+ resqpy-4.15.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
200
+ resqpy-4.15.3.dist-info/RECORD,,