Skip to content

Commit

Permalink
Merge pull request #70 from neptune-ai/kg/rename-fields-to-configs
Browse files Browse the repository at this point in the history
Rename `MetadataSplitter._fields` -> `_configs`
  • Loading branch information
kgodlewski authored Nov 13, 2024
2 parents 1198f26 + 2f54428 commit 1a2efba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/neptune_scale/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ def log(
run_id=self._run_id,
step=step,
timestamp=timestamp,
fields=configs,
configs=configs,
metrics=metrics,
add_tags=tags_add,
remove_tags=tags_remove,
Expand Down
6 changes: 3 additions & 3 deletions src/neptune_scale/core/metadata_splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(
run_id: str,
step: Optional[Union[int, float]],
timestamp: datetime,
fields: Dict[str, Union[float, bool, int, str, datetime, list, set, tuple]],
configs: Dict[str, Union[float, bool, int, str, datetime, list, set, tuple]],
metrics: Dict[str, float],
add_tags: Dict[str, Union[List[str], Set[str], Tuple[str]]],
remove_tags: Dict[str, Union[List[str], Set[str], Tuple[str]]],
Expand All @@ -53,7 +53,7 @@ def __init__(
self._timestamp = datetime_to_proto(timestamp)
self._project = project
self._run_id = run_id
self._fields = peekable(fields.items())
self._configs = peekable(configs.items())
self._metrics = peekable(starmap(lambda k, v: (k, float(v)), metrics.items()))
self._add_tags = peekable(add_tags.items())
self._remove_tags = peekable(remove_tags.items())
Expand Down Expand Up @@ -84,7 +84,7 @@ def __next__(self) -> Tuple[RunOperation, int]:
size = update.ByteSize()

size = self.populate(
assets=self._fields,
assets=self._configs,
update_producer=lambda key, value: update.assign[key].MergeFrom(value),
size=size,
)
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/test_metadata_splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_empty():
run_id="run_id",
step=1,
timestamp=datetime.now(),
fields={},
configs={},
metrics={},
add_tags={},
remove_tags={},
Expand All @@ -51,7 +51,7 @@ def test_fields():
run_id="run_id",
step=1,
timestamp=datetime.now(),
fields={
configs={
"some/string": "value",
"some/int": 2501,
"some/float": 3.14,
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_metrics():
run_id="run_id",
step=1,
timestamp=datetime.now(),
fields={},
configs={},
metrics={
"some/metric": 3.14,
},
Expand Down Expand Up @@ -129,7 +129,7 @@ def test_tags():
run_id="run_id",
step=1,
timestamp=datetime.now(),
fields={},
configs={},
metrics={},
add_tags={
"some/tags": {"tag1", "tag2"},
Expand Down Expand Up @@ -186,7 +186,7 @@ def test_splitting():
run_id="run_id",
step=1,
timestamp=timestamp,
fields=fields,
configs=fields,
metrics=metrics,
add_tags=add_tags,
remove_tags=remove_tags,
Expand Down Expand Up @@ -232,7 +232,7 @@ def test_split_large_tags():
run_id="run_id",
step=1,
timestamp=timestamp,
fields=fields,
configs=fields,
metrics=metrics,
add_tags=add_tags,
remove_tags=remove_tags,
Expand Down

0 comments on commit 1a2efba

Please sign in to comment.