Skip to content

Commit

Permalink
feat(non-combustible): Add Non-Combustible Mat flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-p-may committed May 26, 2023
1 parent 5c737e3 commit fe0a261
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion honeybee_ph/bldg_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def __init__(self):
self.phi_certification = phi.PhiCertification()
self.set_points = SetPoints()
self.mech_room_temp = 20.0
self.non_combustible_materials = False
self.thermal_bridges = {} # type: Dict[str, thermal_bridge.PhThermalBridge]

def add_new_thermal_bridge(self, tb):
Expand All @@ -91,10 +92,11 @@ def to_dict(self):
d["phi_certification"] = self.phi_certification.to_dict()
d["set_points"] = self.set_points.to_dict()
d["mech_room_temp"] = self.mech_room_temp
d["non_combustible_materials"] = self.non_combustible_materials
d["thermal_bridges"] = {}
for tb in self.thermal_bridges.values():
d["thermal_bridges"][str(tb.identifier)] = tb.to_dict()
d['user_data'] = self.user_data
d["user_data"] = self.user_data
return d

@classmethod
Expand All @@ -121,6 +123,7 @@ def from_dict(cls, _dict):
)
obj.set_points = SetPoints.from_dict(_dict.get("set_points", {}))
obj.mech_room_temp = _dict["mech_room_temp"]
obj.non_combustible_materials = _dict.get("non_combustible_materials", False)
for tb_dict in _dict["thermal_bridges"].values():
tb_obj = thermal_bridge.PhThermalBridge.from_dict(tb_dict)
obj.thermal_bridges[tb_obj.identifier] = tb_obj
Expand All @@ -142,6 +145,7 @@ def __copy__(self):
new_obj.phi_certification = self.phi_certification.duplicate()
new_obj.set_points = self.set_points.duplicate()
new_obj.mech_room_temp = self.mech_room_temp
new_obj.non_combustible_materials = self.non_combustible_materials
new_obj.thermal_bridges = {}
for tb_k, tb_v in self.thermal_bridges.items():
new_obj.thermal_bridges[tb_k] = tb_v.duplicate()
Expand Down
2 changes: 2 additions & 0 deletions tests/test_honeybee_ph/test_bldg_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def test_bdg_segment_round_trip_w_tbs():

assert o2.to_dict() == o1.to_dict()


def test_bdg_segment_round_trip_w_user_data():
o1 = BldgSegment()

Expand Down Expand Up @@ -80,6 +81,7 @@ def test_bdg_segment_w_tbs_duplicate():

assert o1.to_dict() == o2.to_dict()


def test_bdg_segment_w_user_data_duplicate():
o1 = BldgSegment()

Expand Down

0 comments on commit fe0a261

Please sign in to comment.