From d0b620fe5a79fd2148a1303531c22f19710e6186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mochol=C3=AD?= Date: Tue, 20 Dec 2022 17:27:01 +0100 Subject: [PATCH] Remove support for `LightningCLI(seed_everything_default=None)` (#16137) --- src/pytorch_lightning/CHANGELOG.md | 3 +++ src/pytorch_lightning/cli.py | 7 ------- .../tests_pytorch/deprecated_api/test_remove_1-9.py | 13 ------------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/pytorch_lightning/CHANGELOG.md b/src/pytorch_lightning/CHANGELOG.md index 3ea2888ffd..976fd1b9b6 100644 --- a/src/pytorch_lightning/CHANGELOG.md +++ b/src/pytorch_lightning/CHANGELOG.md @@ -122,6 +122,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Removed the deprecated `Trainer.reset_train_val_dataloaders()` in favor of `Trainer.reset_{train,val}_dataloader` ([#16131](https://github.com/Lightning-AI/lightning/pull/16131)) +- Removed support for `LightningCLI(seed_everything_default=None)` ([#16131](https://github.com/Lightning-AI/lightning/pull/16131)) + + ### Fixed - Enhanced `reduce_boolean_decision` to accommodate `any`-analogous semantics expected by the `EarlyStopping` callback ([#15253](https://github.com/Lightning-AI/lightning/pull/15253)) diff --git a/src/pytorch_lightning/cli.py b/src/pytorch_lightning/cli.py index 7e15660884..f416fe2312 100644 --- a/src/pytorch_lightning/cli.py +++ b/src/pytorch_lightning/cli.py @@ -358,13 +358,6 @@ class LightningCLI: self._run_subcommand(self.subcommand) def _handle_deprecated_params(self, kwargs: dict) -> None: - if self.seed_everything_default is None: - rank_zero_deprecation( - "Setting `LightningCLI.seed_everything_default` to `None` is deprecated in v1.7 " - "and will be removed in v1.9. Set it to `False` instead." - ) - self.seed_everything_default = False - for name in kwargs.keys() & ["save_config_filename", "save_config_overwrite", "save_config_multifile"]: value = kwargs.pop(name) key = name.replace("save_config_", "").replace("filename", "config_filename") diff --git a/tests/tests_pytorch/deprecated_api/test_remove_1-9.py b/tests/tests_pytorch/deprecated_api/test_remove_1-9.py index 3071cfc354..7cf44a868d 100644 --- a/tests/tests_pytorch/deprecated_api/test_remove_1-9.py +++ b/tests/tests_pytorch/deprecated_api/test_remove_1-9.py @@ -12,13 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from unittest import mock - import pytest -from pytorch_lightning.cli import LightningCLI -from pytorch_lightning.core.module import LightningModule - def test_old_lightningmodule_path(): from pytorch_lightning.core.lightning import LightningModule @@ -47,14 +42,6 @@ def test_old_loop_path(): MyLoop() -def test_lightningCLI_seed_everything_default_to_None_deprecation_warning(): - with mock.patch("sys.argv", ["any.py"]), pytest.deprecated_call( - match="Setting `LightningCLI.seed_everything_default` to `None` is deprecated in v1.7 " - "and will be removed in v1.9. Set it to `False` instead." - ): - LightningCLI(LightningModule, run=False, seed_everything_default=None) - - def test_old_callback_path(): from pytorch_lightning.callbacks.base import Callback