Skip to content

Commit 83db6a1

Browse files
committed
Ensure LLAPI docstrings consistent
1 parent 8a3922a commit 83db6a1

19 files changed

Lines changed: 339 additions & 28 deletions

File tree

simvue/api/objects/administrator/tenant.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,32 @@
1919

2020

2121
class Tenant(SimvueObject):
22-
"""Class for interacting with a tenant instance on the server."""
22+
"""
23+
Simvue Tenant
24+
=============
25+
26+
This class is used to connect to/create tenant objects on the Simvue server,
27+
any modification of instance attributes is mirrored on the remote object.
28+
29+
"""
30+
31+
def __init__(self, identifier: str | None = None, **kwargs) -> None:
32+
"""Initialise a Tenant
33+
34+
If an identifier is provided a connection will be made to the
35+
object matching the identifier on the target server.
36+
Else a new Tenant will be created using arguments provided in kwargs.
37+
38+
**Assumes the current user is an Administrator of the system.**
39+
40+
Parameters
41+
----------
42+
identifier : str, optional
43+
the remote server unique id for the target folder
44+
**kwargs : dict
45+
any additional arguments to be passed to the object initialiser
46+
"""
47+
super().__init__(identifier, **kwargs)
2348

2449
@classmethod
2550
@pydantic.validate_call

simvue/api/objects/administrator/user.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,32 @@
2020

2121

2222
class User(SimvueObject):
23-
"""Class for interacting with a user instance on the server."""
23+
"""
24+
Simvue User
25+
===========
26+
27+
This class is used to connect to/create user objects on the Simvue server,
28+
any modification of instance attributes is mirrored on the remote object.
29+
30+
"""
31+
32+
def __init__(self, identifier: str | None = None, **kwargs) -> None:
33+
"""Initialise a User
34+
35+
If an identifier is provided a connection will be made to the
36+
object matching the identifier on the target server.
37+
Else a new User will be created using arguments provided in kwargs.
38+
39+
**Assumes the current user is an Administrator of the system.**
40+
41+
Parameters
42+
----------
43+
identifier : str, optional
44+
the remote server unique id for the target folder
45+
**kwargs : dict
46+
any additional arguments to be passed to the object initialiser
47+
"""
48+
super().__init__(identifier, **kwargs)
2449

2550
@classmethod
2651
@pydantic.validate_call

simvue/api/objects/alert/events.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,29 @@
1919

2020

2121
class EventsAlert(AlertBase):
22-
"""Connect to an event-based alert either locally or on a server"""
22+
"""
23+
Simvue Events Alert
24+
===================
25+
26+
This class is used to connect to/create event-based alert objects on the Simvue server,
27+
any modification of EventsAlert instance attributes is mirrored on the remote object.
28+
29+
"""
2330

2431
def __init__(self, identifier: str | None = None, **kwargs) -> None:
25-
"""Initialise a connection to an event alert by identifier"""
32+
"""Initialise an Events Alert
33+
34+
If an identifier is provided a connection will be made to the
35+
object matching the identifier on the target server.
36+
Else a new EventsAlert instance will be created using arguments provided in kwargs.
37+
38+
Parameters
39+
----------
40+
identifier : str, optional
41+
the remote server unique id for the target folder
42+
**kwargs : dict
43+
any additional arguments to be passed to the object initialiser
44+
"""
2645
self.alert = EventAlertDefinition(self)
2746
super().__init__(identifier, **kwargs)
2847

simvue/api/objects/alert/fetch.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,23 @@ def check_column(cls, column: str) -> str:
3333

3434

3535
class Alert:
36-
"""Generic Simvue alert retrieval class"""
36+
"""
37+
Simvue Alert
38+
============
39+
40+
Generic Simvue alert retrieval class.
41+
42+
"""
43+
44+
def __init__(self, identifier: str | None = None, *args, **kwargs) -> None:
45+
"""Initialise an instance of generic alert retriever.
46+
47+
Parameters
48+
----------
49+
identifier : str
50+
identifier of alert object to retrieve
51+
"""
52+
super().__init__(identifier=identifier, *args, **kwargs)
3753

3854
@pydantic.validate_call()
3955
def __new__(cls, identifier: str, **kwargs) -> AlertType:

simvue/api/objects/alert/metrics.py

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,29 @@
2424

2525

2626
class MetricsThresholdAlert(AlertBase):
27-
"""Class for connecting to/creating a local or remotely defined metric threshold alert"""
27+
"""
28+
Simvue Metrics Threshold Alert
29+
==============================
30+
31+
This class is used to connect to/create metrics threshold alert objects on the Simvue server,
32+
any modification of MetricsThresholdAlert instance attributes is mirrored on the remote object.
33+
34+
"""
2835

