Skip to content

Commit

Permalink
Add error to sample if called on unfinished job
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrv committed Jun 3, 2022
1 parent cd42c03 commit 7cc8520
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyiron_contrib/atomistics/atomistics/job/trainingcontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ def sample(
Raises:
ValueError: if a job with the given `name` already exists.
"""
if not self.status.finished:
raise ValueError(f"Job must be finished, not '{self.status}'!")
cont = self.project.create.job.TrainingContainer(name, delete_existing_job=delete_existing_job)
if not cont.status.initialized:
raise ValueError(f"Job '{name}' already exists with status: {cont.status}!")
Expand Down

0 comments on commit 7cc8520

Please sign in to comment.