From 982477218cc6888dab4601208003b10f3cca186b Mon Sep 17 00:00:00 2001 From: Raymond G Schireman Date: Fri, 15 Apr 2022 10:03:58 -0400 Subject: [PATCH 1/7] remove test_transform from removed tests --- tests/deprecated_api/test_remove_1-7.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/deprecated_api/test_remove_1-7.py b/tests/deprecated_api/test_remove_1-7.py index 5f1b2d32dc865..7b49ca9766beb 100644 --- a/tests/deprecated_api/test_remove_1-7.py +++ b/tests/deprecated_api/test_remove_1-7.py @@ -43,14 +43,8 @@ def test_v1_7_0_datamodule_transform_properties(tmpdir): dm = MNISTDataModule() with pytest.deprecated_call(match=r"DataModule property `val_transforms` was deprecated in v1.5"): dm.val_transforms = "b" - with pytest.deprecated_call(match=r"DataModule property `test_transforms` was deprecated in v1.5"): - dm.test_transforms = "c" with pytest.deprecated_call(match=r"DataModule property `val_transforms` was deprecated in v1.5"): _ = LightningDataModule(val_transforms="b") - with pytest.deprecated_call(match=r"DataModule property `test_transforms` was deprecated in v1.5"): - _ = LightningDataModule(test_transforms="c") - with pytest.deprecated_call(match=r"DataModule property `test_transforms` was deprecated in v1.5"): - _ = LightningDataModule(test_transforms="c", dims=(1, 1, 1)) def test_v1_7_0_datamodule_size_property(tmpdir): From d2bcf2482360dba222d071ce17f9a5c4ddf298e8 Mon Sep 17 00:00:00 2001 From: Raymond G Schireman Date: Fri, 15 Apr 2022 10:08:17 -0400 Subject: [PATCH 2/7] remove test_transforms from datamodule.py --- pytorch_lightning/core/datamodule.py | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/pytorch_lightning/core/datamodule.py b/pytorch_lightning/core/datamodule.py index b3198a64cf913..06143c41c525c 100644 --- a/pytorch_lightning/core/datamodule.py +++ b/pytorch_lightning/core/datamodule.py @@ -54,20 +54,15 @@ def teardown(self): name: str = ... - def __init__(self, val_transforms=None, test_transforms=None, dims=None): + def __init__(self, val_transforms=None, dims=None): super().__init__() if val_transforms is not None: rank_zero_deprecation( "DataModule property `val_transforms` was deprecated in v1.5 and will be removed in v1.7." ) - if test_transforms is not None: - rank_zero_deprecation( - "DataModule property `test_transforms` was deprecated in v1.5 and will be removed in v1.7." - ) if dims is not None: rank_zero_deprecation("DataModule property `dims` was deprecated in v1.5 and will be removed in v1.7.") self._val_transforms = val_transforms - self._test_transforms = test_transforms self._dims = dims if dims is not None else () # Pointer to the trainer object @@ -92,25 +87,6 @@ def val_transforms(self, t): ) self._val_transforms = t - @property - def test_transforms(self): - """Optional transforms (or collection of transforms) you can apply to test dataset. - - .. deprecated:: v1.5 Will be removed in v1.7.0. - """ - - rank_zero_deprecation( - "DataModule property `test_transforms` was deprecated in v1.5 and will be removed in v1.7." - ) - return self._test_transforms - - @test_transforms.setter - def test_transforms(self, t): - rank_zero_deprecation( - "DataModule property `test_transforms` was deprecated in v1.5 and will be removed in v1.7." - ) - self._test_transforms = t - @property def dims(self): """A tuple describing the shape of your data. Extra functionality exposed in ``size``. From ce22769c24cffa34280182ac356cd9044cc4587c Mon Sep 17 00:00:00 2001 From: Raymond G Schireman Date: Fri, 15 Apr 2022 10:12:27 -0400 Subject: [PATCH 3/7] update docs --- docs/source/starter/core_guide.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/source/starter/core_guide.rst b/docs/source/starter/core_guide.rst index 20ec33534ac71..1b8dfa139370c 100644 --- a/docs/source/starter/core_guide.rst +++ b/docs/source/starter/core_guide.rst @@ -1139,7 +1139,6 @@ spread all over files. # transforms train_transforms = ... val_transforms = ... - test_transforms = ... # dataloader ... # download with dist.barrier() for multi-gpu, etc... From 0d0b0e045ef9a3ff1cf83d342fb0741662b2d528 Mon Sep 17 00:00:00 2001 From: Raymond G Schireman Date: Fri, 15 Apr 2022 10:27:41 -0400 Subject: [PATCH 4/7] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2dbbf50395f0..f844d4325499b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -117,6 +117,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Removed support for passing strategy names or strategy instances to the plugins Trainer argument ([#12700](https://github.com/PyTorchLightning/pytorch-lightning/pull/12700)) +- Removed the deprecated `test_transforms` argument from the `LightningDataModule` constructor ([#12763](https://github.com/PyTorchLightning/pytorch-lightning/pull/12773)) + ### Fixed From 17b3d0a768383218da580942dff9124498b2b86a Mon Sep 17 00:00:00 2001 From: Raymond G Schireman Date: Fri, 15 Apr 2022 10:44:04 -0400 Subject: [PATCH 5/7] add space to make changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f844d4325499b..5ab1258d0e923 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -117,6 +117,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Removed support for passing strategy names or strategy instances to the plugins Trainer argument ([#12700](https://github.com/PyTorchLightning/pytorch-lightning/pull/12700)) + - Removed the deprecated `test_transforms` argument from the `LightningDataModule` constructor ([#12763](https://github.com/PyTorchLightning/pytorch-lightning/pull/12773)) From 2083e2551cd8baea45f99b6cce9809ab66af74ba Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 18 Apr 2022 17:52:11 +0530 Subject: [PATCH 6/7] Update CHANGELOG.md Co-authored-by: Akihiro Nitta --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ab1258d0e923..5b6528e1e5b0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -118,7 +118,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Removed support for passing strategy names or strategy instances to the plugins Trainer argument ([#12700](https://github.com/PyTorchLightning/pytorch-lightning/pull/12700)) -- Removed the deprecated `test_transforms` argument from the `LightningDataModule` constructor ([#12763](https://github.com/PyTorchLightning/pytorch-lightning/pull/12773)) +- Removed the deprecated `test_transforms` argument from the `LightningDataModule` constructor ([#12773](https://github.com/PyTorchLightning/pytorch-lightning/pull/12773)) ### Fixed From 758ce1ba2c5c6739f19beb77c778e8d0eafb529a Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 18 Apr 2022 17:53:48 +0530 Subject: [PATCH 7/7] update --- docs/source/starter/core_guide.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/starter/core_guide.rst b/docs/source/starter/core_guide.rst index 1b8dfa139370c..20ec33534ac71 100644 --- a/docs/source/starter/core_guide.rst +++ b/docs/source/starter/core_guide.rst @@ -1139,6 +1139,7 @@ spread all over files. # transforms train_transforms = ... val_transforms = ... + test_transforms = ... # dataloader ... # download with dist.barrier() for multi-gpu, etc...