Skip to content

Commit

Permalink
Fix for spectrum integrated issue
Browse files Browse the repository at this point in the history
  • Loading branch information
atharva-2001 committed Aug 21, 2024
1 parent 19d0f47 commit 6cae852
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions tardis/spectrum/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 6 additions & 6 deletions tardis/tests/test_tardis_full_formal_integral.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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)

0 comments on commit 6cae852

Please sign in to comment.