Skip to content

Commit

Permalink
Merge pull request #1177 from NREL/fix-empty-weather
Browse files Browse the repository at this point in the history
Empty weather folder trips up run_analysis.rb
  • Loading branch information
joseph-robertson committed Dec 7, 2023
2 parents febef99 + b6eaaef commit 6289911
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/read_the_docs/source/basic_tutorial/run_project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ Run ``openstudio workflow/run_analysis.rb -h`` to see all available commands/arg
.. note::
At this time the ``residential_quota_downselect`` sampler with ``resample`` is not supported.
.. note::
EPW weather files must be contained in a ``weather`` folder at the same level as the ``workflow`` folder (i.e., at the top level of the repository).
If no such folder is present, or if the ``weather`` folder does not contain any ``*.epw`` files, it will automatically be created/populated based on the ``weather_files_url`` (or ``weather_files_path``) present in the specified yml file.
5 changes: 5 additions & 0 deletions workflow/run_analysis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ def run_workflow(yml, in_threads, measures_only, debug_arg, overwrite, building_

# Create weather folder
weather_dir = File.join(thisdir, '../weather')

if File.exist?(weather_dir) && Dir[File.join(weather_dir, '*.epw')].empty?
FileUtils.rm_rf(weather_dir)
end

if !File.exist?(weather_dir)
if cfg.keys.include?('weather_files_url')
Dir.mkdir(weather_dir)
Expand Down

0 comments on commit 6289911

Please sign in to comment.