openstudio-analysis 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/lib/openstudio/analysis/server_api.rb +13 -4
  3. data/lib/openstudio/analysis/translator/excel.rb +4 -1
  4. data/lib/openstudio/analysis/version.rb +1 -1
  5. data/spec/files/0_3_0_outputs.xlsx +0 -0
  6. data/spec/files/analysis/medium_office.json +240 -240
  7. data/spec/files/analysis/medium_office.zip +0 -0
  8. data/spec/files/export/analysis/0_3_0_outputs.json +10 -10
  9. data/spec/files/export/analysis/0_3_0_outputs.zip +0 -0
  10. data/spec/files/export/analysis/discrete_dynamic_seed.json +16 -16
  11. data/spec/files/export/analysis/discrete_dynamic_seed.zip +0 -0
  12. data/spec/files/export/analysis/discrete_seed.json +106 -106
  13. data/spec/files/export/analysis/discrete_seed.zip +0 -0
  14. data/spec/files/export/analysis/kats_model_v2.json +22 -22
  15. data/spec/files/export/analysis/kats_model_v2.zip +0 -0
  16. data/spec/files/export/analysis/output_vars.json +104 -104
  17. data/spec/files/export/analysis/output_vars.zip +0 -0
  18. data/spec/files/export/analysis/small_seed.json +104 -104
  19. data/spec/files/export/analysis/small_seed.zip +0 -0
  20. data/spec/files/partial_weather_2.epw +32 -0
  21. data/spec/openstudio/analysis/translator/excel_spec.rb +6 -0
  22. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.15.xml +9 -0
  23. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.16.xml +9 -0
  24. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.17.xml +9 -0
  25. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.18.xml +9 -0
  26. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.19.xml +9 -0
  27. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.20.xml +9 -0
  28. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.21.xml +9 -0
  29. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.22.xml +9 -0
  30. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.23.xml +9 -0
  31. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.24.xml +9 -0
  32. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.25.xml +9 -0
  33. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.15.xml +9 -0
  34. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.16.xml +9 -0
  35. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.17.xml +9 -0
  36. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.18.xml +9 -0
  37. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.19.xml +9 -0
  38. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.20.xml +9 -0
  39. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.21.xml +9 -0
  40. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.22.xml +9 -0
  41. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.23.xml +9 -0
  42. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.24.xml +9 -0
  43. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.25.xml +9 -0
  44. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.15.xml +7 -0
  45. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.16.xml +7 -0
  46. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.17.xml +7 -0
  47. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.18.xml +7 -0
  48. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.19.xml +7 -0
  49. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.20.xml +7 -0
  50. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.21.xml +7 -0
  51. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.22.xml +7 -0
  52. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.23.xml +7 -0
  53. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.24.xml +7 -0
  54. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.25.xml +7 -0
  55. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.12.xml +18 -0
  56. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.12.xml +17 -0
  57. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.14.xml +18 -0
  58. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.15.xml +18 -0
  59. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.12.xml +9 -0
  60. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.13.xml +9 -0
  61. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.12.xml +36 -0
  62. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.14.xml +21 -0
  63. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.14.xml +9 -0
  64. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.15.xml +9 -0
  65. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.14.xml +9 -0
  66. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.14.xml +23 -0
  67. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.14.xml +9 -0
  68. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.12.xml +13 -0
  69. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.12.xml +21 -0
  70. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.12.xml +32 -0
  71. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.10.xml +22 -0
  72. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.11.xml +29 -0
  73. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.12.xml +40 -0
  74. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.13.xml +40 -0
  75. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.14.xml +36 -0
  76. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.15.xml +22 -0
  77. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.6.xml +21 -0
  78. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.7.xml +21 -0
  79. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.8.xml +21 -0
  80. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.9.xml +22 -0
  81. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.15.xml +7 -0
  82. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.16.xml +7 -0
  83. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.17.xml +7 -0
  84. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.18.xml +7 -0
  85. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.19.xml +7 -0
  86. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.20.xml +7 -0
  87. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.21.xml +7 -0
  88. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.22.xml +7 -0
  89. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.23.xml +7 -0
  90. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.24.xml +7 -0
  91. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.25.xml +7 -0
  92. metadata +143 -3
  93. data/spec/files/~$0_3_0_outputs.xlsx +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 64b711bc6dd71fed0572358ab94477f37adc4fd4
