Skip to content
Snippets Groups Projects
Commit 88c1fc97 authored by Johannes Schumann's avatar Johannes Schumann
Browse files

yapf

parent 08a73c40
No related branches found
No related tags found
No related merge requests found
Pipeline #34228 passed
......@@ -19,6 +19,7 @@ class DetectorVolume(ABC):
"""
Detector geometry class
"""
def __init__(self):
self._volume = -1.0
self._coord_origin = (0., 0., 0.)
......@@ -96,6 +97,7 @@ class NoVolume(DetectorVolume):
"""
Dummy volume to write out data w/o geometry
"""
def __init__(self):
self._solid_angle = 1
self._volume = 1
......@@ -132,6 +134,7 @@ class CanVolume(DetectorVolume):
zenith: float [1] (default: (-1.0, 1.0) )
Zenith range given as cos(θ)
"""
def __init__(self,
radius=403.4,
zmin=0.0,
......@@ -189,6 +192,7 @@ class SphericalVolume(DetectorVolume):
zenith: float [1] (default: (-1.0, 1.0) )
Zenith range given as cos(θ)
"""
def __init__(self, radius, coord_origin=(0, 0, 0), zenith=(-1, 1)):
super().__init__()
self._radius = radius
......
......@@ -17,12 +17,14 @@ import numpy as np
class TestGeneralGeometry(unittest.TestCase):
def test_abstract_init(self):
with self.assertRaises(TypeError) as ctx:
d = DetectorVolume()
class TestSphere(unittest.TestCase):
def setUp(self):
self.detector_geometry = SphericalVolume(20, (2, 2, 2))
......@@ -57,6 +59,7 @@ class TestSphere(unittest.TestCase):
class TestCan(unittest.TestCase):
def setUp(self):
self.detector_geometry = CanVolume()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment