resqpy 4.16.5__py3-none-any.whl → 4.16.7__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 +1 -1
- resqpy/fault/_grid_connection_set.py +15 -11
- resqpy/model/_hdf5.py +8 -0
- resqpy/model/_model.py +15 -0
- {resqpy-4.16.5.dist-info → resqpy-4.16.7.dist-info}/METADATA +1 -1
- {resqpy-4.16.5.dist-info → resqpy-4.16.7.dist-info}/RECORD +8 -8
- {resqpy-4.16.5.dist-info → resqpy-4.16.7.dist-info}/LICENSE +0 -0
- {resqpy-4.16.5.dist-info → resqpy-4.16.7.dist-info}/WHEEL +0 -0
    
        resqpy/__init__.py
    CHANGED
    
    
| @@ -249,6 +249,7 @@ class GridConnectionSet(BaseResqpy): | |
| 249 249 | 
             
                    gcs.model = parent_model
         | 
| 250 250 | 
             
                    gcs.uuid = bu.new_uuid()  # not strictly necessary as append will cause a new uuid as well
         | 
| 251 251 | 
             
                    gcs.title = title
         | 
| 252 | 
            +
                    gcs.property_collection = None
         | 
| 252 253 | 
             
                    # append data from the remaining grid connection sets
         | 
| 253 254 | 
             
                    for another_uuid in gcs_uuid_list[1:]:
         | 
| 254 255 | 
             
                        another_gcs = GridConnectionSet(source_model, uuid = another_uuid)
         | 
| @@ -2089,6 +2090,7 @@ class GridConnectionSet(BaseResqpy): | |
| 2089 2090 | 
             
                    if default_value is None:
         | 
| 2090 2091 | 
             
                        default_value = -1 if dtype is int else np.NaN
         | 
| 2091 2092 | 
             
                    gcs_prop_array = gcs_prop.array_ref()
         | 
| 2093 | 
            +
                    assert gcs_prop_array.shape == (self.count,)
         | 
| 2092 2094 | 
             
                    log.debug(f'preparing grid face arrays from gcs property: {gcs_prop.title}; from gcs:{self.title}')
         | 
| 2093 2095 |  | 
| 2094 2096 | 
             
                    baffle_mask = None
         | 
| @@ -2102,29 +2104,31 @@ class GridConnectionSet(BaseResqpy): | |
| 2102 2104 | 
             
                    ai = np.full((nk, nj, ni + 1), default_value, dtype = dtype)
         | 
| 2103 2105 |  | 
| 2104 2106 | 
             
                    # populate arrays from faces of gcs, optionally filtered by feature index
         | 
