openstudio-analysis 1.0.0.rc19 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +2 -0
  3. data/.gitlab-ci.yml +20 -0
  4. data/.rubocop.yml +2 -133
  5. data/.travis.yml +2 -2
  6. data/CHANGELOG.md +26 -32
  7. data/Gemfile +5 -6
  8. data/LICENSE.md +28 -0
  9. data/README.md +16 -8
  10. data/Rakefile +38 -3
  11. data/lib/openstudio-analysis.rb +35 -0
  12. data/lib/openstudio/analysis.rb +57 -26
  13. data/lib/openstudio/analysis/algorithm_attributes.rb +36 -1
  14. data/lib/openstudio/analysis/formulation.rb +41 -6
  15. data/lib/openstudio/analysis/server_api.rb +53 -36
  16. data/lib/openstudio/analysis/support_files.rb +40 -0
  17. data/lib/openstudio/analysis/translator/datapoints.rb +39 -4
  18. data/lib/openstudio/analysis/translator/excel.rb +43 -8
  19. data/lib/openstudio/analysis/translator/workflow.rb +54 -14
  20. data/lib/openstudio/analysis/version.rb +36 -1
  21. data/lib/openstudio/analysis/workflow.rb +37 -2
  22. data/lib/openstudio/analysis/workflow_step.rb +97 -70
  23. data/lib/openstudio/helpers/hash.rb +35 -0
  24. data/lib/openstudio/helpers/string.rb +36 -2
  25. data/lib/openstudio/weather/epw.rb +32 -17
  26. data/openstudio-analysis.gemspec +21 -18
  27. data/update_license.rb +120 -0
  28. metadata +62 -200
  29. data/LGPL-2.1.txt +0 -502
  30. data/LICENSE.txt +0 -65
  31. data/rubocop-todo.yml +0 -246
  32. data/spec/files/0_1_09_no_variables.xlsx +0 -0
  33. data/spec/files/0_1_09_outputvars.xlsx +0 -0
  34. data/spec/files/0_1_09_setup_version_2.xlsx +0 -0
  35. data/spec/files/0_1_09_small_list.xlsx +0 -0
  36. data/spec/files/0_1_09_small_list_incomplete.xlsx +0 -0
  37. data/spec/files/0_1_09_small_list_repeat_vars.xlsx +0 -0
  38. data/spec/files/0_1_09_small_list_validation_errors.xlsx +0 -0
  39. data/spec/files/0_1_10_proxy.xlsx +0 -0
  40. data/spec/files/0_1_10_proxy_user.xlsx +0 -0
  41. data/spec/files/0_1_10_template_input.xlsx +0 -0
  42. data/spec/files/0_1_11_discrete_variables.xlsx +0 -0
  43. data/spec/files/0_1_12_discrete_dynamic_columns.xlsx +0 -0
  44. data/spec/files/0_2_0_template.xlsx +0 -0
  45. data/spec/files/0_2_0_template_simpletest.xlsx +0 -0
  46. data/spec/files/0_3_0_dynamic_uuids.xlsx +0 -0
  47. data/spec/files/0_3_0_measure_existence.xlsx +0 -0
  48. data/spec/files/0_3_0_outputs.xlsx +0 -0
  49. data/spec/files/0_3_3_short_names.xlsx +0 -0
  50. data/spec/files/0_3_5_multiple_measure_paths.xlsx +0 -0
  51. data/spec/files/0_3_7_unique_measure_names.xlsx +0 -0
  52. data/spec/files/0_3_7_worker_init_final.xlsx +0 -0
  53. data/spec/files/0_4_0_lhs_discrete_continuous.xlsx +0 -0
  54. data/spec/files/0_4_0_multiple_seeds.xlsx +0 -0
  55. data/spec/files/0_4_0_pivot_test.xlsx +0 -0
  56. data/spec/files/analysis/examples/discrete_lhs_example.json +0 -809
  57. data/spec/files/analysis/examples/medium_office_example.json +0 -1673
  58. data/spec/files/analysis/examples/medium_office_workflow.json +0 -1298
  59. data/spec/files/measures/ActualMeasureNoJson/measure.rb +0 -80
  60. data/spec/files/measures/ActualMeasureNoJson/measure.xml +0 -2
  61. data/spec/files/measures/ExampleMeasure/measure.json +0 -3
  62. data/spec/files/measures/ExampleMeasure/measure.rb +0 -5
  63. data/spec/files/measures/ExampleMeasure/measure.xml +0 -1
  64. data/spec/files/measures/IncreaseInsulationRValueForRoofs/measure.json +0 -36
  65. data/spec/files/measures/IncreaseInsulationRValueForRoofs/measure.rb +0 -22
  66. data/spec/files/measures/IncreaseInsulationRValueForRoofs/measure.xml +0 -5
  67. data/spec/files/measures/NoMeasureRbFile/.gitkeep +0 -0
  68. data/spec/files/measures/ReduceLightingLoadsByPercentage/measure.json +0 -3
  69. data/spec/files/measures/ReduceLightingLoadsByPercentage/measure.rb +0 -5
  70. data/spec/files/measures/ReduceLightingLoadsByPercentage/measure.xml +0 -1
  71. data/spec/files/measures/SetThermostatSchedules/measure.json +0 -63
  72. data/spec/files/measures/SetThermostatSchedules/measure.rb +0 -254
  73. data/spec/files/measures/SetThermostatSchedules/measure.xml +0 -2
  74. data/spec/files/measures/example_measure_auto_directory_name/measure.json +0 -3
  75. data/spec/files/measures/example_measure_auto_directory_name/measure.rb +0 -5
  76. data/spec/files/measures/example_measure_auto_directory_name/measure.xml +0 -1
  77. data/spec/files/measures/reduce_lighting_loads_by_percentage/measure.json +0 -3
  78. data/spec/files/measures/reduce_lighting_loads_by_percentage/measure.rb +0 -5
  79. data/spec/files/measures/reduce_lighting_loads_by_percentage/measure.xml +0 -1
  80. data/spec/files/measures/reduce_space_infiltration_by_percentage/measure.rb +0 -5
  81. data/spec/files/measures/reduce_space_infiltration_by_percentage/measure.xml +0 -1
  82. data/spec/files/measures/rotate_building/measure.rb +0 -5
  83. data/spec/files/measures/rotate_building/measure.xml +0 -1
  84. data/spec/files/measures/set_window_to_wall_ratio_by_facade/measure.rb +0 -5
  85. data/spec/files/measures/set_window_to_wall_ratio_by_facade/measure.xml +0 -1
  86. data/spec/files/measures_second_path/measure_in_another_dir/measure.json +0 -3
  87. data/spec/files/measures_second_path/measure_in_another_dir/measure.rb +0 -5
  88. data/spec/files/measures_second_path/measure_in_another_dir/measure.xml +0 -1
  89. data/spec/files/partial_weather.epw +0 -32
  90. data/spec/files/partial_weather_2.epw +0 -32
  91. data/spec/files/small_seed.osm +0 -4622
  92. data/spec/files/worker_init/first_file.rb +0 -15
  93. data/spec/files/worker_init/second_file.rb +0 -15
  94. data/spec/files/workflow/analysis.osa +0 -1334
  95. data/spec/files/workflow/datapoint_0.osd +0 -65
  96. data/spec/files/workflow/datapoint_1.osd +0 -65
  97. data/spec/files/workflow/datapoint_2.osd +0 -65
  98. data/spec/files/workflow/datapoint_wrong_osa_id.osd +0 -65
  99. data/spec/integration/server_api_spec.rb +0 -48
  100. data/spec/openstudio/excel_spec.rb +0 -571
  101. data/spec/openstudio/formulation_spec.rb +0 -157
  102. data/spec/openstudio/hash_spec.rb +0 -21
  103. data/spec/openstudio/osw_spec.rb +0 -94
  104. data/spec/openstudio/server_api_spec.rb +0 -25
  105. data/spec/openstudio/string_spec.rb +0 -0
  106. data/spec/openstudio/support_files_spec.rb +0 -54
  107. data/spec/openstudio/weather_spec.rb +0 -45
  108. data/spec/openstudio/workflow_spec.rb +0 -91
  109. data/spec/openstudio/workflow_step_spec.rb +0 -118
  110. data/spec/schema/osa.json +0 -613
  111. data/spec/schema/osa.png +0 -0
  112. data/spec/schema/osd.json +0 -110
  113. data/spec/schema/osd.png +0 -0
  114. data/spec/spec_helper.rb +0 -19
