compas-dev / compas-dev/compas

VolMesh cell attributes cannot be serialized

Open
#1,396 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
386
Forks
122
Avg merge
11d 46m
Merged PRs (30d)
1

Description

**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**
```python
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.