openstudio-load-flexibility-measures 0.3.1 → 0.5.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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +36 -36
  3. data/.rubocop.yml +6 -9
  4. data/CHANGELOG.html +75 -75
  5. data/CHANGELOG.md +63 -48
  6. data/Gemfile +31 -7
  7. data/Jenkinsfile +11 -10
  8. data/LICENSE.md +27 -0
  9. data/README.md +57 -42
  10. data/Rakefile +15 -15
  11. data/doc_templates/LICENSE.md +26 -26
  12. data/doc_templates/README.md.erb +41 -41
  13. data/doc_templates/copyright_erb.txt +35 -35
  14. data/doc_templates/copyright_js.txt +3 -3
  15. data/doc_templates/copyright_ruby.txt +33 -33
  16. data/lib/measures/add_central_ice_storage/LICENSE.md +26 -26
  17. data/lib/measures/add_central_ice_storage/README.md +264 -264
  18. data/lib/measures/add_central_ice_storage/README.md.erb +41 -41
  19. data/lib/measures/add_central_ice_storage/measure.rb +1325 -1324
  20. data/lib/measures/add_central_ice_storage/measure.xml +503 -503
  21. data/lib/measures/add_central_ice_storage/resources/OsLib_Schedules.rb +171 -173
  22. data/lib/measures/add_central_ice_storage/tests/add_central_ice_storage_test.rb +203 -203
  23. data/lib/measures/add_central_ice_storage/tests/ice_test_model.osm +21523 -21523
  24. data/lib/measures/add_hpwh/LICENSE.md +26 -26
  25. data/lib/measures/add_hpwh/README.md +186 -186
  26. data/lib/measures/add_hpwh/README.md.erb +41 -41
  27. data/lib/measures/add_hpwh/docs/Flexible Domestic Hot Water Implementation Guide.pdf +0 -0
  28. data/lib/measures/add_hpwh/measure.rb +674 -647
  29. data/lib/measures/add_hpwh/measure.xml +402 -397
  30. data/lib/measures/add_hpwh/tests/SmallHotel-2A.osm +42893 -42893
  31. data/lib/measures/add_hpwh/tests/add_hpwh_test.rb +237 -0
  32. data/lib/measures/add_packaged_ice_storage/LICENSE.md +26 -26
  33. data/lib/measures/add_packaged_ice_storage/README.html +185 -185
  34. data/lib/measures/add_packaged_ice_storage/README.md +189 -189
  35. data/lib/measures/add_packaged_ice_storage/measure.rb +694 -691
  36. data/lib/measures/add_packaged_ice_storage/measure.xml +245 -245
  37. data/lib/measures/add_packaged_ice_storage/resources/TESCurves.idf +1059 -1059
  38. data/lib/measures/add_packaged_ice_storage/tests/MeasureTest.osm +9507 -9507
  39. data/lib/measures/add_packaged_ice_storage/tests/add_packaged_ice_storage_test.rb +96 -96
  40. data/lib/openstudio/load_flexibility_measures/version.rb +40 -40
  41. data/lib/openstudio/load_flexibility_measures.rb +50 -50
  42. data/openstudio-load-flexibility-measures.gemspec +33 -34
  43. metadata +25 -24
  44. data/lib/measures/add_hpwh/tests/add_hphw_test.rb +0 -98
@@ -1,98 +0,0 @@
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 HOLDER(S) AND ANY CONTRIBUTORS
24
- # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
25
- # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
- # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
27
- # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
28
- # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29
- # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
30
- # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31
- # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32
- # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33
- # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
- # *******************************************************************************
35
-
36
- # insert your copyright here
37
-
38
- require 'openstudio'
39
- require 'openstudio/measure/ShowRunnerOutput'
40
- require 'minitest/autorun'
41
- require_relative '../measure.rb'
42
- require 'fileutils'
43
-
44
- class AddHphwTest < Minitest::Test
45
- # def setup
46
- # end
47
-
48
- # def teardown
49
- # end
50
-
51
- def test_good_argument_values
52
- # create an instance of the measure
53
- measure = AddHphw.new
54
-
55
- # create runner with empty OSW
56
- osw = OpenStudio::WorkflowJSON.new
57
- runner = OpenStudio::Measure::OSRunner.new(osw)
58
-
59
- # load the test model
60
- translator = OpenStudio::OSVersion::VersionTranslator.new
61
- path = "#{File.dirname(__FILE__)}/SmallHotel-2A.osm"
62
- model = translator.loadModel(path)
63
- assert(!model.empty?)
64
- model = model.get
65
-
66
- # get arguments
67
- arguments = measure.arguments(model)
68
- argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
69
-
70
- # create hash of argument values.
71
- # If the argument has a default that you want to use, you don't need it in the hash
72
- args_hash = {}
73
- # using defaults values from measure.rb for other arguments
74
-
75
- # populate argument with specified hash value if specified
76
- arguments.each do |arg|
77
- temp_arg_var = arg.clone
78
- if args_hash.key?(arg.name)
79
- assert(temp_arg_var.setValue(args_hash[arg.name]))
80
- end
81
- argument_map[arg.name] = temp_arg_var
82
- end
83
-
84
- # run the measure
85
- measure.run(model, runner, argument_map)
86
- result = runner.result
87
-
88
- # assert that it ran correctly
89
- assert_equal('Success', result.value.valueName)
90
-
91
- # show the output
92
- show_output(result)
93
-
94
- # save the model to test output directory
95
- output_file_path = "#{File.dirname(__FILE__)}//output/test_output.osm"
96
- model.save(output_file_path, true)
97
- end
98
- end