Skip to content

Commit

Permalink
Docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Raalsky committed Jul 30, 2024
1 parent 6286c45 commit eccdeeb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
16 changes: 15 additions & 1 deletion src/neptune_scale/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,21 @@ def log(
remove_tags: dict[str, list[str] | set[str]] | None = None,
) -> None:
"""
TODO: Add description
Logs metadata to Neptune Run.
Args:
step: Step number.
timestamp: Time of the metadata.
fields: Dictionary of metadata fields.
metrics: Dictionary of metrics.
add_tags: Dictionary of tags to add.
remove_tags: Dictionary of tags to remove.
Examples:
>>> with Run(...) as run:
... run.log(step=1, timestamp=datetime.now(), fields={"int": 1, "string": "test"})
... run.log(step=2, timestamp=datetime.now(), metrics={"metric": 1.0})
"""
verify_type("step", step, (float, int, type(None)))
verify_type("timestamp", timestamp, (datetime, type(None)))
Expand Down
3 changes: 1 addition & 2 deletions src/neptune_scale/core/message_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ def __init__(
add_tags: dict[str, list[str] | set[str]],
remove_tags: dict[str, list[str] | set[str]],
):
# TODO: Warning instead of raise on step precision loss
self._step = None if step is None else make_step(number=step, raise_on_step_precision_loss=True)
self._step = None if step is None else make_step(number=step)
self._timestamp = datetime_to_proto(timestamp)
self._fields = fields
self._metrics = metrics
Expand Down

0 comments on commit eccdeeb

Please sign in to comment.