diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_pdf.py | 8 | ||||
-rw-r--r-- | tests/test_propagation.py | 12 |
2 files changed, 13 insertions, 7 deletions
diff --git a/tests/test_pdf.py b/tests/test_pdf.py index 791f119..c7c9394 100644 --- a/tests/test_pdf.py +++ b/tests/test_pdf.py @@ -20,7 +20,7 @@ class TestPDF(unittest.TestCase): g4generator = G4ParallelGenerator(1, water_wcsim) gpu_instance = gpu.GPU(0) - gpu_geometry = gpu.GPUGeometry(gpu_instance, self.detector) + gpu_geometry = gpu.GPUGeometry(self.detector) nthreads_per_block, max_blocks = 64, 1024 @@ -34,8 +34,10 @@ class TestPDF(unittest.TestCase): for ev in g4generator.generate_events(itertools.islice(self.vertex_gen, 10)): gpu_photons = gpu.GPUPhotons(ev.photons_beg) - gpu.propagate(gpu_instance, gpu_photons, rng_states, nthreads_per_block, max_blocks) - gpu_channels = gpu_daq.acquire(gpu_photons, rng_states, nthreads_per_block, max_blocks) + gpu_photons.propagate(gpu_geometry, rng_states, nthreads_per_block, + max_blocks) + gpu_channels = gpu_daq.acquire(gpu_photons, rng_states, + nthreads_per_block, max_blocks) gpu_pdf.add_hits_to_pdf(gpu_channels) hitcount, pdf = gpu_pdf.get_pdfs() diff --git a/tests/test_propagation.py b/tests/test_propagation.py index bf886bd..8f9d084 100644 --- a/tests/test_propagation.py +++ b/tests/test_propagation.py @@ -34,10 +34,12 @@ class TestPropagation(unittest.TestCase): wavelengths = np.empty(nphotons, np.float32) wavelengths.fill(400.0) - photons = Photons(pos=pos, dir=dir, pol=pol, t=t, wavelengths=wavelengths) + photons = Photons(pos=pos, dir=dir, pol=pol, t=t, + wavelengths=wavelengths) # First make one step to check for strangeness - photons_end = sim.simulate([photons], keep_photons_end=True, max_steps=1).next().photons_end + photons_end = sim.simulate([photons], keep_photons_end=True, + max_steps=1).next().photons_end self.assertFalse(np.isnan(photons_end.pos).any()) self.assertFalse(np.isnan(photons_end.dir).any()) @@ -46,8 +48,10 @@ class TestPropagation(unittest.TestCase): self.assertFalse(np.isnan(photons_end.wavelengths).any()) # Now let it run the usual ten steps - photons_end = sim.simulate([photons], keep_photons_end=True, max_steps=10).next().photons_end + photons_end = sim.simulate([photons], keep_photons_end=True, + max_steps=10).next().photons_end aborted = (photons_end.flags & (1 << 31)) > 0 - print 'aborted photons: %1.1f' % (float(np.count_nonzero(aborted)) / nphotons) + print 'aborted photons: %1.1f' % \ + (float(np.count_nonzero(aborted)) / nphotons) self.assertFalse(aborted.any()) |