|
24 | 24 | import neptune_scale.types |
25 | 25 | from neptune_api import AuthenticatedClient |
26 | 26 |
|
27 | | -Histogram = neptune_scale.types.Histogram |
28 | | -File = neptune_scale.types.File |
| 27 | +IngestionHistogram = neptune_scale.types.Histogram |
| 28 | +IngestionFile = neptune_scale.types.File |
29 | 29 |
|
30 | 30 |
|
31 | | -SeriesPoint = TypeVar("SeriesPoint", str, float, Histogram, File) |
| 31 | +SeriesPoint = TypeVar("SeriesPoint", str, float, IngestionHistogram, IngestionFile) |
32 | 32 |
|
33 | 33 |
|
34 | 34 | _STEP0_TIMESTAMP = 1_700_000_000.0 # Arbitrary fixed timestamp for ingestion start |
@@ -56,12 +56,15 @@ class RunData: |
56 | 56 | fork_point: tuple[str, float] | None = None |
57 | 57 |
|
58 | 58 | configs: dict[str, int | str] | None = field(default_factory=dict) |
59 | | - files: dict[str, File] | None = field(default_factory=dict) |
| 59 | + files: dict[str, IngestionFile] | None = field(default_factory=dict) |
60 | 60 |
|
61 | 61 | float_series: dict[str, dict[float, float]] = field(default_factory=dict) |
62 | 62 | string_series: dict[str, dict[float, str]] = field(default_factory=dict) |
63 | | - histogram_series: dict[str, dict[float, Histogram]] = field(default_factory=dict) |
64 | | - file_series: dict[str, dict[float, File]] = field(default_factory=dict) |
| 63 | + histogram_series: dict[str, dict[float, IngestionHistogram]] = field(default_factory=dict) |
| 64 | + file_series: dict[str, dict[float, IngestionFile]] = field(default_factory=dict) |
| 65 | + |
| 66 | + # string set attributes (logged as tags) |
| 67 | + string_sets: dict[str, list[str]] | None = field(default_factory=dict) |
65 | 68 |
|
66 | 69 |
|
67 | 70 | def get_all_steps(run_data: RunData) -> Iterable[float]: |
@@ -112,7 +115,7 @@ class IngestedRunData: |
112 | 115 | configs: dict[str, int | str] |
113 | 116 | float_series: dict[str, dict[float, float]] |
114 | 117 | string_series: dict[str, dict[float, str]] |
115 | | - histogram_series: dict[str, dict[float, Histogram]] |
| 118 | + histogram_series: dict[str, dict[float, IngestionHistogram]] |
116 | 119 |
|
117 | 120 |
|
118 | 121 | @dataclass(frozen=True) |
@@ -233,6 +236,9 @@ def _ingest_runs(runs_data: list[RunData], api_token: str, project_identifier: s |
233 | 236 | if run_data.configs: |
234 | 237 | run.log_configs(run_data.configs) |
235 | 238 |
|
| 239 | + if run_data.string_sets: |
| 240 | + run.log(tags_add=run_data.string_sets) |
| 241 | + |
236 | 242 | if run_data.files: |
237 | 243 | run.assign_files(run_data.files) |
238 | 244 |
|
|
0 commit comments