resqpy 5.1.0__py3-none-any.whl → 5.1.2__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/model/_forestry.py +12 -6
- resqpy/multi_processing/wrappers/grid_surface_mp.py +3 -2
- resqpy/olio/vector_utilities.py +18 -0
- resqpy/surface/_surface.py +19 -15
- {resqpy-5.1.0.dist-info → resqpy-5.1.2.dist-info}/METADATA +1 -1
- {resqpy-5.1.0.dist-info → resqpy-5.1.2.dist-info}/RECORD +9 -9
- {resqpy-5.1.0.dist-info → resqpy-5.1.2.dist-info}/LICENSE +0 -0
- {resqpy-5.1.0.dist-info → resqpy-5.1.2.dist-info}/WHEEL +0 -0
    
        resqpy/__init__.py
    CHANGED
    
    
    
        resqpy/model/_forestry.py
    CHANGED
    
    | @@ -686,17 +686,23 @@ def _copy_referenced_parts(model, other_model, realization, consolidate, force, | |
| 686 686 | 
             
                        resident_uuid_int = model.consolidation.map[ref_uuid_int]
         | 
| 687 687 | 
             
                        assert resident_uuid_int is not None
         | 
| 688 688 | 
             
                        # find referring node for ref_uuid_int and modify its reference to resident_uuid_int
         | 
| 689 | 
            -
                        if reference_node_dict is None:
         | 
| 689 | 
            +
                        if reference_node_dict is None:  # now mapping uuid int to list of nodes
         | 
| 690 690 | 
             
                            ref_nodes = rqet.list_obj_references(root_node)
         | 
| 691 691 | 
             
                            reference_node_dict = {}
         | 
| 692 692 | 
             
                            for ref_node in ref_nodes:
         | 
| 693 693 | 
             
                                uuid_node = rqet.find_tag(ref_node, 'UUID')
         | 
| 694 694 | 
             
                                uuid_int = bu.uuid_from_string(uuid_node.text).int
         | 
| 695 | 
            -
                                 | 
| 696 | 
            -
             | 
| 697 | 
            -
             | 
| 698 | 
            -
             | 
| 699 | 
            -
                         | 
| 695 | 
            +
                                if uuid_int in reference_node_dict:
         | 
| 696 | 
            +
                                    reference_node_dict[uuid_int].append(uuid_node)
         | 
| 697 | 
            +
                                else:
         | 
| 698 | 
            +
                                    reference_node_dict[uuid_int] = [uuid_node]
         | 
| 699 | 
            +
                        uuid_node_list = reference_node_dict.pop(ref_uuid_int)
         | 
| 700 | 
            +
                        for uuid_node in uuid_node_list:
         | 
| 701 | 
            +
                            uuid_node.text = str(bu.uuid_from_int(resident_uuid_int))
         | 
| 702 | 
            +
                        if resident_uuid_int in reference_node_dict:
         | 
| 703 | 
            +
                            reference_node_dict[resident_uuid_int] += uuid_node_list
         | 
| 704 | 
            +
                        else:
         | 
| 705 | 
            +
                            reference_node_dict[resident_uuid_int] = uuid_node_list
         | 
| 700 706 |  | 
| 701 707 |  | 
| 702 708 | 
             
            def _copy_relationships_for_present_targets(model, other_model, consolidate, force, resident_uuid, root_node):
         | 
| @@ -161,7 +161,8 @@ def find_faces_to_represent_surface_regular_wrapper( | |
| 161 161 | 
             
                if flange_radius is None:
         | 
| 162 162 | 
             
                    flange_radius = 5.0 * np.sum(np.array(grid.extent_kji, dtype = float) * np.array(grid.aligned_dxyz()))
         | 
| 163 163 | 
             
                s_model = rq.Model(surface_epc, quiet = True)
         | 
| 164 | 
            -
                 | 
| 164 | 
            +
                surface_uuid = str(surface_uuid)
         | 
| 165 | 
            +
                model.copy_uuid_from_other_model(s_model, uuid = surface_uuid)
         | 
| 165 166 | 
             
                if surface_patching_property_uuid is not None:
         | 
| 166 167 | 
             
                    model.copy_uuid_from_other_model(s_model, uuid = surface_patching_property_uuid)
         | 
| 167 168 | 
             
                    uuid_list.append(surface_patching_property_uuid)
         | 
| @@ -213,7 +214,7 @@ def find_faces_to_represent_surface_regular_wrapper( | |
| 213 214 | 
             
                    inherit_interpretation_relationship(model, surface_uuid, surf.uuid)
         | 
| 214 215 | 
             
                    surface_uuid = surf.uuid
         | 
| 215 216 |  | 
| 216 | 
            -
                surface = rqs.Surface(parent_model = model, uuid =  | 
| 217 | 
            +
                surface = rqs.Surface(parent_model = model, uuid = surface_uuid)
         | 
| 217 218 | 
             
                surf_title = surface.title
         | 
| 218 219 | 
             
                assert surf_title
         | 
| 219 220 | 
             
                surface.change_crs(grid.crs)
         | 
    
        resqpy/olio/vector_utilities.py
    CHANGED
    
    | @@ -1363,6 +1363,24 @@ def triangle_normal_vector_numba(points):  # pragma: no cover | |
| 1363 1363 | 
             
                return v / np.linalg.norm(v)
         | 
| 1364 1364 |  | 
| 1365 1365 |  | 
| 1366 | 
            +
            @njit
         | 
| 1367 | 
            +
            def triangles_normal_vectors(t: np.ndarray, p: np.ndarray) -> np.ndarray:  # pragma: no cover
         | 
| 1368 | 
            +
                """For a triangulated set, return an array of unit normal vectors (one per triangle).
         | 
| 1369 | 
            +
             | 
| 1370 | 
            +
                note:
         | 
| 1371 | 
            +
                    resulting vectors implicitly assume that xy & z units are the same; if this is not the case, adjust vectors
         | 
| 1372 | 
            +
                    afterwards as required
         | 
| 1373 | 
            +
                """
         | 
| 1374 | 
            +
                nv = np.empty((len(t), 3), dtype = np.float64)
         | 
| 1375 | 
            +
                v = np.zeros(3, dtype = np.float64)
         | 
| 1376 | 
            +
                for ti in range(len(t)):
         | 
| 1377 | 
            +
                    v[:] = np.cross(p[t[ti, 0]] - p[t[ti, 1]], p[t[ti, 0]] - p[t[ti, 2]])
         | 
| 1378 | 
            +
                    if v[2] < 0.0:
         | 
| 1379 | 
            +
                        v[:] = -v
         | 
| 1380 | 
            +
                    nv[ti, :] = v / np.linalg.norm(v)
         | 
| 1381 | 
            +
                return nv
         | 
| 1382 | 
            +
             | 
| 1383 | 
            +
             | 
| 1366 1384 | 
             
            def in_circumcircle(a, b, c, d):
         | 
| 1367 1385 | 
             
                """Returns True if point d lies within the circumcircle pf ccw points a, b, c, projected onto xy plane.
         | 
| 1368 1386 |  | 
    
        resqpy/surface/_surface.py
    CHANGED
    
    | @@ -480,28 +480,32 @@ class Surface(rqsb.BaseSurface): | |
| 480 480 |  | 
| 481 481 | 
             
                    old_crs = rqc.Crs(self.model, uuid = self.crs_uuid)
         | 
| 482 482 | 
             
                    self.crs_uuid = required_crs.uuid
         | 
| 483 | 
            -
                    if required_crs  | 
| 483 | 
            +
                    if bu.matching_uuids(required_crs.uuid, old_crs.uuid) or not self.patch_list:
         | 
| 484 484 | 
             
                        log.debug(f'no crs change needed for {self.title}')
         | 
| 485 485 | 
             
                        return
         | 
| 486 | 
            +
                    equivalent_crs = (required_crs == old_crs)
         | 
| 486 487 | 
             
                    log.debug(f'crs change needed for {self.title} from {old_crs.title} to {required_crs.title}')
         | 
| 487 488 | 
             
                    for patch in self.patch_list:
         | 
| 488 | 
            -
                        patch. | 
| 489 | 
            -
                         | 
| 489 | 
            +
                        assert bu.matching_uuids(patch.crs_uuid, old_crs.uuid)
         | 
| 490 | 
            +
                        if not equivalent_crs:
         | 
| 491 | 
            +
                            patch.triangles_and_points()
         | 
| 492 | 
            +
                            required_crs.convert_array_from(old_crs, patch.points)
         | 
| 490 493 | 
             
                        patch.crs_uuid = self.crs_uuid
         | 
| 491 494 | 
             
                    self.triangles = None  # clear cached arrays for surface
         | 
| 492 495 | 
             
                    self.points = None
         | 
| 493 | 
            -
                    if  | 
| 494 | 
            -
                         | 
| 495 | 
            -
             | 
| 496 | 
            -
             | 
| 497 | 
            -
                        if  | 
| 498 | 
            -
                             | 
| 499 | 
            -
             | 
| 500 | 
            -
             | 
| 501 | 
            -
             | 
| 502 | 
            -
                             | 
| 503 | 
            -
             | 
| 504 | 
            -
                             | 
| 496 | 
            +
                    if not equivalent_crs:
         | 
| 497 | 
            +
                        if self.extra_metadata.pop('rotation matrix', None) is not None:
         | 
| 498 | 
            +
                            log.warning(f'discarding rotation matrix extra metadata during crs change of: {self.title}')
         | 
| 499 | 
            +
                        self._load_normal_vector_from_extra_metadata()
         | 
| 500 | 
            +
                        if self.normal_vector is not None:
         | 
| 501 | 
            +
                            if required_crs.z_inc_down != old_crs.z_inc_down:
         | 
| 502 | 
            +
                                self.normal_vector[2] = -self.normal_vector[2]
         | 
| 503 | 
            +
                            theta = (wam.convert(required_crs.rotation, required_crs.rotation_units, 'dega') -
         | 
| 504 | 
            +
                                     wam.convert(old_crs.rotation, old_crs.rotation_units, 'dega'))
         | 
| 505 | 
            +
                            if not maths.isclose(theta, 0.0):
         | 
| 506 | 
            +
                                self.normal_vector = vec.rotate_vector(vec.rotation_matrix_3d_axial(2, theta), self.normal_vector)
         | 
| 507 | 
            +
                            self.extra_metadata['normal vector'] = str(
         | 
| 508 | 
            +
                                f'{self.normal_vector[0]},{self.normal_vector[1]},{self.normal_vector[2]}')
         | 
| 505 509 | 
             
                    self.uuid = bu.new_uuid()  # hope this doesn't cause problems
         | 
| 506 510 | 
             
                    assert self.root is None
         | 
| 507 511 |  | 
| @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            resqpy/__init__.py,sha256= | 
| 1 | 
            +
            resqpy/__init__.py,sha256=nPyHkDD2AePG2ykxW2-G7TGyU-7gCdeuHCDUvEZ2J4I,555
         | 
| 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
         | 
| @@ -59,7 +59,7 @@ resqpy/lines/_polyline_set.py,sha256=3K3z_G9l_3mfjLdCL-YVscyj1FA6DHh1uj9rXPtWFOY | |
| 59 59 | 
             
            resqpy/model/__init__.py,sha256=hbxO-IpCOH_82TZqj6e1FjrWxO0tZu2gj2HCN9x-Svw,378
         | 
| 60 60 | 
             
            resqpy/model/_catalogue.py,sha256=duvZlNlTPjAfXyqae0J9lMSEx_8-WIcrw2MYxnNEg_Q,30487
         | 
| 61 61 | 
             
            resqpy/model/_context.py,sha256=0tLBVMcuuIj3i87Ig8lhFMLHE5GHgEA2PEl1NjKaohc,2840
         | 
| 62 | 
            -
            resqpy/model/_forestry.py,sha256= | 
| 62 | 
            +
            resqpy/model/_forestry.py,sha256=42dMwqdvxdRYYwqVSC4ky2iDp9hmqUEEtX2mxMVMLeA,34884
         | 
| 63 63 | 
             
            resqpy/model/_grids.py,sha256=d7hRQRmni5pJrm1CY31D2icJV1XDar7xTmUexq_eVGY,3371
         | 
| 64 64 | 
             
            resqpy/model/_hdf5.py,sha256=-dq2r3HzBKf0F43kwPy--MZOOjQZlDS4RJ6nG3VOeSs,14448
         | 
| 65 65 | 
             
            resqpy/model/_model.py,sha256=ZhOkZ-n8k1cKBQODcDzASwq_JrBhmYcdIwOAVk7g9q4,106326
         | 
| @@ -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= | 
| 71 | 
            +
            resqpy/multi_processing/wrappers/grid_surface_mp.py,sha256=SkobxBOU-xnojll-TewNoiuVQA9IrG2DXGg8fq7IL14,27083
         | 
| 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
         | 
| @@ -97,7 +97,7 @@ resqpy/olio/transmission.py,sha256=auz_12TKtSPy6Fv3wmKn5lXPRAEnn2tYVyTQfsj37xU,6 | |
| 97 97 | 
             
            resqpy/olio/triangulation.py,sha256=sBNP4MhSpY2bv6BYIn7890stqetkK5dag9pYNFiUs2g,46037
         | 
| 98 98 | 
             
            resqpy/olio/uuid.py,sha256=JRMi-RZNeGm8tGNloIwTATzNtdj29lBQDV9OILboPRI,7324
         | 
| 99 99 | 
             
            resqpy/olio/vdb.py,sha256=lQYuK1kr1Wnucq2EoKgT6lrR7vloCemnCKZktzBcLUc,45231
         | 
| 100 | 
            -
            resqpy/olio/vector_utilities.py,sha256= | 
| 100 | 
            +
            resqpy/olio/vector_utilities.py,sha256=T8n9JMhE13msuy1dwJeIWw6ByKbm2o4zUV8l5frVsuk,61784
         | 
| 101 101 | 
             
            resqpy/olio/volume.py,sha256=inKZzW8UiYvyetltz_r_OgO3UzVtqdOz_RMg-WqlyDo,5475
         | 
| 102 102 | 
             
            resqpy/olio/wellspec_keywords.py,sha256=ad3B727golWYiko54OZOw7vG21IvpNxCMCyLv8jSkcI,26533
         | 
| 103 103 | 
             
            resqpy/olio/write_data.py,sha256=bIX7ilMkXWCMz_zQh-Gqk56sNzng4W5l4BahW2EV7Kw,5142
         | 
| @@ -162,7 +162,7 @@ resqpy/surface/_base_surface.py,sha256=LsWrDrbuuaEVRgf2Dlbc-6ZvGQpjtrKuxF7Jjebvl | |
| 162 162 | 
             
            resqpy/surface/_combined_surface.py,sha256=8TnNbSywjej6tW_vRr5zoVgBbvnadCaqWk6WyHWHTYQ,3082
         | 
| 163 163 | 
             
            resqpy/surface/_mesh.py,sha256=yEFldNWT2g8MCGcU4mTeWzDrLHHGLLGLIle1gAjJ_lg,42352
         | 
| 164 164 | 
             
            resqpy/surface/_pointset.py,sha256=niTkBik9hAvqrY8340K1TRG7mg4FMQbbp12WZiiXPMs,27416
         | 
| 165 | 
            -
            resqpy/surface/_surface.py,sha256= | 
| 165 | 
            +
            resqpy/surface/_surface.py,sha256=w57Us5G7MYGXqTHE-VWFKgJ0M1sF5mHNJtMUV1mhUr8,94081
         | 
| 166 166 | 
             
            resqpy/surface/_tri_mesh.py,sha256=f2BiGYNj5v8CgmWJKEZ7aKp1WX9iWX4myETCjVQ5dCA,26746
         | 
| 167 167 | 
             
            resqpy/surface/_tri_mesh_stencil.py,sha256=eXt_HIKvsXGsjQ7nm_NbozR6ProQxPbeO52r79j80ig,16087
         | 
| 168 168 | 
             
            resqpy/surface/_triangulated_patch.py,sha256=FKn_Irzp4aLFkkN_-tx1MLMKjEAiOLE8636sOA481TQ,26802
         | 
| @@ -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. | 
| 197 | 
            -
            resqpy-5.1. | 
| 198 | 
            -
            resqpy-5.1. | 
| 199 | 
            -
            resqpy-5.1. | 
| 196 | 
            +
            resqpy-5.1.2.dist-info/LICENSE,sha256=2duHPIkKQyESMdQ4hKjL8CYEsYRHXaYxt0YQkzsUYE4,1059
         | 
| 197 | 
            +
            resqpy-5.1.2.dist-info/METADATA,sha256=VG951DevQ1K1XVYBB8GSkMCea7HzDyDAPcisC8RevW4,4026
         | 
| 198 | 
            +
            resqpy-5.1.2.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
         | 
| 199 | 
            +
            resqpy-5.1.2.dist-info/RECORD,,
         | 
| 
            File without changes
         | 
| 
            File without changes
         |