diff --git a/tardis/spectrum/base.py b/tardis/spectrum/base.py index 2780e893783..e7b872ff759 100644 --- a/tardis/spectrum/base.py +++ b/tardis/spectrum/base.py @@ -99,14 +99,12 @@ def spectrum_integrated(self): "This RETURNS AN EMPTY SPECTRUM!", UserWarning, ) - return TARDISSpectrum( + self._spectrum_integrated = TARDISSpectrum( np.array([np.nan, np.nan]) * u.Hz, np.array([np.nan]) * u.erg / u.s, ) - else: - self._spectrum_integrated = None return self._spectrum_integrated - + @property def integrator(self): if self._integrator is None: diff --git a/tardis/tests/test_tardis_full_formal_integral.py b/tardis/tests/test_tardis_full_formal_integral.py index 985168baf95..fb9fe746a40 100644 --- a/tardis/tests/test_tardis_full_formal_integral.py +++ b/tardis/tests/test_tardis_full_formal_integral.py @@ -86,9 +86,9 @@ def test_spectrum(self, simulation, request): expected = u.Quantity(expected, "erg /s") assert_quantity_allclose(luminosity, expected) -# def test_spectrum_integrated(self, simulation, request): -# regression_data = RegressionData(request) -# luminosity = simulation.spectrum_solver.spectrum_integrated.luminosity -# expected = regression_data.sync_ndarray(luminosity.cgs.value) -# expected = u.Quantity(expected, "erg /s") -# assert_quantity_allclose(luminosity, expected) \ No newline at end of file + def test_spectrum_integrated(self, simulation, request): + regression_data = RegressionData(request) + luminosity = simulation.spectrum_solver.spectrum_integrated.luminosity + expected = regression_data.sync_ndarray(luminosity.cgs.value) + expected = u.Quantity(expected, "erg /s") + assert_quantity_allclose(luminosity, expected) \ No newline at end of file