Skip to content

Commit 7c77dff

Browse files
committed
[ENH] Add grouping option to structural elements initialization
Introduce a `group_by` parameter with `Literal` typing in `structural_elements_from_borehole_set` for flexible grouping. Also, add dotenv initialization in the example script to manage environment variables.
1 parent 69f1710 commit 7c77dff

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

examples/examples/_aux_func_petrophysics_inversion.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
def generate_spremberg_model(
1313
borehole_set: ss.core.geological_formats.BoreholeSet,
1414
elements_to_gempy: dict[str, dict[str, str]], plot: bool = False) -> gp.data.GeoModel:
15+
1516
elements: list[gp.data.StructuralElement] = gp.structural_elements_from_borehole_set(
1617
borehole_set=borehole_set,
17-
elements_dict=elements_to_gempy
18+
elements_dict=elements_to_gempy,
19+
group_by="component lith"
1820
)
1921

2022
group = gp.data.StructuralGroup(

examples/examples/petrophysics_inversion.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
77
# sphinx_gallery_thumbnail_number = -1
88
"""
9+
import dotenv
910
import numpy as np
1011

1112
import gempy as gp
1213
import gempy_viewer as gpv
1314

1415
from examples.examples._aux_func_petrophysics_inversion import get_spremberg_borehole_set, generate_spremberg_model
16+
from subsurface.modules.visualization import to_pyvista_line, to_pyvista_points
17+
18+
dotenv.load_dotenv()
1519

1620
# %%
1721
vertical_exaggeration = 3

0 commit comments

Comments
 (0)