@@ -1,3 +1,38 @@
1
+ # *******************************************************************************
2
+ # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
+ # All rights reserved.
4
+ # Redistribution and use in source and binary forms, with or without
5
+ # modification, are permitted provided that the following conditions are met:
6
+ #
7
+ # (1) Redistributions of source code must retain the above copyright notice,
8
+ # this list of conditions and the following disclaimer.
9
+ #
10
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
11
+ # this list of conditions and the following disclaimer in the documentation
12
+ # and/or other materials provided with the distribution.
13
+ #
14
+ # (3) Neither the name of the copyright holder nor the names of any contributors
15
+ # may be used to endorse or promote products derived from this software without
16
+ # specific prior written permission from the respective party.
17
+ #
18
+ # (4) Other than as required in clauses (1) and (2), distributions in any form
19
+ # of modifications or other derivative works may not use the "OpenStudio"
20
+ # trademark, "OS", "os", or any other confusingly similar designation without
21
+ # specific prior written permission from Alliance for Sustainable Energy, LLC.
22
+ #
23
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES
27
+ # GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30
+ # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
33
+ # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ # *******************************************************************************
35
+
1
36
  class Hash
2
37
  def deep_find(key)
3
38
  key?(key) ? self[key] : values.reduce(nil) { |memo, v| memo ||= v.deep_find(key) if v.respond_to?(:deep_find) }
