urbanopt-scenario 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad7bee4d19e55b9e3642d7378b412c28507d6a25f41f65d6ca3bed9e8db03983
4
- data.tar.gz: fa81be8958d3c63d07c0ac0fc71cdecb939090c8bdb54f0418c20d0b9a38ab57
3
+ metadata.gz: a8cb63dabcc5a248580c0f5941030e985d95aa03f5cf6e9ecaeead96b5879d3a
4
+ data.tar.gz: ba1fba337a0c9daf1ef6f699bb44864fc663a604bc2d6806919b44947326d7c6
5
5
  SHA512:
6
- metadata.gz: 7f4f0be9908f1f5410d08c6d98613f1a15c907945ee3a980a716a2f4da6c9888946bb90d73b09b6ab8cd58332ba8b7fde0baaf9dd7f54ad81157e251df355725
7
- data.tar.gz: f1ef917f1c094d62439ea616b87fe895a572472ee1089d34044a236afad7bc9cb88eb4388f2aba3c6340823c36040d1073e5e48efb273d8e75c679d647bc79d1
6
+ metadata.gz: 81d7ecde2901d1f8cef37c69ab4052cad2a70e9e87654724d09374cb6646eb9ef61393451e0215ac784534dde74647ca2719d1cb943306a7bf0d45fb1d0d16bf
7
+ data.tar.gz: d9c810fb5d2bda25f6b9910b4e49e6ab7c9a1c065e3570319e85a4d58cd4f047f7d30e1a651bf7c4a6ed867b3f418255d5c7dd1aa4cf342c11a3c369680ed8fb
@@ -1,5 +1,10 @@
1
1
  # URBANopt Scenario Gem
2
2
 
3
+ ## Version 0.4.1
4
+ Date Range: 09/22/20 - 09/28/20
5
+
6
+ - Fixed [#156] (https://github.com/urbanopt/urbanopt-scenario-gem/issues/156), Ignore non-datapoint directories in scenario dir when creating scenario sqlite file
7
+
3
8
  ## Version 0.4.0
4
9
  Date Range: 06/05/20 - 09/21/20
5
10
 
@@ -47,7 +47,7 @@ module URBANopt
47
47
  def initialize(scenario_base)
48
48
  super(scenario_base)
49
49
 
50
- @initialization_hash = { directory_name: scenario_base.run_dir, name: scenario_base.name, id: scenario_base.name }
50
+ @initialization_hash = { directory_name: scenario_base.run_dir, name: scenario_base.name, id: scenario_base.name, root_dir: scenario_base.root_dir }
51
51
  @scenario_result = URBANopt::Reporting::DefaultReports::ScenarioReport.new(@initialization_hash)
52
52
  @default_save_name = 'default_scenario_report'
53
53
 
@@ -97,6 +97,24 @@ module URBANopt
97
97
 
98
98
  values_arr = []
99
99
  feature_list = Pathname.new(@initialization_hash[:directory_name]).children.select(&:directory?) # Folders in the run/scenario directory
100
+
101
+ # get scenario CSV
102
+ scenario_csv = File.join(@initialization_hash[:root_dir], @initialization_hash[:name] + '.csv')
103
+ if File.exist?(scenario_csv)
104
+ # csv found
105
+ feature_ids = CSV.read(scenario_csv, :headers => true)
106
+ feature_list = []
107
+ # loop through building feature ids from scenario csv
108
+ feature_ids["Feature Id"].each do |feature|
109
+ if Dir.exist?(File.join(@initialization_hash[:directory_name], feature))
110
+ feature_list << File.join(@initialization_hash[:directory_name], feature)
111
+ else
112
+ puts "warning: did not find a directory for datapoint #{feature}...skipping"
113
+ end
114
+ end
115
+ else
116
+ raise "Couldn't find scenario CSV: #{scenario_csv}"
117
+ end
100
118
  feature_1_name = File.basename(feature_list[0]) # Get name of first feature, so we can read eplusout.sql from there
101
119
  uo_output_sql_file = File.join(@initialization_hash[:directory_name], feature_1_name, 'eplusout.sql')
102
120
  feature_list.each do |feature| # Loop through each feature in the scenario
@@ -30,6 +30,6 @@
30
30
 
31
31
  module URBANopt
32
32
  module Scenario
33
- VERSION = '0.4.0'.freeze
33
+ VERSION = '0.4.1'.freeze
34
34
  end
35
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urbanopt-scenario
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rawad El Kontar
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-09-22 00:00:00.000000000 Z
12
+ date: 2020-09-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler