diff --git a/matsciml/datasets/utils.py b/matsciml/datasets/utils.py index e7a4942a..75884a12 100644 --- a/matsciml/datasets/utils.py +++ b/matsciml/datasets/utils.py @@ -753,7 +753,7 @@ def _all_sites_have_neighbors(neighbors): all_images.append(site.image) # determine if we terminate the site loop earlier site_count += 1 - if any([len(obj) == 0 for obj in [all_images, all_dst, all_images]]): + if any([len(obj) == 0 for obj in [all_src, all_dst, all_images]]): raise ValueError( f"No images or edges to work off for cutoff {cutoff}." f" Please inspect your structure and neighbors: {structure} {neighbors} {structure.cart_coords}" @@ -864,7 +864,7 @@ def _all_sites_have_neighbors(neighbors): # determine if we terminate the site loop earlier site_count += 1 - if any([len(obj) == 0 for obj in [all_images, all_dst, all_images]]): + if any([len(obj) == 0 for obj in [all_src, all_dst, all_images]]): raise ValueError( f"No images or edges to work off for cutoff {cutoff}." f" Please inspect your atoms object and neighbors: {atoms}."