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

VolMesh cell attributes cannot be serialized #1396

Open
petrasvestartas opened this issue Oct 4, 2024 · 0 comments
Open

VolMesh cell attributes cannot be serialized #1396

petrasvestartas opened this issue Oct 4, 2024 · 0 comments

Comments

@petrasvestartas
Copy link
Contributor

Describe the bug

https://github.com/compas-dev/compas/blob/f85415822840eb6c7223698446c335cef06ce55e/src/compas/datastructures/volmesh/volmesh.py#L173C1-L173C78

I guess, "cell_data": {str(cell): attr for cell, attr in self._cell_data}, needs to be changed to self._cell_data

To Reproduce

from compas import json_dump
from compas.datastructures import VolMesh

volmesh : VolMesh = VolMesh.from_meshgrid(8,8,3.5,5,3,2)

for cell in volmesh.cells():
    volmesh.cell_attribute(cell, 'a', 0)
    
json_dump(volmesh, "volmesh.json") 

Expected behavior
Serialization should work.

Screenshots
None

Desktop (please complete the following information):

  • OS: Ubuntu
  • Python version 3.9.10
  • Python package manager conda

Additional context
None

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

1 participant