osut 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9e23061febdcbf30770082f0fccb3b16aabd5fd18a8f9ae7decdf3b268703e02
4
+ data.tar.gz: 0e672c27b10625c3b287f160362c8fcc4619062fe169b3681c90f5fa9fcf45f4
5
+ SHA512:
6
+ metadata.gz: fda291e260dfabb52f7a01f7ab68120475e60e82db082287df2a1647a6254b0f7e8585b23aa32e75001ec1ef6b0c9c5802606bfe1c2f0181d960e5752633d043
7
+ data.tar.gz: 74c78f3af6ca9e73d97f9b4f5f28c45f05e5002326ebeaa9b731ce1d6143b97595f2eb6af309fe799c280c04b8a3a233444d213372e8d77264568e49d9f3f5db
data/.gitattributes ADDED
@@ -0,0 +1,3 @@
1
+ * text=auto
2
+ *.rb text
3
+ text eol=lf
@@ -0,0 +1,72 @@
1
+ name: Pull Request CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ test_300x:
10
+ runs-on: ubuntu-18.04
11
+ steps:
12
+ - name: Check out repository
13
+ uses: actions/checkout@v2
14
+ - name: Run Tests
15
+ run: |
16
+ echo $(pwd)
17
+ echo $(ls)
18
+ docker pull nrel/openstudio:3.0.0
19
+ docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.0.0
20
+ docker exec -t test pwd
21
+ docker exec -t test ls
22
+ docker exec -t test bundle update
23
+ docker exec -t test bundle exec rake
24
+ docker kill test
25
+ test_321x:
26
+ runs-on: ubuntu-18.04
27
+ steps:
28
+ - name: Check out repository
29
+ uses: actions/checkout@v2
30
+ - name: Run Tests
31
+ run: |
32
+ echo $(pwd)
33
+ echo $(ls)
34
+ docker pull nrel/openstudio:3.2.1
35
+ docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.2.1
36
+ docker exec -t test pwd
37
+ docker exec -t test ls
38
+ docker exec -t test bundle update
39
+ docker exec -t test bundle exec rake
40
+ docker kill test
41
+ test_330x:
42
+ runs-on: ubuntu-18.04
43
+ steps:
44
+ - name: Check out repository
45
+ uses: actions/checkout@v2
46
+ - name: Run Tests
47
+ run: |
48
+ echo $(pwd)
49
+ echo $(ls)
50
+ docker pull nrel/openstudio:3.3.0
51
+ docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.3.0
52
+ docker exec -t test pwd
53
+ docker exec -t test ls
54
+ docker exec -t test bundle update
55
+ docker exec -t test bundle exec rake
56
+ docker kill test
57
+ test_340x:
58
+ runs-on: ubuntu-18.04
59
+ steps:
60
+ - name: Check out repository
61
+ uses: actions/checkout@v2
62
+ - name: Run Tests
63
+ run: |
64
+ echo $(pwd)
65
+ echo $(ls)
66
+ docker pull nrel/openstudio:3.4.0
67
+ docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.4.0
68
+ docker exec -t test pwd
69
+ docker exec -t test ls
70
+ docker exec -t test bundle update
71
+ docker exec -t test bundle exec rake
72
+ docker kill test
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ Gemfile.lock
2
+ .rspec_status
3
+ .bundle
4
+ pkg
5
+
6
+ .yardoc
7
+ _yardoc
8
+ doc/
9
+ rdoc
10
+
11
+ .DS_Store
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2022, Denis Bourgeois
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # osut
2
+
3
+ General purpose Ruby utilities for [OpenStudio](https://openstudio.net) [Measures](https://nrel.github.io/OpenStudio-user-documentation/reference/measure_writing_guide/) or other OpenStudio [SDK](https://openstudio-sdk-documentation.s3.amazonaws.com/index.html) applications. Compatible with SDK v3.0.0 (or newer) and OpenStudio Application [releases](https://github.com/openstudiocoalition/OpenStudioApplication/releases?page=2) distributed by the [OpenStudio Coalition](https://openstudiocoalition.org).
4
+
5
+ Add:
6
+
7
+ ```
8
+ gem "osut", git: "https://github.com/rd2/osut", branch: "main"
9
+ ```
10
+
11
+ ... in a v2.1 [bundled](https://bundler.io) _Measure_ development environment "Gemfile" (or instead as a _gemspec_ dependency), and then run:
12
+
13
+ ```
14
+ bundle install (or 'bundle update')
15
+ ```
16
+ ### Recommended use
17
+
18
+ As a Ruby module, one can access __osut__ by extending a _Measure_ module or class:
19
+
20
+ ```
21
+ require osut
22
+
23
+ module M
24
+ extend OSut
25
+ ...
26
+ end
27
+ ```
28
+ The logger module [oslg](https://github.com/rd2/oslg) is an __osut__ dependency. _Measure_ developers can (optionally) choose to log debug, informative, warning or error messages from within an __osut__-extended module or class, e.g.:
29
+
30
+ ```
31
+ M.log(OSut::WARN, "Calculated material thickness > 1m")
32
+ ```
33
+ ... and then decide (at any given stage in the _Measure_) what to log to the OpenStudio runner, vs an automatically-generated results report (e.g. for code compliance), vs a bug report.
34
+
35
+ ### Features
36
+
37
+ Roughly half of the __osut__ methods extract useful _zoning_ information from OpenStudio models (.osm files), e.g.:
38
+ - is a given space part of a CONDITIONED thermal zone?
39
+ - if CONDITIONED, what are its MIN/MAX heating/cooling setpoint temperatures?
40
+ - is it instead a _plenum_? or otherwise UNCONDITIONED?
41
+
42
+ Most of these _zoning_ queries are adapted from [OpenStudio Standards](https://github.com/NREL/openstudio-standards/blob/master/lib/openstudio-standards/standards/Standards.ThermalZone.rb), providing key inputs to _Measures_ (or gems) such as _Thermal Bridging & Derating_ (or [TBD](https://github.com/rd2/tbd)).
43
+
44
+ The remaining methods deal mainly with constructions & materials, or surface geometry, e.g.:
45
+
46
+ - what is the calculated R-value of a construction?
47
+ - are any layered materials in a construction MASSLESS?
48
+ - which one of these layered materials is considered the most insulating?
49
+ - what is the total thickness of a _standard_ opaque construction?
50
+ - any overlaps between 2x windows in a given wall?
51
+
52
+ Look up the full __osut__ API [here](https://www.rubydoc.info/gems/osut).
53
+
54
+ OpenStudio-related questions can be posted on [UnmetHours](https://unmethours.com/questions/).
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ require "yard"
7
+ YARD::Rake::YardocTask.new do |t|
8
+ t.files = ["lib/osut/utils.rb"]
9
+ end
10
+
11
+ task default: :spec