-
-
Notifications
You must be signed in to change notification settings - Fork 601
Open
Labels
bugUh-oh! Something isn't working as expected.Uh-oh! Something isn't working as expected.feature-requestPlease add this cool feature!Please add this cool feature!
Description
Describe the bug, what's wrong, and what you expected.
The RepresentationType should be supported by the Property.style setter but it isn't. It only accepts string values.
This is inconsistent with other enum types like the interpolation which does support our InterpolationType enum
Steps to reproduce the bug.
>>> import pyvista as pv
>>> from pyvista.plotting.opts import InterpolationType, RepresentationType
>>> a = pv.Actor()
>>> a.prop.interpolation
<InterpolationType.FLAT: 0>
>>> a.prop.interpolation = InterpolationType.GOURAUD
>>> a.prop.style
'Surface'
>>> a.prop.style = RepresentationType.WIREFRAME
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/banesullivan/Software/pyvista/pyvista/pyvista/core/utilities/misc.py", line 359, in __setattr__
object.__setattr__(self, key, value)
File "/Users/banesullivan/Software/pyvista/pyvista/pyvista/plotting/_property.py", line 300, in style
new_style = new_style.lower()
^^^^^^^^^^^^^^^
AttributeError: 'RepresentationType' object has no attribute 'lower'Further, the representation property is inherited from upstream VTK but isn't useable either
>>> a.prop.representation
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/banesullivan/Software/pyvista/pyvista/pyvista/core/_vtk_core.py", line 657, in __getattribute__
DisableVtkSnakeCase.check_attribute(self, item)
File "/Users/banesullivan/Software/pyvista/pyvista/pyvista/core/_vtk_core.py", line 652, in check_attribute
raise pv.PyVistaAttributeError(msg)
pyvista.core.errors.PyVistaAttributeError: The attribute 'representation' is defined by VTK and is not part of the PyVista APISystem Information
latest main at `0.47.dev0`Screenshots
No response
Metadata
Metadata
Assignees
Labels
bugUh-oh! Something isn't working as expected.Uh-oh! Something isn't working as expected.feature-requestPlease add this cool feature!Please add this cool feature!