feat: Adds cooling interpolation tests.

This commit is contained in:
2025-03-13 09:10:52 -04:00
parent ec58ca6364
commit c23e4c5f61
7 changed files with 287 additions and 112 deletions

View File

@@ -4,7 +4,7 @@ import Models
extension SizingLimits.Request {
func respond() async throws -> SizingLimits.Response {
return try .init(
oversizing: .oversizingLimit(systemType: systemType, houseLoad: houseLoad),
oversizing: .oversizingLimit(systemType: systemType, houseLoad: coolingLoad),
undersizing: .undersizingLimits
)
}
@@ -20,7 +20,7 @@ private extension SizingLimits.Limits {
static func oversizingLimit(
systemType: SystemType,
houseLoad: HouseLoad?
houseLoad: Capacity.Cooling?
) throws -> Self {
switch systemType {
case let .heatingOnly(type: type):
@@ -51,7 +51,7 @@ private extension SystemType.HeatingOnlyType {
}
private func coolingTotalOversizingLimit(
houseLoad: HouseLoad?,
houseLoad: Capacity.Cooling?,
compressorType: SystemType.CompressorType,
climateType: SystemType.ClimateType
) throws -> Int {
@@ -67,7 +67,7 @@ private func coolingTotalOversizingLimit(
guard let houseLoad else {
throw HouseLoadError()
}
let decimal = Double(houseLoad.coolingTotal + 15000) / Double(houseLoad.coolingTotal)
let decimal = Double(houseLoad.total + 15000) / Double(houseLoad.total)
return Int(round(decimal * 100))
}
}