Remove support for `LightningCLI(seed_everything_default=None)` (#16137)

This commit is contained in:
Carlos Mocholí 2022-12-20 17:27:01 +01:00 committed by GitHub
parent 711aec5397
commit d0b620fe5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 20 deletions

View File

@ -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))

View File

@ -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")

View File

@ -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