diff --git a/tests/optical_component/test_AHotOpticalComponent.py b/tests/optical_component/test_AHotOpticalComponent.py index f3f2e77..2fd077c 100644 --- a/tests/optical_component/test_AHotOpticalComponent.py +++ b/tests/optical_component/test_AHotOpticalComponent.py @@ -1,4 +1,6 @@ from unittest import TestCase + +from esbo_etc import Entry from esbo_etc.classes.optical_component.AHotOpticalComponent import AHotOpticalComponent from esbo_etc.classes.IRadiant import IRadiant from esbo_etc.classes.SpectralQty import SpectralQty @@ -16,6 +18,10 @@ class HotOpticalComponent(AHotOpticalComponent): def _propagate(self, sqty: SpectralQty) -> SpectralQty: return sqty + @staticmethod + def check_config(conf: Entry) -> Union[None, str]: + pass + class TestAHotOpticalComponent(TestCase): wl = np.arange(201, 205, 1) << u.nm diff --git a/tests/optical_component/test_AOpticalComponent.py b/tests/optical_component/test_AOpticalComponent.py index db12875..9583173 100644 --- a/tests/optical_component/test_AOpticalComponent.py +++ b/tests/optical_component/test_AOpticalComponent.py @@ -10,6 +10,10 @@ class OpticalComponent(AOpticalComponent): obstructor_emissivity: float = 0): super().__init__(parent, transreflectivity, noise, obstruction, obstructor_temp, obstructor_emissivity) + @staticmethod + def check_config(conf: Entry) -> Union[None, str]: + pass + class TestAOpticalComponent(TestCase): wl = np.arange(4, 8, 1) << u.um diff --git a/tests/psf/test_Airy.py b/tests/psf/test_Airy.py index 8ca0910..09f35e7 100644 --- a/tests/psf/test_Airy.py +++ b/tests/psf/test_Airy.py @@ -5,7 +5,7 @@ import astropy.units as u class TestAiry(TestCase): def setUp(self): - self.airy = Airy(4 * u.um, 0.5 * u.m) + self.airy = Airy(13, 4 * u.um, 0.5 * u.m, 10, 6.5 * u.nm) def test_calc_reduced_observation_angle(self): self.assertAlmostEqual(self.airy.calcReducedObservationAngle("peak").value, 0.0) diff --git a/tests/psf/test_Zemax.py b/tests/psf/test_Zemax.py index 6a9c7d5..d9d90e2 100644 --- a/tests/psf/test_Zemax.py +++ b/tests/psf/test_Zemax.py @@ -5,7 +5,7 @@ import astropy.units as u class TestZemax(TestCase): def setUp(self): - self.zemax = Zemax("data/psf.txt", 13, 4 * u.um, 0.5 * u.m) + self.zemax = Zemax("data/psf.txt", 13, 4 * u.um, 0.5 * u.m, 13, 6.5 * u.um) def test_calcReducedObservationAngle(self): - self.assertAlmostEqual(self.zemax.calcReducedObservationAngle(0.6595336151196701).value, 0.08284705528846155) + self.assertAlmostEqual(self.zemax.calcReducedObservationAngle(0.6595336151196701).value, 0.08106259728314079) diff --git a/tests/test_RadiantFactory.py b/tests/test_RadiantFactory.py index a2e2048..50e7c2f 100644 --- a/tests/test_RadiantFactory.py +++ b/tests/test_RadiantFactory.py @@ -1,5 +1,5 @@ from unittest import TestCase -from esbo_etc.classes.config import Configuration +from esbo_etc.classes.Config import Configuration from esbo_etc.classes.RadiantFactory import RadiantFactory import esbo_etc.classes.optical_component as oc from esbo_etc.classes.target import BlackBodyTarget @@ -22,5 +22,5 @@ class TestRadiantFactory(TestCase): parent_2 = oc.Filter.fromRange(parent_2, 400 * u.nm, 480 * u.nm, "data/filter/emissivity.csv", 70 * u.K) parent_2 = oc.Lens(parent_2, "data/lens/transmittance.csv", "data/lens/emissivity.csv", 70 * u.K) - self.assertEqual(parent.calcSignal(), parent_2.calcSignal()) + self.assertEqual(parent.calcSignal()[0], parent_2.calcSignal()[0]) self.assertEqual(parent.calcBackground(), parent_2.calcBackground()) diff --git a/tests/test_config.py b/tests/test_config.py index 0a25452..2cef069 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,5 +1,5 @@ from unittest import TestCase -from esbo_etc.classes.config import Configuration, Entry +from esbo_etc.classes.Config import Configuration, Entry import astropy.units as u @@ -10,7 +10,7 @@ class TestConfiguration(TestCase): def test_signal(self): self.assertTrue(isinstance(self.config.conf, Entry)) self.assertTrue( - {"common", "noise", "astroscene", "common_optics", "instrument"}.issubset(self.config.conf.__dir__())) - self.assertTrue({"wl_min", "wl_max", "wl_delta", "d_aperture", "jitter_rms", "output_path", + {"common", "astroscene", "common_optics", "instrument"}.issubset(self.config.conf.__dir__())) + self.assertTrue({"wl_min", "wl_max", "wl_delta", "d_aperture", "jitter_sigma", "output_path", "wl_bins"}.issubset(self.config.conf.common.__dir__())) self.assertTrue(self.config.conf.common.wl_min().unit.is_equivalent(u.meter))