Skip to content

Commit

Permalink
Fixed types to make tests pass
Browse files Browse the repository at this point in the history
Co-authored-by: harry <[email protected]>
Co-authored-by: Debajyoti Debnath <[email protected]>
Co-authored-by: dwindleduck <[email protected]>
Co-authored-by: Alan Pinkert <[email protected]>
  • Loading branch information
5 people committed Dec 20, 2023
1 parent 27ab4c4 commit 9918651
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions rules-engine/src/rules_engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,10 @@ def get_outputs_normalized(
average_heat_load=average_heat_load,
maximum_heat_load=maximum_heat_load,
)
#return summary_output # TODO: add BalancePointGraph
# return summary_output # TODO: add BalancePointGraph
raise NotImplementedError


def date_to_analysis_type(d: date) -> AnalysisType:
months = {
1: AnalysisType.INCLUDE,
Expand Down Expand Up @@ -197,8 +198,8 @@ def period_hdd(avg_temps: List[float], balance_point: float) -> float:

def get_average_indoor_temperature(
thermostat_set_point: float,
setback_temperature: float,
setback_hours_per_day: float,
setback_temperature: Optional[float],
setback_hours_per_day: Optional[float],
) -> float:
"""
Calculates the average indoor temperature.
Expand All @@ -210,6 +211,12 @@ def get_average_indoor_temperature(
setback_hours_per_day: average # of hours per day the home is at
setback temp
"""
if setback_temperature is None:
setback_temperature = thermostat_set_point

if setback_hours_per_day is None:
setback_hours_per_day = 0

# again, not sure if we should check for valid values here or whether we can
# assume those kinds of checks will be handled at the point of user entry
return (
Expand Down
4 changes: 2 additions & 2 deletions rules-engine/src/rules_engine/pydantic_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class SummaryInput(BaseModel):
)
heating_system_efficiency: float = Field(description="Summary!B12")
thermostat_set_point: float = Field(description="Summary!B17")
setback_temperature: float = Field(description="Summary!B18")
setback_hours_per_day: float = Field(description="Summary!B19")
setback_temperature: Optional[float] = Field(description="Summary!B18")
setback_hours_per_day: Optional[float] = Field(description="Summary!B19")
design_temperature: float = Field(description="TDesign")


Expand Down

0 comments on commit 9918651

Please sign in to comment.