summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2013-02-05 17:00:43 -0500
committertlatorre <tlatorre@uchicago.edu>2021-05-09 08:42:39 -0700
commita73b5669aefe5612209eec02269b00b964565a5b (patch)
treec4d125bc6cdcfe5c843312e4ded1c8086a513031
parent0b338ee6e4dbbd1b41f5c3856b3c36d1578c135a (diff)
downloadchroma-a73b5669aefe5612209eec02269b00b964565a5b.tar.gz
chroma-a73b5669aefe5612209eec02269b00b964565a5b.tar.bz2
chroma-a73b5669aefe5612209eec02269b00b964565a5b.zip
Temporary kludge to correctly handle a Photons object passed into simulate.
-rw-r--r--chroma/sim.py5
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]