openstudio-analysis 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (311) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/openstudio-analysis.rb +2 -0
  5. data/lib/openstudio/analysis/server_api.rb +19 -1
  6. data/lib/openstudio/analysis/translator/excel.rb +194 -129
  7. data/lib/openstudio/analysis/version.rb +1 -1
  8. data/lib/openstudio/templates/discrete_uncertain_variable.json.erb +10 -11
  9. data/lib/openstudio/templates/pivot_variable.json.erb +4 -4
  10. data/lib/openstudio/templates/uncertain_variable.json.erb +14 -12
  11. data/lib/openstudio/templates/workflow_item.json.erb +4 -4
  12. data/spec/files/0_3_0_outputs.xlsx +0 -0
  13. data/spec/files/analysis/medium_office.json +1830 -0
  14. data/spec/files/analysis/medium_office.zip +0 -0
  15. data/spec/files/discrete_dynamic_columns.xlsx +0 -0
  16. data/spec/files/discrete_variables.xlsx +0 -0
  17. data/spec/files/export/analysis/0_3_0_outputs.json +1311 -0
  18. data/spec/files/export/analysis/0_3_0_outputs.zip +0 -0
  19. data/spec/files/export/analysis/apartment_highrise.json +1311 -0
  20. data/spec/files/export/analysis/apartment_highrise.zip +0 -0
  21. data/spec/files/export/analysis/discrete_dynamic_seed.json +488 -0
  22. data/spec/files/export/analysis/discrete_dynamic_seed.zip +0 -0
  23. data/spec/files/export/analysis/discrete_seed.json +743 -0
  24. data/spec/files/export/analysis/discrete_seed.zip +0 -0
  25. data/spec/files/export/analysis/kats_model_v2.json +511 -0
  26. data/spec/files/export/analysis/kats_model_v2.zip +0 -0
  27. data/spec/files/export/analysis/output_vars.json +719 -0
  28. data/spec/files/export/analysis/output_vars.zip +0 -0
  29. data/spec/files/export/analysis/small_seed.json +673 -0
  30. data/spec/files/export/analysis/small_seed.zip +0 -0
  31. data/spec/files/no_variables.xlsx +0 -0
  32. data/spec/files/outputvars.xlsx +0 -0
  33. data/spec/files/proxy.xlsx +0 -0
  34. data/spec/files/proxy_user.xlsx +0 -0
  35. data/spec/files/setup_version_2.xlsx +0 -0
  36. data/spec/files/small_list.xlsx +0 -0
  37. data/spec/files/small_list_incomplete.xlsx +0 -0
  38. data/spec/files/small_list_repeat_vars.xlsx +0 -0
  39. data/spec/files/small_list_validation_errors.xlsx +0 -0
  40. data/spec/files/template_input_0.1.10.xlsx +0 -0
  41. data/spec/files/~$0_3_0_outputs.xlsx +0 -0
  42. data/spec/openstudio/analysis/translator/excel_spec.rb +48 -1
  43. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.0.xml +9 -0
  44. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.1.xml +9 -0
  45. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.10.xml +9 -0
  46. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.11.xml +9 -0
  47. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.12.xml +9 -0
  48. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.13.xml +9 -0
  49. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.14.xml +9 -0
  50. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.2.xml +9 -0
  51. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.3.xml +9 -0
  52. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.4.xml +9 -0
  53. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.5.xml +9 -0
  54. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.6.xml +9 -0
  55. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.7.xml +9 -0
  56. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.8.xml +9 -0
  57. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.9.xml +9 -0
  58. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.xml +9 -0
  59. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.0.xml +9 -0
  60. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.1.xml +9 -0
  61. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.10.xml +9 -0
  62. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.11.xml +9 -0
  63. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.12.xml +9 -0
  64. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.13.xml +9 -0
  65. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.14.xml +9 -0
  66. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.2.xml +9 -0
  67. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.3.xml +9 -0
  68. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.4.xml +9 -0
  69. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.5.xml +9 -0
  70. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.6.xml +9 -0
  71. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.7.xml +9 -0
  72. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.8.xml +9 -0
  73. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.9.xml +9 -0
  74. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.xml +9 -0
  75. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.0.xml +7 -0
  76. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.1.xml +7 -0
  77. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.10.xml +7 -0
  78. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.11.xml +7 -0
  79. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.12.xml +7 -0
  80. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.13.xml +7 -0
  81. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.14.xml +7 -0
  82. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.2.xml +7 -0
  83. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.3.xml +7 -0
  84. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.4.xml +7 -0
  85. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.5.xml +7 -0
  86. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.6.xml +7 -0
  87. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.7.xml +7 -0
  88. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.8.xml +7 -0
  89. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.9.xml +7 -0
  90. data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.xml +7 -0
  91. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.0.xml +25 -0
  92. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.1.xml +25 -0
  93. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.10.xml +18 -0
  94. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.11.xml +18 -0
  95. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.2.xml +25 -0
  96. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.3.xml +18 -0
  97. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.4.xml +18 -0
  98. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.5.xml +18 -0
  99. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.6.xml +18 -0
  100. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.7.xml +18 -0
  101. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.8.xml +18 -0
  102. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.9.xml +18 -0
  103. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.xml +25 -0
  104. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.0.xml +17 -0
  105. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.1.xml +17 -0
  106. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.10.xml +17 -0
  107. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.11.xml +17 -0
  108. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.2.xml +17 -0
  109. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.3.xml +17 -0
  110. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.4.xml +17 -0
  111. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.5.xml +17 -0
  112. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.6.xml +17 -0
  113. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.7.xml +17 -0
  114. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.8.xml +17 -0
  115. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.9.xml +17 -0
  116. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.xml +17 -0
  117. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.0.xml +32 -0
  118. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.1.xml +32 -0
  119. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.10.xml +18 -0
  120. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.11.xml +18 -0
  121. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.12.xml +18 -0
  122. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.13.xml +18 -0
  123. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.2.xml +32 -0
  124. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.3.xml +24 -0
  125. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.4.xml +24 -0
  126. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.5.xml +24 -0
  127. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.6.xml +24 -0
  128. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.7.xml +18 -0
  129. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.8.xml +18 -0
  130. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.9.xml +18 -0
  131. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.xml +32 -0
  132. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.0.xml +16 -0
  133. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.1.xml +16 -0
  134. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.10.xml +9 -0
  135. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.11.xml +9 -0
  136. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.2.xml +16 -0
  137. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.3.xml +9 -0
  138. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.4.xml +9 -0
  139. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.5.xml +9 -0
  140. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.6.xml +9 -0
  141. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.7.xml +9 -0
  142. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.8.xml +9 -0
  143. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.9.xml +9 -0
  144. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.xml +16 -0
  145. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.0.xml +16 -0
  146. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.1.xml +16 -0
  147. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.10.xml +9 -0
  148. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.11.xml +9 -0
  149. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.12.xml +9 -0
  150. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.2.xml +16 -0
  151. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.3.xml +16 -0
  152. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.4.xml +9 -0
  153. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.5.xml +9 -0
  154. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.6.xml +9 -0
  155. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.7.xml +9 -0
  156. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.8.xml +9 -0
  157. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.9.xml +9 -0
  158. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.xml +16 -0
  159. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.0.xml +70 -0
  160. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.1.xml +70 -0
  161. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.10.xml +36 -0
  162. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.11.xml +36 -0
  163. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.2.xml +70 -0
  164. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.3.xml +36 -0
  165. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.4.xml +36 -0
  166. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.5.xml +36 -0
  167. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.6.xml +36 -0
  168. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.7.xml +36 -0
  169. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.8.xml +36 -0
  170. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.9.xml +36 -0
  171. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.xml +70 -0
  172. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.0.xml +43 -0
  173. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.1.xml +43 -0
  174. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.10.xml +21 -0
  175. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.11.xml +21 -0
  176. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.12.xml +21 -0
  177. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.13.xml +21 -0
  178. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.2.xml +43 -0
  179. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.3.xml +43 -0
  180. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.4.xml +43 -0
  181. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.5.xml +21 -0
  182. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.6.xml +21 -0
  183. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.7.xml +21 -0
  184. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.8.xml +21 -0
  185. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.9.xml +21 -0
  186. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.xml +43 -0
  187. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.0.xml +21 -0
  188. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.1.xml +21 -0
  189. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.10.xml +9 -0
  190. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.11.xml +9 -0
  191. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.12.xml +9 -0
  192. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.13.xml +9 -0
  193. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.2.xml +21 -0
  194. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.3.xml +21 -0
  195. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.4.xml +21 -0
  196. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.5.xml +9 -0
  197. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.6.xml +9 -0
  198. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.7.xml +9 -0
  199. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.8.xml +9 -0
  200. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.9.xml +9 -0
  201. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.xml +21 -0
  202. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.0.xml +21 -0
  203. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.1.xml +21 -0
  204. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.10.xml +9 -0
  205. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.11.xml +9 -0
  206. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.12.xml +9 -0
  207. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.13.xml +9 -0
  208. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.2.xml +21 -0
  209. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.3.xml +21 -0
  210. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.4.xml +21 -0
  211. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.5.xml +9 -0
  212. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.6.xml +9 -0
  213. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.7.xml +9 -0
  214. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.8.xml +9 -0
  215. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.9.xml +9 -0
  216. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.xml +21 -0
  217. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.0.xml +43 -0
  218. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.1.xml +43 -0
  219. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.10.xml +23 -0
  220. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.11.xml +23 -0
  221. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.12.xml +23 -0
  222. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.13.xml +23 -0
  223. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.2.xml +43 -0
  224. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.3.xml +43 -0
  225. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.4.xml +43 -0
  226. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.5.xml +23 -0
  227. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.6.xml +23 -0
  228. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.7.xml +23 -0
  229. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.8.xml +23 -0
  230. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.9.xml +23 -0
  231. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.xml +43 -0
  232. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.0.xml +21 -0
  233. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.1.xml +21 -0
  234. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.10.xml +9 -0
  235. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.11.xml +9 -0
  236. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.12.xml +9 -0
  237. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.13.xml +9 -0
  238. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.2.xml +21 -0
  239. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.3.xml +21 -0
  240. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.4.xml +21 -0
  241. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.5.xml +9 -0
  242. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.6.xml +9 -0
  243. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.7.xml +9 -0
  244. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.8.xml +9 -0
  245. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.9.xml +9 -0
  246. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.xml +21 -0
  247. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.0.xml +20 -0
  248. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.1.xml +20 -0
  249. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.10.xml +13 -0
  250. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.11.xml +13 -0
  251. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.2.xml +20 -0
  252. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.3.xml +20 -0
  253. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.4.xml +13 -0
  254. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.5.xml +13 -0
  255. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.6.xml +13 -0
  256. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.7.xml +13 -0
  257. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.8.xml +13 -0
  258. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.9.xml +13 -0
  259. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.xml +20 -0
  260. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.0.xml +21 -0
  261. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.1.xml +21 -0
  262. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.10.xml +21 -0
  263. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.11.xml +21 -0
  264. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.2.xml +21 -0
  265. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.3.xml +21 -0
  266. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.4.xml +21 -0
  267. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.5.xml +21 -0
  268. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.6.xml +21 -0
  269. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.7.xml +21 -0
  270. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.8.xml +21 -0
  271. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.9.xml +21 -0
  272. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.xml +21 -0
  273. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.0.xml +32 -0
  274. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.1.xml +32 -0
  275. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.10.xml +32 -0
  276. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.11.xml +32 -0
  277. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.2.xml +32 -0
  278. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.3.xml +32 -0
  279. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.4.xml +32 -0
  280. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.5.xml +32 -0
  281. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.6.xml +32 -0
  282. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.7.xml +32 -0
  283. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.8.xml +32 -0
  284. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.9.xml +32 -0
  285. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.xml +32 -0
  286. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.0.xml +19 -0
  287. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.1.xml +33 -0
  288. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.2.xml +19 -0
  289. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.3.xml +22 -0
  290. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.4.xml +21 -0
  291. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.5.xml +21 -0
  292. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.xml +46 -0
  293. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.0.xml +7 -0
  294. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.1.xml +7 -0
  295. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.10.xml +7 -0
  296. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.11.xml +7 -0
  297. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.12.xml +7 -0
  298. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.13.xml +7 -0
  299. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.14.xml +7 -0
  300. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.2.xml +7 -0
  301. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.3.xml +7 -0
  302. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.4.xml +7 -0
  303. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.5.xml +7 -0
  304. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.6.xml +7 -0
  305. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.7.xml +7 -0
  306. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.8.xml +7 -0
  307. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.9.xml +7 -0
  308. data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.xml +7 -0
  309. data/spec/spec_helper.rb +2 -2
  310. metadata +570 -3
  311. data/lib/openstudio/templates/static_variable.json.erb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b375c6d43937f29e209710d135a528922a6ef091
