How to Dump/write and load a Comfort Data collection from UTCI calculation to an external file

Hi everyone,

Just starting to explore some of the new python capabilities of LB 1.3, they seem amazing, thanks for the splendid work!

I wonder if there is a way to write the results from the comfort object created by the UTCI component in LB 1.3 into a JSON file? This object does not have a to_dict method. I already saw the solution for individual Continuous or Discontinuous Data Collections from this post. But I wondered if I could save the full comfort obj instead of writing each variable individually.

Best,

Pablo

I would check the new DumpData and LoadData components.
Not 100% sure they do what you ask but maybe yes. They save Data collections as csv, json and pkl formats.
-A

1 Like

@AbrahamYezioro Thank you for your reply, the new DumpData and LoadData work great for DataCollections, and work in an equivalent manner as the post I linked before. Nevertheless, they don’t work with Comfort Objects that contain all the variables used to calculate UTCI or similar metrics.

utci_dump_obj.gh (49.8 KB)

I am aware that saving the comfObj could get me into memory (RAM) limitations when using LB to calculate the annual UTCI of thousands of points.

In another topic, the new DumpData only work with single Data Collections and does not with list of collections like the python script.

Hi @monsieurpablo ,

Those Honeybee components are not the correct ones.

Abraham means the new “LB Dump Data” and “LB Load Data” components that are in the latest development version of the Grasshopper plugin:

They don’t serialize the whole Comfort Collection object but they can serialize the timeseries DataCollections that come out of the comfort components like you see above.

Comfort Collections are one of the few objects in the plugin that I haven’t gotten around to writing to_dict and from_dict methods yet. So I’m sorry there’s no way to serialize them right now. But you see that you can serialize all of the inputs and all of the outputs. So hopefully this is enough for your purposes.

@chris Thank you for the fast response, I would update my components to the latest version as I don’t have the LB versions of the Dump and Load Data. Sure, this is good enough for my work now, thanks!

Yes! Those are the ones that i meant. Tx @chris for stepping in.
-A.