From 2e367a0defd708d7a71e8c233901d7e9686d0fc4 Mon Sep 17 00:00:00 2001 From: Matt Drozt Date: Thu, 17 Oct 2024 15:38:21 -0700 Subject: [PATCH] Add a `Record.__str__` method --- smartsim/launchable/job.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/smartsim/launchable/job.py b/smartsim/launchable/job.py index 2dd03cd13..361efba6b 100644 --- a/smartsim/launchable/job.py +++ b/smartsim/launchable/job.py @@ -26,6 +26,7 @@ from __future__ import annotations +import textwrap import typing as t from copy import deepcopy @@ -191,3 +192,12 @@ def job(self) -> Job: :returns: A deep copy of the launched job. """ return deepcopy(self._job) + + def __str__(self) -> str: + return textwrap.dedent(f"""\ + Launch Record: + Launched Job ID: + {self.launched_id} + Laucnehd Job: + {textwrap.indent(str(job), " ")} + """)