From 109da7c90ccc3e24510c73ce7c6ce9711caca797 Mon Sep 17 00:00:00 2001 From: Matt Drozt Date: Tue, 29 Oct 2024 09:27:43 -0700 Subject: [PATCH] Reviewer feedback: docs and err msgs --- smartsim/experiment.py | 8 ++++---- smartsim/launchable/job.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/smartsim/experiment.py b/smartsim/experiment.py index d5aafc3b6..e0f960079 100644 --- a/smartsim/experiment.py +++ b/smartsim/experiment.py @@ -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 @@ -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 = ( diff --git a/smartsim/launchable/job.py b/smartsim/launchable/job.py index 9ce7dc87e..ac44a21e9 100644 --- a/smartsim/launchable/job.py +++ b/smartsim/launchable/job.py @@ -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: @@ -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), " ")} """)