Skip to content

Commit

Permalink
fix(default_elec_equip): Fix default Ext / Garage Lighting 'inside'
Browse files Browse the repository at this point in the history
- Update default Ext / Garage lighting so it is 'outside' the thermal envelope
  • Loading branch information
ed-p-may committed Nov 20, 2023
1 parent bbdaf88 commit af32d7e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
17 changes: 10 additions & 7 deletions honeybee_energy_ph/load/ph_equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(self):
self.combined_energy_factor = 0.0 # CEF

def apply_default_attr_values(self, _defaults={}):
# type: (Dict) -> None
# type: (Dict[str, Any]) -> None
"""Sets all the object attributes to default values, as specified in a "defaults" dict."""

if not _defaults:
Expand All @@ -104,7 +104,7 @@ def apply_default_attr_values(self, _defaults={}):
setattr(self, k, v)

def to_dict(self):
# type: () -> dict
# type: () -> Dict[str, Any]
d = {}

d['display_name'] = self.display_name
Expand All @@ -124,7 +124,7 @@ def to_dict(self):
return d

def base_attrs_from_dict(self, _obj, _input_dict):
# type: (PhEquipment, dict) -> None
# type: (PhEquipment, Dict[str, Any]) -> None
"""Set the base object attributes from a dictionary
Arguments:
Expand Down Expand Up @@ -511,21 +511,23 @@ def from_dict(cls, _input_dict):
class PhPhiusLightingExterior(PhEquipment):

def __init__(self, _defaults={}):
# type: (Dict[str, Any]) -> None
super(PhPhiusLightingExterior, self).__init__()
self.display_name = "PHIUS+ Exterior Lighting"
self.frac_high_efficiency = 1 # CEF
self.in_conditioned_space = False
self.apply_default_attr_values(_defaults)

def to_dict(self):
# type: () -> dict
# type: () -> Dict[str, Any]
d = {}
d.update(super(PhPhiusLightingExterior, self).to_dict())
d['frac_high_efficiency'] = self.frac_high_efficiency
return d

@classmethod
def from_dict(cls, _input_dict):
# type: (dict) -> PhPhiusLightingExterior
# type: (Dict[str, Any]) -> PhPhiusLightingExterior
new_obj = cls()
super(PhPhiusLightingExterior, new_obj).base_attrs_from_dict(new_obj, _input_dict)
new_obj.frac_high_efficiency = _input_dict['frac_high_efficiency']
Expand All @@ -539,18 +541,19 @@ def __init__(self, _defaults={}):
super(PhPhiusLightingGarage, self).__init__()
self.display_name = "PHIUS+ Garage Lighting"
self.frac_high_efficiency = 1 # CEF
self.in_conditioned_space = False
self.apply_default_attr_values(_defaults)

def to_dict(self):
# type: () -> dict
# type: () -> Dict[str, Any]
d = {}
d.update(super(PhPhiusLightingGarage, self).to_dict())
d['frac_high_efficiency'] = self.frac_high_efficiency
return d

@classmethod
def from_dict(cls, _input_dict):
# type: (dict) -> PhPhiusLightingGarage
# type: (Dict[str, Any]) -> PhPhiusLightingGarage
new_obj = cls()
super(PhPhiusLightingGarage, new_obj).base_attrs_from_dict(new_obj, _input_dict)
new_obj.frac_high_efficiency = _input_dict['frac_high_efficiency']
Expand Down
8 changes: 4 additions & 4 deletions honeybee_ph_standards/programtypes/default_elec_equip.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
'comment': 'default',
'reference_quantity': 6, # PH case floor area
'quantity': 1,
'in_conditioned_space': True,
'in_conditioned_space': False,
'reference_energy_norm': 1, # Use
'energy_demand': 0,
'energy_demand_per_use': 0,
Expand All @@ -249,7 +249,7 @@
'comment': 'default',
'reference_quantity': 6, # PH case floor area
'quantity': 1,
'in_conditioned_space': True,
'in_conditioned_space': False,
'reference_energy_norm': 1, # Use
'energy_demand': 0,
'energy_demand_per_use': 0,
Expand All @@ -262,7 +262,7 @@
'comment': 'default',
'reference_quantity': 2,
'quantity': 0,
'in_conditioned_space': True,
'in_conditioned_space': False,
'reference_energy_norm': 2,
'energy_demand': 100,
'energy_demand_per_use': 100,
Expand All @@ -273,7 +273,7 @@
'comment': 'default',
'reference_quantity': 2,
'quantity': 0,
'in_conditioned_space': True,
'in_conditioned_space': False,
'reference_energy_norm': 2,
'energy_demand': 100,
'energy_demand_per_use': 100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ def test_PhPhiusLightingExterior_round_trip():
e2 = ph_equipment.PhEquipmentBuilder.from_dict(d1)

assert e2.to_dict() == d1
assert e2.in_conditioned_space == False

def test_PhPhiusLightingGarage_round_trip():
e1 = ph_equipment.PhPhiusLightingGarage()
d1 = e1.to_dict()
e2 = ph_equipment.PhEquipmentBuilder.from_dict(d1)

assert e2.to_dict() == d1
assert e2.in_conditioned_space == False

def test_PhCustomAnnualElectric_round_trip():
e1 = ph_equipment.PhCustomAnnualElectric()
Expand Down

0 comments on commit af32d7e

Please sign in to comment.