Attempt to add a test on serialisation
@@ -11,9 +11,11 @@ from gammapy.modeling.models import (
TemplateNPredModel,
EBLAbsorptionNormSpectralModel,
Model,
+ TemporalModel,
Models,
PiecewiseNormSpectralModel,
PowerLawSpectralModel,
+ PowerLawTemporalModel,
)
from gammapy.utils.scripts import read_yaml, write_yaml
from gammapy.utils.testing import requires_data
@@ -278,3 +280,12 @@ def test_simplified_output():
def test_registries_print():
assert "Registry" in str(MODEL_REGISTRY)
+
+
+# def test_serialisation():
+# It fails....
+# pl_model = PowerLawTemporalModel(alpha=-2.)
+# pl_dict = pl_model.to_dict()
+#
+# read_model = TemporalModel.from_dict(pl_dict)
+# assert read_model.alpha == pl_model.alpha
