@@ -84,11 +84,17 @@ def export_openstudio_standards_libraries
8484 templates = templates - missing_czs
8585 end
8686
87+ pkg_dir = "#{ __dir__ } /pkg"
88+ Dir . mkdir ( pkg_dir ) unless Dir . exist? ( pkg_dir )
89+ osm_lib_dir = "#{ pkg_dir } /libraries"
90+ Dir . mkdir ( osm_lib_dir ) unless Dir . exist? ( osm_lib_dir )
91+
8792 # templates = templates_to_climate_zones.keys
8893 # Make a library model for each template
8994 # We parallelize this loop, since it takes really long
9095 # Note: You DO want to use in_processes here, and not in_threads!
9196 Parallel . each ( templates , in_processes : $nproc, progress : 'Exporting openstudio-standards templates' ) do |template_name |
97+ #templates.each do |template_name|
9298
9399 # Wrap each library creation in a begin/rescue because
94100 # the entire process can take a long time and
@@ -464,10 +470,10 @@ def export_openstudio_standards_libraries
464470 std_applier . space_type_apply_rendering_color ( space_type )
465471
466472 # Loads
467- std_applier . space_type_apply_internal_loads ( space_type , true , true , true , true , true , true )
473+ std_applier . space_type_apply_internal_loads ( space_type , true , true , true , true , true )
468474
469475 # Schedules
470- std_applier . space_type_apply_internal_load_schedules ( space_type , true , true , true , true , true , true , true )
476+ std_applier . space_type_apply_internal_load_schedules ( space_type , true , true , true , true , true , true )
471477
472478 end
473479 end
@@ -505,10 +511,6 @@ def export_openstudio_standards_libraries
505511 end
506512
507513 # Save the library
508- pkg_dir = "#{ __dir__ } /pkg"
509- Dir . mkdir ( pkg_dir ) unless Dir . exists? ( pkg_dir )
510- osm_lib_dir = "#{ pkg_dir } /libraries"
511- Dir . mkdir ( osm_lib_dir ) unless Dir . exists? ( osm_lib_dir )
512514 library_path = "#{ osm_lib_dir } /#{ template_name . gsub ( /\W / , '_' ) } .osm"
513515 puts "* Saving library #{ library_path } "
514516 model . save ( OpenStudio ::Path . new ( library_path ) , true )
@@ -526,7 +528,7 @@ def export_openstudio_standards_libraries
526528 rescue Exception => exc
527529 STDERR . puts "\e [0;31;49mERROR creating '#{ template_name } ', skipping to next template.\e [0m"
528530 STDERR . puts "#{ exc } "
529- STDERR . puts "Backtrace:\n \t #{ exc . caller . join ( "\n \t " ) } "
531+ # STDERR.puts "Backtrace:\n\t#{exc.caller.join("\n\t")}"
530532 STDERR . puts "Backtrace:\n \t #{ exc . backtrace . join ( "\n \t " ) } "
531533
532534 # Save the log messages for debugging library creation even on failure
0 commit comments