Skip to content

Commit 61b804b

Browse files
authored
Merge pull request #1025 from gempy-project/changes_while_prob
[ENH] Add group_by parameter to structural_elements_from_borehole_set and plotting improvements
2 parents 2401191 + d4dc685 commit 61b804b

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### From gempy_prob notes:
2+
**Saving models**
3+
- ? Do we want to try to save the full input as versioning so that we can just have one system to go back and forth?
4+
- A way to save the model already with the correct **nugget effects** instead of having to "load nuggets"
5+
6+
# TODO:
7+
-[ ] Saving and loading models
8+
-[ ] Better api for nugget effect optimization
9+

gempy/API/initialization_API.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import warnings
2-
from typing import Union, Hashable
2+
from typing import Union, Hashable, Literal
33

44
import numpy as np
55
from numpy import ndarray
@@ -104,7 +104,9 @@ def create_geomodel(
104104

105105
def structural_elements_from_borehole_set(
106106
borehole_set: "subsurface.core.geological_formats.BoreholeSet",
107-
elements_dict: dict) -> list[StructuralElement]:
107+
elements_dict: dict,
108+
group_by: Literal['component lith', 'lith_ids'] = 'lith_ids'
109+
) -> list[StructuralElement]:
108110
"""Creates a list of StructuralElements from a BoreholeSet.
109111
110112
Args:
@@ -123,7 +125,7 @@ def structural_elements_from_borehole_set(
123125
borehole_set: ss.core.geological_formats.BoreholeSet
124126

125127
elements = []
126-
component_lith: dict[Hashable, np.ndarray] = borehole_set.get_bottom_coords_for_each_lith()
128+
component_lith: dict[Hashable, np.ndarray] = borehole_set.get_bottom_coords_for_each_lith(group_by=group_by)
127129

128130
for name, properties in elements_dict.items():
129131
top_coordinates = component_lith.get(properties['id'])

gempy/core/data/grid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ def bounding_box(self):
118118
return bounding_box_points
119119

120120
@property
121-
def active_grids(self):
121+
def active_grids(self) -> GridTypes:
122122
return self._active_grids
123123

124124
@active_grids.setter
125-
def active_grids(self, value):
125+
def active_grids(self, value: GridTypes):
126126
self._active_grids = value
127127
self._update_values()
128128

0 commit comments

Comments
 (0)