From f0c70f4e29d3a5ec90ad2fb47be943b8d32b6641 Mon Sep 17 00:00:00 2001 From: Tyler Mathis <35553152+tsmathis@users.noreply.github.com> Date: Mon, 8 Jul 2024 11:30:47 -0700 Subject: [PATCH] add early check for validity of tasks --- emmet-core/emmet/core/vasp/material.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emmet-core/emmet/core/vasp/material.py b/emmet-core/emmet/core/vasp/material.py index 68313f0bf9..d3b5fcc2f6 100644 --- a/emmet-core/emmet/core/vasp/material.py +++ b/emmet-core/emmet/core/vasp/material.py @@ -90,6 +90,10 @@ def from_tasks( else structure_optimizations ) + validity_check = [doc for doc in structure_calcs if doc.is_valid] + if not validity_check: + raise ValueError("Group must contain at least one valid task") + # Material ID possible_mat_ids = [task.task_id for task in structure_optimizations]