From a73b5669aefe5612209eec02269b00b964565a5b Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Tue, 5 Feb 2013 17:00:43 -0500 Subject: Temporary kludge to correctly handle a Photons object passed into simulate. --- chroma/sim.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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] -- cgit