Declare the name of the forecasting models as a class variable
This commit is contained in:
parent
c74a7b81f1
commit
77806b14b9
2 changed files with 8 additions and 9 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue