-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from trame.widgets import vtk
is not user friendly and should not be in the examples
#127
Comments
I will be fine doing In other word, that would means that every |
Also a side note, I usually encourage people to do the vtk import as follow when they don't want to deal with from vtk import (
vtkPolyData,
vtkActor,
vtkMapper,
) But I get that namespace can obviously conflict. But in real application the UI tend to be in a different file where no vtk/C++ is involved. |
So should we update the examples? |
Let's do this in the examples with VTK then
yeah... I too do not want to add a |
Is your feature request related to a problem? Please describe.
The
vtk
widgets module should be named something else as only serious VTK power users import vtk-python the proper way likefrom vtkmodules.vtkRenderingCore import vtkRenderWindow
.Most (like 99% of) users simply use
import vtk
and that's not going anywhere. Havingfrom trame.widgets import vtk
in the examples where you want users to also use VTK-python is setting new users up for failure as the two namespaces will conflict.Further, VTK is an overwhelming library for new users, so seeing
from trame.widgets import vtk
, they will likely think thatvtk
is the actualvtk
where they can get classes likevtkPolyData
(actually even I thought that when first trying trame).Describe the solution you'd like
The vtk widgets module should be named something other than
vtk
, likevtk_widgets
from trame.widgets import vtk
should be something else, perhapsfrom trame.widgets import vtk_widgets
Describe alternatives you've considered
An alternative is to have all the examples use an alias:
from trame.widgets import vtk as vtk_widgets
Additional context
I'm having to carefully modify this import statement in every trame app I create from the examples (I use the examples as templates which I expect most others do as well)
The text was updated successfully, but these errors were encountered: