feat: Adds proposed kw interpolation.
Some checks failed
CI / Ubuntu (push) Failing after 23m10s

This commit is contained in:
2025-03-13 12:38:42 -04:00
parent 5f6d2a7b6c
commit 5b2e20921c
4 changed files with 191 additions and 20 deletions

View File

@@ -13,7 +13,7 @@ struct ManualSTests {
} operation: {
@Dependency(\.manualS) var manualS
let response = try await manualS.coolingInterpolation(.init(
let response = try await manualS.interpolate.cooling(.init(
summerDesignInfo: .mock,
coolingLoad: .mockCoolingLoad,
systemType: .airToAir(type: .airConditioner, compressor: .singleSpeed, climate: .mildWinterOrLatentLoad),
@@ -48,7 +48,7 @@ struct ManualSTests {
} operation: {
@Dependency(\.manualS) var manualS
let response = try await manualS.coolingInterpolation(.init(
let response = try await manualS.interpolate.cooling(.init(
summerDesignInfo: .mock,
coolingLoad: .mockCoolingLoad,
systemType: .airToAir(type: .airConditioner, compressor: .singleSpeed, climate: .mildWinterOrLatentLoad),
@@ -78,7 +78,7 @@ struct ManualSTests {
} operation: {
@Dependency(\.manualS) var manualS
let response = try await manualS.coolingInterpolation(.init(
let response = try await manualS.interpolate.cooling(.init(
summerDesignInfo: .mock,
coolingLoad: .mockCoolingLoad,
systemType: .airToAir(type: .airConditioner, compressor: .singleSpeed, climate: .mildWinterOrLatentLoad),
@@ -108,7 +108,7 @@ struct ManualSTests {
} operation: {
@Dependency(\.manualS) var manualS
let response = try await manualS.coolingInterpolation(.init(
let response = try await manualS.interpolate.cooling(.init(
summerDesignInfo: .mock,
coolingLoad: .mockCoolingLoad,
systemType: .airToAir(type: .airConditioner, compressor: .singleSpeed, climate: .mildWinterOrLatentLoad),
@@ -145,7 +145,7 @@ struct ManualSTests {
} operation: {
@Dependency(\.manualS) var manualS
let response = try await manualS.heatPumpHeatingInterpolation(.init(
let response = try await manualS.interpolate.heatPumpHeating(.init(
winterDesignTemperature: 5,
heatLoss: 49667,
climateType: .mildWinterOrLatentLoad,
@@ -166,7 +166,7 @@ struct ManualSTests {
} operation: {
@Dependency(\.manualS) var manualS
let response = try await manualS.furnaceInterpolation(
let response = try await manualS.interpolate.furnace(
.init(
elevation: nil,
winterDesignTemperature: 5,
@@ -189,7 +189,7 @@ struct ManualSTests {
} operation: {
@Dependency(\.manualS) var manualS
let response = try await manualS.furnaceInterpolation(
let response = try await manualS.interpolate.furnace(
.init(
elevation: nil,
winterDesignTemperature: 5,
@@ -204,6 +204,46 @@ struct ManualSTests {
}
}
@Test
func proposedKWInterpolation() async throws {
try await withDependencies {
$0.manualS = .liveValue
} operation: {
@Dependency(\.manualS) var manualS
let response = try await manualS.interpolate.proposeKW(
.init(heatLoss: 49667, proposedKW: 15)
)
#expect(!response.failed)
#expect(response.capacityAsPercentOfLoad == 107)
#expect(response.supplementalHeatRequired == 14)
}
}
@Test
func proposedKWInterpolation_with_heatPump() async throws {
try await withDependencies {
$0.manualS = .liveValue
} operation: {
@Dependency(\.manualS) var manualS
let response = try await manualS.interpolate.proposeKW(
.init(
winterDesignTemperature: 5,
climateType: .mildWinterOrLatentLoad,
capacity: .mock,
heatLoss: 49667,
proposedKW: 15
)
)
#expect(!response.failed)
#expect(response.capacityAsPercentOfLoad == 136)
#expect(response.supplementalHeatRequired == 11)
}
}
@Test
func balancePoint() async throws {
try await withDependencies {