marcomusy / vedo

A python module for scientific analysis of 3D data based on VTK and Numpy
https://vedo.embl.es
MIT License
2.05k stars 266 forks source link

version 2024.5.2 `show()` function returns error #1167

Closed danafd closed 3 months ago

danafd commented 4 months ago

Hello, I use vedo within a cluster and things have been going normally with vedo version 2023.5.0 where I normally set vedo.settings.default_backend = 'ipyvtklink.

However, after updating vedo to 2024.5.2, I've been getting this error when running the show() function.

ValueError: too many values to unpack (expected 2)

So, when I run vedo.Cone().show().close(), I get this:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[4], line 1
----> 1 vedo.Cone().show().close()

File /camp/lab/hadjivasiliouz/home/users/fakhred/.conda/envs/devbio-napari-env3/lib/python3.9/site-packages/vedo/visual.py:141, in CommonVisual.show(self, **options)
    131 def show(self, **options):
    132     """
    133     Create on the fly an instance of class `Plotter` or use the last existing one to
    134     show one single object.
   (...)
    139     Returns the `Plotter` class instance.
    140     """
--> 141     return vedo.plotter.show(self, **options)

File /camp/lab/hadjivasiliouz/home/users/fakhred/.conda/envs/devbio-napari-env3/lib/python3.9/site-packages/vedo/plotter.py:282, in show(at, shape, N, pos, size, screensize, title, bg, bg2, axes, interactive, offscreen, sharecam, resetcam, zoom, viewup, azimuth, elevation, roll, camera, mode, screenshot, new, *objects)
    279             raise RuntimeError()
    280         at = list(range(len(objects)))
--> 282     plt = Plotter(
    283         shape=shape,
    284         N=N,
    285         pos=pos,
    286         size=size,
    287         screensize=screensize,
    288         title=title,
    289         axes=axes,
    290         sharecam=sharecam,
    291         resetcam=resetcam,
    292         interactive=interactive,
    293         offscreen=offscreen,
    294         bg=bg,
    295         bg2=bg2,
    296     )
    298 if settings.dry_run_mode >= 2:
    299     return plt

File /camp/lab/hadjivasiliouz/home/users/fakhred/.conda/envs/devbio-napari-env3/lib/python3.9/site-packages/vedo/plotter.py:662, in Plotter.__init__(self, shape, N, pos, size, screensize, title, bg, bg2, axes, sharecam, resetcam, interactive, offscreen, qt_widget, wx_widget)
    659 if isinstance(self.size, str) and self.size == "auto":
    660     # figure out a reasonable window size
    661     f = 1.5
--> 662     x, y = screensize
    663     xs = y / f * shape[1]  # because y<x
    664     ys = y / f * shape[0]

ValueError: too many values to unpack (expected 2)
marcomusy commented 4 months ago

Hi - the support for ipyvtklink was removed since (in my understanding) that project was abandoned..

danafd commented 4 months ago

Is there another way to fix the error I get in the show function? I would like to use an interactive gui.

marcomusy commented 4 months ago

You can use vedo.settings.default_backend = 'vtk'

danafd commented 3 months ago

It worked. Thanks for the help!