Skip to content

Commit c5df946

Browse files
committed
Remove the broken and unused get_deprecated_arg_names
1 parent ed84d04 commit c5df946

File tree

4 files changed

+1
-25
lines changed

4 files changed

+1
-25
lines changed

src/pytorch_lightning/core/datamodule.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,6 @@ def get_init_arguments_and_types(cls) -> List[Tuple[str, Tuple, Any]]:
113113
"""
114114
return get_init_arguments_and_types(cls)
115115

116-
@classmethod
117-
def get_deprecated_arg_names(cls) -> List:
118-
"""Returns a list with deprecated DataModule arguments."""
119-
depr_arg_names: List[str] = []
120-
for name, val in cls.__dict__.items():
121-
if name.startswith("DEPRECATED") and isinstance(val, (tuple, list)):
122-
depr_arg_names.extend(val)
123-
return depr_arg_names
124-
125116
@classmethod
126117
def from_datasets(
127118
cls,

src/pytorch_lightning/trainer/trainer.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2434,15 +2434,6 @@ def default_attributes(cls) -> dict:
24342434
init_signature = inspect.signature(cls)
24352435
return {k: v.default for k, v in init_signature.parameters.items()}
24362436

2437-
@classmethod
2438-
def get_deprecated_arg_names(cls) -> List:
2439-
"""Returns a list with deprecated Trainer arguments."""
2440-
depr_arg_names = []
2441-
for name, val in cls.__dict__.items():
2442-
if name.startswith("DEPRECATED") and isinstance(val, (tuple, list)):
2443-
depr_arg_names.extend(val)
2444-
return depr_arg_names
2445-
24462437
@classmethod
24472438
def from_argparse_args(cls: Any, args: Union[Namespace, ArgumentParser], **kwargs) -> Any:
24482439
return from_argparse_args(cls, args, **kwargs)

src/pytorch_lightning/utilities/argparse.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,6 @@ def add_argparse_args(
212212
parser = ArgumentParser(parents=[parent_parser], add_help=False)
213213

214214
ignore_arg_names = ["self", "args", "kwargs"]
215-
if hasattr(cls, "get_deprecated_arg_names"):
216-
ignore_arg_names += cls.get_deprecated_arg_names()
217215

218216
allowed_types = (str, int, float, bool)
219217

tests/tests_pytorch/utilities/test_argparse.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import io
22
from argparse import ArgumentParser, Namespace
3-
from typing import Generic, List, TypeVar
3+
from typing import Generic, TypeVar
44
from unittest.mock import MagicMock
55

66
import pytest
@@ -118,10 +118,6 @@ class AddArgparseArgsExampleClass:
118118
def __init__(self, my_parameter: int = 0):
119119
pass
120120

121-
@staticmethod
122-
def get_deprecated_arg_names() -> List[str]:
123-
return []
124-
125121

126122
class AddArgparseArgsExampleClassViaInit:
127123
def __init__(self, my_parameter: int = 0):

0 commit comments

Comments
 (0)