add_orientations function does not work with orientation argument
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]])
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]))
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.
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
This should now be fixed in main. The pip release will follow in the future.
Thank you for addressing this! I'll test the fix on main.