resqpy 5.1.11__py3-none-any.whl → 5.1.12__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__ = "5.1.11" # Set at build time
31
+ __version__ = "5.1.12" # Set at build time
32
32
  log = logging.getLogger(__name__)
33
33
  log.info(f"Imported resqpy version {__version__}")
@@ -10,6 +10,7 @@ import math as maths
10
10
  import numpy as np
11
11
  import pandas as pd
12
12
 
13
+ from typing import Optional
13
14
  import resqpy.grid as grr
14
15
  import resqpy.fault
15
16
  import resqpy.olio.read_nexus_fault as rnf
@@ -2302,8 +2303,11 @@ def _copy_organisation_objects(target_model, source_model, gcs):
2302
2303
  uuid) # will copy related features as well as interpretations
2303
2304
 
2304
2305
 
2305
- def _sort_and_remove_duplicates(a, props = None):
2306
- """Return copy of 1D array a, sorted and with duplicates removed; secondary arrays can be kept in alignment."""
2306
+ def _sort_and_remove_duplicates(a: np.ndarray, props: Optional[list[np.ndarray]] = None):
2307
+ """Return copy of 1D array a, sorted and with duplicates removed; secondary arrays can be kept in alignment.
2308
+
2309
+ note: If present, property arrays are also sorted in-place with duplicates removed.
2310
+ """
2307
2311
  if a is None or a.size <= 1:
2308
2312
  return a
2309
2313
  assert a.ndim == 1
@@ -2317,9 +2321,8 @@ def _sort_and_remove_duplicates(a, props = None):
2317
2321
  m = np.empty(a.size, dtype = bool)
2318
2322
  m[0] = True
2319
2323
  m[1:] = (a[1:] != a[:-1])
2320
- if np.all(m):
2321
- return a
2322
2324
  if not no_props:
2325
+ assert props is not None
2323
2326
  for i in range(len(props)):
2324
2327
  p = props[i][si]
2325
2328
  props[i] = p[m]
@@ -424,16 +424,7 @@ def find_faces_to_represent_surface_regular_wrapper(
424
424
  indexable_element = "cells",
425
425
  )
426
426
  elif p_name == 'flange bool':
427
- property_collection.add_cached_array_to_imported_list(
428
- array,
429
- f"from find_faces function for {surface.title}",
430
- f'{surface.title} {p_name}',
431
- discrete = True,
432
- null_value = -1,
433
- property_kind = "flange bool",
434
- realization = realisation,
435
- indexable_element = "faces",
436
- )
427
+ log.debug('flange bool processed separately to ensure correct dtype for packing')
437
428
  else:
438
429
  raise ValueError(f'unrecognised property name {p_name}')
439
430
  if property_collection.number_of_imports() > 0:
