Skip to content

Commit

Permalink
Modify GenericError to use the working_directory rather than the job
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Apr 28, 2024
1 parent 02216b0 commit b875398
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pyiron_base/jobs/job/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def __init__(self, project, job_name):
self._python_only_job = False
self._write_work_dir_warnings = True
self.interactive_cache = None
self.error = GenericError(job=self)
self.error = GenericError(working_directory=self.project_hdf5.working_directory)

@property
def version(self):
Expand Down Expand Up @@ -1566,8 +1566,8 @@ def _get_executor(self, max_workers=None):


class GenericError(object):
def __init__(self, job):
self._job = job
def __init__(self, working_directory):
self._working_directory = working_directory

def __repr__(self):
all_messages = ""
Expand All @@ -1585,7 +1585,7 @@ def print_queue(self, string=""):
return self._print_error(file_name="error.out", string=string)

def _print_error(self, file_name, string="", print_yes=True):
if self._job[file_name] is None:
if os.path.join(self._working_directory, file_name) is None:
return ""
elif print_yes:
return string.join(self._job[file_name])
return string.join(os.path.join(self._working_directory, file_name))

0 comments on commit b875398

Please sign in to comment.