openstudio-analysis 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/openstudio-analysis.rb +2 -0
- data/lib/openstudio/analysis/server_api.rb +19 -1
- data/lib/openstudio/analysis/translator/excel.rb +194 -129
- data/lib/openstudio/analysis/version.rb +1 -1
- data/lib/openstudio/templates/discrete_uncertain_variable.json.erb +10 -11
- data/lib/openstudio/templates/pivot_variable.json.erb +4 -4
- data/lib/openstudio/templates/uncertain_variable.json.erb +14 -12
- data/lib/openstudio/templates/workflow_item.json.erb +4 -4
- data/spec/files/0_3_0_outputs.xlsx +0 -0
- data/spec/files/analysis/medium_office.json +1830 -0
- data/spec/files/analysis/medium_office.zip +0 -0
- data/spec/files/discrete_dynamic_columns.xlsx +0 -0
- data/spec/files/discrete_variables.xlsx +0 -0
- data/spec/files/export/analysis/0_3_0_outputs.json +1311 -0
- data/spec/files/export/analysis/0_3_0_outputs.zip +0 -0
- data/spec/files/export/analysis/apartment_highrise.json +1311 -0
- data/spec/files/export/analysis/apartment_highrise.zip +0 -0
- data/spec/files/export/analysis/discrete_dynamic_seed.json +488 -0
- data/spec/files/export/analysis/discrete_dynamic_seed.zip +0 -0
- data/spec/files/export/analysis/discrete_seed.json +743 -0
- data/spec/files/export/analysis/discrete_seed.zip +0 -0
- data/spec/files/export/analysis/kats_model_v2.json +511 -0
- data/spec/files/export/analysis/kats_model_v2.zip +0 -0
- data/spec/files/export/analysis/output_vars.json +719 -0
- data/spec/files/export/analysis/output_vars.zip +0 -0
- data/spec/files/export/analysis/small_seed.json +673 -0
- data/spec/files/export/analysis/small_seed.zip +0 -0
- data/spec/files/no_variables.xlsx +0 -0
- data/spec/files/outputvars.xlsx +0 -0
- data/spec/files/proxy.xlsx +0 -0
- data/spec/files/proxy_user.xlsx +0 -0
- data/spec/files/setup_version_2.xlsx +0 -0
- data/spec/files/small_list.xlsx +0 -0
- data/spec/files/small_list_incomplete.xlsx +0 -0
- data/spec/files/small_list_repeat_vars.xlsx +0 -0
- data/spec/files/small_list_validation_errors.xlsx +0 -0
- data/spec/files/template_input_0.1.10.xlsx +0 -0
- data/spec/files/~$0_3_0_outputs.xlsx +0 -0
- data/spec/openstudio/analysis/translator/excel_spec.rb +48 -1
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.0.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.1.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.10.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.11.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.12.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.13.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.14.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.2.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.3.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.4.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.5.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.6.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.7.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.8.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.9.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.0.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.1.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.10.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.11.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.12.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.13.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.14.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.2.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.3.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.4.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.5.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.6.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.7.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.8.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.9.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.0.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.1.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.10.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.11.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.12.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.13.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.14.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.2.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.3.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.4.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.5.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.6.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.7.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.8.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.9.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.0.xml +25 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.1.xml +25 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.10.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.11.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.2.xml +25 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.3.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.4.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.5.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.6.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.7.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.8.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.9.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.xml +25 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.0.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.1.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.10.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.11.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.2.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.3.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.4.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.5.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.6.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.7.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.8.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.9.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.0.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.1.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.10.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.11.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.12.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.13.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.2.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.3.xml +24 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.4.xml +24 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.5.xml +24 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.6.xml +24 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.7.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.8.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.9.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.0.xml +16 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.1.xml +16 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.10.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.11.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.2.xml +16 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.3.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.4.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.5.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.6.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.7.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.8.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.9.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.xml +16 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.0.xml +16 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.1.xml +16 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.10.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.11.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.12.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.2.xml +16 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.3.xml +16 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.4.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.5.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.6.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.7.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.8.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.9.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.xml +16 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.0.xml +70 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.1.xml +70 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.10.xml +36 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.11.xml +36 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.2.xml +70 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.3.xml +36 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.4.xml +36 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.5.xml +36 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.6.xml +36 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.7.xml +36 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.8.xml +36 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.9.xml +36 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.xml +70 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.0.xml +43 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.1.xml +43 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.10.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.11.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.12.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.13.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.2.xml +43 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.3.xml +43 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.4.xml +43 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.5.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.6.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.7.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.8.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.9.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.xml +43 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.0.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.1.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.10.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.11.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.12.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.13.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.2.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.3.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.4.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.5.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.6.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.7.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.8.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.9.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.0.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.1.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.10.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.11.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.12.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.13.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.2.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.3.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.4.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.5.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.6.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.7.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.8.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.9.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.0.xml +43 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.1.xml +43 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.10.xml +23 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.11.xml +23 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.12.xml +23 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.13.xml +23 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.2.xml +43 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.3.xml +43 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.4.xml +43 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.5.xml +23 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.6.xml +23 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.7.xml +23 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.8.xml +23 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.9.xml +23 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.xml +43 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.0.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.1.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.10.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.11.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.12.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.13.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.2.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.3.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.4.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.5.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.6.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.7.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.8.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.9.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.0.xml +20 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.1.xml +20 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.10.xml +13 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.11.xml +13 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.2.xml +20 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.3.xml +20 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.4.xml +13 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.5.xml +13 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.6.xml +13 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.7.xml +13 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.8.xml +13 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.9.xml +13 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.xml +20 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.0.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.1.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.10.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.11.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.2.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.3.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.4.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.5.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.6.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.7.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.8.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.9.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.0.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.1.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.10.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.11.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.2.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.3.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.4.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.5.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.6.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.7.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.8.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.9.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.0.xml +19 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.1.xml +33 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.2.xml +19 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.3.xml +22 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.4.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.5.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.xml +46 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.0.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.1.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.10.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.11.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.12.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.13.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.14.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.2.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.3.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.4.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.5.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.6.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.7.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.8.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.9.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.xml +7 -0
- data/spec/spec_helper.rb +2 -2
- metadata +570 -3
- 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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 64b711bc6dd71fed0572358ab94477f37adc4fd4
|
|
4
|
+
data.tar.gz: 406a7c55aa84200df93e4cb28760baf6e4223b27
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 38020c7b813e88564ff15b2e4eb3e8a721aa129ed602b193f0f0debd3a073f794ea3100c86cd5c8890e31f68b3c1f3ca69423d2b5d9cf952b678b40f407056e1
|
|
7
|
+
data.tar.gz: e1cbce6ac68b8b275f368560c27d39a2c76058ae65a399799723d26796172e7d26aa13fb5389c27db890a8d283a7c6b1c9c1a3c6e326e20459f74f2e0f4f317a
|
data/CHANGELOG.md
CHANGED
|
@@ -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
|
|
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
|
data/lib/openstudio-analysis.rb
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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']
|
|
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
|
-
|
|
112
|
-
|
|
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
|
-
|
|
115
|
-
if variable['
|
|
116
|
-
|
|
117
|
-
|
|
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
|
|
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']['
|
|
138
|
-
fail "Variable #{measure['name']}:#{variable['name']} must have a
|
|
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
|
-
|
|
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']
|
|
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['
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
|
|
234
|
-
|
|
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
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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
|
-
|
|
264
|
+
@static_value = false
|
|
278
265
|
end
|
|
266
|
+
else
|
|
267
|
+
fail "Unknown variable type of '#{@variable['type']}'"
|
|
268
|
+
end
|
|
279
269
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
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
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
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
|
-
|
|
514
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 << {
|
|
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.
|
|
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'
|
|
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'
|
|
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.
|
|
665
|
-
icnt
|
|
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
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
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 =
|
|
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.
|
|
759
|
-
icnt
|
|
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[
|
|
765
|
-
var['
|
|
766
|
-
var['
|
|
767
|
-
var['
|
|
768
|
-
|
|
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[
|
|
776
|
-
var['scaling_factor'] = row[
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
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
|