darts icon indicating copy to clipboard operation
darts copied to clipboard

Mistake in type hinting Exponential Smoothing model - seasonality parameter

Open rijkvandermeulen opened this issue 2 years ago • 3 comments

I believe the type hinting for the seasonal parameter in the Exponential Smoothing model is incorrect (ModelMode iso SeasonalityMode):

class ExponentialSmoothing(ForecastingModel):
    def __init__(
        self,
        trend: Optional[ModelMode] = ModelMode.ADDITIVE,
        damped: Optional[bool] = False,
        seasonal: Optional[ModelMode] = SeasonalityMode.ADDITIVE,
        seasonal_periods: Optional[int] = None,
        random_state: int = 0,
        **fit_kwargs,
    ):

I'll open a PR to make this quick fix. :)

BTW: have you ever considered adding mypy to your pipeline and pre-commit hooks to spot issues like this?

rijkvandermeulen avatar Sep 05 '22 13:09 rijkvandermeulen

I can't speak for @hrzn, but I personally would love to see mypy added to the pre-commit hooks and pipeline. Mypy currently shows 119 errors which will need to be resolved first. Would you be able to help fix those?

gdevos010 avatar Sep 06 '22 18:09 gdevos010

I can't speak for @hrzn, but I personally would love to see mypy added to the pre-commit hooks and pipeline. Mypy currently shows 119 errors which will need to be resolved first. Would you be able to help fix those?

I agree this would be nice 😍 We need a bit of work to fix those issues before can add the pre-commit hook indeed.

hrzn avatar Sep 06 '22 18:09 hrzn

@hrzn @gdevos010 makes sense! I can have a look at the existing mypy errors somewhere in the coming weeks.

rijkvandermeulen avatar Sep 07 '22 06:09 rijkvandermeulen

Fixed by #1186.

madtoinou avatar Jun 14 '23 07:06 madtoinou