@@ -1,3 +1,37 @@
1
+ # *******************************************************************************
2
+ # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
+ # All rights reserved.
4
+ # Redistribution and use in source and binary forms, with or without
5
+ # modification, are permitted provided that the following conditions are met:
6
+ #
7
+ # (1) Redistributions of source code must retain the above copyright notice,
8
+ # this list of conditions and the following disclaimer.
9
+ #
10
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
11
+ # this list of conditions and the following disclaimer in the documentation
12
+ # and/or other materials provided with the distribution.
13
+ #
14
+ # (3) Neither the name of the copyright holder nor the names of any contributors
15
+ # may be used to endorse or promote products derived from this software without
16
+ # specific prior written permission from the respective party.
17
+ #
18
+ # (4) Other than as required in clauses (1) and (2), distributions in any form
19
+ # of modifications or other derivative works may not use the "OpenStudio"
20
+ # trademark, "OS", "os", or any other confusingly similar designation without
21
+ # specific prior written permission from Alliance for Sustainable Energy, LLC.
22
+ #
23
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES
27
+ # GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30
+ # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
33
+ # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ # *******************************************************************************
1
35
 
2
36
  # Typecast Variable Values by a string.
3
37
  def typecast_value(variable_type, value, inspect_string = false)
@@ -15,9 +49,9 @@ def typecast_value(variable_type, value, inspect_string = false)
15
49
  if !!value == value
16
50
  out_value = value
17
51
  else
18
- if value.downcase == 'true'
52
+ if value.casecmp('true').zero?
19
53
  out_value = true
20
- elsif value.downcase == 'false'
54
+ elsif value.casecmp('false').zero?
21
55
  out_value = false
22
56
  else
23
57
  raise "Can't cast to a bool from a value of '#{value}' of class '#{value.class}'"
@@ -1,23 +1,38 @@
1
- ######################################################################
2
- # Copyright (c) 2008-2013, Alliance for Sustainable Energy.
3
- # All rights reserved.
1
+ # *******************************************************************************
2
+ # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
+ # All rights reserved.
4
+ # Redistribution and use in source and binary forms, with or without
5
+ # modification, are permitted provided that the following conditions are met:
4
6
  #
5
- # This library is free software; you can redistribute it and/or
6
- # modify it under the terms of the GNU Lesser General Public
7
- # License as published by the Free Software Foundation; either
8
- # version 2.1 of the License, or (at your option) any later version.
7
+ # (1) Redistributions of source code must retain the above copyright notice,
8
+ # this list of conditions and the following disclaimer.
9
9
  #
10
- # This library is distributed in the hope that it will be useful,
11
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- # Lesser General Public License for more details.
10
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
11
+ # this list of conditions and the following disclaimer in the documentation
12
+ # and/or other materials provided with the distribution.
14
13
  #
15
- # You should have received a copy of the GNU Lesser General Public
16
- # License along with this library; if not, write to the Free Software
17
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
- ######################################################################
14
+ # (3) Neither the name of the copyright holder nor the names of any contributors
15
+ # may be used to endorse or promote products derived from this software without
16
+ # specific prior written permission from the respective party.
17
+ #
18
+ # (4) Other than as required in clauses (1) and (2), distributions in any form
19
+ # of modifications or other derivative works may not use the "OpenStudio"
20
+ # trademark, "OS", "os", or any other confusingly similar designation without
21
+ # specific prior written permission from Alliance for Sustainable Energy, LLC.
22
+ #
23
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES
27
+ # GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30
+ # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
33
+ # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ # *******************************************************************************
19
35
 
20
- # TODO: this should its own gem because this file may be useful in various workflows
21
36
  module OpenStudio
22
37
  module Weather
23
38
  class Epw
@@ -139,7 +154,7 @@ module OpenStudio
139
154
  header_section = true
140
155
  row_count = 0
141
156
 
142
- CSV.foreach(@filename, 'r') do |row|
157
+ CSV.foreach(@filename) do |row|
143
158
  row_count += 1
144
159
 
145
160
  if header_section
