Skip to content

Commit

Permalink
fix: forecast day init
Browse files Browse the repository at this point in the history
  • Loading branch information
WLM1ke committed Jan 10, 2025
1 parent 905b97f commit eecf8ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion poptimizer/domain/portfolio/forecasts.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class Forecast(domain.Entity):
mean: float = 0
std: float = 0

def init_day(self) -> None:
def init_day(self, day: domain.Day) -> None:
self.day = day
self.models.clear()

def update_required(self, portfolio_ver: domain.Version) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion poptimizer/use_cases/portfolio/forecasts.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def __call__(
) -> handler.ForecastsAnalyzed | None:
forecast = await ctx.get_for_update(forecasts.Forecast)
if forecast.day < msg.day:
forecast.init_day()
forecast.init_day(msg.day)

match msg:
case handler.ModelDeleted():
Expand Down

0 comments on commit eecf8ba

Please sign in to comment.