openstudio-analysis 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/.travis.yml +2 -2
  4. data/CHANGELOG.md +5 -0
  5. data/Gemfile +1 -5
  6. data/LICENSE.md +1 -1
  7. data/Rakefile +1 -1
  8. data/lib/openstudio-analysis.rb +1 -1
  9. data/lib/openstudio/analysis.rb +23 -27
  10. data/lib/openstudio/analysis/algorithm_attributes.rb +1 -1
  11. data/lib/openstudio/analysis/formulation.rb +1 -1
  12. data/lib/openstudio/analysis/server_api.rb +8 -14
  13. data/lib/openstudio/analysis/support_files.rb +1 -1
  14. data/lib/openstudio/analysis/translator/datapoints.rb +1 -1
  15. data/lib/openstudio/analysis/translator/excel.rb +2 -2
  16. data/lib/openstudio/analysis/translator/workflow.rb +8 -12
  17. data/lib/openstudio/analysis/version.rb +2 -2
  18. data/lib/openstudio/analysis/workflow.rb +1 -1
  19. data/lib/openstudio/analysis/workflow_step.rb +63 -71
  20. data/lib/openstudio/helpers/hash.rb +1 -1
  21. data/lib/openstudio/helpers/string.rb +1 -1
  22. data/lib/openstudio/weather/epw.rb +1 -1
  23. data/openstudio-analysis.gemspec +17 -13
  24. data/update_license.rb +3 -3
  25. metadata +57 -181
  26. data/spec/files/0_1_09_no_variables.xlsx +0 -0
  27. data/spec/files/0_1_09_outputvars.xlsx +0 -0
  28. data/spec/files/0_1_09_setup_version_2.xlsx +0 -0
  29. data/spec/files/0_1_09_small_list.xlsx +0 -0
  30. data/spec/files/0_1_09_small_list_incomplete.xlsx +0 -0
  31. data/spec/files/0_1_09_small_list_repeat_vars.xlsx +0 -0
  32. data/spec/files/0_1_09_small_list_validation_errors.xlsx +0 -0
  33. data/spec/files/0_1_10_proxy.xlsx +0 -0
  34. data/spec/files/0_1_10_proxy_user.xlsx +0 -0
  35. data/spec/files/0_1_10_template_input.xlsx +0 -0
  36. data/spec/files/0_1_11_discrete_variables.xlsx +0 -0
  37. data/spec/files/0_1_12_discrete_dynamic_columns.xlsx +0 -0
  38. data/spec/files/0_2_0_template.xlsx +0 -0
  39. data/spec/files/0_2_0_template_simpletest.xlsx +0 -0
  40. data/spec/files/0_3_0_dynamic_uuids.xlsx +0 -0
  41. data/spec/files/0_3_0_measure_existence.xlsx +0 -0
  42. data/spec/files/0_3_0_outputs.xlsx +0 -0
  43. data/spec/files/0_3_3_short_names.xlsx +0 -0
  44. data/spec/files/0_3_5_multiple_measure_paths.xlsx +0 -0
  45. data/spec/files/0_3_7_unique_measure_names.xlsx +0 -0
  46. data/spec/files/0_3_7_worker_init_final.xlsx +0 -0
  47. data/spec/files/0_4_0_lhs_discrete_continuous.xlsx +0 -0
  48. data/spec/files/0_4_0_multiple_seeds.xlsx +0 -0
  49. data/spec/files/0_4_0_pivot_test.xlsx +0 -0
  50. data/spec/files/analysis/examples/discrete_lhs_example.json +0 -809
  51. data/spec/files/analysis/examples/medium_office_example.json +0 -1674
  52. data/spec/files/analysis/examples/medium_office_workflow.json +0 -1298
  53. data/spec/files/measures/ActualMeasureNoJson/measure.rb +0 -80
  54. data/spec/files/measures/ActualMeasureNoJson/measure.xml +0 -2
  55. data/spec/files/measures/ExampleMeasure/measure.json +0 -3
  56. data/spec/files/measures/ExampleMeasure/measure.rb +0 -5
  57. data/spec/files/measures/ExampleMeasure/measure.xml +0 -1
  58. data/spec/files/measures/IncreaseInsulationRValueForRoofs/measure.json +0 -36
  59. data/spec/files/measures/IncreaseInsulationRValueForRoofs/measure.rb +0 -22
  60. data/spec/files/measures/IncreaseInsulationRValueForRoofs/measure.xml +0 -5
  61. data/spec/files/measures/NoMeasureRbFile/.gitkeep +0 -0
  62. data/spec/files/measures/ReduceLightingLoadsByPercentage/measure.json +0 -3
  63. data/spec/files/measures/ReduceLightingLoadsByPercentage/measure.rb +0 -5
  64. data/spec/files/measures/ReduceLightingLoadsByPercentage/measure.xml +0 -1
  65. data/spec/files/measures/SetThermostatSchedules/measure.json +0 -63
  66. data/spec/files/measures/SetThermostatSchedules/measure.rb +0 -254
  67. data/spec/files/measures/SetThermostatSchedules/measure.xml +0 -2
  68. data/spec/files/measures/example_measure_auto_directory_name/measure.json +0 -3
  69. data/spec/files/measures/example_measure_auto_directory_name/measure.rb +0 -5
  70. data/spec/files/measures/example_measure_auto_directory_name/measure.xml +0 -1
  71. data/spec/files/measures/reduce_lighting_loads_by_percentage/measure.json +0 -3
  72. data/spec/files/measures/reduce_lighting_loads_by_percentage/measure.rb +0 -5
  73. data/spec/files/measures/reduce_lighting_loads_by_percentage/measure.xml +0 -1
  74. data/spec/files/measures/reduce_space_infiltration_by_percentage/measure.rb +0 -5
  75. data/spec/files/measures/reduce_space_infiltration_by_percentage/measure.xml +0 -1
  76. data/spec/files/measures/rotate_building/measure.rb +0 -5
  77. data/spec/files/measures/rotate_building/measure.xml +0 -1
  78. data/spec/files/measures/set_window_to_wall_ratio_by_facade/measure.rb +0 -5
  79. data/spec/files/measures/set_window_to_wall_ratio_by_facade/measure.xml +0 -1
  80. data/spec/files/measures_second_path/measure_in_another_dir/measure.json +0 -3
  81. data/spec/files/measures_second_path/measure_in_another_dir/measure.rb +0 -5
  82. data/spec/files/measures_second_path/measure_in_another_dir/measure.xml +0 -1
  83. data/spec/files/partial_weather.epw +0 -32
  84. data/spec/files/partial_weather_2.epw +0 -32
  85. data/spec/files/small_seed.osm +0 -4622
  86. data/spec/files/worker_init/first_file.rb +0 -15
  87. data/spec/files/worker_init/second_file.sh +0 -4
  88. data/spec/files/workflow/analysis.osa +0 -1334
  89. data/spec/files/workflow/datapoint_0.osd +0 -65
  90. data/spec/files/workflow/datapoint_1.osd +0 -65
  91. data/spec/files/workflow/datapoint_2.osd +0 -65
  92. data/spec/files/workflow/datapoint_wrong_osa_id.osd +0 -65
  93. data/spec/integration/server_api_spec.rb +0 -83
  94. data/spec/openstudio/excel_spec.rb +0 -606
  95. data/spec/openstudio/formulation_spec.rb +0 -200
  96. data/spec/openstudio/hash_spec.rb +0 -56
  97. data/spec/openstudio/osw_spec.rb +0 -129
  98. data/spec/openstudio/server_api_spec.rb +0 -68
  99. data/spec/openstudio/string_spec.rb +0 -34
  100. data/spec/openstudio/support_files_spec.rb +0 -89
  101. data/spec/openstudio/weather_spec.rb +0 -80
  102. data/spec/openstudio/workflow_spec.rb +0 -126
  103. data/spec/openstudio/workflow_step_spec.rb +0 -158
  104. data/spec/schema/osa.json +0 -613
  105. data/spec/schema/osa.png +0 -0
  106. data/spec/schema/osd.json +0 -110
  107. data/spec/schema/osd.png +0 -0
  108. data/spec/spec_helper.rb +0 -56
