Skip to content

Commit bd6354d

Browse files
committed
[ENH] Add factory methods for interpolation options initialization
Introduced new class methods (`init_octree_options` and `init_dense_grid_options`) to simplify the initialization of interpolation configurations. Also adjusted the default `sigmoid_slope` value and added a placeholder for probabilistic options.
1 parent 1c4d3a1 commit bd6354d

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

gempy_engine/core/data/options/interpolation_options.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,35 @@ def __init__(
7878
self.cache_mode = InterpolationOptions.CacheMode.IN_MEMORY_CACHE
7979
self.cache_model_name = ""
8080
self.block_solutions_type = RawArraysSolution.BlockSolutionType.OCTREE
81-
self.sigmoid_slope = 50_000
81+
self.sigmoid_slope = 5_000_000
8282

8383
# @on
8484

85+
@classmethod
86+
def init_octree_options(cls, range=1.7, c_o=10, refinement: int = 1):
87+
return InterpolationOptions(
88+
range=range,
89+
c_o=c_o,
90+
mesh_extraction=True,
91+
number_octree_levels=refinement,
92+
)
93+
94+
@classmethod
95+
def init_dense_grid_options(cls):
96+
options = InterpolationOptions(
97+
range=1.7,
98+
c_o=10,
99+
mesh_extraction=False,
100+
number_octree_levels=1
101+
)
102+
options.block_solutions_type = RawArraysSolution.BlockSolutionType.DENSE_GRID
103+
return options
104+
105+
@classmethod
106+
def probabilistic_options(cls):
107+
# TODO: This should have the sigmoid slope different
108+
raise NotImplementedError("Probabilistic interpolation is not yet implemented.")
109+
85110
def __repr__(self):
86111
return f"InterpolationOptions({', '.join(f'{k}={v}' for k, v in asdict(self).items())})"
87112

0 commit comments

Comments
 (0)