Skip to content

Commit

Permalink
Merge pull request #19 from pnnl/fix_brick_unittest
Browse files Browse the repository at this point in the history
Fix brick instance
  • Loading branch information
leijerry888 authored Apr 17, 2024
2 parents b9de1a3 + 04ef80d commit 77fb0af
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion constrain/api/brick_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __init__(
}

# load brick schema and instance files
self.g = brickschema.Graph(load_brick=True)
self.g = brickschema.Graph(load_brick=False)
self.g.load_file(self.brick_schema_path)
if perform_reasoning:
self.g.expand(
Expand Down
19 changes: 9 additions & 10 deletions resources/brick/brick_instance.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ bldg:zone_2_zone_air_temperature_sensor a brick:Zone_Air_Temperature_Sensor .

bldg:zone_2_occupancy_sensor a brick:Occupancy_Sensor .


# service hot water
bldg:service_water_heater a brick:Water_heater ;
bldg:service_water_heater a brick:Water_Heater ;
brick:feeds bldg:service_water_heater_pump ;
brick:hasPoint bldg:service_water_heater_water_temperature_sensor .

Expand All @@ -42,7 +41,6 @@ bldg:service_water_heater_pump a brick:Water_Pump ;

bldg:service_water_heater_water_temperature_sensor a brick:Water_Temperature_Sensor .


# AHU
bldg:ahu a brick:AHU ;
brick:hasPoint bldg:ahu_air_temperature_setpoint,
Expand All @@ -66,23 +64,24 @@ bldg:ahu_cooling_start_stop_status a brick:Cooling_Start_Stop_Status .

bldg:ahu_heating_coil a brick:Heating_Coil ;
brick:hasPoint bldg:ahu_heating_coil_on_off_status ;
brick:hasPart bldg:ahu_heating_coil_electrical_meter .
brick:hasSubMeter bldg:ahu_heating_coil_electrical_meter .
# 'brick:hasSubMeter' reference: https://docs.brickschema.org/modeling/meters.html#:~:text=%3ABuilding_Electrical_Meter%20.-,Meters%20and%20Submeters,-%23

bldg:ahu_heating_coil_on_off_status a brick:On_Off_Status .

bldg:ahu_heating_coil_electrical_meter a brick:Electrical_Meter .

bldg:ahu_cooling_coil a brick:Cooling_Coil ;
brick:hasPart bldg:ahu_cooling_coil_thermal_power_meter .

brick:hasSubMeter bldg:ahu_cooling_coil_thermal_power_meter .
bldg:ahu_cooling_coil_thermal_power_meter a brick:Thermal_Power_Meter .

bldg:ahu_fan a brick:Fan ;
brick:feeds bldg:vav1,
bldg:vav2 ;
brick:hasPoint bldg:ahu_fan_on_off_status,
bldg:ahu_fan_supply_air_temperature_sensor ;
brick:hasPart bldg:ahu_fan_electrical_meter .
brick:hasSubMeter bldg:ahu_fan_electrical_meter .

bldg:ahu_fan_on_off_status a brick:Fan_On_Off_Status .

Expand Down Expand Up @@ -131,12 +130,12 @@ bldg:chiller a brick:Chiller ;

bldg:chiller_chilled_water_flow_sensor a brick:Chilled_Water_Flow_Sensor .

bldg:chiller_chilled_water_return_temperature_sensor a brick:Chilled_Water_Return_Temperature_Sensor .
bldg:chiller_chilled_water_return_temperature_sensor a brick:Leaving_Water_Temperature_Sensor .

bldg:cooling_tower a brick:Cooling_Tower ;
brick:hasPoint bldg:cooling_tower_return_condenser_water_temperature_sensor .

bldg:cooling_tower_return_condenser_water_temperature_sensor a brick:Return_Condenser_Water_Temperature_Sensor .
bldg:cooling_tower_return_condenser_water_temperature_sensor a brick:Leaving_Water_Temperature_Sensor .

bldg:chilled_water_pump a brick:Chilled_Water_Pump ;
brick:hasPoint bldg:chilled_water_pump_flow_sensor ;
Expand All @@ -153,7 +152,7 @@ bldg:boiler a brick:Boiler ;

bldg:boiler_hot_water_flow_sensor a brick:Hot_Water_Flow_Sensor .

bldg:boiler_hot_water_return_temperature_sensor a brick:Hot_Water_Return_Temperature_Sensor .
bldg:boiler_hot_water_return_temperature_sensor a brick:Leaving_Hot_Water_Temperature_Sensor .

bldg:boiler_water_flow_sensor a brick:Water_Flow_Sensor .

Expand Down
12 changes: 6 additions & 6 deletions tests/api/test_brick_compliance.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import unittest

sys.path.append("./src")
sys.path.append("./constrain")
from api import BrickCompliance


Expand Down Expand Up @@ -133,11 +133,11 @@ def test_validate_instance(self):
brick_instance_path="./resources/brick/brick_instance.ttl",
)
is_valid, results_msg = brick_comp_obj.validate_brick_instance()
# TODO: brick instance isn't valid. Need to look into it
# self.assertEqual(
# is_valid,
# True,
# )

self.assertEqual(
is_valid,
True,
)

def test_get_applicable_verification_lib_items(self):
brick_comp_obj = BrickCompliance(
Expand Down

0 comments on commit 77fb0af

Please sign in to comment.