| 2105 | 
            -
                    cip, fip = self.list_of_cell_face_pairs_for_feature_index( | 
| 2106 | 
            -
                    assert len(cip) == self.count and len(fip) == self.count
         | 
| 2107 | 
            -
                    assert gcs_prop_array.shape == (self.count,)
         | 
| 2108 | 
            -
                    if feature_index is None:
         | 
| 2109 | 
            -
                        indices = np.arange(self.count, dtype = int)
         | 
| 2110 | 
            -
                    else:
         | 
| 2111 | 
            -
                        indices = self.indices_for_feature_index(feature_index)
         | 
| 2112 | 
            -
             | 
| 2113 | 
            -
                    side_list = ([0] if lazy else [0, 1])
         | 
| 2107 | 
            +
                    cip, fip = self.list_of_cell_face_pairs_for_feature_index(feature_index)
         | 
| 2114 2108 |  | 
| 2115 2109 | 
             
                    value_array = gcs_prop_array.copy()
         | 
| 2110 | 
            +
             | 
| 2116 2111 | 
             
                    if baffle_mask is not None:
         | 
| 2117 2112 | 
             
                        value_array[baffle_mask] = 0  # will be cast to float (or bool) if needed
         | 
| 2113 | 
            +
             | 
| 2114 | 
            +
                    if feature_index is not None:
         | 
| 2115 | 
            +
                        indices = self.indices_for_feature_index(feature_index)
         | 
| 2116 | 
            +
                        value_array = value_array[indices]
         | 
| 2117 | 
            +
                        if active_mask is not None:
         | 
| 2118 | 
            +
                            active_mask = active_mask[indices]
         | 
| 2119 | 
            +
             | 
| 2118 2120 | 
             
                    if active_mask is not None:
         | 
| 2119 2121 | 
             
                        cip = cip[active_mask, :, :]
         | 
| 2120 2122 | 
             
                        value_array = value_array[active_mask]
         | 
| 2121 2123 |  | 
| 2124 | 
            +
                    side_list = ([0] if lazy else [0, 1])
         | 
| 2125 | 
            +
             | 
| 2122 2126 | 
             
                    for side in side_list:
         | 
| 2123 2127 | 
             
                        cell_kji0 = cip[:, side].copy()  # shape (N, 3)
         | 
| 2124 2128 | 
             
                        axis = fip[:, side, 0]  # shape (N,)
         | 
| 2125 2129 | 
             
                        polarity = fip[:, side, 1]  # shape (N,)
         | 
| 2126 | 
            -
                        assert 0 <= np.min(axis) and np.max(axis) <= 2
         | 
| 2127 | 
            -
                        assert 0 <= np.min(polarity) and np.max(polarity) <= 1
         | 
| 2130 | 
            +
                        # assert 0 <= np.min(axis) and np.max(axis) <= 2
         | 
| 2131 | 
            +
                        # assert 0 <= np.min(polarity) and np.max(polarity) <= 1
         | 
| 2128 2132 |  | 
| 2129 2133 | 
             
                        axis_mask = (axis == 0).astype(bool)
         | 
| 2130 2134 | 
             
                        ak_kji0 = cell_kji0[axis_mask, :]
         | 
    
        resqpy/model/_hdf5.py
    CHANGED
    
    | @@ -286,6 +286,14 @@ def _h5_overwrite_array_slice(model, h5_key_pair, slice_tuple, array_slice): | |
| 286 286 | 
             
                dset[slice_tuple] = array_slice
         | 
| 287 287 |  | 
| 288 288 |  | 
| 289 | 
            +
            def _h5_overwrite_array(model, h5_key_pair, array):
         | 
| 290 | 
            +
                """Overwrites (updates) the whole of an hdf5 array."""
         | 
| 291 | 
            +
             | 
| 292 | 
            +
                h5_root = _h5_access(model, h5_key_pair[0], mode = 'a')
         | 
| 293 | 
            +
                dset = h5_root[h5_key_pair[1]]
         | 
| 294 | 
            +
                dset[...] = array
         | 
| 295 | 
            +
             | 
| 296 | 
            +
             | 
| 289 297 | 
             
            def h5_clear_filename_cache(model):
         | 
| 290 298 | 
             
                """Clears the cached filenames associated with all ext uuids."""
         | 
| 291 299 |  | 
    
        resqpy/model/_model.py
    CHANGED
    
    | @@ -1475,6 +1475,21 @@ class Model(): | |
| 1475 1475 |  | 
| 1476 1476 | 
             
                    return m_h._h5_overwrite_array_slice(self, h5_key_pair, slice_tuple, array_slice)
         | 
| 1477 1477 |  | 
| 1478 | 
            +
                def h5_overwrite_array(self, h5_key_pair, array):
         | 
| 1479 | 
            +
                    """Overwrites (updates) the whole of an hdf5 array.
         | 
| 1480 | 
            +
             | 
| 1481 | 
            +
                    arguments:
         | 
| 1482 | 
            +
                       h5_key_pair (uuid, string): the uuid of the hdf5 ext part and the hdf5 internal path to the
         | 
| 1483 | 
            +
                          required hdf5 array
         | 
| 1484 | 
            +
                       array (numpy array of shape to match existing hdf5 dataset): the data to write
         | 
| 1485 | 
            +
             | 
| 1486 | 
            +
                    notes:
         | 
| 1487 | 
            +
                       this method naively updates an hdf5 array without using mpi to look after parallel updates;
         | 
| 1488 | 
            +
                       metadata (such as uuid or property min, max values) is not modified in any way by the method
         | 
| 1489 | 
            +
                    """
         | 
| 1490 | 
            +
             | 
| 1491 | 
            +
                    return m_h._h5_overwrite_array(self, h5_key_pair, array)
         | 
| 1492 | 
            +
             | 
| 1478 1493 | 
             
                def h5_clear_filename_cache(self):
         | 
| 1479 1494 | 
             
                    """Clears the cached filenames associated with all ext uuids."""
         | 
| 1480 1495 |  | 
| @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            resqpy/__init__.py,sha256= | 
| 1 | 
            +
            resqpy/__init__.py,sha256=UxKXI8Fd5rwd7CjVK-yvaBPFhw8-s2GsvgMQgWAy-Wc,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=wMP4gnzT6Smv1RKGex0fdcadzj2xmanyusNA-D_ebfI,29569
         | 
| 28 | 
            -
            resqpy/fault/_grid_connection_set.py,sha256= | 
| 28 | 
            +
            resqpy/fault/_grid_connection_set.py,sha256=O8VQcGZlQNWgnLS_SvGAUc_l5lAvSDK2BHZK5EUf404,117264
         | 
| 29 29 | 
             
            resqpy/grid/__init__.py,sha256=WsfOnR5lHcnpJEx8ZZ3lhd4dImEiieJLM7eFPxMi3u8,692
         | 
| 30 30 | 
             
            resqpy/grid/_cell_properties.py,sha256=pbyAK2eV9n4teOxm2q5hyBinohEbevFPrCfMcpGiqUU,20689
         | 
| 31 31 | 
             
            resqpy/grid/_connection_sets.py,sha256=-277bh9pMoeESSzy9oZehL-vc82aMGZuSLQs2KJ4Wfg,10120
         | 
| @@ -62,8 +62,8 @@ resqpy/model/_catalogue.py,sha256=duvZlNlTPjAfXyqae0J9lMSEx_8-WIcrw2MYxnNEg_Q,30 | |
| 62 62 | 
             
            resqpy/model/_context.py,sha256=0tLBVMcuuIj3i87Ig8lhFMLHE5GHgEA2PEl1NjKaohc,2840
         | 
| 63 63 | 
             
            resqpy/model/_forestry.py,sha256=QYE3P9uSsh77J6ghcgp2cBQP6UKrs8edF-m05sqgboo,34518
         | 
| 64 64 | 
             
            resqpy/model/_grids.py,sha256=d7hRQRmni5pJrm1CY31D2icJV1XDar7xTmUexq_eVGY,3371
         | 
| 65 | 
            -
            resqpy/model/_hdf5.py,sha256= | 
| 66 | 
            -
            resqpy/model/_model.py,sha256= | 
| 65 | 
            +
            resqpy/model/_hdf5.py,sha256=49Ip2ks7EVt6jT7STqkPNcuk1dE3XrrnlLl5TVEWH84,14469
         | 
| 66 | 
            +
            resqpy/model/_model.py,sha256=8kBehyWplIi_zYy_TVJY2V0MaVaROfOKAGEBvvrRfxk,106033
         | 
| 67 67 | 
             
            resqpy/model/_xml.py,sha256=TiZKHZezMdcjRvHSa-HzzrYe9kyDdd8L4hacNV0bjEg,24402
         | 
| 68 68 | 
             
            resqpy/multi_processing/__init__.py,sha256=ZRudHfN9aaZjxvat7t8BZr6mwMi9baiCNjczwwT0WjI,909
         | 
| 69 69 | 
             
            resqpy/multi_processing/_multiprocessing.py,sha256=bnCKfSC1tWwvZmZ7BZqCyje0C93m6q7HZPxNpx8xoxA,7301
         | 
| @@ -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.16. | 
| 198 | 
            -
            resqpy-4.16. | 
| 199 | 
            -
            resqpy-4.16. | 
| 200 | 
            -
            resqpy-4.16. | 
| 197 | 
            +
            resqpy-4.16.7.dist-info/LICENSE,sha256=2duHPIkKQyESMdQ4hKjL8CYEsYRHXaYxt0YQkzsUYE4,1059
         | 
| 198 | 
            +
            resqpy-4.16.7.dist-info/METADATA,sha256=OewCYwU0gqYSS4Gs7o4kiihxMnmLw9W8czw2zLogvN8,4028
         | 
| 199 | 
            +
            resqpy-4.16.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
         | 
| 200 | 
            +
            resqpy-4.16.7.dist-info/RECORD,,
         | 
| 
            File without changes
         | 
| 
            File without changes
         |