Skip to content

Commit

Permalink
Reviewer feedback: docs and err msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
MattToast committed Oct 29, 2024
1 parent bc8a46d commit 109da7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions smartsim/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ def get_status(self, *records: Record) -> tuple[JobStatus | InvalidJobStatus, ..
"""Get the status of jobs launched through the `Experiment` from the
record returned when calling `Experiment.start`.
The `Experiment` will map the launched id of the record back to the
The `Experiment` will map the record id of the record back to the
launcher that started the job and request a status update. The order of
the returned statuses exactly matches the order of the records.
the returned statuses matches the order of the records.
If the `Experiment` cannot find any launcher that started the job
associated with the launched job id, then a
Expand Down Expand Up @@ -448,9 +448,9 @@ def stop(self, *records: Record) -> tuple[JobStatus | InvalidJobStatus, ...]:
respective of the order of the calling arguments.
"""
if not records:
raise ValueError("No records provided")
raise ValueError("No records provided. No jobs will be stopped.")
if not all(isinstance(record, Record) for record in records):
raise TypeError("record argument was not of type Record")
raise TypeError("Record argument was not of type `Record`.")
ids = tuple(record.launched_id for record in records)
by_launcher = self._launch_history.group_by_launcher(set(ids), unknown_ok=True)
id_to_stop_stat = (
Expand Down
6 changes: 3 additions & 3 deletions smartsim/launchable/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ def __str__(self) -> str: # pragma: no cover

@t.final
class Record:
"""A Record object to track a launched job along with its assigned
launch ID.
"""An object composed of a unique identifier for a launched job, and a copy
of the job that was launched.
"""

def __init__(self, launch_id: LaunchedJobID, job: Job) -> None:
Expand Down Expand Up @@ -198,6 +198,6 @@ def __str__(self) -> str:
Launch Record:
Launched Job ID:
{self.launched_id}
Laucnehd Job:
Launched Job:
{textwrap.indent(str(self._job), " ")}
""")

0 comments on commit 109da7c

Please sign in to comment.