diff --git a/python/vasp/plotools.py b/python/vasp/plotools.py index 27ffa860..d86caa67 100644 --- a/python/vasp/plotools.py +++ b/python/vasp/plotools.py @@ -81,6 +81,7 @@ def check_data_consistency(pars, el_struct): """ # Check that ions inside each shell are of the same sort for sh in pars.shells: + assert max(sh['ion_list']) <= el_struct.natom, "Site index in the projected shell exceeds the number of ions in the structure" sorts = set([el_struct.type_of_ion[io] for io in sh['ion_list']]) assert len(sorts) == 1, "Each projected shell must contain only ions of the same sort"