diff --git a/wfl/configset.py b/wfl/configset.py index 2bad8242..ede23f7c 100644 --- a/wfl/configset.py +++ b/wfl/configset.py @@ -144,6 +144,18 @@ def __iter__(self): if self.items is None: return + # special handling for ConfigSet generated by groups() iterator, which + # sets self._cur_at, self._file_loc, and self._open_reader + if self._file_loc is not None and len(self._file_loc) > 0 and self._cur_at[0] is not None: + assert self._open_reader is not None + while self._cur_at[0].info["_ConfigSet_loc"].startswith(self._file_loc): + yield self._cur_at[0] + try: + self._cur_at[0] = next(self._open_reader) + except StopIteration: + break + return + if isinstance(self.items, Path): # yield Atoms from one file ## print("DEBUG __iter__ one file", self.items)