diff --git a/src/pytorch_lightning/CHANGELOG.md b/src/pytorch_lightning/CHANGELOG.md index 4b5e3a893429e..0351719fefa89 100644 --- a/src/pytorch_lightning/CHANGELOG.md +++ b/src/pytorch_lightning/CHANGELOG.md @@ -81,10 +81,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Removed the deprecated `DistributedType` and `DeviceType` enum classes ([#14045](https://github.com/Lightning-AI/lightning/pull/14045)) -- Remove the deprecated `on_train_batch_end(outputs)` format when multiple optimizers are used and TBPTT is enabled ([#14373](https://github.com/PyTorchLightning/pytorch-lightning/pull/14373)) +- Removed the legacy and unused `Trainer.get_deprecated_arg_names()` ([#14415](https://github.com/Lightning-AI/lightning/pull/14415)) -- Remove the deprecated `training_epoch_end(outputs)` format when multiple optimizers are used and TBPTT is enabled ([#14373](https://github.com/PyTorchLightning/pytorch-lightning/pull/14373)) +- Removed the deprecated `on_train_batch_end(outputs)` format when multiple optimizers are used and TBPTT is enabled ([#14373](https://github.com/PyTorchLightning/pytorch-lightning/pull/14373)) + + +- Removed the deprecated `training_epoch_end(outputs)` format when multiple optimizers are used and TBPTT is enabled ([#14373](https://github.com/PyTorchLightning/pytorch-lightning/pull/14373)) - Removed the experimental `pytorch_lightning.utiltiies.meta` functions in favor of built-in https://github.com/pytorch/torchdistx support ([#13868](https://github.com/Lightning-AI/lightning/pull/13868)) diff --git a/src/pytorch_lightning/core/datamodule.py b/src/pytorch_lightning/core/datamodule.py index b7a25badf420f..e4adf9b1ca928 100644 --- a/src/pytorch_lightning/core/datamodule.py +++ b/src/pytorch_lightning/core/datamodule.py @@ -113,15 +113,6 @@ def get_init_arguments_and_types(cls) -> List[Tuple[str, Tuple, Any]]: """ return get_init_arguments_and_types(cls) - @classmethod - def get_deprecated_arg_names(cls) -> List: - """Returns a list with deprecated DataModule arguments.""" - depr_arg_names: List[str] = [] - for name, val in cls.__dict__.items(): - if name.startswith("DEPRECATED") and isinstance(val, (tuple, list)): - depr_arg_names.extend(val) - return depr_arg_names - @classmethod def from_datasets( cls, diff --git a/src/pytorch_lightning/trainer/trainer.py b/src/pytorch_lightning/trainer/trainer.py index d5bcec7db85d6..08561b2e77417 100644 --- a/src/pytorch_lightning/trainer/trainer.py +++ b/src/pytorch_lightning/trainer/trainer.py @@ -2434,15 +2434,6 @@ def default_attributes(cls) -> dict: init_signature = inspect.signature(cls) return {k: v.default for k, v in init_signature.parameters.items()} - @classmethod - def get_deprecated_arg_names(cls) -> List: - """Returns a list with deprecated Trainer arguments.""" - depr_arg_names = [] - for name, val in cls.__dict__.items(): - if name.startswith("DEPRECATED") and isinstance(val, (tuple, list)): - depr_arg_names.extend(val) - return depr_arg_names - @classmethod def from_argparse_args(cls: Any, args: Union[Namespace, ArgumentParser], **kwargs) -> Any: return from_argparse_args(cls, args, **kwargs) diff --git a/src/pytorch_lightning/utilities/argparse.py b/src/pytorch_lightning/utilities/argparse.py index 26277db183410..8b1872ee7b643 100644 --- a/src/pytorch_lightning/utilities/argparse.py +++ b/src/pytorch_lightning/utilities/argparse.py @@ -212,8 +212,6 @@ def add_argparse_args( parser = ArgumentParser(parents=[parent_parser], add_help=False) ignore_arg_names = ["self", "args", "kwargs"] - if hasattr(cls, "get_deprecated_arg_names"): - ignore_arg_names += cls.get_deprecated_arg_names() allowed_types = (str, int, float, bool) diff --git a/tests/tests_pytorch/utilities/test_argparse.py b/tests/tests_pytorch/utilities/test_argparse.py index 2a88e8db531f9..ba5d51c2a2095 100644 --- a/tests/tests_pytorch/utilities/test_argparse.py +++ b/tests/tests_pytorch/utilities/test_argparse.py @@ -1,6 +1,6 @@ import io from argparse import ArgumentParser, Namespace -from typing import Generic, List, TypeVar +from typing import Generic, TypeVar from unittest.mock import MagicMock import pytest @@ -118,10 +118,6 @@ class AddArgparseArgsExampleClass: def __init__(self, my_parameter: int = 0): pass - @staticmethod - def get_deprecated_arg_names() -> List[str]: - return [] - class AddArgparseArgsExampleClassViaInit: def __init__(self, my_parameter: int = 0):