@@ -1,6 +1,5 @@
1
- lib = File.expand_path('../lib/', __FILE__)
2
- $LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
3
-
1
+ lib = File.expand_path('lib', __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'openstudio/analysis/version'
5
4
 
6
5
  Gem::Specification.new do |s|
@@ -9,27 +8,31 @@ Gem::Specification.new do |s|
9
8
  s.platform = Gem::Platform::RUBY
10
9
  s.authors = ['Nicholas Long']
11
10
  s.email = ['Nicholas.Long@nrel.gov']
11
+
12
12
  s.homepage = 'http://openstudio.nrel.gov'
13
13
  s.summary = 'Create JSON, ZIP to communicate with OpenStudio Distributed Analysis in the Cloud'
14
14
  s.description = 'Basic classes for generating the files needed for OpenStudio-Server'
15
- s.license = 'LGPL'
16
-
17
- s.required_ruby_version = '>= 2.0'
18
- s.required_rubygems_version = '>= 1.3.6'
15
+ s.license = 'BSD'
19
16
 
20
- s.files = `git ls-files -z`.split("\x0")
21
- s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
22
- s.test_files = s.files.grep(%r{^(test|spec|features)/})
17
+ s.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ s.bindir = 'exe'
21
+ s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
22
  s.require_paths = ['lib']
24
23
 
25
- s.add_dependency 'faraday', '~> 0.8'
26
- s.add_dependency 'nokogiri', '~> 1.6.8'
27
- s.add_dependency 'roo', '~> 2.4'
28
- s.add_dependency 'rubyzip', '~> 1.2'
29
- s.add_dependency 'semantic', '~> 1.4'
30
- s.add_dependency 'bcl', '~> 0.5.7'
24
+ s.required_ruby_version = '~> 2.5.0'
25
+
26
+ s.add_dependency 'bcl', '= 0.5.8'
31
27
  s.add_dependency 'dencity', '~> 0.1.0'
28
+ s.add_dependency 'faraday', '~> 0.14'
29
+ s.add_dependency 'nokogiri', '~> 1.10.8'
30
+ s.add_dependency 'roo', '~> 2.8.3'
31
+ s.add_dependency 'rubyzip', '~> 2.3.0'
32
+ s.add_dependency 'semantic', '~> 1.4'
32
33
 
33
- s.add_development_dependency 'bundler', '~> 1.7'
34
- s.add_development_dependency 'rake', '~> 11.1'
34
+ s.add_development_dependency 'rake', '~> 13.0'
35
+ s.add_development_dependency 'rspec', '~> 3.9'
36
+ s.add_development_dependency 'rubocop', '~> 0.54.0'
37
+ s.add_development_dependency 'rubocop-checkstyle_formatter', '~> 0.4.0'
35
38
  end
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ruby_regex = /^#.\*{79}.*#.\*{79}$/m
4
+ erb_regex = /^<%.*#.\*{79}.*#.\*{79}.%>$/m
5
+ js_regex = /^\/\* @preserve.*Copyright.*license.{2}\*\//m
6
+
7
+ ruby_header_text = <<EOT
8
+ # *******************************************************************************
9
+ # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
10
+ # All rights reserved.
11
+ # Redistribution and use in source and binary forms, with or without
12
+ # modification, are permitted provided that the following conditions are met:
13
+ #
14
+ # (1) Redistributions of source code must retain the above copyright notice,
15
+ # this list of conditions and the following disclaimer.
16
+ #
17
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
18
+ # this list of conditions and the following disclaimer in the documentation
19
+ # and/or other materials provided with the distribution.
20
+ #
21
+ # (3) Neither the name of the copyright holder nor the names of any contributors
22
+ # may be used to endorse or promote products derived from this software without
23
+ # specific prior written permission from the respective party.
24
+ #
25
+ # (4) Other than as required in clauses (1) and (2), distributions in any form
26
+ # of modifications or other derivative works may not use the "OpenStudio"
27
+ # trademark, "OS", "os", or any other confusingly similar designation without
28
+ # specific prior written permission from Alliance for Sustainable Energy, LLC.
29
+ #
30
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
33
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES
34
+ # GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
35
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
37
+ # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
38
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
39
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
40
+ # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41
+ # *******************************************************************************
42
+ EOT
43
+ ruby_header_text.strip!
44
+
45
+ erb_header_text = <<EOT
46
+ <%
47
+ # *******************************************************************************
48
+ # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
49
+ # All rights reserved.
50
+ # Redistribution and use in source and binary forms, with or without
51
+ # modification, are permitted provided that the following conditions are met:
52
+ #
53
+ # (1) Redistributions of source code must retain the above copyright notice,
54
+ # this list of conditions and the following disclaimer.
55
+ #
56
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
57
+ # this list of conditions and the following disclaimer in the documentation
58
+ # and/or other materials provided with the distribution.
59
+ #
60
+ # (3) Neither the name of the copyright holder nor the names of any contributors
61
+ # may be used to endorse or promote products derived from this software without
62
+ # specific prior written permission from the respective party.
63
+ #
64
+ # (4) Other than as required in clauses (1) and (2), distributions in any form
65
+ # of modifications or other derivative works may not use the "OpenStudio"
66
+ # trademark, "OS", "os", or any other confusingly similar designation without
67
+ # specific prior written permission from Alliance for Sustainable Energy, LLC.
68
+ #
69
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
70
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
71
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
72
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES
73
+ # GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
74
+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
75
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
76
+ # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
77
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
78
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
79
+ # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
80
+ # *******************************************************************************
81
+ %>
82
+ EOT
83
+ erb_header_text.strip!
84
+
85
+ js_header_text = <<EOT
86
+ /* @preserve
87
+ * OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC. All rights reserved.
88
+ * Use of this source code is governed by a BSD-style license that can be found at openstudio.net/license.
89
+ */
90
+ EOT
91
+ js_header_text.strip!
92
+
93
+ paths = [
94
+ { glob: 'lib/**/*.rb', license: ruby_header_text, regex: ruby_regex },
95
+ { glob: 'spec/openstudio/**/*.rb', license: ruby_header_text, regex: ruby_regex },
96
+ { glob: 'spec/integration/**/*.rb', license: ruby_header_text, regex: ruby_regex },
97
+
98
+ # single files
99
+ { glob: 'Rakefile', license: ruby_header_text, regex: ruby_regex },
100
+ { glob: 'spec/spec_helper.rb', license: ruby_header_text, regex: ruby_regex }
101
+ ]
102
+
103
+ paths.each do |path|
104
+ Dir[path[:glob]].each do |file|
105
+ puts "Updating license in file #{file}"
106
+
107
+ f = File.read(file)
108
+ if f =~ path[:regex]
109
+ puts ' License found -- updating'
110
+ File.open(file, 'w') { |write| write << f.gsub(path[:regex], path[:license]) }
111
+ else
112
+ puts ' No license found -- adding'
113
+ if f =~ /#!/
114
+ puts ' CANNOT add license to file automatically, add it manually and it will update automatically in the future'
115
+ next
116
+ end
117
+ File.open(file, 'w') { |write| write << f.insert(0, path[:license] + "\n\n") }
118
+ end
119
+ end
120
+ end
metadata CHANGED
@@ -1,71 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstudio-analysis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc19
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Long
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-16 00:00:00.000000000 Z
11
+ date: 2020-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bcl
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.5.8
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.5.8
27
+ - !ruby/object:Gem::Dependency
28
+ name: dencity
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.1.0
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: faraday
15
43
  requirement: !ruby/object:Gem::Requirement
16
44
  requirements:
17
45
  - - "~>"
18
46
  - !ruby/object:Gem::Version
19
- version: '0.8'
47
+ version: '0.14'
20
48
  type: :runtime
21
49
  prerelease: false
22
50
  version_requirements: !ruby/object:Gem::Requirement
23
51
  requirements:
24
52
  - - "~>"
25
53
  - !ruby/object:Gem::Version
26
- version: '0.8'
54
+ version: '0.14'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: nokogiri
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
59
  - - "~>"
32
60
  - !ruby/object:Gem::Version
33
- version: 1.6.8
61
+ version: 1.10.8
34
62
  type: :runtime
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
37
65
  requirements:
38
66
  - - "~>"
39
67
  - !ruby/object:Gem::Version
40
- version: 1.6.8
68
+ version: 1.10.8
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: roo
43
71
  requirement: !ruby/object:Gem::Requirement
44
72
  requirements:
45
73
  - - "~>"
46
74
  - !ruby/object:Gem::Version
47
- version: '2.4'
75
+ version: 2.8.3
48
76
  type: :runtime
49
77
  prerelease: false
50
78
  version_requirements: !ruby/object:Gem::Requirement
51
79
  requirements:
52
80
  - - "~>"
53
81
  - !ruby/object:Gem::Version
54
- version: '2.4'
82
+ version: 2.8.3
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: rubyzip
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
87
  - - "~>"
60
88
  - !ruby/object:Gem::Version
61
- version: '1.2'
89
+ version: 2.3.0
62
90
  type: :runtime
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
94
  - - "~>"
67
95
  - !ruby/object:Gem::Version
68
- version: '1.2'
96
+ version: 2.3.0
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: semantic
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -81,61 +109,61 @@ dependencies:
81
109
  - !ruby/object:Gem::Version
82
110
  version: '1.4'
83
111
  - !ruby/object:Gem::Dependency
84
- name: bcl
112
+ name: rake
85
113
  requirement: !ruby/object:Gem::Requirement
86
114
  requirements:
87
115
  - - "~>"
88
116
  - !ruby/object:Gem::Version
89
- version: 0.5.7
90
- type: :runtime
117
+ version: '13.0'
118
+ type: :development
91
119
  prerelease: false
92
120
  version_requirements: !ruby/object:Gem::Requirement
93
121
  requirements:
94
122
  - - "~>"
95
123
  - !ruby/object:Gem::Version
96
- version: 0.5.7
124
+ version: '13.0'
97
125
  - !ruby/object:Gem::Dependency
98
- name: dencity
126
+ name: rspec
99
127
  requirement: !ruby/object:Gem::Requirement
100
128
  requirements:
101
129
  - - "~>"
102
130
  - !ruby/object:Gem::Version
103
- version: 0.1.0
104
- type: :runtime
131
+ version: '3.9'
132
+ type: :development
105
133
  prerelease: false
106
134
  version_requirements: !ruby/object:Gem::Requirement
107
135
  requirements:
108
136
  - - "~>"
109
137
  - !ruby/object:Gem::Version
110
- version: 0.1.0
138
+ version: '3.9'
111
139
  - !ruby/object:Gem::Dependency
112
- name: bundler
140
+ name: rubocop
113
141
  requirement: !ruby/object:Gem::Requirement
114
142
  requirements:
115
143
  - - "~>"
116
144
  - !ruby/object:Gem::Version
117
- version: '1.7'
145
+ version: 0.54.0
118
146
  type: :development
119
147
  prerelease: false
120
148
  version_requirements: !ruby/object:Gem::Requirement
121
149
  requirements:
122
150
  - - "~>"
123
151
  - !ruby/object:Gem::Version
124
- version: '1.7'
152
+ version: 0.54.0
125
153
  - !ruby/object:Gem::Dependency
126
- name: rake
154
+ name: rubocop-checkstyle_formatter
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
157
  - - "~>"
130
158
  - !ruby/object:Gem::Version
131
- version: '11.1'
159
+ version: 0.4.0
132
160
  type: :development
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
135
163
  requirements:
136
164
  - - "~>"
137
165
  - !ruby/object:Gem::Version
138
- version: '11.1'
166
+ version: 0.4.0
139
167
  description: Basic classes for generating the files needed for OpenStudio-Server
140
168
  email:
141
169
  - Nicholas.Long@nrel.gov
@@ -144,12 +172,12 @@ extensions: []
144
172
  extra_rdoc_files: []
145
173
  files:
146
174
  - ".gitignore"
175
+ - ".gitlab-ci.yml"
147
176
  - ".rubocop.yml"
148
177
  - ".travis.yml"
149
178
  - CHANGELOG.md
150
179
  - Gemfile
151
- - LGPL-2.1.txt
152
- - LICENSE.txt
180
+ - LICENSE.md
153
181
  - README.md
154
182
  - Rakefile
155
183
  - lib/openstudio-analysis.rb
@@ -168,93 +196,10 @@ files:
168
196
  - lib/openstudio/helpers/string.rb
169
197
  - lib/openstudio/weather/epw.rb
170
198
  - openstudio-analysis.gemspec
171
- - rubocop-todo.yml
172
- - spec/files/0_1_09_no_variables.xlsx
173
- - spec/files/0_1_09_outputvars.xlsx
174
- - spec/files/0_1_09_setup_version_2.xlsx
175
- - spec/files/0_1_09_small_list.xlsx
176
- - spec/files/0_1_09_small_list_incomplete.xlsx
177
- - spec/files/0_1_09_small_list_repeat_vars.xlsx
178
- - spec/files/0_1_09_small_list_validation_errors.xlsx
179
- - spec/files/0_1_10_proxy.xlsx
180
- - spec/files/0_1_10_proxy_user.xlsx
181
- - spec/files/0_1_10_template_input.xlsx
182
- - spec/files/0_1_11_discrete_variables.xlsx
183
- - spec/files/0_1_12_discrete_dynamic_columns.xlsx
184
- - spec/files/0_2_0_template.xlsx
185
- - spec/files/0_2_0_template_simpletest.xlsx
186
- - spec/files/0_3_0_dynamic_uuids.xlsx
187
- - spec/files/0_3_0_measure_existence.xlsx
188
- - spec/files/0_3_0_outputs.xlsx
189
- - spec/files/0_3_3_short_names.xlsx
190
- - spec/files/0_3_5_multiple_measure_paths.xlsx
191
- - spec/files/0_3_7_unique_measure_names.xlsx
192
- - spec/files/0_3_7_worker_init_final.xlsx
193
- - spec/files/0_4_0_lhs_discrete_continuous.xlsx
194
- - spec/files/0_4_0_multiple_seeds.xlsx
195
- - spec/files/0_4_0_pivot_test.xlsx
196
- - spec/files/analysis/examples/discrete_lhs_example.json
197
- - spec/files/analysis/examples/medium_office_example.json
198
- - spec/files/analysis/examples/medium_office_workflow.json
199
- - spec/files/measures/ActualMeasureNoJson/measure.rb
200
- - spec/files/measures/ActualMeasureNoJson/measure.xml
201
- - spec/files/measures/ExampleMeasure/measure.json
202
- - spec/files/measures/ExampleMeasure/measure.rb
203
- - spec/files/measures/ExampleMeasure/measure.xml
204
- - spec/files/measures/IncreaseInsulationRValueForRoofs/measure.json
205
- - spec/files/measures/IncreaseInsulationRValueForRoofs/measure.rb
206
- - spec/files/measures/IncreaseInsulationRValueForRoofs/measure.xml
207
- - spec/files/measures/NoMeasureRbFile/.gitkeep
208
- - spec/files/measures/ReduceLightingLoadsByPercentage/measure.json
209
- - spec/files/measures/ReduceLightingLoadsByPercentage/measure.rb
210
- - spec/files/measures/ReduceLightingLoadsByPercentage/measure.xml
211
- - spec/files/measures/SetThermostatSchedules/measure.json
212
- - spec/files/measures/SetThermostatSchedules/measure.rb
213
- - spec/files/measures/SetThermostatSchedules/measure.xml
214
- - spec/files/measures/example_measure_auto_directory_name/measure.json
215
- - spec/files/measures/example_measure_auto_directory_name/measure.rb
216
- - spec/files/measures/example_measure_auto_directory_name/measure.xml
217
- - spec/files/measures/reduce_lighting_loads_by_percentage/measure.json
218
- - spec/files/measures/reduce_lighting_loads_by_percentage/measure.rb
219
- - spec/files/measures/reduce_lighting_loads_by_percentage/measure.xml
220
- - spec/files/measures/reduce_space_infiltration_by_percentage/measure.rb
221
- - spec/files/measures/reduce_space_infiltration_by_percentage/measure.xml
222
- - spec/files/measures/rotate_building/measure.rb
223
- - spec/files/measures/rotate_building/measure.xml
224
- - spec/files/measures/set_window_to_wall_ratio_by_facade/measure.rb
225
- - spec/files/measures/set_window_to_wall_ratio_by_facade/measure.xml
226
- - spec/files/measures_second_path/measure_in_another_dir/measure.json
227
- - spec/files/measures_second_path/measure_in_another_dir/measure.rb
228
- - spec/files/measures_second_path/measure_in_another_dir/measure.xml
229
- - spec/files/partial_weather.epw
230
- - spec/files/partial_weather_2.epw
231
- - spec/files/small_seed.osm
232
- - spec/files/worker_init/first_file.rb
233
- - spec/files/worker_init/second_file.rb
234
- - spec/files/workflow/analysis.osa
235
- - spec/files/workflow/datapoint_0.osd
236
- - spec/files/workflow/datapoint_1.osd
237
- - spec/files/workflow/datapoint_2.osd
238
- - spec/files/workflow/datapoint_wrong_osa_id.osd
239
- - spec/integration/server_api_spec.rb
240
- - spec/openstudio/excel_spec.rb
241
- - spec/openstudio/formulation_spec.rb
242
- - spec/openstudio/hash_spec.rb
243
- - spec/openstudio/osw_spec.rb
244
- - spec/openstudio/server_api_spec.rb
245
- - spec/openstudio/string_spec.rb
246
- - spec/openstudio/support_files_spec.rb
247
- - spec/openstudio/weather_spec.rb
248
- - spec/openstudio/workflow_spec.rb
249
- - spec/openstudio/workflow_step_spec.rb
250
- - spec/schema/osa.json
251
- - spec/schema/osa.png
252
- - spec/schema/osd.json
253
- - spec/schema/osd.png
254
- - spec/spec_helper.rb
199
+ - update_license.rb
255
200
  homepage: http://openstudio.nrel.gov
256
201
  licenses:
257
- - LGPL
202
+ - BSD
258
203
  metadata: {}
259
204
  post_install_message:
260
205
  rdoc_options: []
@@ -262,102 +207,19 @@ require_paths:
262
207
  - lib
263
208
  required_ruby_version: !ruby/object:Gem::Requirement
264
209
  requirements:
265
- - - ">="
210
+ - - "~>"
266
211
  - !ruby/object:Gem::Version
267
- version: '2.0'
212
+ version: 2.5.0
268
213
  required_rubygems_version: !ruby/object:Gem::Requirement
269
214
  requirements:
270
215
  - - ">="
271
216
  - !ruby/object:Gem::Version
272
- version: 1.3.6
217
+ version: '0'
273
218
  requirements: []
274
219
  rubyforge_project:
275
- rubygems_version: 2.6.10
220
+ rubygems_version: 2.7.6.2
276
221
  signing_key:
277
222
  specification_version: 4
278
223
  summary: Create JSON, ZIP to communicate with OpenStudio Distributed Analysis in the
279
224
  Cloud
280
- test_files:
281
- - spec/files/0_1_09_no_variables.xlsx
282
- - spec/files/0_1_09_outputvars.xlsx
283
- - spec/files/0_1_09_setup_version_2.xlsx
284
- - spec/files/0_1_09_small_list.xlsx
285
- - spec/files/0_1_09_small_list_incomplete.xlsx
286
- - spec/files/0_1_09_small_list_repeat_vars.xlsx
287
- - spec/files/0_1_09_small_list_validation_errors.xlsx
288
- - spec/files/0_1_10_proxy.xlsx
289
- - spec/files/0_1_10_proxy_user.xlsx
290
- - spec/files/0_1_10_template_input.xlsx
291
- - spec/files/0_1_11_discrete_variables.xlsx
292
- - spec/files/0_1_12_discrete_dynamic_columns.xlsx
293
- - spec/files/0_2_0_template.xlsx
294
- - spec/files/0_2_0_template_simpletest.xlsx
295
- - spec/files/0_3_0_dynamic_uuids.xlsx
296
- - spec/files/0_3_0_measure_existence.xlsx
297
- - spec/files/0_3_0_outputs.xlsx
298
- - spec/files/0_3_3_short_names.xlsx
299
- - spec/files/0_3_5_multiple_measure_paths.xlsx
300
- - spec/files/0_3_7_unique_measure_names.xlsx
301
- - spec/files/0_3_7_worker_init_final.xlsx
302
- - spec/files/0_4_0_lhs_discrete_continuous.xlsx
303
- - spec/files/0_4_0_multiple_seeds.xlsx
304
- - spec/files/0_4_0_pivot_test.xlsx
305
- - spec/files/analysis/examples/discrete_lhs_example.json
306
- - spec/files/analysis/examples/medium_office_example.json
307
- - spec/files/analysis/examples/medium_office_workflow.json
308
- - spec/files/measures/ActualMeasureNoJson/measure.rb
309
- - spec/files/measures/ActualMeasureNoJson/measure.xml
310
- - spec/files/measures/ExampleMeasure/measure.json
311
- - spec/files/measures/ExampleMeasure/measure.rb
312
- - spec/files/measures/ExampleMeasure/measure.xml
313
- - spec/files/measures/IncreaseInsulationRValueForRoofs/measure.json
314
- - spec/files/measures/IncreaseInsulationRValueForRoofs/measure.rb
315
- - spec/files/measures/IncreaseInsulationRValueForRoofs/measure.xml
316
- - spec/files/measures/NoMeasureRbFile/.gitkeep
317
- - spec/files/measures/ReduceLightingLoadsByPercentage/measure.json
318
- - spec/files/measures/ReduceLightingLoadsByPercentage/measure.rb
319
- - spec/files/measures/ReduceLightingLoadsByPercentage/measure.xml
320
- - spec/files/measures/SetThermostatSchedules/measure.json
321
- - spec/files/measures/SetThermostatSchedules/measure.rb
322
- - spec/files/measures/SetThermostatSchedules/measure.xml
323
- - spec/files/measures/example_measure_auto_directory_name/measure.json
324
- - spec/files/measures/example_measure_auto_directory_name/measure.rb
325
- - spec/files/measures/example_measure_auto_directory_name/measure.xml
326
- - spec/files/measures/reduce_lighting_loads_by_percentage/measure.json
327
- - spec/files/measures/reduce_lighting_loads_by_percentage/measure.rb
328
- - spec/files/measures/reduce_lighting_loads_by_percentage/measure.xml
329
- - spec/files/measures/reduce_space_infiltration_by_percentage/measure.rb
330
- - spec/files/measures/reduce_space_infiltration_by_percentage/measure.xml
331
- - spec/files/measures/rotate_building/measure.rb
332
- - spec/files/measures/rotate_building/measure.xml
333
- - spec/files/measures/set_window_to_wall_ratio_by_facade/measure.rb
334
- - spec/files/measures/set_window_to_wall_ratio_by_facade/measure.xml
335
- - spec/files/measures_second_path/measure_in_another_dir/measure.json
336
- - spec/files/measures_second_path/measure_in_another_dir/measure.rb
337
- - spec/files/measures_second_path/measure_in_another_dir/measure.xml
338
- - spec/files/partial_weather.epw
339
- - spec/files/partial_weather_2.epw
340
- - spec/files/small_seed.osm
341
- - spec/files/worker_init/first_file.rb
342
- - spec/files/worker_init/second_file.rb
343
- - spec/files/workflow/analysis.osa
344
- - spec/files/workflow/datapoint_0.osd
345
- - spec/files/workflow/datapoint_1.osd
346
- - spec/files/workflow/datapoint_2.osd
347
- - spec/files/workflow/datapoint_wrong_osa_id.osd
348
- - spec/integration/server_api_spec.rb
349
- - spec/openstudio/excel_spec.rb
350
- - spec/openstudio/formulation_spec.rb
351
- - spec/openstudio/hash_spec.rb
352
- - spec/openstudio/osw_spec.rb
353
- - spec/openstudio/server_api_spec.rb
354
- - spec/openstudio/string_spec.rb
355
- - spec/openstudio/support_files_spec.rb
356
- - spec/openstudio/weather_spec.rb
357
- - spec/openstudio/workflow_spec.rb
358
- - spec/openstudio/workflow_step_spec.rb
359
- - spec/schema/osa.json
360
- - spec/schema/osa.png
361
- - spec/schema/osd.json
362
- - spec/schema/osd.png
363
- - spec/spec_helper.rb
225
+ test_files: []