JupyterViewportWidget error for 3.10.0

Hi,

I tried to run the example of creating a Widget in Jupyter lab as the codes below:

from ovito.io import *
from ovito.vis import *
from ovito.modifiers import *
import ipywidgets

# Import a simulation model and set up a data pipeline:
pipeline = import_file('sample_data/NanocrystallinePd.dump.gz')
pipeline.add_to_scene()
pipeline.modifiers.append(ColorCodingModifier(property = 'Potential Energy', start_value = -4.02645, end_value = -3.43657))

# Create a virtual viewport:
vp = Viewport(type=Viewport.Type.Perspective, camera_dir=(-2, -1, -1))
vp.zoom_all()

# Create the visual viewport widget:
widget = vp.create_jupyter_widget()
widget.layout = ipywidgets.Layout(width='500px', height='400px')
display(widget)

But I got a error like:

TraitError: The '_orbit_center' trait of a JupyterViewportWidget instance expected a tuple, not the ndarray array([ 0.00025, 0. , -0.00065]).

I modified line 70 and 118 in _jupyter_widget.py then it works to add extra tuple().


self._orbit_center = tuple(self.viewport.orbit_center) if self.viewport) else (0.0, 0.0, 0.0)
self._orbit_center = tuple(self.viewport.orbit_center)

Could you please double-check if you are really running version 3.10.3 of the ovito package and not a previous one? This error has already been fixed in 3.10.3 and the code lines you mentioned should already contain the tuple() calls.
You can check the module version at runtime by executing:

import ovito
print(ovito.version)

Sorry, my memory was wrong. I did not upgrade to 3.10.3. My current version is 3.10.0.