Skip to content

Commit 0516ed4

Browse files
committed
[WIP] More Small changes to revive vector probability examples.
1 parent a8d40ed commit 0516ed4

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

gempy_engine/core/data/raw_arrays_solution.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
@dataclass(init=True)
2020
class RawArraysSolution:
2121
class BlockSolutionType(enum.Enum):
22-
OCTREE = 0
23-
DENSE_GRID = 1
22+
NONE = 0
23+
OCTREE = 1
24+
DENSE_GRID = 2
25+
2426

2527
# region Regular Grid
2628
lith_block: np.ndarray = field(default_factory=lambda: np.empty(0))
@@ -60,7 +62,7 @@ class BlockSolutionType(enum.Enum):
6062
# ? TODO: This could be just the init
6163
@classmethod
6264
def from_gempy_engine_solutions(cls, octrees_output: list[OctreeLevel], meshes: list[DualContouringMesh],
63-
block_solution_type: BlockSolutionType) -> "RawArraysSolution":
65+
block_solution_type: BlockSolutionType) -> "RawArraysSolution" | None:
6466
raw_arrays_solution = cls()
6567

6668
first_level_octree: OctreeLevel = octrees_output[0]
@@ -78,6 +80,11 @@ def from_gempy_engine_solutions(cls, octrees_output: list[OctreeLevel], meshes:
7880
case cls.BlockSolutionType.DENSE_GRID:
7981
_fill_block_solutions_with_dense_grid(stacks_output, raw_arrays_solution)
8082
raw_arrays_solution.dense_ids = BackendTensor.t.to_numpy(collapsed_output.ids_block_dense_grid)
83+
case cls.BlockSolutionType.NONE:
84+
return None
85+
case _:
86+
raise ValueError(f"Block solution type {block_solution_type} not recognized")
87+
8188

8289
# Endregion
8390

gempy_engine/modules/activator/activator_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def activate_formation_block(exported_fields: ExportedFields, ids: np.ndarray,
1616
sigm = activate_formation_block_from_args(Z_x, ids, scalar_value_at_sp, sigmoid_slope)
1717
else:
1818
from .torch_activation import activate_formation_block_from_args_hard_sigmoid
19-
sigm = activate_formation_block_from_args_hard_sigmoid(Z_x, ids, scalar_value_at_sp, sigmoid_slope)
19+
sigm = activate_formation_block_from_args_hard_sigmoid(Z_x, ids, scalar_value_at_sp)
2020

2121
return sigm
2222

gempy_engine/modules/activator/torch_activation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
'''
1414

1515

16-
def activate_formation_block_from_args_hard_sigmoid(Z_x, ids, scalar_value_at_sp, sigmoid_slope):
16+
def activate_formation_block_from_args_hard_sigmoid(Z_x, ids, scalar_value_at_sp):
1717
element_0 = bt.t.array([0], dtype=BackendTensor.dtype_obj)
1818

1919
min_Z_x = BackendTensor.t.min(Z_x, axis=0).reshape(-1) # ? Is this as good as it gets?

0 commit comments

Comments
 (0)