Skip to content

Commit f72e003

Browse files
committed
docs, typos
1 parent b2e53b3 commit f72e003

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

smartsim/_core/utils/helpers.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@
6464

6565
def unpack(value: _NestedJobSequenceType) -> t.Generator[Job, None, None]:
6666
"""Unpack any iterable input in order to obtain a
67-
single sequence of values
67+
single sequence of values.
6868
6969
:param value: Sequence containing elements of type Job or other
70-
sequences that are also of type _NestedJobSequenceType
71-
:return: flattened list of Jobs"""
70+
sequences that are also of type `_NestedJobSequenceType`.
71+
:raises TypeError: If the value is not a nested sequence of jobs.
72+
:return: A flattened list of `Jobs`.
73+
"""
7274
from smartsim.launchable.job import Job
7375

7476
for item in value:

smartsim/experiment.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,10 @@ def start(self, *jobs: Job | t.Sequence[Job]) -> tuple[Record, ...]:
161161
"""Execute a collection of `Job` instances.
162162
163163
:param jobs: A collection of other job instances to start
164-
:raises TypeError: If jobs provided are not the correct type
165164
:raises ValueError: No Jobs were provided.
166-
:returns: A sequence of ids with order corresponding to the sequence of
167-
jobs that can be used to query or alter the status of that
168-
particular execution of the job.
165+
:returns: A sequence of records with order corresponding to the
166+
sequence of jobs that can be used to query or alter the status of
167+
that particular execution of the job.
169168
"""
170169

171170
if not jobs:
@@ -232,12 +231,12 @@ def execute_dispatch(generator: Generator, job: Job, idx: int) -> LaunchedJobID:
232231
)
233232

234233
def get_status(self, *records: Record) -> tuple[JobStatus | InvalidJobStatus, ...]:
235-
"""Get the status of jobs launched through the `Experiment` from their
236-
launched job id returned when calling `Experiment.start`.
234+
"""Get the status of jobs launched through the `Experiment` from the
235+
record returned when calling `Experiment.start`.
237236
238-
The `Experiment` will map the launched ID back to the launcher that
239-
started the job and request a status update. The order of the returned
240-
statuses exactly matches the order of the launched job ids.
237+
The `Experiment` will map the launched id of the record back to the
238+
launcher that started the job and request a status update. The order of
239+
the returned statuses exactly matches the order of the records.
241240
242241
If the `Experiment` cannot find any launcher that started the job
243242
associated with the launched job id, then a
@@ -450,7 +449,7 @@ def stop(self, *records: Record) -> tuple[JobStatus | InvalidJobStatus, ...]:
450449
"""
451450
if not records:
452451
raise ValueError("No records provided")
453-
if not all(isinstance(reocrd, Record) for reocrd in records):
452+
if not all(isinstance(record, Record) for record in records):
454453
raise TypeError("record argument was not of type Record")
455454
ids = tuple(record.launched_id for record in records)
456455
by_launcher = self._launch_history.group_by_launcher(set(ids), unknown_ok=True)

smartsim/launchable/job.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ def __str__(self) -> str: # pragma: no cover
163163

164164
@t.final
165165
class Record:
166-
"""A record a job that was launched and launch ID assigned to the
167-
launching.
166+
"""A Record object to track a launched job along with its assigned
167+
launch ID.
168168
"""
169169

170170
def __init__(self, launch_id: LaunchedJobID, job: Job) -> None:

0 commit comments

Comments
 (0)