tbd 3.4.1 → 3.4.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d894d405f77c1eb33517cb957ca0a9a8f87319841c983047acdb8055aa5d79c
4
- data.tar.gz: 6788f593ac0bb66c52b81d0be2f5140dd6c4ef9c6dfb0f9df5e684bdd41c714a
3
+ metadata.gz: d4edf2565b741a5d272169d616339e9f86e4651402ea9ca160f2db30fc38b07f
4
+ data.tar.gz: 6320eaf03d3f60c178bc05c4e53d84c42b678dc757590428306b23bf0f6d9b83
5
5
  SHA512:
6
- metadata.gz: 753541a1202a93df6346b8ce164679fbecdce11413d017977d62f9edb386ad0ab03e8b4b2a43be00eac01f0b0d3f45f9f4c91d9ec3db9c5e34a482a2b45a3600
7
- data.tar.gz: 945278734bc73490690e8fdc37e0bf9fe910ea29f4eef43370234f76f3032c8f0d25cf38a648ffde44f990db39c17fcc0fc115662dc4150b4fa1b0c5df8a8776
6
+ metadata.gz: 9972bcf05ee6a42900b8153fd71acb3232a3b00e0cd95c87ffefac1ec982777fa4292fca3361d70ad6a7e4f46cfdca1f1e77879a1677eb75be946bbb4827fe9c
7
+ data.tar.gz: 76c04922cf93a8252b2d08e1d14582152d2d43a71ec99099e63467eb4b761602824d62c8e931d49ecd4f7eaa7a6f518a6d6e10bb0375bf56cebed1eef4a38c26
@@ -118,3 +118,19 @@ jobs:
118
118
  docker exec -t test bundle update
119
119
  docker exec -t test bundle exec rake
120
120
  docker kill test
121
+ test_380x:
122
+ runs-on: ubuntu-22.04
123
+ steps:
124
+ - name: Check out repository
125
+ uses: actions/checkout@v2
126
+ - name: Run Tests
127
+ run: |
128
+ echo $(pwd)
129
+ echo $(ls)
130
+ docker pull nrel/openstudio:3.8.0
131
+ docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.8.0
132
+ docker exec -t test pwd
133
+ docker exec -t test ls
134
+ docker exec -t test bundle update
135
+ docker exec -t test bundle exec rake
136
+ docker kill test
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ task :libraries do
15
15
 
16
16
  libs = ["topolys", "osut", "oslg", "tbd"]
17
17
  files = {}
18
-
18
+
19
19
  $:.each do |path|
20
20
  libs.each do |l|
21
21
  next unless path.include?(l)
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.1</schema_version>
4
4
  <name>tbd_measure</name>
5
5
  <uid>8890787b-8c25-4dc8-8641-b6be1b6c2357</uid>
6
- <version_id>4eec2792-b3ef-4152-95c8-a7dd6a6bf9c4</version_id>
7
- <version_modified>2024-04-17T14:29:06Z</version_modified>
6
+ <version_id>12467d7f-9058-4028-b6f8-0448e81b7fef</version_id>
7
+ <version_modified>2024-10-15T18:51:39Z</version_modified>
8
8
  <xml_checksum>99772807</xml_checksum>
9
9
  <class_name>TBDMeasure</class_name>
10
10
  <display_name>Thermal Bridging and Derating - TBD</display_name>
@@ -523,13 +523,13 @@
523
523
  <filename>psi.rb</filename>
524
524
  <filetype>rb</filetype>
525
525
  <usage_type>resource</usage_type>
526
- <checksum>5ABDEC60</checksum>
526
+ <checksum>25CD6251</checksum>
527
527
  </file>
528
528
  <file>
529
529
  <filename>tbd.rb</filename>
530
530
  <filetype>rb</filetype>
531
531
  <usage_type>resource</usage_type>
532
- <checksum>E8D38E59</checksum>
532
+ <checksum>FCCCAE84</checksum>
533
533
  </file>
534
534
  <file>
535
535
  <filename>transformation.rb</filename>
@@ -541,13 +541,13 @@
541
541
  <filename>ua.rb</filename>
542
542
  <filetype>rb</filetype>
