From fb3bc8eeff3aac3ffb2c8e6edc6800a18cff8b0a Mon Sep 17 00:00:00 2001 From: "Oleg E. Peil" Date: Thu, 15 Oct 2015 11:44:50 +0200 Subject: [PATCH] Added consistency check for the number of sites 'check_data_consistency' now first checks that site indices in projected shells do not exceed the number of ions in the structure. --- python/vasp/plotools.py | 1 + 1 file changed, 1 insertion(+) 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"