Spaces:
Sleeping
Sleeping
Update data/ashrae_tables.py
Browse files- data/ashrae_tables.py +4 -5
data/ashrae_tables.py
CHANGED
@@ -70,13 +70,12 @@ class ASHRAETables:
|
|
70 |
self.thermal_properties = self._load_thermal_properties()
|
71 |
self.roof_classifications = self._load_roof_classifications()
|
72 |
|
73 |
-
def _validate_cltd_inputs(self, group: str, orientation: str, hour: int, latitude: str, month: str,
|
74 |
"""Validate inputs for CLTD calculations."""
|
75 |
valid_groups = [e.value for e in WallGroup] if is_wall else [e.value for e in RoofGroup]
|
76 |
valid_orientations = [e.value for e in Orientation]
|
77 |
valid_latitudes = ['24N', '32N', '40N', '48N', '56N']
|
78 |
valid_months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
79 |
-
valid_colors = ['Dark', 'Medium', 'Light']
|
80 |
|
81 |
if group not in valid_groups:
|
82 |
return False, f"Invalid {'wall' if is_wall else 'roof'} group: {group}. Valid groups: {valid_groups}"
|
@@ -129,9 +128,9 @@ class ASHRAETables:
|
|
129 |
|
130 |
if month not in valid_months:
|
131 |
return False, f"Invalid month: {month}. Valid months: {valid_months}"
|
132 |
-
if
|
133 |
-
return False, f"Invalid
|
134 |
-
return True, "Valid inputs."
|
135 |
|
136 |
def _load_cltd_wall_table(self) -> Dict[str, pd.DataFrame]:
|
137 |
"""
|
|
|
70 |
self.thermal_properties = self._load_thermal_properties()
|
71 |
self.roof_classifications = self._load_roof_classifications()
|
72 |
|
73 |
+
def _validate_cltd_inputs(self, group: str, orientation: str, hour: int, latitude: str, month: str, solar_absorptivity: float, is_wall: bool = True) -> Tuple[bool, str]:
|
74 |
"""Validate inputs for CLTD calculations."""
|
75 |
valid_groups = [e.value for e in WallGroup] if is_wall else [e.value for e in RoofGroup]
|
76 |
valid_orientations = [e.value for e in Orientation]
|
77 |
valid_latitudes = ['24N', '32N', '40N', '48N', '56N']
|
78 |
valid_months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
|
|
79 |
|
80 |
if group not in valid_groups:
|
81 |
return False, f"Invalid {'wall' if is_wall else 'roof'} group: {group}. Valid groups: {valid_groups}"
|
|
|
128 |
|
129 |
if month not in valid_months:
|
130 |
return False, f"Invalid month: {month}. Valid months: {valid_months}"
|
131 |
+
if not 0.0 <= solar_absorptivity <= 1.0:
|
132 |
+
return False, f"Invalid solar absorptivity: {solar_absorptivity}. Must be between 0.0 and 1.0."
|
133 |
+
return True, "Valid inputs."
|
134 |
|
135 |
def _load_cltd_wall_table(self) -> Dict[str, pd.DataFrame]:
|
136 |
"""
|