Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions simvue/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@


FOLDER_REGEX: str = r"^/.*"
NAME_REGEX: str = r"^[a-zA-Z0-9\-\_\s\/\.:]+$"
METRIC_KEY_REGEX: str = r"^[a-zA-Z0-9\-\_\s\/\.:=><]+$"
NAME_REGEX: str = r"^[a-zA-Z0-9\-\_\s\/\.:=><]+$"
METRIC_KEY_REGEX: str = r"^[a-zA-Z0-9\-\_\s\/\.:=><+\(\)]+$"
DATETIME_FORMAT: str = "%Y-%m-%dT%H:%M:%S.%f"

MetadataKeyString = typing.Annotated[
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_run_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def test_log_metrics_online(
visibility: typing.Literal["public", "tenant"] | list[str] | None,
metric_type: typing.Literal["regular", "tensor"],
) -> None:
METRICS = {"a": 10, "b": 1.2}
METRICS = {"a": 10, "aB0-_/.:=><+()": 1.2}

# Have to create the run outside of fixtures because the resources dispatch
# occurs immediately and is not captured by the handler when using the fixture
Expand Down Expand Up @@ -313,7 +313,7 @@ def test_log_metrics_offline(
axes_labels=["x", "y"]
)
else:
METRICS = {"a": 10, "b": 1.2, "c": 2}
METRICS = {"a": 10, "aB0-_/.:=><+()": 1.2, "c": 2}

run.log_metrics(METRICS)

Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_metrics_creation_online() -> None:
_values = {
"x": 1,
"y": 2.0,
"z": True
"aB0-_/.:=><+()": True
}
_time: int = 1
_step: int = 1
Expand All @@ -40,7 +40,7 @@ def test_metrics_creation_online() -> None:
)
assert _metrics.to_dict()
_metrics.commit()
_data = next(_metrics.get(metrics=["x", "y", "z"], runs=[_run.id], xaxis="step"))
_data = next(_metrics.get(metrics=["x", "y", "aB0-_/.:=><+()"], runs=[_run.id], xaxis="step"))
assert sorted(_metrics.names(run_ids=[_run.id])) == sorted(_values.keys())
assert _data.get(_run.id).get('y')[0].get('value') == 2.0
assert _data.get(_run.id).get('y')[0].get('step') == 1
Expand All @@ -61,7 +61,7 @@ def test_metrics_creation_offline(offline_cache_setup) -> None:
_values = {
"x": 1,
"y": 2.0,
"z": True
"aB0-_/.:=><+()": True
}
_time: int = 1
_step: int = 1
Expand Down Expand Up @@ -93,7 +93,7 @@ def test_metrics_creation_offline(offline_cache_setup) -> None:

# Get online version of metrics
_online_metrics = Metrics(_id_mapping.get(_metrics.id))
_data = next(_online_metrics.get(metrics=["x", "y", "z"], runs=[_id_mapping.get(_run.id)], xaxis="step"))
_data = next(_online_metrics.get(metrics=["x", "y", "aB0-_/.:=><+()"], runs=[_id_mapping.get(_run.id)], xaxis="step"))
assert sorted(_online_metrics.names(run_ids=[_id_mapping.get(_run.id)])) == sorted(_values.keys())
assert _data.get(_id_mapping.get(_run.id)).get('y')[0].get('value') == 2.0
assert _data.get(_id_mapping.get(_run.id)).get('y')[0].get('step') == 1
Expand Down