@@ -85,6 +85,7 @@ class CellNetwork(Datastructure):
8585 DATASCHEMA = {
8686 "type" : "object" ,
8787 "properties" : {
88+ "attributes" : {"type" : "object" },
8889 "default_vertex_attributes" : {"type" : "object" },
8990 "default_edge_attributes" : {"type" : "object" },
9091 "default_face_attributes" : {"type" : "object" },
@@ -146,6 +147,7 @@ class CellNetwork(Datastructure):
146147 "max_cell" : {"type" : "number" , "minimum" : - 1 },
147148 },
148149 "required" : [
150+ "attributes" ,
149151 "default_vertex_attributes" ,
150152 "default_edge_attributes" ,
151153 "default_face_attributes" ,
@@ -173,6 +175,7 @@ def __data__(self):
173175 cell [c ] = sorted (list (faces ))
174176
175177 return {
178+ "attributes" : self .attributes ,
176179 "default_vertex_attributes" : self .default_vertex_attributes ,
177180 "default_edge_attributes" : self .default_edge_attributes ,
178181 "default_face_attributes" : self .default_face_attributes ,
@@ -196,6 +199,7 @@ def __from_data__(cls, data):
196199 default_face_attributes = data .get ("default_face_attributes" ),
197200 default_cell_attributes = data .get ("default_cell_attributes" ),
198201 )
202+ cell_network .attributes .update (data .get ("attributes" ) or {})
199203
200204 vertex = data ["vertex" ] or {}
201205 edge = data ["edge" ] or {}
0 commit comments