File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 3434import ifcopenshell .util .classification
3535import ifcopenshell .util .representation
3636from deepdiff import DeepDiff
37+ from ordered_set import OrderedSet
3738
3839
3940class IfcDiff :
@@ -234,6 +235,12 @@ def get_settings(self, ifc):
234235 settings .set_context_ids (body_contexts )
235236 return settings
236237
238+ def json_dump_default (self , obj ):
239+ # result of DeepDiff may contain ordered sets
240+ if isinstance (obj , (OrderedSet , set )):
241+ return list (obj )
242+ return json .JSONEncoder .default (None , obj )
243+
237244 def export (self , path ):
238245 with open (path , "w" , encoding = "utf-8" ) as diff_file :
239246 json .dump (
@@ -244,6 +251,7 @@ def export(self, path):
244251 },
245252 diff_file ,
246253 indent = 4 ,
254+ default = self .json_dump_default ,
247255 )
248256
249257 def get_precision (self ):
You can’t perform that action at this time.
0 commit comments