543
543
  <usage_type>resource</usage_type>
544
- <checksum>928C5E7B</checksum>
544
+ <checksum>013BA732</checksum>
545
545
  </file>
546
546
  <file>
547
547
  <filename>utils.rb</filename>
548
548
  <filetype>rb</filetype>
549
549
  <usage_type>resource</usage_type>
550
- <checksum>E3B4AF4B</checksum>
550
+ <checksum>CBC3935D</checksum>
551
551
  </file>
552
552
  <file>
553
553
  <filename>version.rb</filename>
@@ -1717,49 +1717,26 @@ module TBD
1717
1717
  t_model.wires.each do |wire|
1718
1718
  next unless surface[:wire] == wire.id # should be a unique match
1719
1719
 
1720
- normal = tbd[:surfaces][id][:n] if tbd[:surfaces].key?(id)
1721
- normal = holes[id].attributes[:n] if holes.key?(id)
1722
- normal = shades[id][:n] if shades.key?(id)
1723
- farthest = Topolys::Point3D.new(origin.x, origin.y, origin.z)
1724
- farthest_V = farthest - origin # zero magnitude, initially
1725
- inverted = false
1726
- i_origin = wire.points.index(origin)
1727
- i_terminal = wire.points.index(terminal)
1728
- i_last = wire.points.size - 1
1729
-
1730
- if i_terminal == 0
1731
- inverted = true unless i_origin == i_last
1732
- elsif i_origin == i_last
1733
- inverted = true unless i_terminal == 0
1734
- else
1735
- inverted = true unless i_terminal - i_origin == 1
1736
- end
1720
+ normal = tbd[:surfaces][id][:n] if tbd[:surfaces].key?(id)
1721
+ normal = holes[id].attributes[:n] if holes.key?(id)
1722
+ normal = shades[id][:n] if shades.key?(id)
1723
+ farthest = Topolys::Point3D.new(origin.x, origin.y, origin.z)
1724
+ farthest_V = farthest - origin # zero magnitude, initially
1725
+ farthest_mag = 0
1737
1726
 
1738
1727
  wire.points.each do |point|
1739
1728
  next if point == origin
1740
1729
  next if point == terminal
1741
1730
 
1742
- point_on_plane = edge_plane.project(point)
1743
- origin_point_V = point_on_plane - origin
1744
- point_V_magnitude = origin_point_V.magnitude
1745
- next unless point_V_magnitude > TOL
1746
-
1747
- # Generate a plane between origin, terminal & point. Only consider
1748
- # planes that share the same normal as wire.
1749
- if inverted
1750
- plane = Topolys::Plane3D.from_points(terminal, origin, point)
1751
- else
1752
- plane = Topolys::Plane3D.from_points(origin, terminal, point)
1753
- end
1754
-
1755
- dnx = (normal.x - plane.normal.x).abs
1756
- dny = (normal.y - plane.normal.y).abs
1757
- dnz = (normal.z - plane.normal.z).abs
1758
- next unless dnx < TOL && dny < TOL && dnz < TOL
1731
+ point_on_plane = edge_plane.project(point)
1732
+ origin_point_V = point_on_plane - origin
1733
+ point_V_mag = origin_point_V.magnitude
1734
+ next unless point_V_mag > TOL
1735
+ next unless point_V_mag > farthest_mag
1759
1736
 
1760
- farther = point_V_magnitude > farthest_V.magnitude
1761
- farthest = point if farther
1762
- farthest_V = origin_point_V if farther
1737
+ farthest = point
1738
+ farthest_V = origin_point_V
1739
+ fathest_mag = point_V_mag
1763
1740
  end
1764
1741
 
1765
1742
  angle = reference_V.angle(farthest_V)
@@ -2125,7 +2102,7 @@ module TBD
2125
2102
  end
2126
2103
 
2127
2104
  # Label edge as :ceiling if linked to:
2128
- # +1 deratable surfaces
2105
+ # +1 deratable surface(s)
2129
2106
  # 1x underatable CONDITIONED floor linked to an unoccupied space
2130
2107
  # 1x adjacent CONDITIONED ceiling linked to an occupied space
