From 1379191930a2e3f233d4c389dbda1e814ff50178 Mon Sep 17 00:00:00 2001 From: Siddhant Sadangi Date: Tue, 15 Oct 2024 15:51:36 +0200 Subject: [PATCH 1/2] chore: Forced `step` and `timestamp` to be keyword only --- src/neptune_scale/__init__.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/neptune_scale/__init__.py b/src/neptune_scale/__init__.py index 2bc91f16..09bb7315 100644 --- a/src/neptune_scale/__init__.py +++ b/src/neptune_scale/__init__.py @@ -402,9 +402,10 @@ def _create_run( def log_metrics( self, + data: Dict[str, Union[float, int]], + *, step: Optional[Union[float, int]] = None, timestamp: Optional[datetime] = None, - data: Optional[Dict[str, Union[float, int]]] = None, ) -> None: """ Logs the specified metrics to a Neptune run. @@ -419,15 +420,14 @@ def log_metrics( Use namespaces to structure the metadata into meaningful categories. Args: - step: Index of the log entry. Must be increasing. - If not specified, the log_metrics() call increments the step starting from the highest - already logged value. - Tip: Using float rather than int values can be useful, for example, when logging substeps in a batch. - timestamp: Time of logging the metadata. data: Dictionary of metrics to log. Each metric value is associated with a step. To log multiple metrics at once, pass multiple key-value pairs. - + step (optional): Index of the log entry. Must be increasing. + If not specified, the log_metrics() call increments the step starting from the highest + already logged value. + Tip: Using float rather than int values can be useful, for example, when logging substeps in a batch. + timestamp (optional): Time of logging the metadata. If not specified, the current time is used. Examples: ``` From 52fd244138528dbeccb86b6c4898d88b4576f33c Mon Sep 17 00:00:00 2001 From: Siddhant Sadangi Date: Tue, 15 Oct 2024 15:57:04 +0200 Subject: [PATCH 2/2] Update example --- src/neptune_scale/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neptune_scale/__init__.py b/src/neptune_scale/__init__.py index 09bb7315..5ab64b1c 100644 --- a/src/neptune_scale/__init__.py +++ b/src/neptune_scale/__init__.py @@ -435,8 +435,8 @@ def log_metrics( with Run(...) as run: run.log_metrics( + {"loss": 0.14, "acc": 0.78}, step=1.2, - data={"loss": 0.14, "acc": 0.78}, ) ``` """