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

can not load mesh in paraview: cannot unpack non-iterable CellBlock object #1307

Open
reox opened this issue Mar 25, 2022 · 2 comments · May be fixed by #1483
Open

can not load mesh in paraview: cannot unpack non-iterable CellBlock object #1307

reox opened this issue Mar 25, 2022 · 2 comments · May be fixed by #1483

Comments

@reox
Copy link
Contributor

reox commented Mar 25, 2022

I noticed I could not load meshes with the paraview plugin when using 5.3.4 on python 3.8:

Traceback (most recent call last):
  File "/programs/shared/paraview/ParaView-5.9.0-RC3-MPI-Linux-Python3.8-64bit/lib/python3.8/site-packages/vtkmodules/util/vtkAlgorithm.py", line 152, in ProcessRequest
    return vtkself.ProcessRequest(request, inInfo, outInfo)
  File "/programs/shared/paraview/ParaView-5.9.0-RC3-MPI-Linux-Python3.8-64bit/lib/python3.8/site-packages/vtkmodules/util/vtkAlgorithm.py", line 198, in ProcessRequest
    return self.RequestData(request, inInfo, outInfo)
  File "/home/reox/.local/share/paraview-5.9/plugins/paraview-meshio-plugin.py", line 85, in RequestData
    for meshio_type, data in cells:
TypeError: cannot unpack non-iterable CellBlock object

This line was probably not updated to the (new?) CellBlock class:

for meshio_type, data in cells:

I think changing the lines to:

for cellblock in cells:
    meshio_type = cellblock.type
    data = cellblock.data

should do the trick (at least for me the mesh loads again), but I don't know if anything else has to be changed?

@mkghadban
Copy link

mkghadban commented Jan 17, 2023

Indeed, this is an issue that I faced as well (Ubuntu 20.04, Paraview 5.11.0, and meshio 5.3.4) . However, the proposed solution

for cellblock in cells:
meshio_type = cellblock.type
data = cellblock.data

resulted in:

ValueError: invalid literal for int() with base 10: 'quad'

what worked for me is the following:

for cellblock in cells:
meshio_type = meshio_to_vtk_type[cellblock.type]
data = cellblock.data
...

I hope this helps!

@mwestphal
Copy link

Issue is still present in the plugin

@mwestphal mwestphal linked a pull request Jul 16, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants