diff options
-rw-r--r-- | chroma/sim.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chroma/sim.py b/chroma/sim.py index fd1c0a5..c3c0151 100644 --- a/chroma/sim.py +++ b/chroma/sim.py @@ -55,7 +55,10 @@ class Simulation(object): def simulate(self, iterable, keep_photons_beg=False, keep_photons_end=False, run_daq=True, max_steps=100): try: - first_element, iterable = itertoolset.peek(iterable) + if isinstance(iterable, event.Photons): + raise TypeError # Kludge because Photons looks iterable + else: + first_element, iterable = itertoolset.peek(iterable) except TypeError: first_element, iterable = iterable, [iterable] |