seghier
September 29, 2021, 4:07pm
1
Hello, is there a way to save and load Ladybug data to avoid recalculation everytime i open the file?
I tried to internalize data but it changed when i reopen the file to : …GH_objectWrawper
seghier
September 29, 2021, 4:34pm
2
I find this solution of @chris , thank you
@RafaelA ,
Data Collections can be serialized to/from a dictionary or JSON but the honeybee serialization components are only meant for serializing honeybee objects. You can do the serailization to JSON with the following code:
import json
a = 'C:/ladybug/data_collection.json'
obj_dict = [data.to_dict() for data in x]
with open(a, 'w') as fp:
json.dump(obj_dict, fp)
And here’s how you can re-serialize it back:
from ladybug.datacollection import HourlyDiscontinuousCollection
import jso…
1 Like