Enable SIM in flake8 and ruff
This commit is contained in:
parent
5dce8e6645
commit
007998372f
3 changed files with 33 additions and 36 deletions
|
|
@ -232,25 +232,13 @@ class Forecast(meta.Base):
|
|||
low95 = data.loc[timestamp_idx, "low95"]
|
||||
high95 = data.loc[timestamp_idx, "high95"]
|
||||
|
||||
if math.isnan(low80):
|
||||
low80 = None
|
||||
else:
|
||||
low80 = float(round(low80, 5))
|
||||
low80 = None if math.isnan(low80) else float(round(low80, 5))
|
||||
|
||||
if math.isnan(high80):
|
||||
high80 = None
|
||||
else:
|
||||
high80 = float(round(high80, 5))
|
||||
high80 = None if math.isnan(high80) else float(round(high80, 5))
|
||||
|
||||
if math.isnan(low95):
|
||||
low95 = None
|
||||
else:
|
||||
low95 = float(round(low95, 5))
|
||||
low95 = None if math.isnan(low95) else float(round(low95, 5))
|
||||
|
||||
if math.isnan(high95):
|
||||
high95 = None
|
||||
else:
|
||||
high95 = float(round(high95, 5))
|
||||
high95 = None if math.isnan(high95) else float(round(high95, 5))
|
||||
|
||||
forecasts.append(
|
||||
cls(
|
||||
|
|
|
|||
|
|
@ -177,10 +177,7 @@ class Pixel(meta.Base):
|
|||
info_text = f"Pixel({self.n_x}|{self.n_y})"
|
||||
|
||||
# Make the `Pixel`s look like a checkerboard.
|
||||
if (self.n_x + self.n_y) % 2:
|
||||
color = "#808000"
|
||||
else:
|
||||
color = "#ff8c00"
|
||||
color = "#808000" if (self.n_x + self.n_y) % 2 else "#ff8c00"
|
||||
|
||||
marker = folium.Rectangle(
|
||||
bounds=bounds,
|
||||
|
|
|
|||
|
|
@ -580,9 +580,7 @@ class OrderHistory:
|
|||
# For now, we only make forecasts with 7 and 8 weeks
|
||||
# as the training horizon (note:4f79e8fa).
|
||||
if train_horizon in {7, 8}:
|
||||
if add >= 25: # = "high demand"
|
||||
return models.HorizontalETSModel(order_history=self)
|
||||
elif add >= 10: # = "medium demand"
|
||||
if add >= 10: # = "high" or "medium demand"
|
||||
return models.HorizontalETSModel(order_history=self)
|
||||
elif add >= 2.5: # = "low demand"
|
||||
return models.HorizontalSMAModel(order_history=self)
|
||||
|
|
|
|||
Loading…
Reference in a new issue