diff options
author | 2017-12-04 13:48:07 -0800 | |
---|---|---|
committer | 2017-12-04 13:48:07 -0800 | |
commit | 7ee4ea19fe76260bb293ada0bd8cbee530cd8eb7 (patch) | |
tree | b8eb1571be62ccd8ee4aca34670e8549e6c4f8b1 /Python/pywarpx | |
parent | 80d8c2eb76bb7996d119546a515515a4e803ad0b (diff) | |
download | WarpX-7ee4ea19fe76260bb293ada0bd8cbee530cd8eb7.tar.gz WarpX-7ee4ea19fe76260bb293ada0bd8cbee530cd8eb7.tar.zst WarpX-7ee4ea19fe76260bb293ada0bd8cbee530cd8eb7.zip |
Added len method to PGroup python class
Diffstat (limited to 'Python/pywarpx')
-rw-r--r-- | Python/pywarpx/PGroup.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/pywarpx/PGroup.py b/Python/pywarpx/PGroup.py index fa8572c0a..64e396d38 100644 --- a/Python/pywarpx/PGroup.py +++ b/Python/pywarpx/PGroup.py @@ -148,7 +148,7 @@ class PGroups(object): self._pgroups = [] for igroup in range(self.ngroups): self._pgroups.append(PGroup(igroup, self.ispecie)) - + def __iter__(self): self.setuppgroups() for igroup in range(self.ngroups): @@ -158,3 +158,6 @@ class PGroups(object): self.setuppgroups() return self._pgroups[key] + def __len__(self): + self.setuppgroups() + return len(self._pgroups) |