Skip to content

Commit

Permalink
Document exceptions in loggers (#6171)
Browse files Browse the repository at this point in the history
* Document exceptions in loggers

* minor formatting

* docstring changed in comet.py

* Apply suggestions from code review

Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
  • Loading branch information
AlKun25 and rohitgr7 authored Feb 25, 2021
1 parent 3df02b8 commit 4d96f19
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pytorch_lightning/loggers/comet.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ class CometLogger(LightningLoggerBase):
prefix: A string to put at the beginning of metric keys.
\**kwargs: Additional arguments like `workspace`, `log_code`, etc. used by
:class:`CometExperiment` can be passed as keyword arguments in this logger.
Raises:
ImportError:
If required Comet package is not installed on the device.
MisconfigurationException:
If neither ``api_key`` nor ``save_dir`` are passed as arguments.
"""

LOGGER_JOIN_CHAR = '-'
Expand Down
3 changes: 3 additions & 0 deletions pytorch_lightning/loggers/mlflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def any_lightning_module_function_or_hook(self):
Has no effect if `tracking_uri` is provided.
prefix: A string to put at the beginning of metric keys.
Raises:
ImportError:
If required MLFlow package is not installed on the device.
"""

LOGGER_JOIN_CHAR = '-'
Expand Down
4 changes: 4 additions & 0 deletions pytorch_lightning/loggers/neptune.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ def any_lightning_module_function_or_hook(self):
prefix: A string to put at the beginning of metric keys.
\**kwargs: Additional arguments like `params`, `tags`, `properties`, etc. used by
:func:`neptune.Session.create_experiment` can be passed as keyword arguments in this logger.
Raises:
ImportError:
If required Neptune package is not installed on the device.
"""

LOGGER_JOIN_CHAR = '-'
Expand Down
4 changes: 4 additions & 0 deletions pytorch_lightning/loggers/test_tube.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ def any_lightning_module_function_or_hook(self):
the user has defined the `self.example_input_array` attribute in their
model.
prefix: A string to put at the beginning of metric keys.
Raises:
ImportError:
If required TestTube package is not installed on the device.
"""

__test__ = False
Expand Down
6 changes: 6 additions & 0 deletions pytorch_lightning/loggers/wandb.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ class WandbLogger(LightningLoggerBase):
\**kwargs: Additional arguments like `entity`, `group`, `tags`, etc. used by
:func:`wandb.init` can be passed as keyword arguments in this logger.
Raises:
ImportError:
If required WandB package is not installed on the device.
MisconfigurationException:
If both ``log_model`` and ``offline``is set to ``True``.
Example::
from pytorch_lightning.loggers import WandbLogger
Expand Down

0 comments on commit 4d96f19

Please sign in to comment.