From 9d343ba137452a82e2939003d80a1f0245bbba8c Mon Sep 17 00:00:00 2001 From: Ray Schireman <41241487+rschireman@users.noreply.github.com> Date: Mon, 11 Apr 2022 14:20:30 -0400 Subject: [PATCH] Remove the deprecated `pl.callbacks.ProgressBar` (#12658) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Raymond G Schireman Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec Co-authored-by: Adrian Wälchli --- CHANGELOG.md | 4 ++- pytorch_lightning/callbacks/__init__.py | 3 +-- .../callbacks/progress/__init__.py | 1 - .../callbacks/progress/progress.py | 26 ------------------- tests/deprecated_api/test_remove_1-7.py | 6 ----- 5 files changed, 4 insertions(+), 36 deletions(-) delete mode 100644 pytorch_lightning/callbacks/progress/progress.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 9abc1ccf64..25346105b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -88,6 +88,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Removed the deprecated `terminate_on_nan` argument from the `Trainer` constructor ([#12553](https://github.com/PyTorchLightning/pytorch-lightning/pull/12553)) +- Remove deprecated `pytorch_lightning.callbacks.progress.progress` ([#12658](https://github.com/PyTorchLightning/pytorch-lightning/pull/12658)) + + - Removed the deprecated `train_transforms` argument from the `LightningDataModule` constructor([#12662](https://github.com/PyTorchLightning/pytorch-lightning/pull/12662)) @@ -99,7 +102,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Removed deprecated `GPUStatsMonitor` callback ([#12554](https://github.com/PyTorchLightning/pytorch-lightning/pull/12554)) - ### Fixed - Run main progress bar updates independent of val progress bar updates in `TQDMProgressBar` ([#12563](https://github.com/PyTorchLightning/pytorch-lightning/pull/12563)) diff --git a/pytorch_lightning/callbacks/__init__.py b/pytorch_lightning/callbacks/__init__.py index 808ee02084..3e0971e878 100644 --- a/pytorch_lightning/callbacks/__init__.py +++ b/pytorch_lightning/callbacks/__init__.py @@ -21,7 +21,7 @@ from pytorch_lightning.callbacks.lr_monitor import LearningRateMonitor from pytorch_lightning.callbacks.model_checkpoint import ModelCheckpoint from pytorch_lightning.callbacks.model_summary import ModelSummary from pytorch_lightning.callbacks.prediction_writer import BasePredictionWriter -from pytorch_lightning.callbacks.progress import ProgressBar, ProgressBarBase, RichProgressBar, TQDMProgressBar +from pytorch_lightning.callbacks.progress import ProgressBarBase, RichProgressBar, TQDMProgressBar from pytorch_lightning.callbacks.pruning import ModelPruning from pytorch_lightning.callbacks.quantization import QuantizationAwareTraining from pytorch_lightning.callbacks.rich_model_summary import RichModelSummary @@ -43,7 +43,6 @@ __all__ = [ "ModelPruning", "ModelSummary", "BasePredictionWriter", - "ProgressBar", "ProgressBarBase", "QuantizationAwareTraining", "RichModelSummary", diff --git a/pytorch_lightning/callbacks/progress/__init__.py b/pytorch_lightning/callbacks/progress/__init__.py index 6ccc181b95..0317bbc952 100644 --- a/pytorch_lightning/callbacks/progress/__init__.py +++ b/pytorch_lightning/callbacks/progress/__init__.py @@ -19,6 +19,5 @@ Use or override one of the progress bar callbacks. """ from pytorch_lightning.callbacks.progress.base import ProgressBarBase # noqa: F401 -from pytorch_lightning.callbacks.progress.progress import ProgressBar # noqa: F401 from pytorch_lightning.callbacks.progress.rich_progress import RichProgressBar # noqa: F401 from pytorch_lightning.callbacks.progress.tqdm_progress import TQDMProgressBar # noqa: F401 diff --git a/pytorch_lightning/callbacks/progress/progress.py b/pytorch_lightning/callbacks/progress/progress.py deleted file mode 100644 index cc02b8b597..0000000000 --- a/pytorch_lightning/callbacks/progress/progress.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright The PyTorch Lightning team. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -from typing import Any - -from pytorch_lightning.callbacks.progress.tqdm_progress import TQDMProgressBar -from pytorch_lightning.utilities import rank_zero_deprecation - - -class ProgressBar(TQDMProgressBar): - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - rank_zero_deprecation( - "`ProgressBar` has been deprecated in v1.5 and will be removed in v1.7." - " It has been renamed to `TQDMProgressBar` instead." - ) diff --git a/tests/deprecated_api/test_remove_1-7.py b/tests/deprecated_api/test_remove_1-7.py index d9cb922932..8d955be44e 100644 --- a/tests/deprecated_api/test_remove_1-7.py +++ b/tests/deprecated_api/test_remove_1-7.py @@ -23,7 +23,6 @@ import torch import pytorch_lightning from pytorch_lightning import Callback, LightningDataModule, Trainer from pytorch_lightning.callbacks.lr_monitor import LearningRateMonitor -from pytorch_lightning.callbacks.progress import ProgressBar from pytorch_lightning.callbacks.xla_stats_monitor import XLAStatsMonitor from pytorch_lightning.loggers import LoggerCollection, TestTubeLogger from pytorch_lightning.overrides.distributed import IndexBatchSamplerWrapper @@ -327,11 +326,6 @@ def test_v1_7_0_deprecate_xla_stats_monitor(monkeypatch): _ = XLAStatsMonitor() -def test_v1_7_0_progress_bar(): - with pytest.deprecated_call(match="has been deprecated in v1.5 and will be removed in v1.7."): - _ = ProgressBar() - - def test_v1_7_0_deprecated_max_steps_none(tmpdir): with pytest.deprecated_call(match="`max_steps = None` is deprecated in v1.5"): _ = Trainer(max_steps=None)