Skip to content

Commit 27bdbcf

Browse files
committed
fix linter warning
1 parent 7358aef commit 27bdbcf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/lightning/pytorch/loggers/comet.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
import logging
2020
import os
2121
from argparse import Namespace
22-
from typing import TYPE_CHECKING, Any, Dict, Literal, Mapping, Optional, Union
22+
from collections.abc import Mapping
23+
from typing import TYPE_CHECKING, Any, Literal, Optional, Union
2324

2425
from lightning_utilities.core.imports import RequirementCache
2526
from torch import Tensor
@@ -261,7 +262,7 @@ def __init__(
261262
self._project_name: Optional[str] = project
262263
self._experiment_key: Optional[str] = experiment_key
263264
self._prefix: Optional[str] = prefix
264-
self._kwargs: Dict[str, Any] = kwargs
265+
self._kwargs: dict[str, Any] = kwargs
265266

266267
# needs to be set before the first `comet_ml` import
267268
# because comet_ml imported after another machine learning libraries (Torch)
@@ -318,7 +319,7 @@ def experiment(self) -> comet_experiment:
318319

319320
@override
320321
@rank_zero_only
321-
def log_hyperparams(self, params: Union[Dict[str, Any], Namespace]) -> None:
322+
def log_hyperparams(self, params: Union[dict[str, Any], Namespace]) -> None:
322323
params = _convert_params(params)
323324
self.experiment.__internal_api__log_parameters__(
324325
parameters=params,
@@ -394,7 +395,7 @@ def version(self) -> Optional[str]:
394395
if self._experiment is not None:
395396
return self._experiment.get_key()
396397

397-
def __getstate__(self) -> Dict[str, Any]:
398+
def __getstate__(self) -> dict[str, Any]:
398399
state = self.__dict__.copy()
399400

400401
# Save the experiment id in case an experiment object already exists,

0 commit comments

Comments
 (0)