Skip to content

Commit

Permalink
fix(cli): Change CLI to take advantage of optional artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Aug 6, 2021
1 parent 4f7a3b9 commit f0ed568
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions honeybee_radiance/cli/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ def split_view(view, count, skip_overture, octree, rad_params, folder, log_file)
env = dict(os.environ, **env) if env else None
rpict.run(env=env, cwd=folder)
os.remove(os.path.join(folder, out_file))
else: # write a dummy ambient file so that queenbee does not crash
write_to_file_by_name(folder, amb_file, '')

# record all of the view files that were generated
log_file.write(json.dumps(views_info))
Expand Down
10 changes: 5 additions & 5 deletions honeybee_radiance/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ def model_to_rad_folder(
# copy all bsdfs into the bsdf folder
bsdf_folder = model_folder.bsdf_folder(full=True)
bsdf_mods = model.properties.radiance.bsdf_modifiers
preparedir(bsdf_folder)
bsdfs_info = []
if len(bsdf_mods) != 0:
preparedir(bsdf_folder)
bsdfs_info = []
for bdf_mod in bsdf_mods:
bsdf_name = os.path.split(bdf_mod.bsdf_file)[-1]
new_bsdf_path = os.path.join(bsdf_folder, bsdf_name)
Expand All @@ -351,9 +351,9 @@ def model_to_rad_folder(
'identifier': bdf_mod.identifier,
'path': os.path.join(model_folder.bsdf_folder(full=False), bsdf_name)
})
bsdf_info_file = os.path.join(bsdf_folder, '_info.json')
with open(bsdf_info_file, 'w') as fp:
json.dump(bsdfs_info, fp, indent=2)
bsdf_info_file = os.path.join(bsdf_folder, '_info.json')
with open(bsdf_info_file, 'w') as fp:
json.dump(bsdfs_info, fp, indent=2)

# write the assigned sensor grids and views into the correct folder
grid_dir = model_folder.grid_folder(full=True)
Expand Down

0 comments on commit f0ed568

Please sign in to comment.