4
- data.tar.gz: 406a7c55aa84200df93e4cb28760baf6e4223b27
3
+ metadata.gz: 74c0043c7f139238a9d7794eba641042e2fcf941
4
+ data.tar.gz: 3f6c3788437d50dce80865981d5d97a5717c6204
5
5
  SHA512:
6
- metadata.gz: 38020c7b813e88564ff15b2e4eb3e8a721aa129ed602b193f0f0debd3a073f794ea3100c86cd5c8890e31f68b3c1f3ca69423d2b5d9cf952b678b40f407056e1
7
- data.tar.gz: e1cbce6ac68b8b275f368560c27d39a2c76058ae65a399799723d26796172e7d26aa13fb5389c27db890a8d283a7c6b1c9c1a3c6e326e20459f74f2e0f4f317a
6
+ metadata.gz: ee7e7dd7efbe7c142e128a5f1409775f6a74b5e9bbff3476c8536cfe51300c7292e9c64a9c2f4517cf7d7429f8cf42b5ff49783fac706dec4f8f4481dd9b2db1
7
+ data.tar.gz: ea72ccaf13c8fabba36290b2c8451fbae3a30245650bcde78f8237b25e3f72d56c0ca62ecee09ecadd420a173f9b9f327e904a3cebd058727f4417bb90a8e2ef
@@ -109,8 +109,8 @@ module OpenStudio
109
109
  analysis_ids
110
110
  end
111
111
 
112
- def download_dataframe(analysis_id, save_directory=".")
113
- response = @conn.get "/analyses/#{analysis_id}/download_data.rdata"
112
+ def download_dataframe(analysis_id, format='rdata', save_directory=".")
113
+ response = @conn.get "/analyses/#{analysis_id}/download_data.#{format}"
114
114
  if response.status == 200
115
115
  filename = response['content-disposition'].match(/filename=(\"?)(.+)\1/)[2]
116
116
  puts "File #{filename} already exists, overwriting" if File.exist?("#{save_directory}/#{filename}")
@@ -118,8 +118,17 @@ module OpenStudio
118
118
  end
119
119
  end
120
120
 
121
- def download_variables(analysis_id, save_directory=".")
122
- response = @conn.get "/analyses/#{analysis_id}/download_variables.rdata"
121
+ def download_variables(analysis_id, format='rdata', save_directory=".")
122
+ response = @conn.get "/analyses/#{analysis_id}/variables/download_variables.#{format}"
123
+ if response.status == 200
124
+ filename = response['content-disposition'].match(/filename=(\"?)(.+)\1/)[2]
125
+ puts "File #{filename} already exists, overwriting" if File.exist?("#{save_directory}/#{filename}")
126
+ File.open("#{save_directory}/#{filename}",'w') {|f| f << response.body}
127
+ end
128
+ end
129
+
130
+ def download_all_data_points(analysis_id, save_directory=".")
131
+ response = @conn.get "/analyses/#{analysis_id}/download_all_data_points"
123
132
  if response.status == 200
124
133
  filename = response['content-disposition'].match(/filename=(\"?)(.+)\1/)[2]
125
134
  puts "File #{filename} already exists, overwriting" if File.exist?("#{save_directory}/#{filename}")
@@ -421,7 +421,10 @@ module OpenStudio
421
421
  if File.extname(@weather_files.first) =~ /.zip/i
422
422
  new_analysis_json['analysis']['weather_file']['path'] = "./weather/#{File.basename(@weather_files.first, '.zip')}.epw"
423
423
  else
424
- new_analysis_json['analysis']['weather_file']['path'] = "./weather/#{File.basename(@weather_files.first)}"
424
+ # get the first EPW file (not the first file)
425
+ weather = @weather_files.find{|w| File.extname(w).downcase == '.epw'}
426
+ fail "Could not find a weather file (*.epw) in weather directory #{File.dirname(@weather_files.first)}" unless weather
427
+ new_analysis_json['analysis']['weather_file']['path'] = "./weather/#{File.basename(weather)}"
425
428
  end
426
429
 
427
430
  json_file_name = "#{@export_path}/#{model[:name]}.json"
@@ -1,5 +1,5 @@
1
1
  module OpenStudio
2
2
  module Analysis
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
5
5
  end
Binary file