Skip to content
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

Trait Error: The ‘children’ trait of a VBox instance ... itkwidgets 1.0a16 #556

Open
kevinsweeney84 opened this issue Oct 17, 2022 · 6 comments

Comments

@kevinsweeney84
Copy link

Getting TraitError: The 'children' trait of a VBox instance contains an Instance of a TypedTuple which expected a Widget, not the Viewer at '0x2aaab5d0ad00'.

when running the code below in Jupyter Lab

import itkwidgets
import ipywidgets
    
view = itkwidgets.view(geometries=None, background=[0.0, 0.0, 0.0])

# Headings
heading = ipywidgets.HTML(value="<h1>Heading</h1>")

# Output Widget
widget = ipywidgets.VBox(children = [heading, view])

Below are my versions of packages.

itkwidgets 1.0a16 pypi_0 pypi
ipywidgets 7.6.5 pyhd3eb1b0_1 defaults

When running with version 0.X of itkwidgets this error does not occur

itkwidgets 0.32.0 py38h32f6830_0 conda-forge

@thewtex
Copy link
Member

thewtex commented Oct 20, 2022

@kevinsweeney84 thanks for the report.

In version 1.X, we also work outside Jupyter.

We are adding detection of the environment in #558

For Jupyter environments, we will:

  • Create a new ViewerWidget class that inherits from ipywidgets.Widget -- return this from view.
  • Hook up callbacks from the viewer eventEmitter to update associated traitlets
  • Have traitlets call get_ methods to provide their value

@kevinsweeney84
Copy link
Author

@thewtex I see that you have closed #558 , congrats.
Do you have an approximate timeline as to when this will be available through pip?

@thewtex
Copy link
Member

thewtex commented Oct 27, 2022

Yes, making progress towards this. The other blocker is #568 , which is a bit tricky and hard to estimate a timeline.

@kevinsweeney84
Copy link
Author

@thewtex I installed your commit from #558 using pip

  • pip install git+https://github.com/InsightSoftwareConsortium/itkwidgets.git@302126a3e17d3ef8b848136a0c973e0bb142ceee#egg=itkwidgets
  • Installed package information
    • itkwidgets 1.0a18.dev12+g302126a pypi_0 pypi

but I am still seeing the same error:

  • TraitError: The 'children' trait of a VBox instance contains an Instance of a TypedTuple which expected a Widget, not the Viewer at '0x2aab2b843430'.

Should this be fixed in this instance?

@thewtex
Copy link
Member

thewtex commented Nov 22, 2022

@kevinsweeney84 not, yet but we are working on it.

@hjmjohnson
Copy link
Member

@thewtex This bug is affecting itk notebooks tutorials as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants