Reinstated warning module
This commit is contained in:
parent
024b80e79c
commit
2abb4dac24
@ -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",
|
||||||
|
8
tianshou/utils/warning.py
Normal file
8
tianshou/utils/warning.py
Normal 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)
|
Loading…
x
Reference in New Issue
Block a user