added json encoder for PoyCubes

This commit is contained in:
=
2024-02-06 17:15:45 +01:00
parent 644ba22d1b
commit 3e4288cd66

View File

@@ -0,0 +1,9 @@
from json import JSONEncoder
from typing import Any
from polycube import PolyCube
class PolyCubeEncdoder(JSONEncoder):
def default(self, o: Any) -> Any:
if isinstance(o, PolyCube):
return list(o.cubes)
return super().default(o)