'radiance_version': folders.radiance_version_str, 'standards_data_folder': folders.standards_data_folder, 'modifier_lib': folders.modifier_lib, 'modifierset_lib': folders.modifierset_lib } output_file.write(json.dumps(config_dict, indent=4)) except Exception as e: _logger.exception('Failed to retrieve configurations.\n{}'.format(e)) sys.exit(1) else: sys.exit(0) # add sub-commands to radiance radiance.add_command(edit) radiance.add_command(translate) radiance.add_command(lib) radiance.add_command(sky) radiance.add_command(grid) radiance.add_command(view) radiance.add_command(sunpath) radiance.add_command(octree) radiance.add_command(raytrace) radiance.add_command(rpict) radiance.add_command(dc) radiance.add_command(post_process, name='post-process') radiance.add_command(mtxop) # add radiance sub-commands to honeybee CLI main.add_command(radiance)
'honeybee_openstudio_gem_path': folders.honeybee_openstudio_gem_path, 'standards_data_folder': folders.standards_data_folder, 'construction_lib': folders.construction_lib, 'constructionset_lib': folders.constructionset_lib, 'schedule_lib': folders.schedule_lib, 'programtype_lib': folders.programtype_lib, 'defaults_file': folders.defaults_file, 'standards_extension_folders': folders.standards_extension_folders } output_file.write(json.dumps(config_dict, indent=4)) except Exception as e: _logger.exception('Failed to retrieve configurations.\n{}'.format(e)) sys.exit(1) else: sys.exit(0) # add sub-commands to energy energy.add_command(lib) energy.add_command(translate) energy.add_command(edit) energy.add_command(settings) energy.add_command(simulate) energy.add_command(result) energy.add_command(baseline) energy.add_command(validate) # add energy sub-commands to honeybee CLI main.add_command(energy)
"""honeybee-vtk commands which will be added to honeybee command line interface.""" import click from .translate import translate from .export import export from .config import config from honeybee.cli import main # command group for all radiance extension commands. @click.group(help='honeybee-vtk commands.') @click.version_option() def vtk(): pass # add sub-commands to vtk vtk.add_command(translate) vtk.add_command(export) vtk.add_command(config) main.add_command(vtk)
# write updated inputs to project folder inputs_file = pathlib.Path( input_values['simulation_folder'], '__inputs__.json' ).as_posix() with open(inputs_file, 'w') as inpf: json.dump(input_values, inpf) python_executable_path = sys.executable # add path to scripts folder to env scripts_path = sysconfig.get_paths()['scripts'] genv['PATH'] = os.pathsep.join((scripts_path, genv['PATH'])) # put all the paths in quotes - this should address the issue for paths with # white space command = f'"{python_executable_path}" "{recipe_path}" ' \ f'"{project_folder}" "{inputs_file}" {workers}' try: subprocess.call(command, cwd=project_folder, shell=True, env=genv) except Exception: print(f'Failed to execute {recipe_name} recipe...') sys.exit(1) else: sys.exit(0) main.add_command(recipe)