2131
2108
  edge[:surfaces].keys.each do |i|
@@ -2139,9 +2116,9 @@ module TBD
2139
2116
  next if floors[i][:occupied ]
2140
2117
 
2141
2118
  ceiling = floors[i][:boundary]
2142
- next unless ceilings.key?(ceiling)
2143
- next unless ceilings[ceiling][:conditioned]
2144
- next unless ceilings[ceiling][:occupied ]
2119
+ next unless ceilings.key?(ceiling)
2120
+ next unless ceilings[ceiling][:conditioned]
2121
+ next unless ceilings[ceiling][:occupied ]
2145
2122
 
2146
2123
  other = deratables.first unless deratables.first == id
2147
2124
  other = deratables.last unless deratables.last == id
@@ -3308,9 +3285,9 @@ module TBD
3308
3285
  match2 = /files/.match(file_paths[1].to_s.strip)
3309
3286
  match = match1 || match2
3310
3287
 
3311
- if file_paths.size >= 2 && File.exists?(file_paths[1].to_s.strip) && match
3288
+ if file_paths.size >= 2 && File.exist?(file_paths[1].to_s.strip) && match
3312
3289
  out_dir = file_paths[1].to_s.strip
3313
- elsif !file_paths.empty? && File.exists?(file_paths.first.to_s.strip)
3290
+ elsif !file_paths.empty? && File.exist?(file_paths.first.to_s.strip)
3314
3291
  out_dir = file_paths.first.to_s.strip
3315
3292
  end
3316
3293
 
@@ -40,16 +40,16 @@ require_relative "geo"
40
40
  require_relative "ua"
41
41
 
42
42
  module TBD
43
- extend OSut # OpenStudio utilities
44
-
45
- TOL = OSut::TOL
46
- TOL2 = OSut::TOL2
47
- DBG = OSut::DEBUG # mainly to flag invalid arguments for devs (buggy code)
48
- INF = OSut::INFO # informs TBD user of measure success or failure
49
- WRN = OSut::WARN # e.g. WARN users of 'iffy' .osm inputs (yet not critical)
50
- ERR = OSut::ERR # e.g. flag invalid .osm inputs
51
- FTL = OSut::FATAL # e.g. invalid TBD JSON format/entries
52
- NS = "nameString" # OpenStudio IdfObject nameString method
43
+ extend OSut # OpenStudio utilities
44
+
45
+ TOL = OSut::TOL.dup # default distance tolerance (m)
46
+ TOL2 = OSut::TOL2.dup # default area tolerance (m2)
47
+ DBG = OSut::DEBUG.dup # github.com/rd2/oslg
48
+ INF = OSut::INFO.dup # github.com/rd2/oslg
49
+ WRN = OSut::WARN.dup # github.com/rd2/oslg
50
+ ERR = OSut::ERR.dup # github.com/rd2/oslg
51
+ FTL = OSut::FATAL.dup # github.com/rd2/oslg
52
+ NS = OSut::NS.dup # OpenStudio IdfObject nameString method
53
53
 
54
54
  extend TBD
55
55
  end
@@ -799,8 +799,8 @@ module TBD
799
799
  blc.each do |b|
800
800
  bloc = b1
801
801
  bloc = b2 if b == :b2
802
- pro_sum = bloc[:pro].values.reduce(:+)
803
- ref_sum = bloc[:ref].values.reduce(:+)
802
+ pro_sum = bloc[:pro].values.sum
803
+ ref_sum = bloc[:ref].values.sum
804
804
 
805
805
  if pro_sum > TOL || ref_sum > TOL
806
806
  ratio = nil
@@ -1000,7 +1000,7 @@ module TBD
1000
1000
  model = "* modèle : #{ua[:file]}" if ua.key?(:file) && lang == :fr
1001
1001
  model += " (v#{ua[:version]})" if ua.key?(:version)
1002
1002
  report << model unless model.empty?
1003
- report << "* TBD : v3.4.0"
1003
+ report << "* TBD : v3.4.3"
1004
1004
  report << "* date : #{ua[:date]}"
1005
1005
 
1006
1006
  if lang == :en