openstudio-analysis 0.4.5 → 1.0.0.pat1
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/.travis.yml +1 -1
- data/CHANGELOG.md +7 -3
- data/Gemfile +1 -0
- data/README.md +53 -47
- data/lib/openstudio/analysis/formulation.rb +1 -1
- data/lib/openstudio/analysis/server_api.rb +143 -246
- data/lib/openstudio/analysis/translator/datapoints.rb +8 -3
- data/lib/openstudio/analysis/translator/excel.rb +16 -4
- data/lib/openstudio/analysis/translator/workflow.rb +106 -0
- data/lib/openstudio/analysis/version.rb +1 -1
- data/lib/openstudio/analysis/workflow_step.rb +5 -2
- data/lib/openstudio/analysis.rb +85 -0
- data/lib/openstudio-analysis.rb +1 -0
- data/openstudio-analysis.gemspec +4 -3
- data/spec/files/workflow/analysis.osa +1334 -0
- data/spec/files/workflow/datapoint_0.osd +63 -0
- data/spec/files/workflow/datapoint_1.osd +63 -0
- data/spec/files/workflow/datapoint_2.osd +63 -0
- data/spec/files/workflow/datapoint_wrong_osa_id.osd +65 -0
- data/spec/openstudio/excel_spec.rb +0 -5
- data/spec/openstudio/osw_spec.rb +618 -0
- metadata +36 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a00a07cb4a46381c5195104bd6313d60e5beb88
|
4
|
+
data.tar.gz: 5c1123d9cd96dbec5d40559d939ab63507c03a60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9176d9833797ca194c4c0331db1b126e285ddf502f4048b989b00aab4b136d3547f874a66e6017439ac0dbe9065043a4518ab7fd632f571026d82b5a235ce68
|
7
|
+
data.tar.gz: e0c9f0ec99960484cddb742b7e40131dd035bf9115c013ddeda7928dd9eea6c44d060bc5e07f8830e5fc6d9cdaaba507a6df7beda5a2823d2c2f6d15c4296280
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
OpenStudio Analysis Gem Change Log
|
2
2
|
==================================
|
3
3
|
|
4
|
-
Version Unreleased
|
5
|
-
|
4
|
+
Version Unreleased (Version 0.5)
|
5
|
+
--------------------------------
|
6
|
+
* Remove allow_multiple_jobs and server_as_worker options. These are by defaulted to true now.
|
7
|
+
* Remove uncertain strings from end of uncertainty distributions
|
8
|
+
* Remove measures eval path for CSV import
|
6
9
|
* Add diag analysis type to server_api run method
|
7
|
-
* Remove support for Rubies < 2.0.
|
10
|
+
* Remove support for Rubies < 2.0 and > 2.0.
|
8
11
|
* Add json extension to formulation name upon save if none exists
|
9
12
|
* Add zip extension to formulation zip upon save if none exists
|
13
|
+
* In upload_datapoint, allows set the analysis_id in the file to the one passed.
|
10
14
|
|
11
15
|
Version 0.4.4
|
12
16
|
------------------
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -18,51 +18,59 @@ There are two ways to create an OpenStudio Analysis description:
|
|
18
18
|
|
19
19
|
* Programmatically
|
20
20
|
|
21
|
-
```
|
22
|
-
analysis = OpenStudio::Analysis.create('Analysis Name')
|
23
|
-
analysis.seed_model = 'local/dir/seed.osm'
|
24
|
-
analysis.weather_file = 'local/dir/USA_CO_Golden-NREL.724666_TMY3.epw'
|
25
|
-
|
26
|
-
# override existing workflow from a file by
|
27
|
-
analysis.workflow = OpenStudio::Analysis::Workflow.load_from_file(...)
|
28
|
-
|
29
|
-
# add measures to the workflow
|
30
|
-
wf = analysis.workflow
|
31
|
-
def add_measure_from_path(instance_name, instance_display_name, local_path_to_measure)
|
32
|
-
wf.add_measure_from_path('instance_name', 'Display name', 'path_to_measure')
|
33
|
-
wf.add_measure_from_path('instance_name_2', 'Display name two', 'path_to_measure_2')
|
34
|
-
|
35
|
-
# make a measure's argument a variable
|
36
|
-
m = wf.add_measure_from_path('instance_name_3', 'Display name three', 'path_to_measure_3')
|
37
|
-
m.make_variable('variable_argument_name', 'discrete')
|
38
|
-
|
39
|
-
m = wf.add_measure_from_path('instance_name_4', 'Display name four', 'path_to_measure_4')
|
40
|
-
m.make_variable('variable_argument_name', 'pivot')
|
41
|
-
m.argument_value('variable_argument_name', value)
|
42
|
-
|
43
|
-
# Save off the analysis files and a static data point
|
44
|
-
run_dir = 'local/run'
|
45
|
-
analysis.save("#{run_dir}/analysis.json")
|
46
|
-
analysis.save_zip("#{run_dir}/analysis.zip")
|
47
|
-
analysis.save_static_data_point("#{run_dir}/data_point.zip")
|
48
|
-
```
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
```
|
53
|
-
require 'openstudio-workflow'
|
54
|
-
|
55
|
-
run_dir = 'local/run'
|
56
|
-
OpenStudio::Workflow.extract_archive("#{run_dir}/analysis.zip", run_dir)
|
57
|
-
|
58
|
-
options = {
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
}
|
63
|
-
k = OpenStudio::Workflow.load 'Local', run_dir, options
|
64
|
-
k.run
|
65
|
-
```
|
21
|
+
```
|
22
|
+
analysis = OpenStudio::Analysis.create('Analysis Name')
|
23
|
+
analysis.seed_model = 'local/dir/seed.osm'
|
24
|
+
analysis.weather_file = 'local/dir/USA_CO_Golden-NREL.724666_TMY3.epw'
|
25
|
+
|
26
|
+
# override existing workflow from a file by
|
27
|
+
analysis.workflow = OpenStudio::Analysis::Workflow.load_from_file(...)
|
28
|
+
|
29
|
+
# add measures to the workflow
|
30
|
+
wf = analysis.workflow
|
31
|
+
def add_measure_from_path(instance_name, instance_display_name, local_path_to_measure)
|
32
|
+
wf.add_measure_from_path('instance_name', 'Display name', 'path_to_measure')
|
33
|
+
wf.add_measure_from_path('instance_name_2', 'Display name two', 'path_to_measure_2')
|
34
|
+
|
35
|
+
# make a measure's argument a variable
|
36
|
+
m = wf.add_measure_from_path('instance_name_3', 'Display name three', 'path_to_measure_3')
|
37
|
+
m.make_variable('variable_argument_name', 'discrete')
|
38
|
+
|
39
|
+
m = wf.add_measure_from_path('instance_name_4', 'Display name four', 'path_to_measure_4')
|
40
|
+
m.make_variable('variable_argument_name', 'pivot')
|
41
|
+
m.argument_value('variable_argument_name', value)
|
42
|
+
|
43
|
+
# Save off the analysis files and a static data point
|
44
|
+
run_dir = 'local/run'
|
45
|
+
analysis.save("#{run_dir}/analysis.json")
|
46
|
+
analysis.save_zip("#{run_dir}/analysis.zip")
|
47
|
+
analysis.save_static_data_point("#{run_dir}/data_point.zip")
|
48
|
+
```
|
49
|
+
|
50
|
+
* Running Data Points with Workflow Gem
|
51
|
+
|
52
|
+
```
|
53
|
+
require 'openstudio-workflow'
|
54
|
+
|
55
|
+
run_dir = 'local/run'
|
56
|
+
OpenStudio::Workflow.extract_archive("#{run_dir}/analysis.zip", run_dir)
|
57
|
+
|
58
|
+
options = {
|
59
|
+
problem_filename: 'analysis.json',
|
60
|
+
datapoint_filename: 'data_point.json',
|
61
|
+
analysis_root_path: run_dir
|
62
|
+
}
|
63
|
+
k = OpenStudio::Workflow.load 'Local', run_dir, options
|
64
|
+
k.run
|
65
|
+
```
|
66
|
+
|
67
|
+
* Server API
|
68
|
+
|
69
|
+
```
|
70
|
+
|
71
|
+
|
72
|
+
```
|
73
|
+
|
66
74
|
|
67
75
|
## Testing
|
68
76
|
|
@@ -72,7 +80,6 @@ This gem used RSpec for testing. To test simply run `rspec` at the command line
|
|
72
80
|
|
73
81
|
In the programmatic interface there are still several items that would be nice to have.
|
74
82
|
|
75
|
-
* verify that the measure.xml file exists
|
76
83
|
* Check the type of measure being added and make sure that it is in the right workflow (e.g. no energyplus measures before rubymeasures)
|
77
84
|
* add reverse translator from existing analysis.jsons
|
78
85
|
* more explicit run workflows. For example, add workflow steps for running energyplus, openstudio translator, radiance, etc
|
@@ -85,5 +92,4 @@ In the programmatic interface there are still several items that would be nice t
|
|
85
92
|
|
86
93
|
* adding mulitple seed models
|
87
94
|
* adding multiple weather files
|
88
|
-
*
|
89
95
|
|
@@ -61,7 +61,7 @@ module OpenStudio
|
|
61
61
|
@workflow ||= OpenStudio::Analysis::Workflow.new
|
62
62
|
end
|
63
63
|
|
64
|
-
# Define the type of analysis
|
64
|
+
# Define the type of analysis which is going to be running
|
65
65
|
#
|
66
66
|
# @param name [String] Name of the algorithm/analysis. (e.g. rgenoud, lhs, single_run)
|
67
67
|
attr_writer :analysis_type
|