Skip to content

Commit 4ef75c0

Browse files
authored
Merge pull request #734 from simvue-io/dev
v2.0.0 Alpha 2 Release
2 parents 5fb84ac + 3297e1f commit 4ef75c0

File tree

17 files changed

+397
-142
lines changed

17 files changed

+397
-142
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
args: [--branch, main, --branch, dev]
2424
- id: check-added-large-files
2525
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: v0.9.6
26+
rev: v0.9.7
2727
hooks:
2828
- id: ruff
2929
args: [ --fix, --exit-non-zero-on-fix, "--ignore=C901" ]

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Change log
22

3+
## [v2.0.0-alpha2](https://github.com/simvue-io/client/releases/tag/v2.0.0a2) - 2025-02-27
4+
* Removed 'no config file' and 'unstaged changes' warnings from Offline mode as they do not apply
5+
* Made `staging_check` not apply in Offline mode
6+
* Added heartbeat functionality to Offline mode
7+
* Moved away from `FlatDict` module for metadata collection, fixes Simvue in Jupyter notebooks
8+
* Fixed `reconnect()` by setting `read_only` to False and added tests
9+
* Fixed resource metrics collection to return measurement on startup and use short interval for more accurate measurements
10+
* Fixed `set_pid` so that resource metrics are also collected for child processes of it
11+
* Improved sender by having all cached files read at start and lock file so only one sender runs at once
12+
* Added `name` option in `log_alert` and added tests
13+
* Fixed client `get_alerts` and improved tests
14+
* Removed all server config checks in Offline mode
15+
316
## [v2.0.0-alpha1](https://github.com/simvue-io/client/releases/tag/v2.0.0a1) - 2025-02-19
417
* Fixed `add_alerts` so that it now works with both IDs and names
518
* Improved alert and folder deduplication methods to rely on 409 responses from server upon creation

CITATION.cff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ keywords:
4242
- alerting
4343
- simulation
4444
license: Apache-2.0
45-
commit: 124b2993d91dbff2e475aa972916b11e7bd02fa4
46-
version: 2.0.0a1
47-
date-released: '2025-02-19'
45+
commit: 83b9144abd2092d4be304bf742d72a249ad1d8ff
46+
version: 2.0.0a2
47+
date-released: '2025-02-27'
4848
references:
4949
- title: mlco2/codecarbon
5050
version: v2.8.2

poetry.lock

Lines changed: 25 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.0.0a1"
3+
version = "2.0.0a2"
44
description = "Simulation tracking and monitoring"
55
authors = [
66
{name = "Simvue Development Team", email = "[email protected]"}

simvue/api/objects/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def _wrapper(self) -> typing.Any:
5050
raise RuntimeError(
5151
f"Cannot use 'staging_check' decorator on type '{type(self).__name__}'"
5252
)
53+
if _sv_obj._offline:
54+
return member_func(self)
5355
if not _sv_obj._read_only and member_func.__name__ in _sv_obj._staging:
5456
_sv_obj._logger.warning(
5557
f"Uncommitted change found for attribute '{member_func.__name__}'"

simvue/api/objects/run.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,14 @@ def events(
315315

316316
@write_only
317317
def send_heartbeat(self) -> dict[str, typing.Any] | None:
318-
if self._offline or not self._identifier:
318+
if not self._identifier:
319+
return None
320+
321+
if self._offline:
322+
if not (_dir := self._local_staging_file.parent).exists():
323+
_dir.mkdir(parents=True)
324+
_heartbeat_file = self._local_staging_file.with_suffix(".heartbeat")
325+
_heartbeat_file.touch()
319326
return None
320327

321328
_url = self._base_url

simvue/client.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -990,17 +990,23 @@ def get_alerts(
990990
RuntimeError
991991
if there was a failure retrieving data from the server
992992
"""
993-
994993
if not run_id:
994+
if critical_only:
995+
raise RuntimeError(
996+
"critical_only is ambiguous when returning alerts with no run ID specified."
997+
)
995998
return [alert.name if names_only else alert for _, alert in Alert.get()] # type: ignore
996999

997-
return [
998-
alert.get("name")
999-
if names_only
1000-
else Alert(identifier=alert.get("id"), **alert)
1000+
_alerts = [
1001+
Alert(identifier=alert.get("id"), **alert)
10011002
for alert in Run(identifier=run_id).get_alert_details()
1002-
if not critical_only or alert["status"].get("current") == "critical"
1003-
] # type: ignore
1003+
]
1004+
1005+
return [
1006+
alert.name if names_only else alert
1007+
for alert in _alerts
1008+
if not critical_only or alert.get_status(run_id) == "critical"
1009+
]
10041010

10051011
@prettify_pydantic
10061012
@pydantic.validate_call

simvue/config/user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def fetch(
180180
except FileNotFoundError:
181181
if not server_token or not server_url:
182182
_config_dict = {"server": {}}
183-
logger.warning("No config file found, checking environment variables")
183+
logger.debug("No config file found, checking environment variables")
184184

185185
_config_dict["server"] = _config_dict.get("server", {})
186186

simvue/executor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,11 @@ def _update_alerts(self) -> None:
348348
if self._runner._dispatcher:
349349
self._runner._dispatcher.purge()
350350

351-
self._runner.log_alert(self._alert_ids[proc_id], "critical")
351+
self._runner.log_alert(
352+
identifier=self._alert_ids[proc_id], state="critical"
353+
)
352354
else:
353-
self._runner.log_alert(self._alert_ids[proc_id], "ok")
355+
self._runner.log_alert(identifier=self._alert_ids[proc_id], state="ok")
354356

355357
_current_time: float = 0
356358
while (

0 commit comments

Comments
 (0)