From fec98170868b9a79bd40fa52ee109660b39bde7c Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Thu, 12 Sep 2019 14:14:06 -0400 Subject: [PATCH] Add __getitem__ implementation for NeighList --- python/lammps.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/lammps.py b/python/lammps.py index 4772a34c8d..99d0b026a5 100644 --- a/python/lammps.py +++ b/python/lammps.py @@ -70,6 +70,9 @@ class NeighList: iatom, numneigh, neighbors = self.lmp.get_neighlist_element_neighbors(self.idx, element) return iatom, numneigh, neighbors + def __getitem__(self, element): + return self.get(element) + def __iter__(self): inum = self.size