From 88c1fc97fcf4d34ec00e5a7435bb0e7fec379e95 Mon Sep 17 00:00:00 2001 From: Johannes Schumann <johannes.schumann@fau.de> Date: Mon, 16 Jan 2023 17:29:54 +0100 Subject: [PATCH] yapf --- km3buu/geometry.py | 4 ++++ km3buu/tests/test_geometry.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/km3buu/geometry.py b/km3buu/geometry.py index 712ddc6..27c685e 100644 --- a/km3buu/geometry.py +++ b/km3buu/geometry.py @@ -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 diff --git a/km3buu/tests/test_geometry.py b/km3buu/tests/test_geometry.py index ee4c209..f41e6b1 100644 --- a/km3buu/tests/test_geometry.py +++ b/km3buu/tests/test_geometry.py @@ -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() -- GitLab