Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Removed

- Removed the deprecated `Logger.close` method ([#13149](https://github.com/PyTorchLightning/pytorch-lightning/pull/13149))


- Removed the deprecated `flush_logs_every_n_steps` argument from the `Trainer` constructor ([#13074](https://github.com/PyTorchLightning/pytorch-lightning/pull/13074))


Expand Down
28 changes: 0 additions & 28 deletions pytorch_lightning/loggers/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,21 +177,6 @@ def finalize(self, status: str) -> None:
"""
self.save()

def close(self) -> None:
"""Do any cleanup that is necessary to close an experiment.

See deprecation warning below.

.. deprecated:: v1.5
This method is deprecated in v1.5 and will be removed in v1.7.
Please use `Logger.finalize` instead.
"""
rank_zero_deprecation(
"`Logger.close` method is deprecated in v1.5 and will be removed in v1.7."
" Please use `Logger.finalize` instead."
)
self.save()

@property
def save_dir(self) -> Optional[str]:
"""Return the root directory where experiment logs get saved, or `None` if the logger does not save data
Expand Down Expand Up @@ -285,19 +270,6 @@ def finalize(self, status: str) -> None:
for logger in self._logger_iterable:
logger.finalize(status)

def close(self) -> None:
"""
.. deprecated:: v1.5
This method is deprecated in v1.5 and will be removed in v1.7.
Please use `LoggerCollection.finalize` instead.
"""
rank_zero_deprecation(
"`LoggerCollection.close` method is deprecated in v1.5 and will be removed in v1.7."
" Please use `LoggerCollection.finalize` instead."
)
for logger in self._logger_iterable:
logger.close()

@property
def save_dir(self) -> Optional[str]:
"""Returns ``None`` as checkpoints should be saved to default / chosen location when using multiple
Expand Down
13 changes: 0 additions & 13 deletions tests/deprecated_api/test_remove_1-7.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

from pytorch_lightning import Callback, Trainer
from pytorch_lightning.callbacks.lr_monitor import LearningRateMonitor
from pytorch_lightning.loggers import LoggerCollection
from pytorch_lightning.overrides.distributed import IndexBatchSamplerWrapper
from pytorch_lightning.plugins.environments import (
KubeflowEnvironment,
Expand All @@ -34,7 +33,6 @@
from pytorch_lightning.strategies import SingleDeviceStrategy
from tests.deprecated_api import _soft_unimport_module
from tests.helpers import BoringModel
from tests.loggers.test_logger import CustomLogger
from tests.plugins.environments.test_lsf_environment import _make_rankfile


Expand Down Expand Up @@ -80,17 +78,6 @@ def test_v1_7_0_deprecate_add_get_queue(tmpdir):
trainer.fit(model)


def test_v1_7_0_lightning_logger_base_close(tmpdir):
logger = CustomLogger()
with pytest.deprecated_call(match="`Logger.close` method is deprecated in v1.5 and will be removed in v1.7."):
logger.close()
with pytest.deprecated_call(
match="`LoggerCollection.close` method is deprecated in v1.5 and will be removed in v1.7."
):
logger = LoggerCollection([logger])
logger.close()


def test_v1_7_0_deprecate_lightning_distributed(tmpdir):
with pytest.deprecated_call(match="LightningDistributed is deprecated in v1.5 and will be removed in v1.7."):
from pytorch_lightning.distributed.dist import LightningDistributed
Expand Down