gempy icon indicating copy to clipboard operation
gempy copied to clipboard

add_orientations function does not work with orientation argument

Open benk-mira opened this issue 1 year ago • 2 comments

Describe the bug The orientation argument to add_orientations is a Sequence[np.ndarray] in the docstrings. Passing a list of arrays as the docstring implies fails at line 130 of manipulate_points.py since slicing is not supported for lists. Ignoring the doctrings and passing an array instead fails at line 128 of the same file because arrays are not truthy in that way.

To Reproduce

        extent = [-1000, 1000, -1000, 1000, -500, 500]
        geo_model = gp.create_geomodel(
            project_name="test",
            extent=extent,
            refinement=4,
            structural_frame=gp.data.StructuralFrame.initialize_default_structure()
        )
        gp.add_orientations(geo_model, x=[0], y=[0], z=[0], elements_names=['surface1'], orientation=[[0, 0, 0]])

image

        extent = [-1000, 1000, -1000, 1000, -500, 500]
        geo_model = gp.create_geomodel(
            project_name="test",
            extent=extent,
            refinement=4,
            structural_frame=gp.data.StructuralFrame.initialize_default_structure()
        )
        gp.add_orientations(geo_model, x=[0], y=[0], z=[0], elements_names=['surface1'], orientation=np.array([0, 0, 0]))

image

benk-mira avatar Jul 15 '24 22:07 benk-mira

Hi, sorry for not replying for a while and thanks for the catch. I made a pull request to fix this, hopefully it will be resolved soon.

javoha avatar Aug 13 '24 10:08 javoha

Hi, sorry for not replying for a while and thanks for the catch. I made a pull request to fix this, hopefully it will be resolved soon.

i.e. #929

agzimmerman avatar Aug 19 '24 14:08 agzimmerman

This should now be fixed in main. The pip release will follow in the future.

javoha avatar Sep 03 '24 12:09 javoha

Thank you for addressing this! I'll test the fix on main.

benk-mira avatar Sep 03 '24 15:09 benk-mira