subsurface-terra 2025.1.0rc15__py3-none-any.whl → 2025.1.0rc16__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.
Files changed (81) hide show
  1. subsurface/__init__.py +31 -31
  2. subsurface/_version.py +34 -21
  3. subsurface/api/__init__.py +13 -13
  4. subsurface/api/interfaces/__init__.py +3 -3
  5. subsurface/api/interfaces/stream.py +136 -136
  6. subsurface/api/reader/read_wells.py +78 -78
  7. subsurface/core/geological_formats/boreholes/_combine_trajectories.py +117 -117
  8. subsurface/core/geological_formats/boreholes/_map_attrs_to_survey.py +236 -234
  9. subsurface/core/geological_formats/boreholes/_survey_to_unstruct.py +163 -163
  10. subsurface/core/geological_formats/boreholes/boreholes.py +140 -140
  11. subsurface/core/geological_formats/boreholes/collars.py +26 -26
  12. subsurface/core/geological_formats/boreholes/survey.py +86 -86
  13. subsurface/core/geological_formats/fault.py +47 -47
  14. subsurface/core/reader_helpers/reader_unstruct.py +11 -11
  15. subsurface/core/reader_helpers/readers_data.py +130 -130
  16. subsurface/core/reader_helpers/readers_wells.py +13 -13
  17. subsurface/core/structs/__init__.py +3 -3
  18. subsurface/core/structs/base_structures/__init__.py +2 -2
  19. subsurface/core/structs/base_structures/_liquid_earth_mesh.py +121 -121
  20. subsurface/core/structs/base_structures/_unstructured_data_constructor.py +70 -70
  21. subsurface/core/structs/base_structures/base_structures_enum.py +6 -6
  22. subsurface/core/structs/base_structures/structured_data.py +282 -282
  23. subsurface/core/structs/base_structures/unstructured_data.py +319 -319
  24. subsurface/core/structs/structured_elements/octree_mesh.py +10 -10
  25. subsurface/core/structs/structured_elements/structured_grid.py +59 -59
  26. subsurface/core/structs/structured_elements/structured_mesh.py +9 -9
  27. subsurface/core/structs/unstructured_elements/__init__.py +3 -3
  28. subsurface/core/structs/unstructured_elements/line_set.py +72 -72
  29. subsurface/core/structs/unstructured_elements/point_set.py +43 -43
  30. subsurface/core/structs/unstructured_elements/tetrahedron_mesh.py +35 -35
  31. subsurface/core/structs/unstructured_elements/triangular_surface.py +62 -62
  32. subsurface/core/utils/utils_core.py +38 -38
  33. subsurface/modules/reader/__init__.py +13 -13
  34. subsurface/modules/reader/faults/faults.py +80 -80
  35. subsurface/modules/reader/from_binary.py +46 -46
  36. subsurface/modules/reader/mesh/_GOCAD_mesh.py +82 -82
  37. subsurface/modules/reader/mesh/_trimesh_reader.py +447 -447
  38. subsurface/modules/reader/mesh/csv_mesh_reader.py +53 -53
  39. subsurface/modules/reader/mesh/dxf_reader.py +177 -177
  40. subsurface/modules/reader/mesh/glb_reader.py +30 -30
  41. subsurface/modules/reader/mesh/mx_reader.py +232 -232
  42. subsurface/modules/reader/mesh/obj_reader.py +53 -53
  43. subsurface/modules/reader/mesh/omf_mesh_reader.py +43 -43
  44. subsurface/modules/reader/mesh/surface_reader.py +56 -56
  45. subsurface/modules/reader/mesh/surfaces_api.py +41 -41
  46. subsurface/modules/reader/profiles/__init__.py +3 -3
  47. subsurface/modules/reader/profiles/profiles_core.py +197 -197
  48. subsurface/modules/reader/read_netcdf.py +38 -38
  49. subsurface/modules/reader/topography/__init__.py +7 -7
  50. subsurface/modules/reader/topography/topo_core.py +100 -100
  51. subsurface/modules/reader/volume/read_grav3d.py +478 -428
  52. subsurface/modules/reader/volume/read_volume.py +327 -230
  53. subsurface/modules/reader/volume/segy_reader.py +105 -105
  54. subsurface/modules/reader/volume/seismic.py +173 -173
  55. subsurface/modules/reader/volume/volume_utils.py +43 -43
  56. subsurface/modules/reader/wells/DEP/__init__.py +43 -43
  57. subsurface/modules/reader/wells/DEP/_well_files_reader.py +167 -167
  58. subsurface/modules/reader/wells/DEP/_wells_api.py +61 -61
  59. subsurface/modules/reader/wells/DEP/_welly_reader.py +180 -180
  60. subsurface/modules/reader/wells/DEP/pandas_to_welly.py +212 -212
  61. subsurface/modules/reader/wells/_read_to_df.py +57 -57
  62. subsurface/modules/reader/wells/read_borehole_interface.py +148 -148
  63. subsurface/modules/reader/wells/wells_utils.py +68 -68
  64. subsurface/modules/tools/mocking_aux.py +104 -104
  65. subsurface/modules/visualization/__init__.py +2 -2
  66. subsurface/modules/visualization/to_pyvista.py +320 -320
  67. subsurface/modules/writer/to_binary.py +12 -12
  68. subsurface/modules/writer/to_rex/common.py +78 -78
  69. subsurface/modules/writer/to_rex/data_struct.py +74 -74
  70. subsurface/modules/writer/to_rex/gempy_to_rexfile.py +791 -791
  71. subsurface/modules/writer/to_rex/material_encoder.py +44 -44
  72. subsurface/modules/writer/to_rex/mesh_encoder.py +152 -152
  73. subsurface/modules/writer/to_rex/to_rex.py +115 -115
  74. subsurface/modules/writer/to_rex/utils.py +15 -15
  75. subsurface/optional_requirements.py +116 -116
  76. {subsurface_terra-2025.1.0rc15.dist-info → subsurface_terra-2025.1.0rc16.dist-info}/METADATA +194 -194
  77. subsurface_terra-2025.1.0rc16.dist-info/RECORD +98 -0
  78. {subsurface_terra-2025.1.0rc15.dist-info → subsurface_terra-2025.1.0rc16.dist-info}/WHEEL +1 -1
  79. {subsurface_terra-2025.1.0rc15.dist-info → subsurface_terra-2025.1.0rc16.dist-info}/licenses/LICENSE +203 -203
  80. subsurface_terra-2025.1.0rc15.dist-info/RECORD +0 -98
  81. {subsurface_terra-2025.1.0rc15.dist-info → subsurface_terra-2025.1.0rc16.dist-info}/top_level.txt +0 -0
