diff --git a/examples/examples/real/Hecho.py b/examples/examples/real/Hecho.py index bdad86b7..b2539350 100644 --- a/examples/examples/real/Hecho.py +++ b/examples/examples/real/Hecho.py @@ -12,6 +12,7 @@ # Aux imports import pandas as pn +from gempy.modules.serialization.save_load import _validate_serialization # Importing gempy import gempy as gp @@ -126,7 +127,7 @@ gp.set_section_grid( grid=geo_model.grid, section_dict={ - 'section': ([0, 0], [16, 0], [321, 91]) + 'section': ((0., 0.), (16., 0.), (321, 91)) }, ) @@ -149,7 +150,8 @@ y=new_orientations.data['Y'], z=new_orientations.data['Z'], pole_vector=new_orientations.grads, - elements_names=fn + elements_names=fn, + name_id_map=element.surface_points.name_id_map ) # %% @@ -216,6 +218,7 @@ # Setting verbose and condition number options for debugging geo_model.interpolation_options.kernel_options.compute_condition_number = True + # %% gp.compute_model( gempy_model=geo_model, @@ -223,7 +226,7 @@ backend=gp.data.AvailableBackends.PYTORCH, dtype='float64' ), - validate_serialization=False + validate_serialization=True ) # %% diff --git a/gempy/modules/data_manipulation/manipulate_points.py b/gempy/modules/data_manipulation/manipulate_points.py index edc0df45..9c8a4974 100644 --- a/gempy/modules/data_manipulation/manipulate_points.py +++ b/gempy/modules/data_manipulation/manipulate_points.py @@ -96,7 +96,8 @@ def add_orientations(geo_model: GeoModel, elements_names: Sequence[str], pole_vector: Optional[Union[Sequence[np.ndarray], np.ndarray]] = None, orientation: Optional[Union[Sequence[np.ndarray], np.ndarray]] = None, - nugget: Optional[Sequence[float]] = None + nugget: Optional[Sequence[float]] = None, + name_id_map: Optional[dict[str, int]] = None #: A mapping between orientation names and ids. ) -> StructuralFrame: """Add orientation data to the geological model. @@ -176,6 +177,7 @@ def add_orientations(geo_model: GeoModel, G_z=data['pole_vector'][..., 2], names=[element_name] * len(data['x']), nugget=data['nugget'], + name_id_map=name_id_map ) element: StructuralElement = geo_model.structural_frame.get_element_by_name(element_name)