Reinstated warning module

This commit is contained in:
Michael Panchenko 2024-05-05 22:23:13 +02:00
parent 024b80e79c
commit 2abb4dac24
2 changed files with 10 additions and 0 deletions

View File

@ -6,11 +6,13 @@ from tianshou.utils.logger.wandb import WandbLogger
from tianshou.utils.lr_scheduler import MultipleLRSchedulers from tianshou.utils.lr_scheduler import MultipleLRSchedulers
from tianshou.utils.progress_bar import DummyTqdm, tqdm_config from tianshou.utils.progress_bar import DummyTqdm, tqdm_config
from tianshou.utils.statistics import MovAvg, RunningMeanStd from tianshou.utils.statistics import MovAvg, RunningMeanStd
from tianshou.utils.warning import deprecation
__all__ = [ __all__ = [
"MovAvg", "MovAvg",
"RunningMeanStd", "RunningMeanStd",
"tqdm_config", "tqdm_config",
"deprecation",
"DummyTqdm", "DummyTqdm",
"BaseLogger", "BaseLogger",
"TensorboardLogger", "TensorboardLogger",

View File

@ -0,0 +1,8 @@
import warnings
warnings.simplefilter("once", DeprecationWarning)
def deprecation(msg: str) -> None:
"""Deprecation warning wrapper."""
warnings.warn(msg, category=DeprecationWarning, stacklevel=2)