Skip to content

Commit 336ae2f

Browse files
committed
util.tensorboard: Fix type annotations requiring Python 3.10+ (now Python 3.9+)
1 parent c202fc3 commit 336ae2f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
* Dropped support for Python versions below 3.9
88
* Dropped support for TensorFlow (removing `sensai.tensorflow`)
99

10+
### Fixes
11+
12+
* `util.tensorboard`: Fix type annotations requiring Python 3.10+ (now Python 3.9+)
13+
1014
## 1.4.0 (2025-01-21)
1115

1216
### Improvements/Changes

src/sensai/util/tensorboard.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import List, Optional
2+
13
import numpy as np
24
import pandas as pd
35
from tensorboard.backend.event_processing import event_accumulator
@@ -43,15 +45,15 @@ def get_series(self, tag: str, smoothing_factor: float = 0.0) -> pd.Series:
4345

4446
return pd.Series(values, index=steps, name=tag)
4547

46-
def get_tags(self) -> list[str]:
48+
def get_tags(self) -> List[str]:
4749
"""
4850
Get list of available scalar tags in the events.
4951
5052
:return: list of tag names
5153
"""
5254
return self.events.Tags()['scalars']
5355

54-
def get_data_frame(self, tags: list[str] | None = None, smoothing_factor: float = 0.0) -> pd.DataFrame:
56+
def get_data_frame(self, tags: Optional[List[str]] = None, smoothing_factor: float = 0.0) -> pd.DataFrame:
5557
"""
5658
Gets multiple series as a DataFrame.
5759

0 commit comments

Comments
 (0)