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), " ")} """) diff --git a/tests/test_experiment.py b/tests/test_experiment.py index f3494de61..b4b036424 100644 --- a/tests/test_experiment.py +++ b/tests/test_experiment.py @@ -709,7 +709,7 @@ def test_type_wait_parameter(test_dir): def test_type_stop_parameter(test_dir): exp = Experiment(name="exp_name", exp_path=test_dir) - with pytest.raises(TypeError, match="record argument was not of type Record"): + with pytest.raises(TypeError, match="Record argument was not of type `Record`"): exp.stop(2)