epb_view_models 1.0.18 → 1.0.19
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/.buildspec.yml +2 -2
- data/.ruby-version +1 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/api/schemas/xml/SAP-Schema-19.0.0/SAP/UDT/SAP-Domains.xsd +1 -1
- data/lib/epb_view_models.rb +1 -1
- data/lib/presenter/export/domestic.rb +2 -2
- data/lib/view_model/sap_schema_1900/common_schema.rb +40 -9
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4c9e0148c91fdfa17b8230647b7f44630d9197877639f5f8da2948d329afb8e6
|
|
4
|
+
data.tar.gz: db0feff6c2a220fef4810e938bb53d6382df34df65355ff3946443b58ada8950
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f5e51bceb16b9c4ec62cb2a724ccb58e4daf1d8699b67672a755533278b568c00c7f13ee119f7d78983f913bb13a2cd69b36a1d1372e43a4dc4f62f82b89bb03
|
|
7
|
+
data.tar.gz: 9813262b24abc17231f36b6d5b4bf0eac81f58a31d103b80172e518b228e1974b15176af4c97f6ffeee7bea8cd8ac47cd74b08286554ff57883f6ec9fb3085e3
|
data/.buildspec.yml
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3.1.2
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1360,7 +1360,7 @@
|
|
|
1360
1360
|
</xs:enumeration>
|
|
1361
1361
|
</xs:restriction>
|
|
1362
1362
|
</xs:simpleType>
|
|
1363
|
-
|
|
1363
|
+
<xs:simpleType name="SAP-FlatLevelCode">
|
|
1364
1364
|
<xs:annotation>
|
|
1365
1365
|
<xs:documentation>Codes which indicates where a flat is located within a building.</xs:documentation>
|
|
1366
1366
|
</xs:annotation>
|
data/lib/epb_view_models.rb
CHANGED
|
@@ -68,8 +68,8 @@ module Presenter::Export
|
|
|
68
68
|
view[:lighting_environmental_efficiency_rating] =
|
|
69
69
|
@view_model.lighting_environmental_efficiency_rating.to_i
|
|
70
70
|
view[:low_energy_fixed_lighting_outlets_count] =
|
|
71
|
-
@view_model.low_energy_fixed_lighting_outlets_count.to_i
|
|
72
|
-
view[:low_energy_lighting] = @view_model.low_energy_lighting.to_i
|
|
71
|
+
@view_model.low_energy_fixed_lighting_outlets_count.nil? ? nil : @view_model.low_energy_fixed_lighting_outlets_count.to_i
|
|
72
|
+
view[:low_energy_lighting] = @view_model.low_energy_lighting.nil? ? nil : @view_model.low_energy_lighting.to_i
|
|
73
73
|
view[:main_fuel_type] = @view_model.main_fuel_type
|
|
74
74
|
view[:main_heating_controls_descriptions] =
|
|
75
75
|
@view_model.all_main_heating_controls_descriptions
|
|
@@ -259,12 +259,12 @@ module ViewModel
|
|
|
259
259
|
end
|
|
260
260
|
|
|
261
261
|
def top_storey
|
|
262
|
-
flat_level_code = xpath(%w[
|
|
262
|
+
flat_level_code = xpath(%w[SAP-FlatLevelCode])
|
|
263
263
|
flat_level_code == "3" ? "Y" : "N"
|
|
264
264
|
end
|
|
265
265
|
|
|
266
266
|
def storey_count
|
|
267
|
-
|
|
267
|
+
xpath(%w[Storeys])
|
|
268
268
|
end
|
|
269
269
|
|
|
270
270
|
def building_part_number
|
|
@@ -365,20 +365,51 @@ module ViewModel
|
|
|
365
365
|
nil
|
|
366
366
|
end
|
|
367
367
|
|
|
368
|
-
def
|
|
369
|
-
|
|
368
|
+
def fixed_lighting_outlets_count
|
|
369
|
+
@xml_doc.search("Fixed-Lights/Fixed-Light/Lighting-Outlets").map(&:content).map(&:to_i).sum
|
|
370
370
|
end
|
|
371
371
|
|
|
372
|
-
def
|
|
373
|
-
|
|
372
|
+
def format_fixed_light_array
|
|
373
|
+
@xml_doc
|
|
374
|
+
.search("Fixed-Lights/Fixed-Light")
|
|
375
|
+
.map do |part|
|
|
376
|
+
{
|
|
377
|
+
lighting_efficacy:
|
|
378
|
+
xpath(%w[Lighting-Efficacy], part),
|
|
379
|
+
lighting_outlets:
|
|
380
|
+
xpath(%w[Lighting-Outlets], part),
|
|
381
|
+
}
|
|
382
|
+
end
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
def low_energy_lighting
|
|
386
|
+
total_energy_outlet_count = []
|
|
387
|
+
low_energy_outlet_count = []
|
|
388
|
+
|
|
389
|
+
format_fixed_light_array.each do |outlet|
|
|
390
|
+
if outlet[:lighting_efficacy].to_i > 65
|
|
391
|
+
low_energy_outlet_count << outlet[:lighting_outlets].to_i
|
|
392
|
+
end
|
|
393
|
+
total_energy_outlet_count << outlet[:lighting_outlets].to_f
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
(low_energy_outlet_count.sum / total_energy_outlet_count.sum * 100).round
|
|
374
397
|
end
|
|
375
398
|
|
|
376
399
|
def low_energy_fixed_lighting_outlets_count
|
|
377
|
-
|
|
400
|
+
low_energy_outlet_count = []
|
|
401
|
+
|
|
402
|
+
format_fixed_light_array.each do |outlet|
|
|
403
|
+
if outlet[:lighting_efficacy].to_i > 65
|
|
404
|
+
low_energy_outlet_count << outlet[:lighting_outlets].to_i
|
|
405
|
+
end
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
low_energy_outlet_count.sum
|
|
378
409
|
end
|
|
379
410
|
|
|
380
411
|
def open_fireplaces_count
|
|
381
|
-
xpath(%w[Open-
|
|
412
|
+
xpath(%w[Open-Chimneys-Count])
|
|
382
413
|
end
|
|
383
414
|
|
|
384
415
|
def hot_water_description
|
|
@@ -438,7 +469,7 @@ module ViewModel
|
|
|
438
469
|
end
|
|
439
470
|
|
|
440
471
|
def wind_turbine_count
|
|
441
|
-
|
|
472
|
+
@xml_doc.search("Wind-Turbines/Wind-Turbine").map(&:content).count
|
|
442
473
|
end
|
|
443
474
|
|
|
444
475
|
def unheated_corridor_length
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: epb_view_models
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.19
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- MHCLG Energy Performance of Buildings
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-06
|
|
11
|
+
date: 2022-07-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|
|
@@ -1870,7 +1870,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1870
1870
|
- !ruby/object:Gem::Version
|
|
1871
1871
|
version: '0'
|
|
1872
1872
|
requirements: []
|
|
1873
|
-
rubygems_version: 3.
|
|
1873
|
+
rubygems_version: 3.3.7
|
|
1874
1874
|
signing_key:
|
|
1875
1875
|
specification_version: 4
|
|
1876
1876
|
summary: Library used to parse Energy Performance Certificates (EPC)
|