From 6327c30dfd682cc70ffa65ded7eafa02cd9062bd Mon Sep 17 00:00:00 2001 From: "d.a.bunin" Date: Wed, 7 Jun 2023 12:00:38 +0300 Subject: [PATCH 1/2] test: remove to_be_fixed from inference tests on SpecialDaysTransform --- .../test_inference/test_inverse_transform.py | 32 +++--------------- .../test_inference/test_transform.py | 33 +++---------------- 2 files changed, 8 insertions(+), 57 deletions(-) diff --git a/tests/test_transforms/test_inference/test_inverse_transform.py b/tests/test_transforms/test_inference/test_inverse_transform.py index 289737260..0e23db17b 100644 --- a/tests/test_transforms/test_inference/test_inverse_transform.py +++ b/tests/test_transforms/test_inference/test_inverse_transform.py @@ -691,6 +691,8 @@ def test_inverse_transform_train_new_segments(self, transform, dataset_name, exp (DensityOutliersTransform(in_column="target"), "ts_with_outliers"), (MedianOutliersTransform(in_column="target"), "ts_with_outliers"), (PredictionIntervalOutliersTransform(in_column="target", model=ProphetModel), "ts_with_outliers"), + # timestamp + (SpecialDaysTransform(), "regular_ts"), ], ) def test_inverse_transform_train_new_segments_not_implemented(self, transform, dataset_name, request): @@ -700,20 +702,6 @@ def test_inverse_transform_train_new_segments_not_implemented(self, transform, d ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={} ) - @to_be_fixed(raises=NotImplementedError, match="Per-segment transforms can't work on new segments") - @pytest.mark.parametrize( - "transform, dataset_name", - [ - # timestamp - (SpecialDaysTransform(), "regular_ts"), - ], - ) - def test_inverse_transform_train_new_segments_failed_not_implemented(self, transform, dataset_name, request): - ts = request.getfixturevalue(dataset_name) - self._test_inverse_transform_train_new_segments( - ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={} - ) - class TestInverseTransformFutureNewSegments: """Test inverse transform on future part of new segments. @@ -1027,6 +1015,8 @@ def test_inverse_transform_future_new_segments(self, transform, dataset_name, ex (DensityOutliersTransform(in_column="target"), "ts_with_outliers"), (MedianOutliersTransform(in_column="target"), "ts_with_outliers"), (PredictionIntervalOutliersTransform(in_column="target", model=ProphetModel), "ts_with_outliers"), + # timestamp + (SpecialDaysTransform(), "regular_ts"), ], ) def test_inverse_transform_future_new_segments_not_implemented(self, transform, dataset_name, request): @@ -1036,20 +1026,6 @@ def test_inverse_transform_future_new_segments_not_implemented(self, transform, ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={} ) - @to_be_fixed(raises=NotImplementedError, match="Per-segment transforms can't work on new segments") - @pytest.mark.parametrize( - "transform, dataset_name", - [ - # timestamp - (SpecialDaysTransform(), "regular_ts"), - ], - ) - def test_inverse_transform_future_new_segments_failed_not_implemented(self, transform, dataset_name, request): - ts = request.getfixturevalue(dataset_name) - self._test_inverse_transform_future_new_segments( - ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={} - ) - @to_be_fixed(raises=Exception) @pytest.mark.parametrize( "transform, dataset_name, expected_changes", diff --git a/tests/test_transforms/test_inference/test_transform.py b/tests/test_transforms/test_inference/test_transform.py index f8f2d1014..d601f98d5 100644 --- a/tests/test_transforms/test_inference/test_transform.py +++ b/tests/test_transforms/test_inference/test_transform.py @@ -56,7 +56,6 @@ from etna.transforms.decomposition import RupturesChangePointsModel from tests.test_transforms.test_inference.common import find_columns_diff from tests.utils import select_segments_subset -from tests.utils import to_be_fixed # TODO: figure out what happened to TrendTransform @@ -652,6 +651,8 @@ def test_transform_train_new_segments(self, transform, dataset_name, expected_ch (DensityOutliersTransform(in_column="target"), "ts_with_outliers"), (MedianOutliersTransform(in_column="target"), "ts_with_outliers"), (PredictionIntervalOutliersTransform(in_column="target", model=ProphetModel), "ts_with_outliers"), + # timestamp + (SpecialDaysTransform(), "regular_ts"), ], ) def test_transform_train_new_segments_not_implemented(self, transform, dataset_name, request): @@ -661,20 +662,6 @@ def test_transform_train_new_segments_not_implemented(self, transform, dataset_n ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={} ) - @to_be_fixed(raises=NotImplementedError, match="Per-segment transforms can't work on new segments") - @pytest.mark.parametrize( - "transform, dataset_name", - [ - # timestamp - (SpecialDaysTransform(), "regular_ts"), - ], - ) - def test_transform_train_new_segments_failed_not_implemented(self, transform, dataset_name, request): - ts = request.getfixturevalue(dataset_name) - self._test_transform_train_new_segments( - ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={} - ) - class TestTransformFutureNewSegments: """Test transform on future part of new segments. @@ -981,6 +968,8 @@ def test_transform_future_new_segments(self, transform, dataset_name, expected_c (DensityOutliersTransform(in_column="target"), "ts_with_outliers"), (MedianOutliersTransform(in_column="target"), "ts_with_outliers"), (PredictionIntervalOutliersTransform(in_column="target", model=ProphetModel), "ts_with_outliers"), + # timestamp + (SpecialDaysTransform(), "regular_ts"), ], ) def test_transform_future_new_segments_not_implemented(self, transform, dataset_name, request): @@ -990,20 +979,6 @@ def test_transform_future_new_segments_not_implemented(self, transform, dataset_ ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={} ) - @to_be_fixed(raises=NotImplementedError, match="Per-segment transforms can't work on new segments") - @pytest.mark.parametrize( - "transform, dataset_name", - [ - # timestamp - (SpecialDaysTransform(), "regular_ts"), - ], - ) - def test_transform_future_new_segments_failed_not_implemented(self, transform, dataset_name, request): - ts = request.getfixturevalue(dataset_name) - self._test_transform_future_new_segments( - ts, transform, train_segments=["segment_1", "segment_2"], expected_changes={} - ) - class TestTransformFutureWithTarget: """Test transform on future dataset with known target. From fac9bf4b8a69b3d74fbe126c686d4527f4784f43 Mon Sep 17 00:00:00 2001 From: "d.a.bunin" Date: Wed, 7 Jun 2023 12:06:31 +0300 Subject: [PATCH 2/2] chore: update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94f758900..2c3cec891 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update requirements for `holidays` and `scipy`, change saving library from `pickle` to `dill` in `SaveMixin` ([#1268](https://github.com/tinkoff-ai/etna/pull/1268)) - Update requirement for `ruptures`, add requirement for `sqlalchemy` ([#1276](https://github.com/tinkoff-ai/etna/pull/1276)) - Optimize `make_samples` of `RNNNet` and `MLPNet` ([#1281](https://github.com/tinkoff-ai/etna/pull/1281)) +- Remove `to_be_fixed` from inference tests on `SpecialDaysTransform` ([#1283](https://github.com/tinkoff-ai/etna/pull/1283)) +- +- - ### Fixed - Fix `plot_backtest` and `plot_backtest_interactive` on one-step forecast ([1260](https://github.com/tinkoff-ai/etna/pull/1260))