4
- data.tar.gz: b075c4886fe35caf999e7a2e7275df418a7e3efa
3
+ metadata.gz: 64b711bc6dd71fed0572358ab94477f37adc4fd4
4
+ data.tar.gz: 406a7c55aa84200df93e4cb28760baf6e4223b27
5
5
  SHA512:
6
- metadata.gz: a730b5829fca946e4bfef3a42d26f85b9d163c1d3709c5f10162d37407d1e8b35987fa2418b1c2235ed8b2a438b50a175b58bff6b73b80b210c6ff8b90a14f7c
7
- data.tar.gz: b8a1b254c5f20680010a7cee0cc5638ddd82e06c1f0a069ab855bb9b3ef4e4b4db189c755a285e0a9643e5e1513fed9f991a0df490a2edb6db06283f00547671
6
+ metadata.gz: 38020c7b813e88564ff15b2e4eb3e8a721aa129ed602b193f0f0debd3a073f794ea3100c86cd5c8890e31f68b3c1f3ca69423d2b5d9cf952b678b40f407056e1
7
+ data.tar.gz: e1cbce6ac68b8b275f368560c27d39a2c76058ae65a399799723d26796172e7d26aa13fb5389c27db890a8d283a7c6b1c9c1a3c6e326e20459f74f2e0f4f317a
@@ -4,6 +4,13 @@ OpenStudio Analysis Gem Change Log
4
4
  Unreleased
