openstudio-analysis 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openstudio/analysis/server_api.rb +13 -4
- data/lib/openstudio/analysis/translator/excel.rb +4 -1
- data/lib/openstudio/analysis/version.rb +1 -1
- data/spec/files/0_3_0_outputs.xlsx +0 -0
- data/spec/files/analysis/medium_office.json +240 -240
- data/spec/files/analysis/medium_office.zip +0 -0
- data/spec/files/export/analysis/0_3_0_outputs.json +10 -10
- data/spec/files/export/analysis/0_3_0_outputs.zip +0 -0
- data/spec/files/export/analysis/discrete_dynamic_seed.json +16 -16
- data/spec/files/export/analysis/discrete_dynamic_seed.zip +0 -0
- data/spec/files/export/analysis/discrete_seed.json +106 -106
- data/spec/files/export/analysis/discrete_seed.zip +0 -0
- data/spec/files/export/analysis/kats_model_v2.json +22 -22
- data/spec/files/export/analysis/kats_model_v2.zip +0 -0
- data/spec/files/export/analysis/output_vars.json +104 -104
- data/spec/files/export/analysis/output_vars.zip +0 -0
- data/spec/files/export/analysis/small_seed.json +104 -104
- data/spec/files/export/analysis/small_seed.zip +0 -0
- data/spec/files/partial_weather_2.epw +32 -0
- data/spec/openstudio/analysis/translator/excel_spec.rb +6 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.15.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.16.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.17.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.18.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.19.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.20.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.21.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.22.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.23.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.24.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.25.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.15.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.16.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.17.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.18.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.19.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.20.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.21.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.22.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.23.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.24.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.25.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.15.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.16.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.17.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.18.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.19.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.20.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.21.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.22.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.23.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.24.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.25.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.12.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.12.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.14.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.15.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.12.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.13.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.12.xml +36 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.14.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.14.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.15.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.14.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.14.xml +23 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.14.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.12.xml +13 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0-simple.12.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.12.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.10.xml +22 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.11.xml +29 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.12.xml +40 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.13.xml +40 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.14.xml +36 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.15.xml +22 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.6.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.7.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.8.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-3-0-objective-functions.9.xml +22 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.15.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.16.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.17.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.18.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.19.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.20.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.21.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.22.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.23.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.24.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.25.xml +7 -0
- metadata +143 -3
- data/spec/files/~$0_3_0_outputs.xlsx +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74c0043c7f139238a9d7794eba641042e2fcf941
|
4
|
+
data.tar.gz: 3f6c3788437d50dce80865981d5d97a5717c6204
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee7e7dd7efbe7c142e128a5f1409775f6a74b5e9bbff3476c8536cfe51300c7292e9c64a9c2f4517cf7d7429f8cf42b5ff49783fac706dec4f8f4481dd9b2db1
|
7
|
+
data.tar.gz: ea72ccaf13c8fabba36290b2c8451fbae3a30245650bcde78f8237b25e3f72d56c0ca62ecee09ecadd420a173f9b9f327e904a3cebd058727f4417bb90a8e2ef
|
@@ -109,8 +109,8 @@ module OpenStudio
|
|
109
109
|
analysis_ids
|
110
110
|
end
|
111
111
|
|
112
|
-
def download_dataframe(analysis_id, save_directory=".")
|
113
|
-
response = @conn.get "/analyses/#{analysis_id}/download_data
|
112
|
+
def download_dataframe(analysis_id, format='rdata', save_directory=".")
|
113
|
+
response = @conn.get "/analyses/#{analysis_id}/download_data.#{format}"
|
114
114
|
if response.status == 200
|
115
115
|
filename = response['content-disposition'].match(/filename=(\"?)(.+)\1/)[2]
|
116
116
|
puts "File #{filename} already exists, overwriting" if File.exist?("#{save_directory}/#{filename}")
|
@@ -118,8 +118,17 @@ module OpenStudio
|
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
121
|
-
def download_variables(analysis_id, save_directory=".")
|
122
|
-
response = @conn.get "/analyses/#{analysis_id}/download_variables
|
121
|
+
def download_variables(analysis_id, format='rdata', save_directory=".")
|
122
|
+
response = @conn.get "/analyses/#{analysis_id}/variables/download_variables.#{format}"
|
123
|
+
if response.status == 200
|
124
|
+
filename = response['content-disposition'].match(/filename=(\"?)(.+)\1/)[2]
|
125
|
+
puts "File #{filename} already exists, overwriting" if File.exist?("#{save_directory}/#{filename}")
|
126
|
+
File.open("#{save_directory}/#{filename}",'w') {|f| f << response.body}
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def download_all_data_points(analysis_id, save_directory=".")
|
131
|
+
response = @conn.get "/analyses/#{analysis_id}/download_all_data_points"
|
123
132
|
if response.status == 200
|
124
133
|
filename = response['content-disposition'].match(/filename=(\"?)(.+)\1/)[2]
|
125
134
|
puts "File #{filename} already exists, overwriting" if File.exist?("#{save_directory}/#{filename}")
|
@@ -421,7 +421,10 @@ module OpenStudio
|
|
421
421
|
if File.extname(@weather_files.first) =~ /.zip/i
|
422
422
|
new_analysis_json['analysis']['weather_file']['path'] = "./weather/#{File.basename(@weather_files.first, '.zip')}.epw"
|
423
423
|
else
|
424
|
-
|
424
|
+
# get the first EPW file (not the first file)
|
425
|
+
weather = @weather_files.find{|w| File.extname(w).downcase == '.epw'}
|
426
|
+
fail "Could not find a weather file (*.epw) in weather directory #{File.dirname(@weather_files.first)}" unless weather
|
427
|
+
new_analysis_json['analysis']['weather_file']['path'] = "./weather/#{File.basename(weather)}"
|
425
428
|
end
|
426
429
|
|
427
430
|
json_file_name = "#{@export_path}/#{model[:name]}.json"
|
Binary file
|