Skip to content

Commit a7602f2

Browse files
authored
Merge pull request #9 from BuildingSync/revise-assets
Revise asset units handling
2 parents 2841897 + a813405 commit a7602f2

File tree

11 files changed

+463
-322
lines changed

11 files changed

+463
-322
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# CHANGELOG
22

3+
## Version 0.1.12
4+
5+
Updated lxml dependency to 4.9.1
6+
7+
## Version 0.1.11
8+
9+
- Better units handling (distinction between predefined units and calculated units)
10+
- added "export_units" key to asset definition schema to indicate fields that will get a generated associated units field
11+
12+
## Version 0.1.10
13+
14+
Revise how asset units are handled
15+
316
## Version 0.1.9
417

518
Add new Heating, Cooling, WaterHeating, and LightingSystems assets

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ The pre-importer will identify assets defined in the `asset_definitions.json` fi
4141

4242
1. `custom`. Use this method for particular asset that do not fit in the other categories; i.e. Heating Efficiency. Note that a dedicated method may need to be written to support this type of asset.
4343

44+
When an asset has a unit associated with it, a separate asset will be generated to store the unit information. That asset will be named the same as the original asset, with ' Units' appended at the end.
45+
4446
To test usage:
4547

4648
```bash
@@ -63,6 +65,7 @@ bp = BSyncProcessor(data=file_data)
6365
## Assumptions
6466
1. Assuming 1 building per file
6567
1. Assuming sqft method uses "Conditioned" floor area for calculations. If not present, uses "Gross"
68+
1. Assuming averages that use served space area must be defined in Sections (LinkedSectionIDs). LinkedBuildingID is not used.
6669

6770
## TODO
6871
1. thermal zones: when spaces are listed within them with spaces (or multiple thermal zones), this would change the average setpoint calculations. Is this an exception or a normal case to handle?

buildingsync_asset_extractor/config/asset_definitions.json

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,98 +5,113 @@
55
"key": "LightingSystemEfficiency",
66
"name": "LightingSystemEfficiency",
77
"export_name": "Lighting System Efficiency",
8-
"type": "custom"
8+
"type": "custom",
9+
"export_units": true,
10+
"units": "W/ft2"
911
},
1012
{
1113
"parent_path": "/BuildingSync/Facilities/Facility/Systems/LightingSystems",
1214
"key": "LightingSystem",
1315
"name": "LightingSystem",
1416
"export_name": "Lighting System Oldest",
15-
"type": "age_oldest"
17+
"type": "age_oldest",
18+
"export_units": false
1619
},
1720
{
1821
"parent_path": "/BuildingSync/Facilities/Facility/Systems/LightingSystems",
1922
"key": "LightingSystem",
2023
"name": "LightingSystem",
2124
"export_name": "Lighting System Average Age",
22-
"type": "age_average"
25+
"type": "age_average",
26+
"export_units": false
2327
},
2428
{
2529
"parent_path": "/BuildingSync/Facilities/Facility/Systems/HVACSystems/HVACSystem/HeatingAndCoolingSystems/HeatingSources/HeatingSource",
2630
"key": "AnnualHeatingEfficiencyValue",
2731
"name": "AnnualHeatingEfficiency",
2832
"export_name": "Heating System Efficiency",
29-
"type": "custom"
33+
"type": "custom",
34+
"export_units": true
3035
},
3136
{
3237
"parent_path": "/BuildingSync/Facilities/Facility/Systems/HVACSystems/HVACSystem/HeatingAndCoolingSystems/HeatingSources",
3338
"key": "HeatingSource",
3439
"name": "HeatingSource",
3540
"export_name": "Heating System Oldest",
36-
"type": "age_oldest"
41+
"type": "age_oldest",
42+
"export_units": false
3743
},
3844
{
3945
"parent_path": "/BuildingSync/Facilities/Facility/Systems/HVACSystems/HVACSystem/HeatingAndCoolingSystems/HeatingSources",
4046
"key": "HeatingSource",
4147
"name": "HeatingSource",
4248
"export_name": "Heating System Average Age",
43-
"type": "age_average"
49+
"type": "age_average",
50+
"export_units": false
4451
},
4552
{
4653
"parent_path": "/BuildingSync/Facilities/Facility/Systems/HVACSystems/HVACSystem/HeatingAndCoolingSystems/HeatingSources/HeatingSource",
4754
"key": "PrimaryFuel",
4855
"name": "PrimaryFuel",
4956
"export_name": "Heating Fuel Type",
50-
"type": "custom"
57+
"type": "custom",
58+
"export_units": false
5159
},
5260
{
5361
"parent_path": "/BuildingSync/Facilities/Facility/Systems/HVACSystems/HVACSystem/HeatingAndCoolingSystems/CoolingSources/CoolingSource",
5462
"key": "AnnualCoolingEfficiencyValue",
5563
"name": "AnnualCoolingEfficiency",
5664
"export_name": "Cooling System Efficiency",
57-
"type": "custom"
65+
"type": "custom",
66+
"export_units": true
5867
},
5968
{
6069
"parent_path": "/BuildingSync/Facilities/Facility/Systems/HVACSystems/HVACSystem/HeatingAndCoolingSystems/CoolingSources",
6170
"key": "CoolingSource",
6271
"name": "CoolingSource",
6372
"export_name": "Cooling System Oldest",
64-
"type": "age_oldest"
73+
"type": "age_oldest",
74+
"export_units": false
6575
},
6676
{
6777
"parent_path": "/BuildingSync/Facilities/Facility/Systems/HVACSystems/HVACSystem/HeatingAndCoolingSystems/CoolingSources",
6878
"key": "CoolingSource",
6979
"name": "CoolingSource",
7080
"export_name": "Cooling System Average Age",
71-
"type": "age_average"
81+
"type": "age_average",
82+
"export_units": false
7283
},
7384
{
7485
"parent_path": "/BuildingSync/Facilities/Facility/Systems/DomesticHotWaterSystems/DomesticHotWaterSystem",
7586
"key": "WaterHeaterEfficiency",
7687
"name": "WaterHeaterEfficiency",
7788
"export_name": "Hot Water System Efficiency",
78-
"type": "custom"
89+
"type": "custom",
90+
"export_units": true
7991
},
8092
{
8193
"parent_path": "/BuildingSync/Facilities/Facility/Systems/DomesticHotWaterSystems",
8294
"key": "DomesticHotWaterSystem",
8395
"name": "DomesticHotWaterSystem",
8496
"export_name": "Hot Water System Oldest",
85-
"type": "age_oldest"
97+
"type": "age_oldest",
98+
"export_units": false
8699
},
87100
{
88101
"parent_path": "/BuildingSync/Facilities/Facility/Systems/DomesticHotWaterSystems",
89102
"key": "DomesticHotWaterSystem",
90103
"name": "DomesticHotWaterSystem",
91104
"export_name": "Hot Water System Average Age",
92-
"type": "age_average"
105+
"type": "age_average",
106+
"export_units": false
93107
},
94108
{
95109
"parent_path": "/BuildingSync/Facilities/Facility/Systems/DomesticHotWaterSystems/DomesticHotWaterSystem",
96110
"key": "PrimaryFuel",
97111
"name": "PrimaryFuel",
98112
"export_name": "Hot Water System Fuel Type",
99-
"type": "custom"
113+
"type": "custom",
114+
"export_units": false
100115
}
101116
]
102117
}

buildingsync_asset_extractor/main.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@
3737

3838
from buildingsync_asset_extractor.processor import BSyncProcessor
3939

40-
# import glob
41-
# from pathlib import Path
42-
43-
44-
# # 1: regular test
40+
# 1: regular test
4541
filename = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'tests/files/completetest.xml')
4642
out_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'assets_output.json')
4743
out_file2 = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'assets_output2.json')
@@ -53,15 +49,17 @@
5349
bp.extract()
5450
bp.save(out_file)
5551

56-
# does it work when already loaded?
57-
with open(filename, mode='rb') as file:
58-
file_data = file.read()
52+
# # does it work when already loaded?
53+
# with open(filename, mode='rb') as file:
54+
# file_data = file.read()
5955

60-
bp = BSyncProcessor(data=file_data)
61-
bp.extract()
62-
bp.save(out_file2)
56+
# bp = BSyncProcessor(data=file_data)
57+
# bp.extract()
58+
# bp.save(out_file2)
6359

6460
# 2: bigger test
61+
# import glob
62+
# from pathlib import Path
6563
# bae_tester_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', '..', 'Desktop/BAE-tester/20220519_AT_BSXML')
6664
# find_path = os.path.join(bae_tester_dir, '*', '*.xml')
6765

@@ -72,7 +70,10 @@
7270
# bp.extract()
7371
# bp.save(out_file)
7472

73+
7574
# 3: schema examples test
75+
# import glob
76+
# from pathlib import Path
7677
# bae_tester_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'bsync-schema', 'examples')
7778
# find_path = os.path.join(bae_tester_dir, '*.xml')
7879

0 commit comments

Comments
 (0)