Cleanup effective area tests
@@ -19,12 +19,8 @@ def aeff():
return EffectiveAreaTable2D.read(filename, hdu="AEFF")
-class TestEffectiveAreaTable2D:
- # TODO: split this out into separate tests, especially the plotting
- # Add I/O test
- @staticmethod
@requires_data()
- def test(aeff):
+def test_basic(aeff):
assert aeff.axes["energy_true"].nbin == 96
assert aeff.axes["offset"].nbin == 6
assert aeff.data.shape == (96, 6)
@@ -39,7 +35,7 @@ class TestEffectiveAreaTable2D:
test_val = aeff.evaluate(energy_true="14 TeV", offset="0.2 deg")
assert_allclose(test_val.value, 683177.5, rtol=1e-3)
- @staticmethod
+
def test_from_parametrization():
# Log center of this is 100 GeV
area_ref = 1.65469579e07 * u.cm ** 2
@@ -59,7 +55,7 @@ class TestEffectiveAreaTable2D:
assert area.unit == area_ref.unit
assert area.meta["TELESCOP"] == "HESS"
- @staticmethod
+
@requires_dependency("matplotlib")
@requires_data()
def test_plot(aeff):
@@ -72,8 +68,8 @@ class TestEffectiveAreaTable2D:
with mpl_plot_check():
aeff.plot_offset_dependence()
- @staticmethod
- def test_write():
+
+def test_to_table():
energy_axis_true = MapAxis.from_energy_bounds(
"1 TeV", "10 TeV", nbin=10, name="energy_true"
)
