gempy-project / gempy

GemPy is an open-source, Python-based 3-D structural geological modeling software, which allows the implicit (i.e. automatic) creation of complex geological models from interface and orientation data. It also offers support for stochastic modeling to address parameter and model uncertainties.
https://gempy.org
European Union Public License 1.2
941 stars 232 forks source link

AttributeError: 'Solutions' object has no attribute '_ordered_elements' #863

Closed ai-quantitative closed 2 months ago

ai-quantitative commented 6 months ago

Describe the bug

c:\src\gempy\gempy\core\data\geo_model.py:183: UserWarning: You are using refinement and passing a regular grid. The resolution of the regular grid will be overwritten warnings.warn(

AttributeError Traceback (most recent call last) Cell In[15], line 1 ----> 1 sol = gp.compute_model(geo_model) 2 sol

File c:\src\gempy\gempy\API\compute_API.py:48, in compute_model(gempy_model, engine_config) 17 """ 18 Compute the geological model given the provided GemPy model. 19 (...) 28 Solutions: The computed geological model. 29 """ 30 engine_config = engine_config or GemPyEngineConfig( 31 backend=AvailableBackends.numpy, 32 use_gpu=False, 33 ) 35 match engine_config.backend: 36 case AvailableBackends.numpy | AvailableBackends.PYTORCH: 37 38 BackendTensor.change_backend_gempy( 39 engine_backend=engine_config.backend, 40 use_gpu=engine_config.use_gpu, 41 dtype=engine_config.dtype 42 ) 43 44 # TODO: To decide what to do with this. 45 interpolation_input = gempy_model.interpolation_input 46 gempy_model.taped_interpolation_input = interpolation_input 47 ---> 48 gempy_model.solutions = gempy_engine.compute_model( 49 interpolation_input=interpolation_input, 50 options=gempy_model.interpolation_options, 51 data_descriptor=gempy_model.input_data_descriptor, 52 geophysics_input=gempy_model.geophysics_input, 53 ) 54 55 case AvailableBackends.aesara | AvailableBackends.legacy: 56 gempy_model.legacy_model = _legacy_compute_model(gempymodel) 57 case : 58 raise ValueError(f'Backend {engine_config} not supported') 60 return gempy_model.solutions

File c:\src\gempy\gempy\core\data\geo_model.py:137, in GeoModel.solutions(self, value) 134 element.edges = (dc_mesh.edges if dc_mesh is not None else None) 136 # * Reordering the elements according to the scalar field --> 137 for e, order_per_structural_group in enumerate(self._solutions._ordered_elements): 138 elements = self.structural_frame.structural_groups[e].elements 139 reordered_elements = [elements[i] for i in order_per_structural_group]

AttributeError: 'Solutions' object has no attribute '_ordered_elements'

To Reproduce Just running the sol = gp.compute_model(geo_model) sol

from the tutorial ch1_1_basics

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

javoha commented 2 months ago

Hi, sorry for the very late reply. The work on the new gempy release (v3) has kept us busy. Please install the new version and use the updated version of the tutorial, which should work properly now. Please feel free to reopen the issue if any problems persist.