@@ -442,6 +433,26 @@ def find_faces_to_represent_surface_regular_wrapper(
442
433
  uuids_properties = property_collection.create_xml_for_imported_list_and_add_parts_to_model(
443
434
  find_local_property_kinds = True)
444
435
  uuid_list.extend(uuids_properties)
436
+
437
+ if 'flange bool' in properties.keys():
438
+ log.debug('flange bool processed separately to ensure correct dtype for packing')
439
+ p_name = 'flange bool'
440
+ array = properties['flange bool']
441
+ property_collection.add_cached_array_to_imported_list(array,
442
+ f"from find_faces function for {surface.title}",
443
+ f'{surface.title} {p_name}',
444
+ discrete = True,
445
+ null_value = -1,
446
+ property_kind = "flange bool",
447
+ realization = realisation,
448
+ indexable_element = "faces")
449
+ if property_collection.number_of_imports() > 0:
450
+ # log.debug('writing gcs property hdf5 data')
451
+ property_collection.write_hdf5_for_imported_list(use_pack = use_pack, dtype = np.int8)
452
+ uuids_properties = property_collection.create_xml_for_imported_list_and_add_parts_to_model(
453
+ find_local_property_kinds = True)
454
+ uuid_list.extend(uuids_properties)
455
+
445
456
  if grid_pc is not None and grid_pc.number_of_imports() > 0:
446
457
  # log.debug('writing grid property (bisector) hdf5 data')
447
458
  grid_pc.write_hdf5_for_imported_list(use_pack = use_pack)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: resqpy
3
- Version: 5.1.11
3
+ Version: 5.1.12
4
4
  Summary: Python API for working with RESQML models
5
5
  License: MIT
6
6
  Keywords: RESQML
@@ -1,4 +1,4 @@
1
- resqpy/__init__.py,sha256=m9JFC4Ii5VrtWGEZYLL9BYR98bJiF1BmuA3-HN9ix7E,556
1
+ resqpy/__init__.py,sha256=csBim4zh4sLjMvqtbQcxmkK9N3KOj3_pnVIpz7DiUvc,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
@@ -25,7 +25,7 @@ resqpy/derived_model/_zonal_grid.py,sha256=H-IGMudUV-tiRHZqvl9B1wxMQNjeAM2zHvTll
25
25
  resqpy/derived_model/_zone_layer_ranges_from_array.py,sha256=4pHkp7yqvkif_pC59VEK0g0JeFx7kt8mqhqADTOcucI,4358
26
26
  resqpy/fault/__init__.py,sha256=IStX_EhPnppIExf_mgYrBddC4KP26VcqblcfXiBT614,996
27
27
  resqpy/fault/_gcs_functions.py,sha256=NRyhKkYChRaKDUIQ6pfVQiD67e4TTm3LnBvWEPtpkDU,29569
28
- resqpy/fault/_grid_connection_set.py,sha256=xStOkWHsbh9m6lql7f2PDURnoFOIM1mFmx-QG6yPaKo,126124
28
+ resqpy/fault/_grid_connection_set.py,sha256=nr7Zvz7uExTchMhjDH5TUSVoqDR8ZcGdmHDIotjS3Ss,126289
29
29
  resqpy/grid/__init__.py,sha256=FTeNW9kJ8By6gA2-x-NisQQ8cY8RHCAro0lT-3ssxYQ,601
30
30
  resqpy/grid/_cell_properties.py,sha256=pbyAK2eV9n4teOxm2q5hyBinohEbevFPrCfMcpGiqUU,20689
31
31
  resqpy/grid/_connection_sets.py,sha256=-277bh9pMoeESSzy9oZehL-vc82aMGZuSLQs2KJ4Wfg,10120
@@ -68,7 +68,7 @@ resqpy/multi_processing/__init__.py,sha256=ZRudHfN9aaZjxvat7t8BZr6mwMi9baiCNjczw
68
68
  resqpy/multi_processing/_multiprocessing.py,sha256=bnCKfSC1tWwvZmZ7BZqCyje0C93m6q7HZPxNpx8xoxA,7301
69
69
  resqpy/multi_processing/wrappers/__init__.py,sha256=7vjuTWdHnp3rN9Ud8ljpDnt1NbBAyhA08lv-sQ9Kf3o,72
70
70
  resqpy/multi_processing/wrappers/blocked_well_mp.py,sha256=_2fEsSmJVQCnbQIjTHqmnNEugfhN1KvX-o4ZbvtChdI,5952
71
- resqpy/multi_processing/wrappers/grid_surface_mp.py,sha256=3dt6yj9vj3lSjqnRJ7ZTc9KySirxaRrLgd55WOhaJek,27443
71
+ resqpy/multi_processing/wrappers/grid_surface_mp.py,sha256=SzNhu8ATLkYMJS1gUFXHvkv7uClGKvHFkg5eRQ-jETw,28458
72
72
  resqpy/multi_processing/wrappers/mesh_mp.py,sha256=0VYoqtgBFfrlyYB6kkjbdrRQ5FKe6t5pHJO3wD9b8Fc,5793
73
73
  resqpy/olio/__init__.py,sha256=j2breqKYVufhw5k8qS2uZwB3tUKT7FhdZ23ninS75YA,84
74
74
  resqpy/olio/ab_toolbox.py,sha256=bZlAhOJVS0HvIYBW0Lg68re17N8eltoQhIUh0xuUyVc,2147
@@ -193,7 +193,7 @@ resqpy/well/_wellbore_marker_frame.py,sha256=xvYH2_2Ie3a18LReFymbUrZboOx7Rhv5DOD
193
193
  resqpy/well/blocked_well_frame.py,sha256=Rx8jwkCjchseDZaTttPkA1-f6l7W6vRGrxWtDHlEPx8,22560
194
194
  resqpy/well/well_object_funcs.py,sha256=1O4EVPuTn-kN3uT_V4TbSwehnMUMY0TX36XOUgasTcc,24689
195
195
  resqpy/well/well_utils.py,sha256=-g_pg2v5XD9g4SQz9sk7KK-x2xEQZHzWehCQqiEGo6M,7627
196
- resqpy-5.1.11.dist-info/LICENSE,sha256=2duHPIkKQyESMdQ4hKjL8CYEsYRHXaYxt0YQkzsUYE4,1059
197
- resqpy-5.1.11.dist-info/METADATA,sha256=gkVzn_t3EvFt34mBA4s6N0ORYZKq7JVunxs_JDzWn_c,3987
198
- resqpy-5.1.11.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
199
- resqpy-5.1.11.dist-info/RECORD,,
196
+ resqpy-5.1.12.dist-info/LICENSE,sha256=2duHPIkKQyESMdQ4hKjL8CYEsYRHXaYxt0YQkzsUYE4,1059
197
+ resqpy-5.1.12.dist-info/METADATA,sha256=MyMKuS_qJfJF9j8-62rw8qjvtmVq43Y9gaZXidK77KI,3987
198
+ resqpy-5.1.12.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
199
+ resqpy-5.1.12.dist-info/RECORD,,