2936
def __init__(self, identifier: str | None = None, **kwargs) -> None:
30-
"""Connect to a local or remote threshold alert by identifier"""
37+
"""Initialise a Metrics Threshold Alert
38+
39+
If an identifier is provided a connection will be made to the
40+
object matching the identifier on the target server.
41+
Else a new MetricsThresholdAlert instance will be created using arguments provided in kwargs.
42+
43+
Parameters
44+
----------
45+
identifier : str, optional
46+
the remote server unique id for the target folder
47+
**kwargs : dict
48+
any additional arguments to be passed to the object initialiser
49+
"""
3150
self.alert = MetricThresholdAlertDefinition(self)
3251
super().__init__(identifier, **kwargs)
3352
self._local_only_args += [
@@ -117,10 +136,29 @@ def new(
117136

118137

119138
class MetricsRangeAlert(AlertBase):
120-
"""Class for connecting to/creating a local or remotely defined metric range alert"""
139+
"""
140+
Simvue Metrics Range Alert
141+
==========================
142+
143+
This class is used to connect to/create metrics range alert objects on the Simvue server,
144+
any modification of MetricsRangeAlert instance attributes is mirrored on the remote object.
145+
146+
"""
121147

122148
def __init__(self, identifier: str | None = None, **kwargs) -> None:
123-
"""Connect to a local or remote threshold alert by identifier"""
149+
"""Initialise a Metrics Range Alert
150+
151+
If an identifier is provided a connection will be made to the
152+
object matching the identifier on the target server.
153+
Else a new MetricsRangeAlert instance will be created using arguments provided in kwargs.
154+
155+
Parameters
156+
----------
157+
identifier : str, optional
158+
the remote server unique id for the target folder
159+
**kwargs : dict
160+
any additional arguments to be passed to the object initialiser
161+
"""
124162
self.alert = MetricRangeAlertDefinition(self)
125163
super().__init__(identifier, **kwargs)
126164
self._local_only_args += [

simvue/api/objects/alert/user.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,29 @@
2121

2222

2323
class UserAlert(AlertBase):
24-
"""Connect to/create a user defined alert either locally or on server"""
24+
"""
25+
Simvue User Alert
26+
=================
27+
28+
This class is used to connect to/create user alert objects on the Simvue server,
29+
any modification of UserAlert instance attributes is mirrored on the remote object.
30+
31+
"""
2532

2633
def __init__(self, identifier: str | None = None, **kwargs) -> None:
34+
"""Initialise a User Alert
35+
36+
If an identifier is provided a connection will be made to the
37+
object matching the identifier on the target server.
38+
Else a new UserAlert instance will be created using arguments provided in kwargs.
39+
40+
Parameters
41+
----------
42+
identifier : str, optional
43+
the remote server unique id for the target folder
44+
**kwargs : dict
45+
any additional arguments to be passed to the object initialiser
46+
"""
2747
super().__init__(identifier, **kwargs)
2848
self._local_status: dict[str, str | None] = kwargs.pop("status", {})
2949

simvue/api/objects/artifact/fetch.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ def check_column(cls, column: str) -> str:
2828

2929

3030
class Artifact:
31-
"""Generic Simvue artifact retrieval class"""
31+
"""
32+
Simvue Artifact
33+
===============
34+
35+
Generic Simvue artifact retrieval class.
36+
37+
"""
3238

3339
def __init__(self, identifier: str | None = None, *args, **kwargs) -> None:
3440
"""Initialise an instance of generic artifact retriever.

simvue/api/objects/artifact/file.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,30 @@
1717

1818

1919
class FileArtifact(ArtifactBase):
20-
"""File based artifact modification and creation class."""
20+
"""
21+
Simvue File Artifact
22+
====================
23+
24+
This class is used to connect to/create file artifact objects on the Simvue server,
25+
any modification of instance attributes is mirrored on the remote object.
26+
27+
"""
2128

2229
def __init__(
2330
self, identifier: str | None = None, _read_only: bool = True, **kwargs
2431
) -> None:
25-
"""Initialise a new file artifact connection.
32+
"""Initialise a File Artifact
33+
34+
If an identifier is provided a connection will be made to the
35+
object matching the identifier on the target server.
36+
Else a new FileArtifact instance will be created using arguments provided in kwargs.
2637
2738
Parameters
2839
----------
2940
identifier : str, optional
30-
the identifier of this object on the server.
41+
the remote server unique id for the target folder
42+
**kwargs : dict
43+
any additional arguments to be passed to the object initialiser
3144
"""
3245
super().__init__(identifier=identifier, _read_only=_read_only, **kwargs)
3346

simvue/api/objects/artifact/object.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,30 @@
1515

1616

1717
class ObjectArtifact(ArtifactBase):
18-
"""Object based artifact modification and creation class."""
18+
"""
19+
Simvue Object Artifact
20+
======================
21+
22+
This class is used to connect to/create file object artifact objects on the Simvue server,
23+
any modification of instance attributes is mirrored on the remote object.
24+
25+
"""
1926

2027
def __init__(
2128
self, identifier: str | None = None, _read_only: bool = True, **kwargs
2229
) -> None:
23-
"""Initialise a new object artifact connection.
30+
"""Initialise a Object Artifact
31+
32+
If an identifier is provided a connection will be made to the
33+
object matching the identifier on the target server.
34+
Else a new ObjectArtifact instance will be created using arguments provided in kwargs.
2435
2536
Parameters
2637
----------
2738
identifier : str, optional
28-
the identifier of this object on the server.
39+
the remote server unique id for the target folder
40+
**kwargs : dict
41+
any additional arguments to be passed to the object initialiser
2942
"""
3043
kwargs.pop("original_path", None)
3144
super().__init__(identifier, _read_only, original_path="", **kwargs)

simvue/api/objects/events.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,22 @@
2929

3030

3131
class Events(SimvueObject):
32+
"""
33+
Simvue Events
34+
=============
35+
36+
This class is used to connect to/create events objects on the Simvue server,
37+
any modification of instance attributes is mirrored on the remote object.
38+
39+
"""
40+
3241
def __init__(
3342
self,
3443
_read_only: bool = True,
3544
_local: bool = False,
3645
**kwargs,
3746
) -> None:
47+
"""Initialise an Events object instance for creation/retrieval."""
3848
self._label = "event"
3949
super().__init__(_read_only=_read_only, _local=_local, **kwargs)
4050
self._run_id = self._staging.get("run")

0 commit comments

Comments
 (0)