@@ -1,78 +1,78 @@
1
- import numpy as np
2
-
3
- __all__ = ['write_data_block_header', 'encode']
4
-
5
- rexFileHeaderSize = 64
6
- rexCoordSize = 22
7
-
8
- file_header_size = 86
9
- rexDataBlockHeaderSize = 16
10
-
11
- file_header_and_data_header = 102
12
- mesh_header_size = 128
13
- all_header_size = 230
14
-
15
- # Supported block types
16
- # typeLineSet = 0
17
- # typeText = 1
18
- # typePointList = 2
19
- typeMesh = 3
20
- # typeImage = 4
21
- # typeMaterial = 5
22
- # typePeopleSimulation = 6
23
- # typeUnityPackage = 7
24
- # typeSceneNode = 8
25
-
26
-
27
- n_bytes = 0
28
-
29
-
30
- def write_data_block_header(size_data, data_id=1, data_type=3, version_data=1):
31
- """Function to write a DATA BLOCK header.
32
-
33
- Args:
34
- size_data: data block size (without header)
35
- data_id: id which is used in the database
36
- data_type (int): Type of data the data block contains:
37
- * 0 LineSet A list of vertices which get connected by line segments
38
- * 1 Text A position information and the actual text
39
- * 2 PointList A list of 3D points with color information (e.g. point cloud)
40
- * 3 Mesh A triangle mesh datastructure️
41
- * 4 Image A single of arbitrary format can be stored in this block
42
- * 5 MaterialStandard A standard (mesh) material definition
43
- * 6 SceneNode A wrapper around a data block which can be used in the scenegraph
44
- * 7 Track A track is a tracked position and orientation of an AR device
45
- version_data: version for this data block
46
-
47
- Returns:
48
-
49
- """
50
-
51
- input_ = [(data_type, 'uint16'), # data type
52
- (version_data, 'uint16'), # version for this data block
53
- (size_data, 'uint32'), # data block size (without header)
54
- (data_id, 'uint64')] # id which is used in the database
55
-
56
- block_bytes = encode(input_)
57
- return block_bytes
58
-
59
-
60
- def encode(input_: list):
61
- """Encode python objects - normally Python primitives or numpy arrays - into
62
- its correspondent byte representation
63
-
64
- Args:
65
- input_ (List[tuples]): List of tuples: (object, type)
66
-
67
- Returns:
68
- byte: Array of bytes
69
- """
70
- global n_bytes
71
- block = bytearray()
72
-
73
- for tup in input_:
74
- arr = np.array(tup[0], dtype=tup[1]).tobytes()
75
- n_bytes += len(arr)
76
- block += arr
77
-
78
- return block
1
+ import numpy as np
2
+
3
+ __all__ = ['write_data_block_header', 'encode']
4
+
5
+ rexFileHeaderSize = 64
6
+ rexCoordSize = 22
7
+
8
+ file_header_size = 86
9
+ rexDataBlockHeaderSize = 16
10
+
11
+ file_header_and_data_header = 102
12
+ mesh_header_size = 128
13
+ all_header_size = 230
14
+
15
+ # Supported block types
16
+ # typeLineSet = 0
17
+ # typeText = 1
18
+ # typePointList = 2
19
+ typeMesh = 3
20
+ # typeImage = 4
21
+ # typeMaterial = 5
22
+ # typePeopleSimulation = 6
23
+ # typeUnityPackage = 7
24
+ # typeSceneNode = 8
25
+
26
+
27
+ n_bytes = 0
28
+
29
+
30
+ def write_data_block_header(size_data, data_id=1, data_type=3, version_data=1):
31
+ """Function to write a DATA BLOCK header.
32
+
33
+ Args:
34
+ size_data: data block size (without header)
35
+ data_id: id which is used in the database
36
+ data_type (int): Type of data the data block contains:
37
+ * 0 LineSet A list of vertices which get connected by line segments
38
+ * 1 Text A position information and the actual text
39
+ * 2 PointList A list of 3D points with color information (e.g. point cloud)
40
+ * 3 Mesh A triangle mesh datastructure️
41
+ * 4 Image A single of arbitrary format can be stored in this block
42
+ * 5 MaterialStandard A standard (mesh) material definition
43
+ * 6 SceneNode A wrapper around a data block which can be used in the scenegraph
44
+ * 7 Track A track is a tracked position and orientation of an AR device
45
+ version_data: version for this data block
46
+
47
+ Returns:
48
+
49
+ """
50
+
51
+ input_ = [(data_type, 'uint16'), # data type
52
+ (version_data, 'uint16'), # version for this data block
53
+ (size_data, 'uint32'), # data block size (without header)
54
+ (data_id, 'uint64')] # id which is used in the database
55
+
56
+ block_bytes = encode(input_)
57
+ return block_bytes
58
+
59
+
60
+ def encode(input_: list):
61
+ """Encode python objects - normally Python primitives or numpy arrays - into
62
+ its correspondent byte representation
63
+
64
+ Args:
65
+ input_ (List[tuples]): List of tuples: (object, type)
66
+
67
+ Returns:
68
+ byte: Array of bytes
69
+ """
70
+ global n_bytes
71
+ block = bytearray()
72
+
73
+ for tup in input_:
74
+ arr = np.array(tup[0], dtype=tup[1]).tobytes()
75
+ n_bytes += len(arr)
76
+ block += arr
77
+
78
+ return block
@@ -1,74 +1,74 @@
1
- from dataclasses import dataclass
2
- from typing import Optional, List
3
- import numpy as np
4
-
5
-
6
- __all__ = ['RexMesh', 'RexMaterial', 'RexLineSet']
7
-
8
-
9
- @dataclass
10
- class RexMesh:
11
- """Data structure that can be converted to rex binary. Represent
12
- a Datatype Mesh"""
13
- name: str
14
- vertex: np.ndarray
15
- edges: np.ndarray
16
- normals: Optional[np.ndarray] = np.array([])
17
- texture: Optional[np.ndarray] = np.array([])
18
- color: Optional[np.ndarray] = np.array([])
19
- material_id: Optional[int] = np.array([])
20
-
21
- @property
22
- def ver_ravel(self):
23
- return self.vertex.ravel().astype('float32')
24
-
25
- @property
26
- def tri_ravel(self):
27
- return self.edges.ravel().astype('int32')
28
-
29
- @property
30
- def color_ravel(self):
31
- return self.color.ravel()
32
-
33
- @property
34
- def n_vtx(self):
35
- return self.ver_ravel.shape[0]
36
-
37
- @property
38
- def n_triangles(self):
39
- return self.tri_ravel.shape[0]
40
-
41
- @property
42
- def n_color(self):
43
- return self.color_ravel.shape[0]
44
-
45
-
46
- @dataclass
47
- class RexMaterial:
48
- # ambient
49
- ka_red: float = 1
50
- ka_green: float = 1
51
- ka_blue: float = 1
52
- # specular
53
- ks_red: float = 1
54
- ks_green: float = 1
55
- ks_blue: float = 1
56
-
57
- # difuse
58
- kd_red: float = 1
59
- kd_green: float = 1
60
- kd_blue: float = 1
61
-
62
- # textures
63
- ka_texture_ID: int = 9223372036854775807
64
- ks_texture_ID: int = 9223372036854775807
65
- kd_texture_ID: int = 9223372036854775807
66
-
67
- ns: float = 0.1 # specular exponent
68
- alpha: float = 1
69
-
70
-
71
- @dataclass
72
- class RexLineSet:
73
- foo: int
74
-
1
+ from dataclasses import dataclass
2
+ from typing import Optional, List
3
+ import numpy as np
4
+
5
+
6
+ __all__ = ['RexMesh', 'RexMaterial', 'RexLineSet']
7
+
8
+
9
+ @dataclass
10
+ class RexMesh:
11
+ """Data structure that can be converted to rex binary. Represent
12
+ a Datatype Mesh"""
13
+ name: str
14
+ vertex: np.ndarray
15
+ edges: np.ndarray
16
+ normals: Optional[np.ndarray] = np.array([])
17
+ texture: Optional[np.ndarray] = np.array([])
18
+ color: Optional[np.ndarray] = np.array([])
19
+ material_id: Optional[int] = np.array([])
20
+
21
+ @property
22
+ def ver_ravel(self):
23
+ return self.vertex.ravel().astype('float32')
24
+
25
+ @property
26
+ def tri_ravel(self):
27
+ return self.edges.ravel().astype('int32')
28
+
29
+ @property
30
+ def color_ravel(self):
31
+ return self.color.ravel()
32
+
33
+ @property
34
+ def n_vtx(self):
35
+ return self.ver_ravel.shape[0]
36
+
37
+ @property
38
+ def n_triangles(self):
39
+ return self.tri_ravel.shape[0]
40
+
41
+ @property
42
+ def n_color(self):
43
+ return self.color_ravel.shape[0]
44
+
45
+
46
+ @dataclass
47
+ class RexMaterial:
48
+ # ambient
49
+ ka_red: float = 1
50
+ ka_green: float = 1
51
+ ka_blue: float = 1
52
+ # specular
53
+ ks_red: float = 1
54
+ ks_green: float = 1
55
+ ks_blue: float = 1
56
+
57
+ # difuse
58
+ kd_red: float = 1
59
+ kd_green: float = 1
60
+ kd_blue: float = 1
61
+
62
+ # textures
63
+ ka_texture_ID: int = 9223372036854775807
64
+ ks_texture_ID: int = 9223372036854775807
65
+ kd_texture_ID: int = 9223372036854775807
66
+
67
+ ns: float = 0.1 # specular exponent
68
+ alpha: float = 1
69
+
70
+
71
+ @dataclass
72
+ class RexLineSet:
73
+ foo: int
74
+