Declare the name of the forecasting models as a class variable

This commit is contained in:
Alexander Hess 2026-12-01 14:36:01 +01:00
commit 77806b14b9
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
2 changed files with 8 additions and 9 deletions

View file

@ -2,6 +2,7 @@
import abc
import datetime as dt
import typing as t
import pandas as pd
@ -20,16 +21,14 @@ class ForecastingModelABC(abc.ABC):
"""
self._order_history = order_history
@property
@abc.abstractmethod
def name(self) -> str:
"""The name of the model.
name: t.ClassVar[str]
"""The name of the model.
Used to identify `Forecast`s of the same `*Model` in the database.
So, these must be chosen carefully and must not be changed later on!
Used to identify `Forecast`s of the same `*Model` in the database.
So, these must be chosen carefully and must not be changed later on!
Example: "hets" or "varima" for tactical demand forecasting
"""
Example: "hets" or "varima" for tactical demand forecasting
"""
@abc.abstractmethod
def predict(

View file

@ -40,7 +40,7 @@ class TestGenericForecastingModelProperties:
assert model is not None
def test_model_has_a_name(self, model_cls, order_history):
"""Access the `*Model.name` property."""
"""Access the `*Model.name` class variable."""
model = model_cls(order_history=order_history)
result = model.name