Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch all exception in pyiron table #1610

Merged
merged 2 commits into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions pyiron_base/jobs/datamining.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,14 +844,9 @@ def always_true(_):
return True


def _apply_function_on_job(funct, job):
try:
return funct(job)
except (ValueError, TypeError):
return {}


def _apply_list_of_functions_on_job(input_parameters):
from pyiron_snippets.logger import logger

from pyiron_base.jobs.job.path import JobPath

db_entry, function_lst, convert_to_object = input_parameters
Expand All @@ -861,7 +856,8 @@ def _apply_list_of_functions_on_job(input_parameters):
job.set_input_to_read_only()
diff_dict = {}
for funct in function_lst:
funct_dict = _apply_function_on_job(funct, job)
for key, value in funct_dict.items():
diff_dict[key] = value
try:
diff_dict.update(funct(job))
except Exception as e:
logger.warn(f"Caught exception '{e}' when called on job {job.id}!")
return diff_dict
Loading