Load HB Objects - error "No module named __main__"

hbzones

#1

Hi all,

I´m running into a strange error using the Dump/load HB components. I´m Dumping a big thermal model with 136 Zones, but when I try to load the zones, it runs into the following error:

Runtime error (ImportException): No module named main
Traceback:
line 250, in main, “”
line 273, in script

Has someone experienced something similar?

I have succesfully used it in the past but somehow I can´t get it to work now.
Thanks
Rafael


#3

This might be why: https://stackoverflow.com/a/28543508/4394669


#4

@RafaelA ,

Sorry for the late response. Can you upload an example file with the minimum that is needed to re-create the issue? It sounds like one of the objects assigned to the HBZone isn’t being pickled well. Alternatively, if you can describe some of the things that make this model unique from some of the others you have built, that might give us a starting place to recreate it.


#5

thanks for picking this up @chris.

The objects I´m working with are around 140 zones, from a complex thermal model (with custom schedules, internal gains, constructions etc). I´m trying to Dump all of the thermal zones and that is giving me the error. Some of the features that might be failing to be pickled could be:

  • Custom .csv schedules, which prompts a warning from the Dump component.
  • Shading assigned to some windows
  • I´m using E+ Basement and Slab preprocessor. For which I´ve tweaked the Make Adiabatic by Name component to assign the following boundary conditions to certain surfaces: GroundBasementPreprocessorUpperWall, GroundBasementPreprocessorLowerWall, GroundBasementPreprocessorAverageFloor

Now that you mention it, I´ve checked further and, indeed, the last item is the one causing the error. I should have imagined it :sweat_smile:

In case it helps, this is what happens inside one of those tweaked Make Adiabatic by Name.

With all this in mind, do you think there is a way to read back the Thermal Zones from the HB file?
Now I understand that the Load Honeybee Objects component doesn´t recognise/understand my custom boundary conditions.


#6

@RafaelA ,

I apologize for the late response and I am glad that you found the culprit.

It seems that this issue comes about not because of code in the Load HB Objects component but rather code in the Dump HB Objects. Specifically, there is a check to see if the boundary condition is of a certain type in this component, which is written in a way that only supports the 4 current Honeybee Boundary conditions. This does unfortunately mean that, if you have a already have a custom-bc model written to .hb format with the Dump Honeybee component, there is no easy way to get it back (the only way that I can think of is if you try to edit the .hb file in a text editor and try to replace parts that reference boundary conditions but this is pretty difficult given that it is a compressed format).

The good news is that it is very easy to make a Dump Honeybee Objects component that supports the writing of these custom boundary conditions into the .hb file. In fact, all that we need to do is edit that one check and it can be done in a way that does not interfere with the current functionality so I just push this change to gihtub:

You can see a working example with your special ground boundary condition here:
custom_boundary_conditions.gh (476.9 KB)


#7

that´s great @chris. Thank you for the update - I´ve just tried it and works perfectly :slight_smile: