From 73675816894c8ad9eb4f498f9a6a25c5af5530f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Morales?= Date: Mon, 11 Nov 2024 12:33:32 -0600 Subject: [PATCH] enforce positive --- mlforecast/core.py | 2 +- nbs/core.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mlforecast/core.py b/mlforecast/core.py index 2096e499..cfe9e6b2 100644 --- a/mlforecast/core.py +++ b/mlforecast/core.py @@ -438,7 +438,7 @@ def _transform( if ( self.keep_last_n is None and update_samples - and all(samples > -1 for samples in update_samples) + and all(samples > 0 for samples in update_samples) ): # user didn't set keep_last_n and we can infer it from the transforms self.keep_last_n = max(update_samples) diff --git a/nbs/core.ipynb b/nbs/core.ipynb index 0d5451d2..1fefe533 100644 --- a/nbs/core.ipynb +++ b/nbs/core.ipynb @@ -931,7 +931,7 @@ " if (\n", " self.keep_last_n is None\n", " and update_samples\n", - " and all(samples > -1 for samples in update_samples)\n", + " and all(samples > 0 for samples in update_samples)\n", " ):\n", " # user didn't set keep_last_n and we can infer it from the transforms\n", " self.keep_last_n = max(update_samples)\n",