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

Crash on import: ValueError: setting an array element with a sequence. #6

Open
FranseFrikandel opened this issue Sep 1, 2023 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@FranseFrikandel
Copy link

Hello there!

When trying to import pyccx, the statement 'import pyccx' causes a crash. This is done similarly as the example python file.

Simply commenting out the WEDGE6 class in mesher.py appears to fix it for now for me, but this class is presumably needed somewhere and should probably be fixed.

Traceback (most recent call last):
  File "/mnt/c/Users/CRGam/Documents/tandwielen/calculate.py", line 1, in <module>
    import pyccx
  File "/mnt/c/Users/CRGam/Documents/tandwielen/pyccx/pyccx/__init__.py", line 2, in <module>
    from . import mesh
  File "/mnt/c/Users/CRGam/Documents/tandwielen/pyccx/pyccx/mesh/__init__.py", line 1, in <module>
    from .mesher import ElementType, Mesher, MeshingAlgorithm
  File "/mnt/c/Users/CRGam/Documents/tandwielen/pyccx/pyccx/mesh/mesher.py", line 19, in <module>
    class ElementType:
  File "/mnt/c/Users/CRGam/Documents/tandwielen/pyccx/pyccx/mesh/mesher.py", line 79, in ElementType
    class WEDGE6:
  File "/mnt/c/Users/CRGam/Documents/tandwielen/pyccx/pyccx/mesh/mesher.py", line 84, in WEDGE6
    faces = np.array([[1,2,3], [4,5,6], [1,2,5,4], [2,3,6,5], [3,1,4,6]])
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part.
@drlukeparry drlukeparry self-assigned this Sep 1, 2023
@drlukeparry drlukeparry added the bug Something isn't working label Sep 1, 2023
@drlukeparry drlukeparry added this to the v0.2 milestone Sep 1, 2023
@drlukeparry
Copy link
Owner

Hi,

This is a known issue that has appeared with later versions of python/numpy.

This will be resolved in future version (v0.2) with a new approach to elements and mapping their faces.

For now you can comment the line out, unless you specifically need Wedge elements.

@FranseFrikandel
Copy link
Author

Thanks. I've indeed commented it out for now, but decided to report it here incase it wasn't known.

I've also encountered another issue, but I'll have to take a look for creating the issue tomorrow when I'm back at my computer. Happy to see this repo is still actively maintained!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants