Skip to content

Commit f90e093

Browse files
committed
Addressed review comments
1 parent 3b497cd commit f90e093

File tree

6 files changed

+41
-9
lines changed

6 files changed

+41
-9
lines changed

simvue/api/objects/artifact/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class ArtifactBase(SimvueObject):
4242
def __init__(
4343
self, identifier: str | None = None, _read_only: bool = True, **kwargs
4444
) -> None:
45-
"""Initialise a artifact connection.
45+
"""Initialise an artifact connection.
4646
4747
Parameters
4848
----------
@@ -246,7 +246,7 @@ def uploaded(self) -> bool:
246246
247247
Returns
248248
-------
249-
datetime.datetime | None
249+
bool
250250
"""
251251
return self._get_attribute("uploaded")
252252

simvue/api/objects/events.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
from simvue.models import DATETIME_FORMAT, EventSet
2020
from simvue.api.request import get as sv_get, get_json_from_response
2121

22+
try:
23+
from typing import Self
24+
except ImportError:
25+
from typing_extensions import Self
26+
2227
__all__ = ["Events"]
2328

2429

@@ -58,7 +63,9 @@ def get(
5863

5964
@classmethod
6065
@pydantic.validate_call
61-
def new(cls, *, run: str, offline: bool = False, events: list[EventSet], **kwargs):
66+
def new(
67+
cls, *, run: str, offline: bool = False, events: list[EventSet], **kwargs
68+
) -> Self:
6269
"""Create a new Events entry on the Simvue server"""
6370
return Events(
6471
run=run,
@@ -109,6 +116,13 @@ def histogram(
109116
return _json_response.get("data")
110117

111118
def delete(self, **kwargs) -> dict[str, typing.Any]:
119+
"""Event set deletion not implemented.
120+
121+
Raises
122+
------
123+
NotImplementedError
124+
as event set deletion not supported
125+
"""
112126
raise NotImplementedError("Cannot delete event set")
113127

114128
def on_reconnect(self, id_mapping: dict[str, str]):

simvue/api/objects/folder.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
from .base import SimvueObject, staging_check, write_only
2020
from simvue.models import FOLDER_REGEX, DATETIME_FORMAT
2121

22+
try:
23+
from typing import Self
24+
except ImportError:
25+
from typing_extensions import Self
26+
27+
28+
__all__ = ["Folder"]
29+
2230

2331
class Folder(SimvueObject):
2432
"""
@@ -56,7 +64,7 @@ def new(
5664
path: typing.Annotated[str, pydantic.Field(pattern=FOLDER_REGEX)],
5765
offline: bool = False,
5866
**kwargs,
59-
):
67+
) -> Self:
6068
"""Create a new Folder on the Simvue server with the given path"""
6169
return Folder(path=path, _read_only=False, _offline=offline, **kwargs)
6270

simvue/api/objects/metrics.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
from simvue.models import MetricSet
1919
from simvue.api.request import get as sv_get, get_json_from_response
2020

21+
try:
22+
from typing import Self
23+
except ImportError:
24+
from typing_extensions import Self
25+
2126
__all__ = ["Metrics"]
2227

2328

@@ -39,7 +44,7 @@ def __init__(
3944
@pydantic.validate_call
4045
def new(
4146
cls, *, run: str, metrics: list[MetricSet], offline: bool = False, **kwargs
42-
):
47+
) -> Self:
4348
"""Create a new Metrics entry on the Simvue server.
4449
4550
Parameters

simvue/api/objects/tag.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
from .base import SimvueObject, staging_check, write_only
1414
from simvue.models import DATETIME_FORMAT
1515

16+
try:
17+
from typing import Self
18+
except ImportError:
19+
from typing_extensions import Self
20+
1621
__all__ = ["Tag"]
1722

1823

@@ -21,7 +26,7 @@ class Tag(SimvueObject):
2126

2227
@classmethod
2328
@pydantic.validate_call
24-
def new(cls, *, name: str, offline: bool = False, **kwargs):
29+
def new(cls, *, name: str, offline: bool = False, **kwargs) -> Self:
2530
"""Create a new Tag on the Simvue server.
2631
2732
Parameters

simvue/run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ def init(
630630
folder : str, optional
631631
folder within which to store the run, by default "/"
632632
notification: typing.Literal["none", "all", "error", "lost"], optional
633-
email notification settings
633+
email notification on completion settings
634634
* none - do not notify (default).
635635
* all - notify for all updates.
636636
* error - notify on errors.
@@ -1890,7 +1890,7 @@ def create_metric_threshold_alert(
18901890
* all - returns if all values in window satisfy condition.
18911891
notification : Literal['email', 'none'], optional
18921892
whether to notify on trigger
1893-
* email - send email to user on notify.
1893+
* email - send email to user on alert.
18941894
* none - send no notifications (default).
18951895
trigger_abort : bool, optional
18961896
whether this alert can trigger a run abort, default False
@@ -1949,7 +1949,7 @@ def create_event_alert(
19491949
frequency at which to check alert condition in seconds, by default None
19501950
notification : Literal['email', 'none'], optional
19511951
whether to notify on trigger
1952-
* email - send email to user on notify.
1952+
* email - send email to user on alert.
19531953
* none - send no notifications (default).
19541954
trigger_abort : bool, optional
19551955
whether this alert can trigger a run abort

0 commit comments

Comments
 (0)