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

test_conversion: meshio TypeError: cannot unpack non-iterable CellBlock #14

Open
drew-parsons opened this issue Jan 26, 2022 · 1 comment

Comments

@drew-parsons
Copy link

Recent changes to meshio now cause test_conversion.py to fail:

_________________________________________________________________________________________________ test_conversion _________________________________________________________________________________________________

    def test_conversion():
        """
        Test the conversion from msh to xdmf.
        """
        # Get the current directory
        current_dir = "{}".format(os.getcwd())
        # Run the conversion
>       msh2xdmf("multidomain.msh", dim=2, directory=current_dir)

test_conversion_here.py:14: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/msh2xdmf.py:28: in msh2xdmf
    export_domain(msh, dim, directory, prefix)
/usr/lib/python3/dist-packages/msh2xdmf.py:45: in export_domain
    data_array = [arr for (t, arr) in msh.cells if t == cell_type]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

.0 = <list_iterator object at 0x7f5a9ca5c280>

>   data_array = [arr for (t, arr) in msh.cells if t == cell_type]
E   TypeError: cannot unpack non-iterable CellBlock object

/usr/lib/python3/dist-packages/msh2xdmf.py:45: TypeError
============================================================================================= short test summary info =============================================================================================
FAILED test_conversion_here.py::test_conversion - TypeError: cannot unpack non-iterable CellBlock object
================================================================================================ 1 failed in 1.28s ================================================================================================

This is with meshio 5.3.0. The change might be related to nschloe/meshio#1234 , which went into meshio 5.1.1

@bragostin
Copy link

I have it working again with these modifications:
line 49 : data_array = [cell.data for cell in msh.cells if cell.type == cell_type]
line 57 : cell_type=cell_type,
line 109 : data_array = [cell.data for cell in msh.cells if cell.type == cell_type]
line 117 : cell_type=cell_type,

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

2 participants