Module: OpenStudio::Workflow::Util::WeatherFile
- Included in:
- RunInitialization
- Defined in:
- lib/openstudio/workflow/util/weather_file.rb
Overview
The current precedence rules for weather files are defined in this module. Best practice is to only use the
#get_weather_file method, as it will be forward compatible
Instance Method Summary collapse
-
#get_weather_file(directory, wf, wf_search_array, model, logger = nil) ⇒ String?
Returns the weather file with precedence.
Instance Method Details
#get_weather_file(directory, wf, wf_search_array, model, logger = nil) ⇒ String?
Returns the weather file with precedence
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/openstudio/workflow/util/weather_file.rb', line 26 def get_weather_file(directory, wf, wf_search_array, model, logger = nil) # TODO: this logic needs some updating, weather file should come from current model, found using search paths logger ||= ::Logger.new($stdout) unless logger if wf weather_file = get_weather_file_from_fs(directory, wf, wf_search_array, logger) raise 'Could not locate the weather file in the filesystem. Please see the log' if weather_file == false end weather_file = get_weather_file_from_osm(model, logger) if weather_file.nil? raise 'Could not locate the weather file in the filesystem. Please see the log' if weather_file == false logger.warn 'The weather file could not be determined. Please see the log for details' unless weather_file weather_file end |