Hi everyone
I’m having some issues figuring out why some gains aren’t being translated from my honeybee model to an IDF.
Below are two simple HBJSONs, one of which seems to pull everything across (Office), but the other (Exhibition) doesn’t include Lighting, Electric Equipment and People in the resulting OSM and IDF files … but I can’t determine why.
Both have valid programs and don’t show any errors in the translation logs. I’ve also included a rough script I’ve been using to test a few different files.
Does anyone have any idea why this might be happening?
Exhibition.hbjson (489.3 KB)
Office.hbjson (394.7 KB)
from pathlib import Path
from honeybee.model import Model
from honeybee_energy.run import run_osw, to_openstudio_osw
test_dir = Path(r"C:\test") # contains two files, Exhibition.hbjson and Office.hbjson
for hbjson in test_dir.glob("*.hbjson"):
# prep the working directory
wd = (test_dir / hbjson.stem)
wd.mkdir(parents=True, exist_ok=True)
# show the gains
prog = Model.from_hbjson(hbjson_file=hbjson).properties.energy.program_types[0]
print(prog.lighting)
print(prog.people)
# write the stuff
osw = to_openstudio_osw(
osw_directory=wd.as_posix(),
model_path=hbjson.as_posix()
)
osm, idf = run_osw(osw, silent=False)
# find the gains ... if they exist!
with open(idf, "r") as fp:
idf_str = fp.readlines()
for n, i in enumerate(idf_str):
if i.startswith("Lights,"):
print("".join(idf_str[n:n+13]))
if i.startswith("People,"):
print("".join(idf_str[n:n+11]))
print()