From b18ad91482ae3248340ef0175bd48edbf68d2cb9 Mon Sep 17 00:00:00 2001 From: Parham Panahi Date: Sun, 22 Dec 2024 18:33:01 -0700 Subject: [PATCH] fix: cache idx passed to constructor fixes #98 --- PyExpUtils/collection/Collector.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PyExpUtils/collection/Collector.py b/PyExpUtils/collection/Collector.py index 510d336..e124b30 100644 --- a/PyExpUtils/collection/Collector.py +++ b/PyExpUtils/collection/Collector.py @@ -64,6 +64,10 @@ def __init__(self, config: Dict[str, Sampler | Ignore] = {}, idx: int | None = N self._idxs = set[int]() self._keys = set[str]() + # if an idx is provided add it to the cache + if idx is not None: + self._idxs.add(idx) + # ------------- # -- Context -- # -------------