pnnl / tesp

Other
39 stars 36 forks source link

Add method to GLMModifier to get dictionary of objects by type #109

Closed trevorhardy closed 1 year ago

trevorhardy commented 1 year ago

We need a method that creates a dictionary of all of the objects of a certain type. This would make it easy to make changes to, say, all the house objects and change their insulation level. This would likely tie into my request for an iterator in #99.

trevorhardy commented 1 year ago

This does exist and I just didn't see how it works:

objs = GLMModifier.get_object(<GridLAB-D class name>).instance

This returns a dictionary with keys as the names of all the objects in the model of that class (e.g. "house", "triplex_meters", transformer") and values that are themselves a dictionary of all parameters and values defined in the .glm.