Skip to content

Commit

Permalink
a method to get the status of an experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
recursix committed Oct 29, 2024
1 parent 6da763a commit 25c5eb8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions browsergym/experiments/src/browsergym/experiments/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,22 @@ def logs(self):
self._logs = (self.exp_dir / "experiment.log").read_text()
return self._logs

@property
def status(self):
"""Return one of the following status:
* "done": completed with no error
* "error": completed with error
* "incomplete": not completed yet (may be pending or just stalled)
"""
try:
summary_info = self.summary_info
except FileNotFoundError:
return "incomplete"

if summary_info.get("err_msg", None) is not None:
return "error"
return "done"


EXP_RESULT_CACHE = {}

Expand Down

0 comments on commit 25c5eb8

Please sign in to comment.