Skip to content

Commit a5481aa

Browse files
committed
Merge branch 'hotfix/negative-time' into dev
2 parents 4032be6 + 9712055 commit a5481aa

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## [v2.3.1](https://github.com/simvue-io/client/releases/tag/v2.3.1) - 2026-01-30
4+
5+
- Allow negative time when logging simulation metrics.
6+
37
## [v2.3.0](https://github.com/simvue-io/client/releases/tag/v2.3.0) - 2025-12-11
48

59
- Refactored sender functionality introducing new `Sender` class.

CITATION.cff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ keywords:
4242
- alerting
4343
- simulation
4444
license: Apache-2.0
45-
commit: 07c35339ddda150a01ce21d3f8535572dfcd6b11
46-
version: 2.3.0
47-
date-released: '2025-12-11'
45+
commit: ef738fec3a98c0b59b73d1ce6bfbc22be7a1d5bc
46+
version: 2.3.1
47+
date-released: '2026-01-30'

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "simvue"
3-
version = "2.3.0"
3+
version = "2.3.1"
44
description = "Simulation tracking and monitoring"
55
authors = [
66
{name = "Simvue Development Team", email = "info@simvue.io"}

simvue/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class RunInput(pydantic.BaseModel):
8585

8686
class MetricSet(pydantic.BaseModel):
8787
model_config = pydantic.ConfigDict(extra="forbid")
88-
time: pydantic.NonNegativeFloat | pydantic.NonNegativeInt
88+
time: float | int
8989
timestamp: typing.Annotated[str | None, pydantic.BeforeValidator(simvue_timestamp)]
9090
step: pydantic.NonNegativeInt
9191
values: dict[str, int | float | bool]
@@ -95,7 +95,7 @@ class GridMetricSet(pydantic.BaseModel):
9595
model_config = pydantic.ConfigDict(
9696
arbitrary_types_allowed=True, extra="forbid", validate_default=True
9797
)
98-
time: pydantic.NonNegativeFloat | pydantic.NonNegativeInt
98+
time: float | int
9999
timestamp: typing.Annotated[str | None, pydantic.BeforeValidator(simvue_timestamp)]
100100
step: pydantic.NonNegativeInt
101101
array: list[float] | list[list[float]] | numpy.ndarray

tests/functional/test_scenarios.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,12 @@ def test_uploaded_data_immediately_accessible(
161161
assert i == int(values[(i, shared_dict["ident"])]), (
162162
"values should be ascending ints"
163163
)
164+
165+
@pytest.mark.scenario
166+
def test_negative_time(create_plain_run: tuple[simvue.Run, dict]) -> None:
167+
_run, _ = create_plain_run
168+
169+
for i in range(10):
170+
time.sleep(0.1)
171+
_run.log_metrics({"x": 10, "y": 20}, time=-10 + i)
172+

0 commit comments

Comments
 (0)