5
5
  --------------
6
6
 
7
+ Version 0.3.0 (not yet on RubyGems)
8
+ --------------
9
+ * Remove the column for Sampling Method. That is now part of the analysis config.
10
+ * All variables need static values now
11
+ * Updated output tab to add more information about the outputs if available
12
+ * Remove hardcoded baseline exception
13
+
7
14
  Version 0.2.3
8
15
  --------------
9
16
 
data/README.md CHANGED
@@ -6,7 +6,7 @@ The OpenStudio Analysis Gem is used to communicate files to the OpenStudio Distr
6
6
  The purpose of this gem is to generate the analysis.json file, analysis.zip, and communicate with the server to upload
7
7
  the simulations.
8
8
 
9
- The gem does not create the cluster (not launch it). Currently the only supported Cloud platform is
9
+ The gem does not create the cluster. Currently the only supported Cloud platform is
10
10
  Amazon AWS using either [OpenStudio's PAT](https://openstudio.nrel.gov) the [openstudio-aws gem](https://rubygems.org/gems/openstudio-aws) or using [vagrant](http://www.vagrantup.com/).
11
11
 
12
12
  Instructions
@@ -5,8 +5,10 @@ require 'roo'
5
5
  require 'erb'
6
6
  require 'zip'
7
7
  require 'semantic'
8
+ require 'semantic/core_ext'
8
9
  require 'logger'
9
10
  require 'pp'
11
+ require 'pathname'
10
12
 
11
13
  # core
12
14
  require 'openstudio/analysis/server_api'
@@ -109,13 +109,31 @@ 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"
114
+ if response.status == 200
115
+ filename = response['content-disposition'].match(/filename=(\"?)(.+)\1/)[2]
116
+ puts "File #{filename} already exists, overwriting" if File.exist?("#{save_directory}/#{filename}")
117
+ File.open("#{save_directory}/#{filename}",'w') {|f| f << response.body}
118
+ end
119
+ end
120
+
121
+ def download_variables(analysis_id, save_directory=".")
122
+ response = @conn.get "/analyses/#{analysis_id}/download_variables.rdata"
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
+
112
130
  def new_analysis(project_id, options)
113
131
  defaults = { analysis_name: nil, reset_uuids: false }
114
132
  options = defaults.merge(options)
115
133
 
116
134
  fail 'No project id passed' if project_id.nil?
117
135
  fail 'no formulation passed to new_analysis' unless options[:formulation_file]
118
- fail "No formation exists #{options[:formulation_file]}" unless File.exist?(options[:formulation_file])
136
+ fail "No formulation exists #{options[:formulation_file]}" unless File.exist?(options[:formulation_file])
119
137
 
120
138
  formulation_json = JSON.parse(File.read(options[:formulation_file]), symbolize_names: true)
121
139
 
@@ -17,7 +17,7 @@ module OpenStudio
17
17
  attr_reader :run_setup
18
18
 
19
19
  # remove these once we have classes to construct the JSON file
20
- attr_reader :name
20
+ attr_accessor :name
21
21
  attr_reader :machine_name
22
22
  attr_reader :template_json
23
23
 
@@ -103,47 +103,48 @@ module OpenStudio
103
103
  # verify that all continuous variables have all the data needed and create a name maps
104
104
  variable_names = []
105
105
  @variables['data'].each do |measure|
106
- if measure['enabled'] && measure['name'] != 'baseline'
106
+ if measure['enabled']
107
107
  measure['variables'].each do |variable|
108
108
  # Determine if row is suppose to be an argument or a variable to be perturbed.
109
109
  if variable['variable_type'] == 'variable'
110
110
  variable_names << variable['display_name']
111
- if variable['method'] == 'static'
112
- # add this as an argument
111
+
112
+ # make sure that the variable has a static value
113
+ if variable['distribution']['static_value'].nil? || variable['distribution']['static_value'] == ''
114
+ fail "Variable #{measure['name']}:#{variable['name']} needs a static value"
115
+ end
116
+
117
+ if variable['type'] == 'enum' || variable['type'] == 'Choice'
113
118
  # check something
114
- elsif variable['method'] == 'lhs'
115
- if variable['type'] == 'enum' || variable['type'] == 'Choice'
116
- # check something
117
- else # must be an integer or double
118
- if variable['distribution']['type'] == 'discrete_uncertain'
119
- if variable['distribution']['discrete_values'].nil? || variable['distribution']['discrete_values'] == ''
120
- fail "Variable #{measure['name']}:#{variable['name']} needs discrete values"
121
- end
122
- else
123
- if variable['distribution']['mean'].nil? || variable['distribution']['mean'] == ''
124
- fail "Variable #{measure['name']}:#{variable['name']} must have a mean"
125
- end
126
- if variable['distribution']['stddev'].nil? || variable['distribution']['stddev'] == ''
127
- fail "Variable #{measure['name']}:#{variable['name']} must have a stddev"
128
- end
119
+ else # must be an integer or double
120
+ if variable['distribution']['type'] == 'discrete_uncertain'
121
+ if variable['distribution']['discrete_values'].nil? || variable['distribution']['discrete_values'] == ''
122
+ fail "Variable #{measure['name']}:#{variable['name']} needs discrete values"
129
123
  end
130
-
124
+ else
131
125
  if variable['distribution']['mean'].nil? || variable['distribution']['mean'] == ''
132
- fail "Variable #{measure['name']}:#{variable['name']} must have a mean/mode"
133
- end
134
- if variable['distribution']['min'].nil? || variable['distribution']['min'] == ''
135
- fail "Variable #{measure['name']}:#{variable['name']} must have a minimum"
126
+ fail "Variable #{measure['name']}:#{variable['name']} must have a mean"
136
127
  end
137
- if variable['distribution']['max'].nil? || variable['distribution']['max'] == ''
138
- fail "Variable #{measure['name']}:#{variable['name']} must have a maximum"
128
+ if variable['distribution']['stddev'].nil? || variable['distribution']['stddev'] == ''
129
+ fail "Variable #{measure['name']}:#{variable['name']} must have a stddev"
139
130
  end
131
+ end
132
+
133
+ if variable['distribution']['mean'].nil? || variable['distribution']['mean'] == ''
134
+ fail "Variable #{measure['name']}:#{variable['name']} must have a mean/mode"
135
+ end
136
+ if variable['distribution']['min'].nil? || variable['distribution']['min'] == ''
137
+ fail "Variable #{measure['name']}:#{variable['name']} must have a minimum"
138
+ end
139
+ if variable['distribution']['max'].nil? || variable['distribution']['max'] == ''
140
+ fail "Variable #{measure['name']}:#{variable['name']} must have a maximum"
141
+ end
142
+ unless variable['type'] == 'string'
140
143
  if variable['distribution']['min'] > variable['distribution']['max']
141
144
  fail "Variable min is greater than variable max for #{measure['name']}:#{variable['name']}"
142
145
  end
143
-
144
146
  end
145
- elsif variable['method'] == 'pivot'
146
- # check something
147
+
147
148
  end
148
149
  end
149
150
  end
@@ -189,7 +190,6 @@ module OpenStudio
189
190
  workflow_template = ERB.new(File.open("#{template_root}/workflow_item.json.erb", 'r').read)
190
191
  uncertain_variable_template = ERB.new(File.open("#{template_root}/uncertain_variable.json.erb", 'r').read)
191
192
  discrete_uncertain_variable_template = ERB.new(File.open("#{template_root}/discrete_uncertain_variable.json.erb", 'r').read)
192
- static_variable_template = ERB.new(File.open("#{template_root}/static_variable.json.erb", 'r').read)
193
193
  pivot_variable_template = ERB.new(File.open("#{template_root}/pivot_variable.json.erb", 'r').read)
194
194
  argument_template = ERB.new(File.open("#{template_root}/argument.json.erb", 'r').read)
195
195
 
@@ -204,7 +204,7 @@ module OpenStudio
204
204
  @measure_index = -1
205
205
  @variables['data'].each do |measure|
206
206
  # With OpenStudio server we need to create the workflow with all the measure instances
207
- if measure['enabled'] && measure['name'] != 'baseline'
207
+ if measure['enabled']
208
208
  @measure_index += 1
209
209
 
210
210
  puts " Adding measure item '#{measure['name']}'"
@@ -217,21 +217,16 @@ module OpenStudio
217
217
  # add in the variables
218
218
  measure['variables'].each do |variable|
219
219
  @variable = variable
220
-
221
220
  # Determine if row is suppose to be an argument or a variable to be perturbed.
222
221
  if @variable['variable_type'] == 'argument'
223
222
  ag = nil
224
- if @variable['method'] == 'static'
225
- if @variable['distribution']['static_value'].nil? || @variable['distribution']['static_value'] == 'null'
226
- puts " Warning: '#{measure['name']}:#{@variable['name']}' static value was empty or null, assuming optional and skipping"
227
- next
228
- end
229
- # unless @variable['distribution']['static_value']
230
- # fail 'Cannot have an argument that is not a static value defined in which to set the argument'
231
- # end
223
+ if @variable['distribution']['static_value'].nil? || @variable['distribution']['static_value'] == 'null'
224
+ puts " Warning: '#{measure['name']}:#{@variable['name']}' static value was empty or null, assuming optional and skipping"
225
+ next
226
+ end
232
227
 
233
- # add this as an argument
234
- case @variable['type'].downcase
228
+ # add this as an argument
229
+ case @variable['type'].downcase
235
230
  when 'double'
236
231
  @static_value = @variable['distribution']['static_value'].to_f
237
232
  when 'integer'
@@ -247,54 +242,69 @@ module OpenStudio
247
242
  end
248
243
  else
249
244
  fail "Unknown variable type of '#{@variable['type']}'"
250
- end
251
- ag = JSON.parse(argument_template.result(get_binding))
252
245
  end
246
+ ag = JSON.parse(argument_template.result(get_binding))
253
247
  fail "Argument '#{@variable['name']}' did not process. Most likely it did not have all parameters defined." if ag.nil?
254
248
  wf['arguments'] << ag
255
249
  else # must be a variable [either pivot or normal variable]
256
250
  vr = nil
257
- if @variable['method'] == 'static'
258
- # add this as an argument
259
- vr = JSON.parse(static_variable_template.result(get_binding))
260
- elsif @variable['method'] == 'lhs'
261
- # TODO: remove enum and choice as this is not the variable type
262
- if @variable['type'] == 'enum' || @variable['type'].downcase == 'choice'
263
- @values_and_weights = @variable['distribution']['enumerations'].map { |v| { value: v } }.to_json
264
- vr = JSON.parse(discrete_uncertain_variable_template.result(get_binding))
265
- elsif @variable['distribution']['type'] == 'discrete_uncertain'
266
- # puts @variable.inspect
267
- weights = nil
268
- if @variable['distribution']['discrete_weights'] && @variable['distribution']['discrete_weights'] != ''
269
- weights = eval(@variable['distribution']['discrete_weights'])
270
- end
271
-
272
- values = nil
273
- if variable['type'].downcase == 'bool'
274
- values = eval(@variable['distribution']['discrete_values'])
275
- values.map! { |v| v.downcase == 'true' }
251
+ # add this as an argument
252
+ case @variable['type'].downcase
253
+ when 'double'
254
+ @static_value = @variable['distribution']['static_value'].to_f
255
+ when 'integer'
256
+ @static_value = @variable['distribution']['static_value'].to_i
257
+ # TODO: update openstudio export to write only Strings
258
+ when 'string', 'choice'
259
+ @static_value = @variable['distribution']['static_value'].inspect
260
+ when 'bool'
261
+ if @variable['distribution']['static_value'].downcase == 'true'
262
+ @static_value = true
276
263
  else
277
- values = eval(@variable['distribution']['discrete_values'])
264
+ @static_value = false
278
265
  end
266
+ else
267
+ fail "Unknown variable type of '#{@variable['type']}'"
268
+ end
279
269
 
280
- if weights
281
- fail "Discrete variable '#{@variable['name']}' does not have equal length of values and weights" if values.size != weights.size
282
- @values_and_weights = values.zip(weights).map { |v, w| { value: v, weight: w } }.to_json
283
- else
284
- @values_and_weights = values.map { |v| { value: v } }.to_json
285
- end
270
+ # TODO: remove enum and choice as this is not the variable type
271
+ if @variable['type'] == 'enum' || @variable['type'].downcase == 'choice'
272
+ @values_and_weights = @variable['distribution']['enumerations'].map { |v| {value: v} }.to_json
273
+ vr = JSON.parse(discrete_uncertain_variable_template.result(get_binding))
274
+ elsif @variable['distribution']['type'] == 'discrete_uncertain'
275
+ # puts @variable.inspect
276
+ weights = nil
277
+ if @variable['distribution']['discrete_weights'] && @variable['distribution']['discrete_weights'] != ''
278
+ weights = eval(@variable['distribution']['discrete_weights'])
279
+ end
286
280
 
287
- if @variable['variable_type'] == 'pivot'
288
- vr = JSON.parse(pivot_variable_template.result(get_binding))
289
- else
290
- vr = JSON.parse(discrete_uncertain_variable_template.result(get_binding))
291
- end
281
+ values = nil
282
+ if variable['type'].downcase == 'bool'
283
+ values = eval(@variable['distribution']['discrete_values'])
284
+ values.map! { |v| v.to_s == 'true' }
292
285
  else
293
- if @variable['variable_type'] == 'pivot'
294
- fail 'Currently unable to pivot on continuous variables... stay tuned.'
295
- else
296
- vr = JSON.parse(uncertain_variable_template.result(get_binding))
297
- end
286
+ values = eval(@variable['distribution']['discrete_values'])
287
+ end
288
+
289
+ if weights
290
+ fail "Discrete variable '#{@variable['name']}' does not have equal length of values and weights" if values.size != weights.size
291
+ @values_and_weights = values.zip(weights).map { |v, w| {value: v, weight: w} }.to_json
292
+ else
293
+ @values_and_weights = values.map { |v| {value: v} }.to_json
294
+ end
295
+
296
+
297
+ if @variable['variable_type'] == 'pivot'
298
+
299
+ vr = JSON.parse(pivot_variable_template.result(get_binding))
300
+ else
301
+ vr = JSON.parse(discrete_uncertain_variable_template.result(get_binding))
302
+ end
303
+ else
304
+ if @variable['variable_type'] == 'pivot'
305
+ fail 'Currently unable to pivot on continuous variables... stay tuned.'
306
+ else
307
+ vr = JSON.parse(uncertain_variable_template.result(get_binding))
298
308
  end
299
309
  end
300
310
  fail 'variable was nil after processing' if vr.nil?
@@ -352,11 +362,6 @@ module OpenStudio
352
362
  end
353
363
  end
354
364
 
355
- if v['measure_file_name_directory'] =~ /baseline/i
356
- puts ' Skipping baseline measure'
357
- next
358
- end
359
-
360
365
  if measure_to_save && !added_measures.include?(measure_to_save)
361
366
  # pp "Attempting to add measure #{measure_to_save}"
362
367
  if File.exist?(measure_to_save)
@@ -397,6 +402,7 @@ module OpenStudio
397
402
  def deep_copy(o)
398
403
  Marshal.load(Marshal.dump(o))
399
404
  end
405
+
400
406
  # append the model name to the analysis name if requested (normally if there are more than
401
407
  # 1 models in the spreadsheet)
402
408
  new_analysis_json = deep_copy(analysis_json)
@@ -510,11 +516,23 @@ module OpenStudio
510
516
  # type some of the values that we know
511
517
  @settings['proxy_port'] = @settings['proxy_port'].to_i if @settings['proxy_port']
512
518
  elsif b_run_setup
513
- @name = row[1].chomp if row[0] == 'Analysis Name'
514
- @machine_name = @name.snake_case
519
+ if row[0] == 'Analysis Name'
520
+ if row[1]
521
+ @name = row[1]
522
+ else
523
+ @name = UUID.new.generate
524
+ end
525
+ @machine_name = @name.snake_case
526
+ end
515
527
  @export_path = File.expand_path(File.join(@root_path, row[1])) if row[0] == 'Export Directory'
516
- @measure_path = File.expand_path(File.join(@root_path, row[1])) if row[0] == 'Measure Directory'
517
-
528
+ if row[0] == 'Measure Directory'
529
+ tmp_filepath = row[1]
530
+ if (Pathname.new tmp_filepath).absolute?
531
+ @measure_path = tmp_filepath
532
+ else
533
+ @measure_path = File.expand_path(File.join(@root_path, tmp_filepath))
534
+ end
535
+ end
518
536
  @run_setup["#{row[0].snake_case}"] = row[1] if row[0]
519
537
 
520
538
  # type cast
@@ -539,9 +557,14 @@ module OpenStudio
539
557
  @weather_files += Dir.glob(File.expand_path(File.join(@root_path, row[1])))
540
558
  end
541
559
  elsif b_models
542
- @models << { name: row[1].snake_case, display_name: row[1], type: row[2], path: File.expand_path(File.join(@root_path, row[3])) }
560
+ if row[1]
561
+ tmp_m_name = row[1]
562
+ else
563
+ tmp_m_name = UUID.new.generate
564
+ end
565
+ @models << {name: tmp_m_name.snake_case, display_name: tmp_m_name, type: row[2], path: File.expand_path(File.join(@root_path, row[3]))}
543
566
  elsif b_other_libs
544
- @other_files << { lib_zip_name: row[1], path: row[2] }
567
+ @other_files << {lib_zip_name: row[1], path: row[2]}
545
568
  end
546
569
  end
547
570
  end
@@ -557,7 +580,30 @@ module OpenStudio
557
580
  # puts rows.inspect
558
581
  rows = nil
559
582
  begin
560
- if @version >= '0.2.0'
583
+ if @version >= '0.3.0'.to_version
584
+ rows = @xls.sheet('Variables').parse(enabled: '# variable',
585
+ measure_name_or_var_type: 'type',
586
+ measure_file_name_or_var_display_name: 'parameter display name.*',
587
+ measure_file_name_directory: 'measure directory',
588
+ measure_type_or_parameter_name_in_measure: 'parameter name in measure',
589
+ #sampling_method: 'sampling method',
590
+ variable_type: 'Variable Type',
591
+ units: 'units',
592
+ default_value: 'static.default value',
593
+ enums: 'enumerations',
594
+ min: 'min',
595
+ max: 'max',
596
+ mode: 'mean|mode',
597
+ stddev: 'std dev',
598
+ delta_x: 'delta.x',
599
+ discrete_values: 'discrete values',
600
+ discrete_weights: 'discrete weights',
601
+ distribution: 'distribution',
602
+ source: 'data source',
603
+ notes: 'notes',
604
+ relation_to_eui: 'typical var to eui relationship',
605
+ clean: true)
606
+ elsif @version >= '0.2.0'.to_version
561
607
  rows = @xls.sheet('Variables').parse(enabled: '# variable',
562
608
  measure_name_or_var_type: 'type',
563
609
  measure_file_name_or_var_display_name: 'parameter display name.*',
@@ -580,7 +626,7 @@ module OpenStudio
580
626
  notes: 'notes',
581
627
  relation_to_eui: 'typical var to eui relationship',
582
628
  clean: true)
583
- elsif @version >= '0.1.12' # add delta x
629
+ elsif @version >= '0.1.12'.to_version
584
630
  rows = @xls.sheet('Variables').parse(enabled: '# variable',
585
631
  measure_name_or_var_type: 'type',
586
632
  measure_file_name_or_var_display_name: 'parameter display name.*',
@@ -602,7 +648,7 @@ module OpenStudio
602
648
  notes: 'notes',
603
649
  relation_to_eui: 'typical var to eui relationship',
604
650
  clean: true)
605
- elsif @version >= '0.1.11' # add discrete variables
651
+ elsif @version >= '0.1.11'.to_version
606
652
  rows = @xls.sheet('Variables').parse(enabled: '# variable',
607
653
  measure_name_or_var_type: 'type',
608
654
  measure_file_name_or_var_display_name: 'parameter display name.*',
@@ -657,13 +703,11 @@ module OpenStudio
657
703
  data = {}
658
704
  data['data'] = []
659
705
 
660
- icnt = 0
661
706
  measure_index = -1
662
707
  variable_index = -1
663
708
  measure_name = nil
664
- rows.each do |row|
665
- icnt += 1
666
- next if icnt <= 1 # skip the first line after the header
709
+ rows.each_with_index do |row, icnt|
710
+ next if icnt < 1 # skip the first line after the header
667
711
  # puts "Parsing line: #{icnt}:#{row}"
668
712
 
669
713
  # check if we are a measure - nil means that the cell was blank
@@ -678,7 +722,6 @@ module OpenStudio
678
722
  var['name'] = row[:measure_type_or_parameter_name_in_measure]
679
723
  var['index'] = variable_index # order of the variable (not sure of its need)
680
724
 
681
- var['method'] = row[:sampling_method]
682
725
  var['type'] = row[:variable_type] ? row[:variable_type].downcase : row[:variable_type]
683
726
  var['units'] = row[:units]
684
727
 
@@ -693,17 +736,14 @@ module OpenStudio
693
736
  var['distribution']['enumerations'] << 'false'
694
737
  end
695
738
 
696
- if var['method'] == 'lhs'
697
- var['distribution']['min'] = row[:min]
698
- var['distribution']['max'] = row[:max]
699
- var['distribution']['mean'] = row[:mode]
700
- var['distribution']['stddev'] = row[:stddev]
701
- var['distribution']['discrete_values'] = row[:discrete_values]
702
- var['distribution']['discrete_weights'] = row[:discrete_weights]
703
- var['distribution']['type'] = row[:distribution]
704
- elsif var['method'] == 'static'
705
- var['distribution']['static_value'] = row[:default_value]
706
- end
739
+ var['distribution']['min'] = row[:min]
740
+ var['distribution']['max'] = row[:max]
741
+ var['distribution']['mean'] = row[:mode]
742
+ var['distribution']['stddev'] = row[:stddev]
743
+ var['distribution']['discrete_values'] = row[:discrete_values]
744
+ var['distribution']['discrete_weights'] = row[:discrete_weights]
745
+ var['distribution']['type'] = row[:distribution]
746
+ var['distribution']['static_value'] = row[:default_value]
707
747
 
708
748
  var['distribution']['source'] = row[:source]
709
749
  var['notes'] = row[:notes]
@@ -724,7 +764,7 @@ module OpenStudio
724
764
  data['data'][measure_index]['name'] = measure_name
725
765
  data['data'][measure_index]['enabled'] = row[:enabled] == 'TRUE' ? true : false
726
766
  data['data'][measure_index]['measure_file_name'] = row[:measure_file_name_or_var_display_name]
727
- if row[:measure_file_name_directory]
767
+ if row[:measure_file_name_directory]
728
768
  data['data'][measure_index]['measure_file_name_directory'] = row[:measure_file_name_directory]
729
769
  else
730
770
  data['data'][measure_index]['measure_file_name_directory'] = row[:measure_file_name_or_var_display_name].underscore
@@ -741,7 +781,28 @@ module OpenStudio
741
781
  end
742
782
 
743
783
  def parse_outputs
744
- rows = @xls.sheet('Outputs').parse
784
+ rows = nil
785
+ if @version >= '0.3.0'.to_version
786
+ rows = @xls.sheet('Outputs').parse(display_name: 'Variable Display Name',
787
+ metadata_id: 'Taxonomy Identifier',
788
+ name: '^Name$',
789
+ units: 'Units',
790
+ visualize: 'Visualize',
791
+ export: 'Export',
792
+ variable_type: 'Variable Type',
793
+ objective_function: 'Objective Function',
794
+ objective_function_target: 'Objective Function Target',
795
+ scaling_factor: 'Scale',
796
+ objective_function_group: 'Objective Function Group')
797
+ else
798
+ rows = @xls.sheet('Outputs').parse(display_name: 'Variable Display Name',
799
+ name: '^Name$',
800
+ units: 'units',
801
+ objective_function: 'objective function',
802
+ objective_function_target: 'objective function target',
803
+ scaling_factor: 'scale',
804
+ objective_function_group: 'objective')
805
+ end
745
806
 
746
807
  unless rows
747
808
  fail "Could not find the sheet name 'Outputs' in excel file #{@root_path}"
@@ -750,35 +811,39 @@ module OpenStudio
750
811
  data = {}
751
812
  data['output_variables'] = []
752
813
 
753
- icnt = 0
754
814
  variable_index = -1
755
815
  group_index = 1
756
816
  @algorithm['objective_functions'] = []
757
817
 
758
- rows.each do |row|
759
- icnt += 1
760
- # puts "Parsing line: #{icnt}"
761
- next if icnt <= 3 # skip the first 3 lines of the file
818
+ rows.each_with_index do |row, icnt|
819
+ next if icnt < 2 # skip the first 3 lines of the file
762
820
 
763
821
  var = {}
764
- var['display_name'] = row[0].strip
765
- var['name'] = row[1]
766
- var['units'] = row[2]
767
- var['objective_function'] = row[3].downcase == 'true' ? true : false
768
- if var['objective_function'] == true
822
+ var['display_name'] = row[:display_name]
823
+ var['metadata_id'] = row[:metadata_id]
824
+ var['name'] = row[:name]
825
+ var['units'] = row[:units]
826
+ var['visualize'] = row[:visualize].downcase == 'true' ? true : false if row[:visualize]
827
+ var['export'] = row[:export].downcase == 'true' ? true : false if row[:export]
828
+ var['variable_type'] = row[:variable_type] if row[:variable_type]
829
+ var['objective_function'] = row[:objective_function].downcase == 'true' ? true : false
830
+ if var['objective_function']
769
831
  @algorithm['objective_functions'] << var['name']
770
832
  variable_index += 1
771
833
  var['objective_function_index'] = variable_index
772
834
  else
773
835
  var['objective_function_index'] = nil
774
836
  end
775
- var['objective_function_target'] = row[4]
776
- var['scaling_factor'] = row[5]
777
- if row[6].nil?
778
- var['objective_function_group'] = group_index
779
- group_index += 1
780
- else
781
- var['objective_function_group'] = row[6]
837
+ var['objective_function_target'] = row[:objective_function_target]
838
+ var['scaling_factor'] = row[:scaling_factor]
839
+
840
+ if var['objective_function']
841
+ if row[:objective_function_group].nil?
842
+ var['objective_function_group'] = group_index
843
+ group_index += 1
844
+ else
845
+ var['objective_function_group'] = row[:objective_function_group]
846
+ end
782
847
  end
783
848
  data['output_variables'] << var
784
849
  end