28
28
from pytorch_lightning import Callback , LightningDataModule , LightningModule , seed_everything , Trainer
29
29
from pytorch_lightning .utilities .exceptions import MisconfigurationException
30
30
from pytorch_lightning .utilities .model_helpers import is_overridden
31
- from pytorch_lightning .utilities .rank_zero import rank_zero_deprecation , rank_zero_warn
31
+ from pytorch_lightning .utilities .rank_zero import rank_zero_warn
32
32
33
33
_JSONARGPARSE_SIGNATURES_AVAILABLE = RequirementCache ("jsonargparse[signatures]>=4.17.0" )
34
34
@@ -279,7 +279,6 @@ def __init__(
279
279
args : ArgsType = None ,
280
280
run : bool = True ,
281
281
auto_configure_optimizers : bool = True ,
282
- ** kwargs : Any , # Remove with deprecations of v2.0.0
283
282
) -> None :
284
283
"""Receives as input pytorch-lightning classes (or callables which return pytorch-lightning classes), which
285
284
are called / instantiated using a parsed configuration file and / or command line args.
@@ -331,8 +330,6 @@ def __init__(
331
330
self .parser_kwargs = parser_kwargs or {} # type: ignore[var-annotated] # github.com/python/mypy/issues/6463
332
331
self .auto_configure_optimizers = auto_configure_optimizers
333
332
334
- self ._handle_deprecated_params (kwargs )
335
-
336
333
self .model_class = model_class
337
334
# used to differentiate between the original value and the processed value
338
335
self ._model_class = model_class or LightningModule
@@ -357,28 +354,6 @@ def __init__(
357
354
if self .subcommand is not None :
358
355
self ._run_subcommand (self .subcommand )
359
356
360
- def _handle_deprecated_params (self , kwargs : dict ) -> None :
361
- for name in kwargs .keys () & ["save_config_filename" , "save_config_overwrite" , "save_config_multifile" ]:
362
- value = kwargs .pop (name )
363
- key = name .replace ("save_config_" , "" ).replace ("filename" , "config_filename" )
364
- self .save_config_kwargs [key ] = value
365
- rank_zero_deprecation (
366
- f"LightningCLI's { name !r} init parameter is deprecated from v1.8 and will "
367
- f"be removed in v2.0.0. Use `save_config_kwargs={{'{ key } ': ...}}` instead."
368
- )
369
-
370
- for name in kwargs .keys () & ["description" , "env_prefix" , "env_parse" ]:
371
- value = kwargs .pop (name )
372
- key = name .replace ("env_parse" , "default_env" )
373
- self .parser_kwargs [key ] = value
374
- rank_zero_deprecation (
375
- f"LightningCLI's { name !r} init parameter is deprecated from v1.9 and will "
376
- f"be removed in v2.0. Use `parser_kwargs={{'{ key } ': ...}}` instead."
377
- )
378
-
379
- if kwargs :
380
- raise ValueError (f"Unexpected keyword parameters: { kwargs } " )
381
-
382
357
def _setup_parser_kwargs (self , parser_kwargs : Dict [str , Any ]) -> Tuple [Dict [str , Any ], Dict [str , Any ]]:
383
358
subcommand_names = self .subcommands ().keys ()
384
359
main_kwargs = {k : v for k , v in parser_kwargs .items () if k not in subcommand_names }
0 commit comments