data/spec/schema/osa.json DELETED
@@ -1,613 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-04/schema#",
3
- "description": "JSON Schema for the OpenStudioAnalysis File Type",
4
- "type": "object",
5
- "properties": {
6
- "analysis": {
7
- "$ref": "#/definitions/Analysis"
8
- }
9
- },
10
- "required": [
11
- "analysis"
12
- ],
13
- "additionalProperties": false,
14
- "definitions": {
15
- "Output": {
16
- "description": "Hash",
17
- "type": "object",
18
- "properties": {
19
- "units": {
20
- "description": "Haystack compliant unit string, or empty string if not applicable",
21
- "type": "string"
22
- },
23
- "objective_function": {
24
- "description": "Determines if output is part of an objective function",
25
- "type": "boolean"
26
- },
27
- "objective_function_index": {
28
- "description": "Key used to define multi-objective functions, null if not applicable",
29
- "type": "number"
30
- },
31
- "objective_function_target": {
32
- "description": "Key used to define target of the objective function, null if not applicable",
33
- "type": [
34
- "number",
35
- "null"
36
- ]
37
- },
38
- "objective_function_group": {
39
- "description": "Optional key used to define multi-objective functions",
40
- "type": "number"
41
- },
42
- "scaling_factor": {
43
- "description": "????",
44
- "type": "null"
45
- },
46
- "display_name": {
47
- "description": "User facing name of objective which must be unique",
48
- "type": "string"
49
- },
50
- "display_name_short": {
51
- "description": "User facing name less that 20 characters",
52
- "type": "string"
53
- },
54
- "metadata_id": {
55
- "description": "??????",
56
- "type": [
57
- "string",
58
- "null"
59
- ]
60
- },
61
- "name": {
62
- "description": "Snake cased output machine name",
63
- "type": "string"
64
- },
65
- "visualize": {
66
- "description": "Determines if variable will be include in plots on the server",
67
- "type": "boolean"
68
- },
69
- "export": {
70
- "description": "?????",
71
- "type": "boolean"
72
- },
73
- "variable_type": {
74
- "description": "Allowed values of 'string', 'bool', or 'number'",
75
- "type": "string"
76
- }
77
- },
78
- "required": [
79
- "units",
80
- "objective_function",
81
- "objective_function_index",
82
- "objective_function_target",
83
- "scaling_factor",
84
- "display_name",
85
- "metadata_id",
86
- "name"
87
- ],
88
- "additionalProperties": false
89
- },
90
- "Algorithm Attributes": {
91
- "title": "algorithm",
92
- "description": "Hash of attributes associated with the analysis_type",
93
- "type": "object",
94
- "additionalProperties": {
95
- "description": "Attributes defined by analysis type"
96
- }
97
- },
98
- "Argument": {
99
- "title": "argument",
100
- "description": "Individual argument instance",
101
- "type": "object",
102
- "properties": {
103
- "display_name": {
104
- "description": "User-facing display name which must be unique",
105
- "type": "string"
106
- },
107
- "display_name_short": {
108
- "description": "Optional user-facing display name under 20 characters",
109
- "type": "string"
110
- },
111
- "name": {
112
- "description": "Machine readable snake-cased name of argument as defined in the measure.xml",
113
- "type": "string"
114
- },
115
- "value_type": {
116
- "description": "Accepts inputs of 'string', 'bool', and 'number'",
117
- "type": "string"
118
- },
119
- "default_value": {
120
- "description": "Default value for argument, if defined in the measure.xml file",
121
- "type": [
122
- "string",
123
- "number",
124
- "boolean"
125
- ]
126
- },
127
- "value": {
128
- "description": "Value to set argument to in analysis",
129
- "type": [
130
- "string",
131
- "number",
132
- "boolean"
133
- ]
134
- },
135
- "machine_name": {
136
- "description": "????",
137
- "type": "string"
138
- },
139
- "uuid": {
140
- "description": "UUID for the measure from the measure.xml",
141
- "type": "string"
142
- },
143
- "version_uuid": {
144
- "description": "UUID for the measure version form the measure.xml",
145
- "type": "string"
146
- }
147
- },
148
- "required": [
149
- "display_name",
150
- "name",
151
- "value",
152
- "machine_name",
153
- "uuid",
154
- "version_uuid"
155
- ],
156
- "additionalProperties": false
157
- },
158
- "Workflow Step": {
159
- "description": "Individual measure definition",
160
- "type": "object",
161
- "properties": {
162
- "name": {
163
- "description": "Snake-cased machine readable measure name which must be unique",
164
- "type": "string"
165
- },
166
- "display_name": {
167
- "description": "User facing measure name which must also be unique",
168
- "type": "string"
169
- },
170
- "measure_type": {
171
- "description": "Accepts values of 'Ruby' 'EnergyPlus' and 'Reporting'",
172
- "type": "string"
173
- },
174
- "description": {
175
- "description": "Measure description",
176
- "type": "string"
177
- },
178
- "taxonomy": {
179
- "description": "Measure taxonomy tag",
180
- "type": "string"
181
- },
182
- "measure_definition_class_name": {
183
- "description": "Class name of measure.rb file",
184
- "type": "string"
185
- },
186
- "measure_definition_directory": {
187
- "description": "??",
188
- "type": "string"
189
- },
190
- "measure_definition_directory_local": {
191
- "description": "Local path to the measure directory",
192
- "type": "string"
193
- },
194
- "measure_definition_display_name": {
195
- "description": "?????",
196
- "type": "string"
197
- },
198
- "measure_definition_name": {
199
- "description": "?????",
200
- "type": "string"
201
- },
202
- "measure_definition_name_xml": {
203
- "description": "?????",
204
- "type": "null"
205
- },
206
- "measure_definition_uuid": {
207
- "description": "UUID of measure in measure.xml",
208
- "type": "string"
209
- },
210
- "measure_definition_version_uuid": {
211
- "description": "UUID of measure version in measure.xml",
212
- "type": "string"
213
- },
214
- "arguments": {
215
- "$ref": "#/definitions/Argument Array"
216
- },
217
- "variables": {
218
- "$ref": "#/definitions/Variable Array"
219
- },
220
- "workflow_index": {
221
- "description": "Index in workflow array, indexing from 0",
222
- "type": "number"
223
- },
224
- "workflow_step_type": {
225
- "description": "???????",
226
- "type": "string"
227
- },
228
- "version_uuid": {
229
- "description": "UUID of measure version from the measure.xml",
230
- "type": "string"
231
- },
232
- "uuid": {
233
- "description": "UUID of measure from the measure.xml",
234
- "type": "string"
235
- }
236
- },
237
- "required": [
238
- "name",
239
- "display_name",
240
- "measure_type",
241
- "measure_definition_class_name",
242
- "measure_definition_directory",
243
- "measure_definition_uuid",
244
- "measure_definition_version_uuid",
245
- "arguments",
246
- "variables",
247
- "workflow_index",
248
- "workflow_step_type",
249
- "version_uuid",
250
- "uuid"
251
- ],
252
- "additionalProperties": false
253
- },
254
- "Uncertainty Definition": {
255
- "title": "uncertainty_description",
256
- "description": "Set of attributes defining the variability of the input",
257
- "type": "object",
258
- "properties": {
259
- "type": {
260
- "description": "Uncertainty type, accepting values of 'triangle', 'uniform', 'discrete', and 'normal'",
261
- "type": "string",
262
- "oneof": [
263
- "triangle",
264
- "uniform",
265
- "normal",
266
- "discrete"
267
- ]
268
- },
269
- "attributes": {
270
- "$ref": "#/definitions/Distribution Definition"
271
- }
272
- },
273
- "required": [
274
- "type",
275
- "attributes"
276
- ],
277
- "additionalProperties": false
278
- },
279
- "Design Alternative": {
280
- "description": "Individual design alternative instance",
281
- "type": "object",
282
- "properties": {
283
- "name": {
284
- "description": "Name of design alternative",
285
- "type": "string"
286
- },
287
- "description": {
288
- "description": "Description of design alternative",
289
- "type": "string"
290
- },
291
- "seed": {
292
- "$ref": "#/definitions/Seed Object"
293
- },
294
- "options": {
295
- "description": "Each option corresponds to one WorkflowStep (i.e. Measure). Options are listed in order",
296
- "type": "array",
297
- "items": {
298
- "type": "object",
299
- "properties": {
300
- "measure_name": {
301
- "description": "Name of the measure in this workflow",
302
- "type": "string"
303
- },
304
- "workflow_index": {
305
- "description": "Index of the measure in the workflow",
306
- "type": "number"
307
- },
308
- "name": {
309
- "description": "Name of the user specified option",
310
- "type": "string"
311
- },
312
- "description": {
313
- "description": "Description of the user specified option",
314
- "type": "string"
315
- }
316
- },
317
- "additionalProperties": false
318
- }
319
- }
320
- },
321
- "required": [
322
- "name",
323
- "description"
324
- ],
325
- "additionalProperties": false
326
- },
327
- "Variable": {
328
- "description": "Individual variable instance",
329
- "type": "object",
330
- "properties": {
331
- "argument": {
332
- "$ref": "#/definitions/Argument"
333
- },
334
- "display_name": {
335
- "description": "User-facing display name which must be unique",
336
- "type": "string"
337
- },
338
- "display_name_short": {
339
- "description": "Optional user-facing name under 20 characters",
340
- "type": "string"
341
- },
342
- "variable_type": {
343
- "description": "Definition of variable type",
344
- "type": "string",
345
- "oneof": [
346
- "variable",
347
- "pivot"
348
- ]
349
- },
350
- "units": {
351
- "description": "Haystack compliant units with an empty string if not defined.",
352
- "type": "null"
353
- },
354
- "minimum": {
355
- "description": "????",
356
- "type": "number"
357
- },
358
- "maximum": {
359
- "description": "????",
360
- "type": "number"
361
- },
362
- "relation_to_output": {
363
- "description": "????",
364
- "type": "null"
365
- },
366
- "static_value": {
367
- "description": "Value to default to in the case of this variable not being perturbed in a datapoint",
368
- "type": "number"
369
- },
370
- "uuid": {
371
- "description": "Variable UUID to link against in the .osd file",
372
- "type": "string"
373
- },
374
- "version_uuid": {
375
- "description": "???",
376
- "type": "string"
377
- },
378
- "variable": {
379
- "description": "????",
380
- "type": "boolean"
381
- },
382
- "uncertainty_description": {
383
- "$ref": "#/definitions/Uncertainty Definition"
384
- },
385
- "workflow_index": {
386
- "description": "???????",
387
- "type": "number"
388
- },
389
- "machine_name": {
390
- "description": "???????",
391
- "type": "string"
392
- }
393
- },
394
- "required": [
395
- "argument",
396
- "display_name",
397
- "variable_type",
398
- "units",
399
- "static_value",
400
- "uuid",
401
- "version_uuid",
402
- "uncertainty_description",
403
- "machine_name"
404
- ],
405
- "additionalProperties": false
406
- },
407
- "Problem": {
408
- "title": "problem",
409
- "description": "Defines procedure for running the analysis",
410
- "type": "object",
411
- "properties": {
412
- "analysis_type": {
413
- "description": "Type of analysis to be run, e.g. LHS or nsga2",
414
- "type": "string",
415
- "oneof": [
416
- "morris",
417
- "lhs",
418
- "rgenound",
419
- "nsga_nrel",
420
- "spea",
421
- "sequential_search",
422
- "single_run",
423
- "batch_run",
424
- "doe",
425
- "repeat_run",
426
- "optim",
427
- "baseline_perturbation",
428
- "preflight"
429
- ]
430
- },
431
- "algorithm": {
432
- "$ref": "#/definitions/Algorithm Attributes"
433
- },
434
- "workflow": {
435
- "$ref": "#/definitions/Workflow"
436
- },
437
- "random_seed": {
438
- "description": "Random seed to set server to for the execution of the OSA file",
439
- "type": "number"
440
- },
441
- "name": {
442
- "description": "??????",
443
- "type": "string"
444
- },
445
- "design_alternatives": {
446
- "description": "Array of design alternative names and descriptions",
447
- "type": "array",
448
- "items": {
449
- "$ref": "#/definitions/Design Alternative"
450
- }
451
- }
452
- },
453
- "required": [
454
- "analysis_type",
455
- "algorithm",
456
- "workflow",
457
- "random_seed"
458
- ],
459
- "additionalProperties": false
460
- },
461
- "Output Array": {
462
- "description": "Array of objects which define user-desired outputs from the analysis ",
463
- "type": "array",
464
- "items": {
465
- "$ref": "#/definitions/Output"
466
- }
467
- },
468
- "Workflow": {
469
- "description": "Definition of measures to be applied in the analysis",
470
- "type": "array",
471
- "items": {
472
- "$ref": "#/definitions/Workflow Step"
473
- }
474
- },
475
- "Seed Object": {
476
- "title": "seed",
477
- "description": "Seed osm or idf file for default use",
478
- "type": "object",
479
- "properties": {
480
- "file_type": {
481
- "description": "Accepted values of 'osm' and 'idf'",
482
- "type": "string",
483
- "oneonf": [
484
- "osm",
485
- "idf"
486
- ]
487
- },
488
- "path": {
489
- "description": "Path to the seed file from the project directory",
490
- "type": "string"
491
- }
492
- },
493
- "required": [
494
- "file_type"
495
- ],
496
- "additionalProperties": false
497
- },
498
- "Weather File": {
499
- "title": "weather_file",
500
- "description": "Weather file for default use in the simulation",
501
- "type": "object",
502
- "properties": {
503
- "file_type": {
504
- "description": "Weather file type, e.g. TMY3",
505
- "type": "string"
506
- },
507
- "path": {
508
- "description": "Path to weather file from the project directory",
509
- "type": "string"
510
- }
511
- },
512
- "required": [
513
- "file_type",
514
- "path"
515
- ],
516
- "additionalProperties": false
517
- },
518
- "Analysis": {
519
- "title": "analysis",
520
- "description": "Analysis object",
521
- "type": "object",
522
- "properties": {
523
- "display_name": {
524
- "description": "User facing string, spaces & capitals allowed",
525
- "type": "string"
526
- },
527
- "name": {
528
- "description": "snake_cassed machine name",
529
- "type": "string"
530
- },
531
- "output_variables": {
532
- "$ref": "#/definitions/Output Array"
533
- },
534
- "problem": {
535
- "$ref": "#/definitions/Problem"
536
- },
537
- "seed": {
538
- "$ref": "#/definitions/Seed Object"
539
- },
540
- "weather_file": {
541
- "$ref": "#/definitions/Weather File"
542
- },
543
- "file_format_version": {
544
- "description": "1.0",
545
- "type": "number"
546
- },
547
- "_id": {
548
- "description": "UUID of the OSA file",
549
- "type": "string"
550
- },
551
- "uuid": {
552
- "description": "UUID of the OSA file",
553
- "type": "string"
554
- },
555
- "project_id": {
556
- "description": "?????",
557
- "type": "string"
558
- }
559
- },
560
- "required": [
561
- "output_variables",
562
- "problem",
563
- "seed",
564
- "weather_file",
565
- "_id",
566
- "uuid",
567
- "project_id"
568
- ],
569
- "additionalProperties": false
570
- },
571
- "Argument Array": {
572
- "description": "Array of fixed inputs for the measure",
573
- "type": "array",
574
- "items": {
575
- "$ref": "#/definitions/Argument"
576
- }
577
- },
578
- "Variable Array": {
579
- "description": "Array of variable inputs for the measure",
580
- "type": "array",
581
- "items": {
582
- "$ref": "#/definitions/Variable"
583
- }
584
- },
585
- "Distribution Definition": {
586
- "title": "attributes",
587
- "description": "Array of attributes defining the distribution type properties",
588
- "type": "array",
589
- "items": {
590
- "title": "Distribution Attributes",
591
- "type": "object",
592
- "properties": {
593
- "name": {
594
- "type": "string"
595
- },
596
- "value": {
597
- "type": [
598
- "array",
599
- "string",
600
- "number",
601
- "boolean"
602
- ]
603
- }
604
- },
605
- "required": [
606
- "name",
607
- "value"
608
- ],
609
- "additionalProperties": false
610
- }
611
- }
612
- }
613
- }